Skip to content

Commit 1e087f3

Browse files
author
x97davka
committed
Doc fixes
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@429 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 900c0dc commit 1e087f3

File tree

9 files changed

+43
-87
lines changed

9 files changed

+43
-87
lines changed

modeq/absyn.rml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ module Absyn:
2222
(** - Classes *)
2323
datatype Class = CLASS of Ident (* Name *)
2424
* bool (* Partial *)
25-
(* FIXME: final *)
2625
* Restriction (* Restricion *)
2726
* ClassDef (* Body *)
2827
(** A class definition consists of a name, a flag to indicate if this *)

modeq/builtin.rml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ SCode.CLASS("Boolean",false,Absyn.R_PREDEFINED_BOOL,
9797

9898
(** - The `time' variable *)
9999

100-
(* FIXME: Shuold contain components (attributes) from the real Real type *)
101100
val time_var =
102101
Types.VAR("time", SCode.ATTR([] , false, SCode.RO, Absyn.VAR, Absyn.BIDIR),
103102
false, Types.T_REAL, Types.UNBOUND)

modeq/connect.rml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ relation equ_equations : Exp.ComponentRef list => DAE.Element list =
149149

150150
axiom equ_equations [_] => []
151151

152-
rule (* FIXME: check types. Must be real. *)
153-
equ_equations y::cs => eq
152+
rule equ_equations y::cs => eq
154153
------------------------
155154
equ_equations x::y::cs
156155
=> DAE.EQUATION(Exp.CREF(x), Exp.CREF(y))::eq

modeq/explode.rml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ module SCode :
2828
* bool (* Partial *)
2929
* Restriction (* Restricion *)
3030
* ClassDef (* Parts *)
31-
(* FIXME: should the name really be part of the class type? *)
3231

3332
datatype ClassDef = PARTS of Element list
3433
* Equation list
@@ -329,7 +328,7 @@ end
329328
relation build_sub_sub : (Subscript list, Mod) => Mod =
330329

331330
axiom build_sub_sub ([], m) => m
332-
axiom build_sub_sub (l, m) => MOD(false(*FIXME*),[IDXMOD(l,m)],NONE)
331+
axiom build_sub_sub (l, m) => MOD(false,[IDXMOD(l,m)],NONE)
333332

334333
end
335334

modeq/inst.rml

Lines changed: 19 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
**
55
** RCS: $Id$
66
**
7-
** This module exports only one relation. *)
7+
** This module exports only one relation.
8+
**)
89

910
module Inst:
1011

@@ -33,9 +34,10 @@ with "staticexp.rml"
3334
with "mod.rml"
3435
with "rtopts.rml"
3536

36-
(** These type aliases are introduced to make the code a little more
37+
(**
38+
** These type aliases are introduced to make the code a little more
3739
** readable.
38-
** FIXME: maybe they should be removed? *)
40+
**)
3941

4042
type Prefix = Prefix.Prefix
4143
type Mod = Mod.Mod
@@ -156,8 +158,6 @@ end
156158
**
157159
** This rule instantiates the contents of a class definition, with a
158160
** new environment already setup.
159-
**
160-
** FIXME: This relation is just a wrapper around `inst_classdef', and could probably be removed.
161161
**)
162162

163163
relation inst_class_in: (Env, Mod, Prefix, Connect.Sets, ClassInf.State,
@@ -175,7 +175,6 @@ relation inst_class_in: (Env, Mod, Prefix, Connect.Sets, ClassInf.State,
175175
c as SCode.CLASS(n,_,r,d), prot)
176176
=> (l,env', csets', ci_state', tys)
177177

178-
(* FIXME *)
179178
rule print "- inst_class_in failed\n"
180179
----------------------------------
181180
inst_class_in(_,_,_,csets,_,_,_) => fail
@@ -203,7 +202,6 @@ relation inst_classdef: (Env, Mod, Prefix, Connect.Sets, ClassInf.State,
203202
(** This rule describes how to instantiate an explicit
204203
** class definition *)
205204

206-
(** FIXME: propagate prot *)
207205
rule ClassInf.trans(ci_state, ClassInf.NEWDEF) => ci_state' &
208206
inst_element_list(env,mods,pre,csets,ci_state', els)
209207
=> (dae1,env', csets', ci_state'', tys) &
@@ -227,7 +225,6 @@ relation inst_classdef: (Env, Mod, Prefix, Connect.Sets, ClassInf.State,
227225
ClassInf.start(r, cn2) => new_ci_state &
228226
print " deriving from " & Absyn.print_restr r & print " : " &
229227
ClassInf.print_state new_ci_state & print "\n" &
230-
(* FIXME order *)
231228
Mod.merge(mods,m) => mods' &
232229
Mod.merge(mods',mod') => mods'' &
233230
inst_class_in(env, mods'', pre, csets, new_ci_state, c, prot)
@@ -317,15 +314,11 @@ relation inst_element : (Env, Mod, Prefix, Connect.Sets, ClassInf.State,
317314
(* classmod is the modifications stored with the class *)
318315
(* mods is the modifications passed to the relation *)
319316
(* m is the modification stored in the element *)
320-
(* FIXME: verify order *)
321-
(* print " mod 1: " & print cns & Mod.print_mod classmod & print "\n" &
322-
print " mod 2: " & print cns & Mod.print_mod mods & print "\n" &
323-
print " mod 3: " & print cns & Mod.print_mod m' & print "\n" & *)
324317
Mod.merge(classmod,mods) => mods' &
325318
Mod.merge(mods',m') => mods'' &
326319

327320
(* Can't use inst_class, as that creates a new frame *)
328-
inst_class_in(env,mods'',pre,csets,ci_state,c,false(*FIXME: FOO?*))
321+
inst_class_in(env,mods'',pre,csets,ci_state,c,false)
329322
=> (dae,env',csets',ci_state',vars)
330323
----------------------------------
331324
inst_element(env,mods,pre,csets, ci_state, SCode.EXTENDS(cn,m))
@@ -377,7 +370,6 @@ relation inst_element : (Env, Mod, Prefix, Connect.Sets, ClassInf.State,
377370
** parameter or constant. All of these are treated in a
378371
** similar way.
379372
**
380-
** FIXME: doc
381373
** Lookup the class name, apply modifications and add the
382374
** variable to the current frame in the environment. Then
383375
** instantiate the class with an extended prefix.
@@ -386,7 +378,6 @@ relation inst_element : (Env, Mod, Prefix, Connect.Sets, ClassInf.State,
386378
rule Prefix.prefix_cref(pre,Exp.CREF_IDENT(n,[])) => vn &
387379

388380
print " variable " & Exp.print_component_ref vn & print "\n" &
389-
(** FIXME: merge order *)
390381

391382
(** The class definition is fetched from the environment. *)
392383
(** Then the set of modifications is calculated. The *)
@@ -434,10 +425,6 @@ relation inst_element : (Env, Mod, Prefix, Connect.Sets, ClassInf.State,
434425
print " extended frame with variable " & Exp.print_component_ref vn &
435426
print " :: " & Types.print_type ty & print "\n" &
436427

437-
(** If the modification includes an equation, it is added. *)
438-
(* FIXME: use env or env'? *)
439-
(* inst_mod_equation(env',pre,n,ty,mod') => dae2 & *)
440-
441428
(** If the type is one of the simple, predifined types a *)
442429
(** simple variable declaration is added to the DAE. *)
443430
(* dae_declare (vn,cl,attr) => dae3 & *)
@@ -451,7 +438,7 @@ relation inst_element : (Env, Mod, Prefix, Connect.Sets, ClassInf.State,
451438
attr as SCode.ATTR(ad,flow,acc,param,dir),
452439
t,m))
453440
=> (dae, env',csets',ci_state,
454-
[Types.VAR(n,SCode.ATTR([(* FIXME: why? *)],flow,acc,param,dir),
441+
[Types.VAR(n,SCode.ATTR([],flow,acc,param,dir),
455442
prot, ty, binding)])
456443

457444

@@ -493,7 +480,7 @@ relation inst_var : (Env.Env,Mod.Mod,Prefix.Prefix,Connect.Sets,Ident,
493480

494481
rule list_reverse idxs => idxs' &
495482
Prefix.prefix_add(n,idxs',pre) => pre' &
496-
(** FIXME: Redeclarations! *)
483+
(* This is where redeclare should be handled *)
497484
inst_class(env,mod,pre',csets,cl) => (dae1,csets',ty,st) &
498485

499486
Exp.int_subscripts idxs' => subs &
@@ -534,7 +521,7 @@ relation inst_array : (Env.Env,Mod.Mod,Prefix.Prefix,Connect.Sets,Ident,
534521

535522
rule Mod.lookup_idx_modification(mod,i) => mod' &
536523
print " modification[]: " & Mod.print_mod mod' & print "\n" &
537-
inst_var(env,mod',pre,csets,n,cl,attr,NONE(*FIXME*),dims,i::idxs)
524+
inst_var(env,mod',pre,csets,n,cl,attr,NONE,dims,i::idxs)
538525
=> (dae1,csets',ty) &
539526
int_add(i,1) => i' &
540527
inst_array(env,mod,pre,csets',n,(cl,attr),i',stop,dims,idxs)
@@ -886,8 +873,6 @@ relation inst_equation : (Env,Mod, Prefix, Connect.Sets, ClassInf.State,
886873
=> ([],env,csets',ci_state')
887874

888875
(** assert
889-
**
890-
** FIXME: Handle assertions
891876
**)
892877

893878
rule Static.elab_exp(env,e) => (e', Static.PROP(t, c)) &
@@ -969,7 +954,6 @@ end
969954
** Equations follow the same typing rules as equality expressions.
970955
** This relation adds the equation to the DAE.
971956
**
972-
** FIXME: type conversions (use Static.match_prop)
973957
**)
974958

975959
relation inst_eq_equation : (Exp.Exp, Static.Properties,
@@ -1003,7 +987,8 @@ end
1003987

1004988
(** relation: inst_eq_equation_2
1005989
**
1006-
** FIXME: doc
990+
** This is the second stage of `inst_eq_equation', when the types are
991+
** checked.
1007992
**)
1008993

1009994
relation inst_eq_equation_2 : (Exp.Exp, Exp.Exp, Types.Type)
@@ -1085,7 +1070,8 @@ end
10851070

10861071
(** relation: inst_array_equation
10871072
**
1088-
** FIXME: doc
1073+
** This checks the array size and uses `inst_array_el_eq' to create
1074+
** equations for each array element.
10891075
**)
10901076

10911077
relation inst_array_equation : (Exp.Exp, Exp.Exp,
@@ -1110,7 +1096,8 @@ end
11101096

11111097
(** relation: inst_array_el_eq
11121098
**
1113-
** FIXME: doc
1099+
** This relation loops recursively through all indexes in the two
1100+
** arrays and generates an equation for each pair of elements.
11141101
**)
11151102

11161103
relation inst_array_el_eq : (Exp.Exp, Exp.Exp, Types.Type, int, int)
@@ -1138,7 +1125,8 @@ end
11381125

11391126
(** relation: inst_assertion
11401127
**
1141-
** Instantiate an assertion.
1128+
** Instantiate an assertion. There are not assertions in the output
1129+
** currently.
11421130
**)
11431131

11441132
relation inst_assertion : (Env.Env, Exp.Exp, Types.Type,
@@ -1149,13 +1137,13 @@ relation inst_assertion : (Env.Env, Exp.Exp, Types.Type,
11491137
print " (constant) ASSERTION(" & Exp.print_exp e' & print "): " &
11501138
print d & print "\n"
11511139
--------------------
1152-
inst_assertion (env, e, Types.T_BOOL, true, d, pre) => [(*FIXME*)]
1140+
inst_assertion (env, e, Types.T_BOOL, true, d, pre) => [(* lost *)]
11531141

11541142
rule Prefix.prefix_exp(env,e,pre) => e' &
11551143
print " ASSERTION(" & Exp.print_exp e' & print "): " &
11561144
print d & print "\n"
11571145
--------------------
1158-
inst_assertion (env, e, Types.T_BOOL, _, d, pre) => [(*FIXME*)]
1146+
inst_assertion (env, e, Types.T_BOOL, _, d, pre) => [(* lost *)]
11591147

11601148
rule print "# Assertions have to be of type Boolean\n" &
11611149
print " assertion: (" &
@@ -1342,7 +1330,6 @@ end
13421330
** This relation tests whether a type is a eligible to be used in
13431331
** connections.
13441332
**
1345-
** FIXME: It is unknown whether `Real' is a valid connector.
13461333
**)
13471334

13481335
relation valid_connector : Types.Type => () =
@@ -1364,7 +1351,6 @@ end
13641351
** Check that the type and type attributes of two connectors match,
13651352
** so that they really may be connected.
13661353
**
1367-
** FIXME: This checks the `flow' attribute on the top variable. This depends on whether connections are allowed on Reals.
13681354
**)
13691355

13701356
relation check_connect_types : (Exp.ComponentRef, Types.Type,
@@ -1570,7 +1556,6 @@ relation component_face : Exp.ComponentRef => Connect.Face =
15701556
rule print "# While connecting " &
15711557
Exp.print_component_ref c & print "\n" &
15721558
print "# Only local or child connectors allowed.\n"
1573-
(* FIXME: This only checks the syntactic properties. *)
15741559
---------------------------------------------------
15751560
component_face c => fail
15761561

@@ -1626,7 +1611,6 @@ end
16261611
** If the component being declared is declared to be constant, the
16271612
** relation `make_const_binding' is used.
16281613
**
1629-
** FIXME: Why is the result from make_const_binding ignored?
16301614
**)
16311615

16321616
relation make_binding : (Env.Env, SCode.Attributes, Mod.EqMod option, SCode.Class)
@@ -1635,8 +1619,6 @@ relation make_binding : (Env.Env, SCode.Attributes, Mod.EqMod option, SCode.Clas
16351619
axiom make_binding (_,_,NONE,_) => Types.UNBOUND
16361620

16371621
rule print " constant binding: " & Exp.print_exp e & print "\n" &
1638-
class_type cl => ct &
1639-
make_const_binding (env,e, prop, ct) => binding
16401622
----------------------------------------
16411623
make_binding (env,
16421624
SCode.ATTR(_,_,_,Absyn.CONST,_),
@@ -1682,18 +1664,3 @@ relation make_const_binding : (Env.Env, Exp.Exp, Static.Properties,
16821664
make_const_binding(_,_,_,_) => fail
16831665

16841666
end
1685-
1686-
(** relation: class_type *)
1687-
1688-
relation class_type : SCode.Class => Types.Type =
1689-
1690-
axiom class_type SCode.CLASS(_,_,Absyn.R_PREDEFINED_INT,_) => Types.T_INTEGER
1691-
axiom class_type SCode.CLASS(_,_,Absyn.R_PREDEFINED_STRING,_)
1692-
=> Types.T_STRING
1693-
axiom class_type SCode.CLASS(_,_,Absyn.R_PREDEFINED_REAL,_) => Types.T_REAL
1694-
axiom class_type SCode.CLASS(_,_,Absyn.R_PREDEFINED_BOOL,_) => Types.T_BOOL
1695-
1696-
(* FIXME: Should instantiate the class *)
1697-
axiom class_type _ => Types.T_COMPLEX(ClassInf.UNKNOWN("---"),[(* FIXME *)])
1698-
1699-
end

modeq/lookup.rml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -250,16 +250,21 @@ end
250250
relation lookup_in_var: (Types.Type, Exp.ComponentRef)
251251
=> (SCode.Attributes,Types.Type,Types.Binding) =
252252

253-
(* FIXME: Check protected flag *)
254-
255-
(* FIXME: Should I really strip the ArrayDim? *)
253+
(* Public components *)
256254
rule Types.lookup_component(ty, id)
257-
=> (Types.VAR(_,SCode.ATTR(ad,fl,acc,vt,di),_,ty',binding)) &
255+
=> (Types.VAR(_,SCode.ATTR(ad,fl,acc,vt,di),false,ty',binding)) &
258256
check_subscripts(ad, ty', ss) => (dim, ty'')
259257
--------------------------------------------
260258
lookup_in_var(ty, Exp.CREF_IDENT(id,ss))
261259
=> (SCode.ATTR(dim,fl,acc,vt,di),ty'',binding)
262260

261+
(* Protected components *)
262+
rule Types.lookup_component(ty, id)
263+
=> (Types.VAR(_,_,true,_,_))
264+
------------------------------
265+
lookup_in_var(ty, Exp.CREF_IDENT(id,ss))
266+
=> fail
267+
263268
rule Types.lookup_component(ty, id)
264269
=> (Types.VAR(_,SCode.ATTR(ad,fl,acc,vt,di),_,ty',_)) &
265270
check_subscripts(ad, ty', ss) => (_, ty'') &
@@ -272,7 +277,10 @@ relation lookup_in_var: (Types.Type, Exp.ComponentRef)
272277
lookup_in_var(_,_) => fail
273278

274279
end
275-
(**)
280+
281+
(** relation lookup_var_f
282+
**)
283+
276284
relation lookup_var_f : ((SCode.Ident * Env.Item) list,
277285
Exp.ComponentRef)
278286
=> (SCode.Attributes, Types.Type, Types.Binding) =
@@ -283,11 +291,11 @@ relation lookup_var_f : ((SCode.Ident * Env.Item) list,
283291
check_subscripts(ad,ty,ss) => (ad', ty')
284292
----------------------------------
285293
lookup_var_f(f,Exp.CREF_IDENT(id,ss))
286-
=> (SCode.ATTR([(*FIXME*)],f,acc,vt,di),ty',bind)
294+
=> (SCode.ATTR([],f,acc,vt,di),ty',bind)
287295

288296
rule (* print " lookup_var_f 2: " & print id & print "\n" & *)
289297
lookup_var2(f, id) => Types.VAR(n,SCode.ATTR(ad,f,acc,vt,di),_,ty,_) &
290-
check_subscripts(ad, ty,ss) => ([], ty') & (* FIXME: error message *)
298+
check_subscripts(ad, ty,ss) => ([], ty') &
291299
lookup_in_var(ty', ids) => (attr,ty'',binding)
292300
----------------------------------
293301
lookup_var_f(f,Exp.CREF_QUAL(id,ss,ids)) => (attr,ty'',binding)
@@ -301,7 +309,6 @@ end
301309
relation locate_package : (Env.Env, string) => SCode.Class =
302310

303311
rule lookup_class(env, Absyn.IDENT(pack)) => c &
304-
(* FIXME: modifications? *)
305312
assert_package c
306313
----------------
307314
locate_package (env, pack) => c
@@ -337,8 +344,6 @@ end
337344
relation lookup_class_in_elements : (SCode.Element list, Absyn.Path)
338345
=> SCode.Class =
339346

340-
(* FIXME: Doesn't complain about an identifier being used for *)
341-
(* both a variable and a class *)
342347
rule n1 = n2
343348
-------
344349
lookup_class_in_elements (SCode.CLASSDEF(n1,_,_,c)::_,

0 commit comments

Comments
 (0)