-- ========================================================== --> An example answer for the exercise of lecture3 -- ========================================================== -- -- 1. A possible solution is as follows: -- mod! EXP { pr(NAT) [Nat < Exp] op _++_ : Exp Exp -> Exp {constr l-assoc prec: 30} op _--_ : Exp Exp -> Exp {constr l-assoc prec: 30} op _**_ : Exp Exp -> Exp {constr l-assoc prec: 29} op _//_ : Exp Exp -> Exp {constr l-assoc prec: 29} op _%%_ : Exp Exp -> Exp {constr l-assoc prec: 29} op /_ : Exp -> Exp {constr prec: 28} op _^2 : Exp -> Exp {constr prec: 27} op _! : Exp -> Exp {constr prec: 27} } open EXP red (3 ++ / (3 ^2 -- 4 ** 1 ** 2)) // (2 ** 1) . red (3 -- / (3 ^2 -- 4 ** 1 ** 2)) // (2 ** 1) . red 1 ++ 5 ! . close -- ========================================================== --> end end end -- ==========================================================