Skip to content

Commit c5ea1c7

Browse files
author
x02lucpo
committed
added pow
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@1496 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 50db64d commit c5ea1c7

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

modeq/ceval.rml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)