Skip to content

Commit 20134ea

Browse files
author
Peter Aronsson
committed
Fixed model editor interface bug, still need to clean up.
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@1577 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 183ead9 commit 20134ea

File tree

6 files changed

+35
-21
lines changed

6 files changed

+35
-21
lines changed

modeq/ceval.rml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ relation ceval_function: (Env.Env, Absyn.Path, Values.Value list, bool (*impl*)
709709
Print.get_string => s & print s & print "\n" &
710710
DAE.dae_to_record_value(funcname,dae,impl) => value
711711
----------------------
712-
ceval_function(env,funcname,vallst,impl as false) => value
712+
ceval_function(env,funcname,vallst,impl) => value
713713

714714
rule Debug.fprint("failtrace", "ceval_function: Don't know what to do. impl was always false before:")
715715
& Absyn.path_string funcname => s

modeq/inst.rml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2520,8 +2520,9 @@ relation inst_array : (Env.Env,
25202520
inst_array(env,ci_state as ClassInf.FUNCTION(_),mod,pre,csets,n,(cl,attr),i,DIMEXP(_,_),dims,idxs,inst_dims,impl)
25212521
=> ([dae],[],ty)*)
25222522

2523-
rule inst_var2(env,ci_state,mod,pre,csets,n,cl,attr,dims,i::idxs,inst_dims,impl)
2524-
=> (dae,csets,ty)
2523+
rule print "DIMEXP in inst_array\n" &
2524+
inst_var2(env,ci_state,mod,pre,csets,n,cl,attr,dims,i::idxs,inst_dims,impl)
2525+
=> (dae,csets,ty)
25252526
-----------------
25262527
inst_array(env,ci_state,mod,pre,csets,n,(cl,attr),i,DIMEXP(_,_),dims,idxs,inst_dims,impl)
25272528
=> (dae,csets,ty)
@@ -2531,7 +2532,7 @@ relation inst_array : (Env.Env,
25312532
inst_array(env,ci_state,mod,pre,csets,n,(cl,attr),i,DIMINT(stop),dims,idxs,inst_dims,impl)
25322533
=> ([], csets, (Types.T_NOTYPE,NONE))
25332534

2534-
rule (* Modifiers of arrays that are functioncall, eg. Real x[:]=foo(...) *)
2535+
(*rule (* Modifiers of arrays that are functioncall, eg. Real x[:]=foo(...) *)
25352536
(* Should only generate -one- functioncall *)
25362537
Mod.mod_equation(mod) => SOME(Types.TYPED(e,p)) &
25372538
Exp.contain_functioncall(e) => true &
@@ -2547,9 +2548,13 @@ relation inst_array : (Env.Env,
25472548
Util.list_flatten([dae1,dae2,[dae3]]) => dae
25482549
-----------------------------
25492550
inst_array(env,ci_state,mod,pre,csets,n,(cl,attr),i,DIMINT(stop),dims,idxs,inst_dims,impl)
2550-
=> (dae,csets',ty)
2551+
=> (dae,csets',ty)*)
25512552

25522553
rule Mod.lookup_idx_modification(mod,i) => mod' &
2554+
Mod.print_mod_str mod' => str &
2555+
Debug.fprint("failtrace", "inst array, mod' =") &
2556+
Debug.fprint("failtrace", str) &
2557+
Debug.fprint("failtrace", "\n") &
25532558
inst_var2(env,ci_state,mod',pre,csets,n,cl,attr,dims,i::idxs,inst_dims,impl)
25542559
=> (dae1,csets',ty) &
25552560
int_add(i,1) => i' &
@@ -2739,7 +2744,7 @@ relation elab_arraydim_decl : (Env.Env, Absyn.ComponentRef, Absyn.ArrayDim, bool
27392744
Ceval.ceval(env,e,impl,st,NONE) => (Values.INTEGER(i),_) &
27402745
elab_arraydim_decl(env,cref,ds,impl,st) => l
27412746
-------------------------------------------
2742-
elab_arraydim_decl(env,cref,Absyn.SUBSCRIPT(d)::ds,impl as false,st) => SOME(DIMINT(i))::l
2747+
elab_arraydim_decl(env,cref,Absyn.SUBSCRIPT(d)::ds,impl (* as false*),st) => SOME(DIMINT(i))::l
27432748

27442749
rule Debug.fprintln("insttr", "elab_arraydim_decl6") &
27452750
Static.elab_exp(env, d,impl,st) => (e,Types.PROP((Types.T_INTEGER(_),_),cnst),_) &

modeq/interactive.rml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3613,7 +3613,7 @@ relation get_annotation_string: (string,Absyn.Annotation) => string =
36133613
SCode.elab_class(placementc) => placementclass &
36143614
Mod.elab_mod (env,Prefix.NOPRE,mod',true) => mod'' &
36153615
Inst.inst_class(env, mod'', Prefix.NOPRE, [], placementclass,
3616-
[], true,Inst.TOP_CALL)
3616+
[], false,Inst.TOP_CALL)
36173617
=> (dae, _, cs, t, state) &
36183618
(* Put bindings of variables as expressions inside variable elements of the dae instead of equations *)
36193619
Inst.init_vars_modelica_output dae => dae' &

modeq/lookup.rml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,10 @@ relation build_record_constructor_varlst : (SCode.Class,Env.Env) => Types.Var li
10461046
build_record_constructor_varlst (cl as SCode.CLASS(_,_,_,_,SCode.PARTS(elts,_,_,_,_,_)),env)
10471047
(* Add the return type of the record constructor *)
10481048
=> Types.VAR("result",Types.ATTR(false,SCode.RW,SCode.VAR,Absyn.OUTPUT),false,ty,Types.UNBOUND)::inputvarlst
1049+
1050+
rule Debug.fprint("failtrace","build_record_constructor_varlst failed\n")
1051+
-----------------------
1052+
build_record_constructor_varlst(_,_) => fail
10491053
end
10501054

10511055
(** relation: build_varlst_from_elts

modeq/mod.rml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ module Mod:
146146
relation mod_equation : Types.Mod => Types.EqMod option
147147

148148
relation print_mod : Types.Mod => ()
149+
relation print_mod_str : Types.Mod => string
149150

150151
end
151152

@@ -683,9 +684,13 @@ relation lookup_idx_modification: (Types.Mod, int) => Types.Mod =
683684
-----------------------------------
684685
lookup_idx_modification(Types.MOD(f,subs,eq),idx) => mod'''
685686

686-
rule Print.print_buf "# Mod.lookup_idx_modification(" &
687-
print_mod mod & Print.print_buf "," & int_string idx => s & Print.print_buf s &
688-
Print.print_buf ") failed\n"
687+
rule Debug.fprint("failtrace","-lookup_idx_modification(") &
688+
print_mod_str mod => str &
689+
Debug.fprint("failtrace",str) &
690+
Debug.fprint("failtrace",",") &
691+
int_string idx => s &
692+
Debug.fprint("failtrace",s) &
693+
Debug.fprint("failtrace",") failed\n")
689694
--------------------
690695
lookup_idx_modification(mod,idx) => fail
691696

modeq/types.rml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -519,24 +519,24 @@ relation subtype : (Type, Type) => bool =
519519
subtype((T_ARRAY(_,t1),_),(T_ARRAY(DIM(NONE),t2),_)) => true
520520

521521
rule subtype (t1,t2) => true
522-
-----------------------
523-
subtype((T_ARRAY(DIM(NONE),t1),_),(T_ARRAY(_,t2),_)) => true
522+
-----------------------
523+
subtype((T_ARRAY(DIM(NONE),t1),_),(T_ARRAY(_,t2),_)) => true
524524

525525
rule i1 = i2 &
526-
subtype (t1,t2) => true
527-
---------------------------------------------------------
528-
subtype((T_ARRAY(DIM(SOME(i1)),t1),_),(T_ARRAY(DIM(SOME(i2)),t2),_)) => true
529-
526+
subtype (t1,t2) => true
527+
---------------------------------------------------------
528+
subtype((T_ARRAY(DIM(SOME(i1)),t1),_),(T_ARRAY(DIM(SOME(i2)),t2),_)) => true
529+
530530
rule subtype_varlist(els1, els2) => true
531-
-----------------------------------
532-
subtype((T_COMPLEX(st1,els1),_), (T_COMPLEX(st2,els2),_)) => true
531+
-----------------------------------
532+
subtype((T_COMPLEX(st1,els1),_), (T_COMPLEX(st2,els2),_)) => true
533533

534-
(* PR. Check of tuples, similar to complex. Just that
534+
(* PR. Check of tuples, similar to complex. Just that
535535
identifier name do not have to be checked. Only types are
536-
checked. *)
536+
checked. *)
537537
rule subtype_typelist(type_list1,type_list2) => true
538538
-----------------------------------
539-
subtype((T_TUPLE(type_list1),_), (T_TUPLE(type_list2),_)) => true
539+
subtype((T_TUPLE(type_list1),_), (T_TUPLE(type_list2),_)) => true
540540

541541
axiom subtype(t1,t2) => false
542542

0 commit comments

Comments
 (0)