Skip to content

Commit 12c7b8a

Browse files
author
Peter Aronsson
committed
Fixed bug in fix_direction
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@1394 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 9d1e0b8 commit 12c7b8a

File tree

1 file changed

+31
-25
lines changed

1 file changed

+31
-25
lines changed

modeq/inst.rml

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,43 +1779,43 @@ relation inst_var2 : (Env.Env,
17791779
=> (dae,csets',ty)
17801780

17811781
rule (* Scalar Variables *)
1782-
list_reverse idxs => idxs' &
1783-
Prefix.prefix_add(n,idxs',pre) => pre' &
1784-
(* This is where redeclare should be handled *)
1785-
1782+
list_reverse idxs => idxs' &
1783+
Prefix.prefix_add(n,idxs',pre) => pre' &
1784+
(* This is where redeclare should be handled *)
1785+
17861786
Prefix.print_prefix_str(pre') => prefix_str &
17871787

1788-
Debug.fprintl ("insttr", ["instantiating var class: ", n," prefix ",prefix_str, "\n"]) &
1789-
(*Debug.fcall ("envprint", Env.print_env, env) & *)
1790-
1791-
inst_class(env,mod,pre',csets,cl,inst_dims,impl,INNER_CALL)
1792-
=> (dae1,_,csets',ty,st) &
1793-
fix_direction(dae1,dir) => dae1' &
1794-
1795-
(*& Debug.fcall ("insttr",DAE.dump2,DAE.DAE(dae'))*)
1796-
1788+
Debug.fprintl ("insttr", ["instantiating var class: ", n," prefix ",prefix_str, "\n"]) &
1789+
(*Debug.fcall ("envprint", Env.print_env, env) & *)
1790+
1791+
inst_class(env,mod,pre',csets,cl,inst_dims,impl,INNER_CALL)
1792+
=> (dae1,_,csets',ty,st) &
1793+
fix_direction(dae1,dir) => dae1' &
1794+
1795+
(*& Debug.fcall ("insttr",DAE.dump2,DAE.DAE(dae'))*)
1796+
17971797
Exp.int_subscripts idxs' => subs &
1798-
Prefix.prefix_cref(pre,Exp.CREF_IDENT(n,subs)) => cr &
1799-
inst_mod_equation(cr,ty,mod) => dae2 &
1798+
Prefix.prefix_cref(pre,Exp.CREF_IDENT(n,subs)) => cr &
1799+
inst_mod_equation(cr,ty,mod) => dae2 &
18001800

18011801
Util.list_map(idxs',int_string) => index_string &
18021802

18031803
Debug.fprint ("insttr", "\n ******************\n ") &
18041804
Debug.fprint ("insttr", "\n index_string ") & Debug.fprintl ("insttr", index_string) &
18051805
Debug.fprint ("insttr", "\n component ref ") & Debug.fcall ("insttr", Exp.print_component_ref,cr) &
18061806
Debug.fprint ("insttr", "\n ******************\n ") &
1807-
Debug.fprint ("insttr", "\n ") &
1808-
1807+
Debug.fprint ("insttr", "\n ") &
1808+
18091809
inst_start_binding(mod,ty,idxs') => start &
1810-
dae_declare(cr,ty,SCode.ATTR([], flow, acc, vt, dir), NONE,
1811-
inst_dims, start) => dae3 &
1812-
list_append(dae1',dae2) => daex &
1813-
list_append(daex,dae3) => dae
1810+
dae_declare(cr,ty,SCode.ATTR([], flow, acc, vt, dir), NONE,
1811+
inst_dims, start) => dae3 &
1812+
list_append(dae1',dae2) => daex &
1813+
list_append(daex,dae3) => dae
18141814
(* & Debug.fcall ("instvardae",DAE.dump2,DAE.DAE(dae))
1815-
& Debug.fprint("instvartr", "\nEnd of inst_var variables\n")*)
1816-
--------------------------
1817-
inst_var2(env,ci_state,mod,pre,csets,n,cl,SCode.ATTR(_,flow,acc,vt,dir),
1818-
[],idxs,inst_dims,impl (*as false*))
1815+
& Debug.fprint("instvartr", "\nEnd of inst_var variables\n")*)
1816+
--------------------------
1817+
inst_var2(env,ci_state,mod,pre,csets,n,cl,SCode.ATTR(_,flow,acc,vt,dir),
1818+
[],idxs,inst_dims,impl (*as false*))
18191819
=> (dae,csets',ty)
18201820

18211821

@@ -2240,6 +2240,12 @@ relation fix_direction : (DAE.Element list, Absyn.Direction)
22402240
fix_direction (DAE.VAR(cr,vk,_,t,e,id,start,flow,class)::r,dir)
22412241
=> DAE.VAR(cr,vk,dir',t,e,id,start,flow,class)::r'
22422242

2243+
rule fix_direction(lst,dir) => lst' &
2244+
fix_direction(r,dir) => r'
2245+
-------------------------------
2246+
fix_direction(DAE.COMP(id,DAE.DAE(lst))::r,dir)
2247+
=> DAE.COMP(id,DAE.DAE(lst'))::r'
2248+
22432249
rule fix_direction(r,dir) => r'
22442250
---------------------------
22452251
fix_direction (x::r,dir) => x::r'

0 commit comments

Comments
 (0)