@@ -200,6 +200,41 @@ relation ceval : (Env.Env, Exp.Exp, bool, Interactive.InteractiveSymbolTable opt
200200 -----------------------------------------
201201 ceval (env,Exp.CALL(Absyn.IDENT("diagonal"),[exp1],_,_),impl,st,_) => (v,st)
202202
203+
204+ rule ceval (env,lh,impl,st,dim) => (Values.INTEGER(lhv),st') &
205+ ceval (env,rh,impl,st',dim) => (Values.INTEGER(rhv),st'') &
206+ int_real(lhv) => lhvr &
207+ int_real(rhv) => rhvr &
208+ real_pow(lhvr,rhvr) => resr &
209+ real_int(resr) => res
210+ ------------------------
211+ ceval (env, Exp.BINARY(lh, Exp.POW(Exp.INT), rh),impl,st,dim)
212+ => (Values.INTEGER(res),st'')
213+
214+ rule ceval (env,lh,impl,st,dim) => (Values.REAL(lhv),st') &
215+ ceval (env,rh,impl,st',dim) => (Values.INTEGER(rhv),st'') &
216+ int_real(rhv) => rhvr &
217+ real_pow(lhv,rhvr) => resr
218+ ------------------------
219+ ceval (env, Exp.BINARY(lh, Exp.POW(Exp.REAL), rh),impl,st,dim)
220+ => (Values.REAL(resr),st'')
221+
222+ rule ceval (env,lh,impl,st,dim) => (Values.INTEGER(lhv),st') &
223+ ceval (env,rh,impl,st',dim) => (Values.REAL(rhv),st'') &
224+ int_real(lhv) => lhvr &
225+ real_pow(lhvr,rhv) => resr
226+ ------------------------
227+ ceval (env, Exp.BINARY(lh, Exp.POW(Exp.REAL), rh),impl,st,dim)
228+ => (Values.REAL(resr),st'')
229+
230+ rule ceval (env,lh,impl,st,dim) => (Values.REAL(lhv),st') &
231+ ceval (env,rh,impl,st',dim) => (Values.REAL(rhv),st'') &
232+ real_pow(lhv,rhv) => resr
233+ ------------------------
234+ ceval (env, Exp.BINARY(lh, Exp.POW(Exp.REAL), rh),impl,st,dim)
235+ => (Values.REAL(resr),st'')
236+
237+
203238 (* end luc_pop *)
204239
205240 rule Print.print_buf "# Can't call functions at compile time\n" &
0 commit comments