@@ -1779,43 +1779,43 @@ relation inst_var2 : (Env.Env,
1779
1779
=> (dae,csets',ty)
1780
1780
1781
1781
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
+
1786
1786
Prefix.print_prefix_str(pre') => prefix_str &
1787
1787
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
+
1797
1797
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 &
1800
1800
1801
1801
Util.list_map(idxs',int_string) => index_string &
1802
1802
1803
1803
Debug.fprint ("insttr", "\n ******************\n ") &
1804
1804
Debug.fprint ("insttr", "\n index_string ") & Debug.fprintl ("insttr", index_string) &
1805
1805
Debug.fprint ("insttr", "\n component ref ") & Debug.fcall ("insttr", Exp.print_component_ref,cr) &
1806
1806
Debug.fprint ("insttr", "\n ******************\n ") &
1807
- Debug.fprint ("insttr", "\n ") &
1808
-
1807
+ Debug.fprint ("insttr", "\n ") &
1808
+
1809
1809
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
1814
1814
(* & 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*))
1819
1819
=> (dae,csets',ty)
1820
1820
1821
1821
@@ -2240,6 +2240,12 @@ relation fix_direction : (DAE.Element list, Absyn.Direction)
2240
2240
fix_direction (DAE.VAR(cr,vk,_,t,e,id,start,flow,class)::r,dir)
2241
2241
=> DAE.VAR(cr,vk,dir',t,e,id,start,flow,class)::r'
2242
2242
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
+
2243
2249
rule fix_direction(r,dir) => r'
2244
2250
---------------------------
2245
2251
fix_direction (x::r,dir) => x::r'
0 commit comments