Skip to content

Commit

Permalink
Doc fix.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@334 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
x97davka committed Jul 8, 1998
1 parent 2647564 commit ce88dbf
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 19 deletions.
4 changes: 0 additions & 4 deletions modeq/builtin.rml
Expand Up @@ -3,10 +3,6 @@
** description: Builting types and variables
**
** RCS: $Id$
**
**)

(** - Module header
**
** The only exported relation is `initial_env'.
**)
Expand Down
29 changes: 29 additions & 0 deletions modeq/env.rml
Expand Up @@ -37,29 +37,58 @@ module Env:

end

(** - Values *)

val empty_frame = FRAME([])
val empty_env = []

(** - Relations *)

(** relation: open_scope
**
** Opening a new scope in the environment mans adding a new frame on
** top of the stack of frames.
**)

relation open_scope: Env => Env =

axiom open_scope(env) => empty_frame::env

end

(** relation: extend_frame_c
**
** This relation adds a class definition to the environment.
**)

relation extend_frame_c : (Env, SCode.Class) => Env =

axiom extend_frame_c(FRAME(items)::fs,c as SCode.CLASS(n,_,_,_))
=> ((FRAME((n,CLASS(c))::items)::fs))

end

(** relation: extend_frame_v
**
** This relation adds a component to the environment.
**)

relation extend_frame_v : (Env,Types.Var) => Env =

axiom extend_frame_v(FRAME(items)::fs,v as Types.VAR(n,_,_,_))
=> (FRAME((n,VAR(v))::items)::fs)

end

(** relation: extend_frame_t
**
** This relation adds a type to the environment. Types in the
** environment are used for looking up constants etc. inside class
** definitions, such as packages. For each type in the environment,
** there is a class definition with the same name in the
** environment.
**)

relation extend_frame_t : (Env,Ident,Types.Type) => Env =

axiom extend_frame_t(FRAME(items)::fs, n, t)
Expand Down
16 changes: 4 additions & 12 deletions modeq/inst.rml
Expand Up @@ -1371,23 +1371,11 @@ relation inst_mod_equation : (Exp.ComponentRef, Types.Type, Mod)

rule print " equation modification: " & Exp.print_component_ref cr &
Mod.print_mod mod & print "\n" &

(* Types.same_type(ty1,ty2) => true & *)
inst_eq_equation(Exp.CREF(cr),ty1,e,ty2) => dae
-----------------------------------------------
inst_mod_equation(cr,ty1,mod as Mod.MOD(_,_,SOME((e,ty2,c))))
=> dae

(*
rule Types.same_type(ty1,ty2) => false &
print "# Wrong type in equation modifier\n" &
print " expected: " & Types.print_type ty1 & print "\n" &
print " was: " & Types.print_type ty2 & print "\n"
--------------------------------------------------------
inst_mod_equation(cr,ty1,mod as Mod.MOD(_,_,SOME((e,ty2,c))))
=> fail
*)

axiom inst_mod_equation(_,_,Mod.MOD(_,_,NONE)) => []
axiom inst_mod_equation(_,_,Mod.NOMOD) => []

Expand Down Expand Up @@ -1444,6 +1432,8 @@ relation make_binding : (Env.Env, Absyn.VarAttr, Mod.EqMod option, SCode.Class)

end

(** relation: make_const_binding *)

relation make_const_binding : (Env.Env, Exp.Exp,
Types.Type, Types.Type, bool) => Types.Binding =

Expand Down Expand Up @@ -1475,6 +1465,8 @@ relation make_const_binding : (Env.Env, Exp.Exp,

end

(** relation: class_type *)

relation class_type : SCode.Class => Types.Type =

axiom class_type SCode.CLASS(_,_,Absyn.R_PREDEFINED_INT,_) => Types.T_INTEGER
Expand Down
15 changes: 12 additions & 3 deletions modeq/staticexp.rml
Expand Up @@ -284,6 +284,8 @@ relation elab_call : (Env.Env, Absyn.ComponentRef, Absyn.Exp list)

end

(**)

relation elab_call2 : (Env.Env, Absyn.Path, Absyn.Exp list)
=> (Exp.Exp, Types.Type, bool) =

Expand All @@ -300,6 +302,8 @@ relation elab_call2 : (Env.Env, Absyn.Path, Absyn.Exp list)

end

(**)

relation elab_call_args : (Env.Env, Absyn.Exp list, Types.FuncArg list)
=> (Exp.Exp list, bool) =

Expand Down Expand Up @@ -509,7 +513,7 @@ relation subscript_cref_type2 : (Exp.ComponentRef, Types.Type) => Types.Type =

end

(** relation subscript_type
(** relation: subscript_type
**
** Given an array dimensionality and a list of subscripts, this
** relation reduces the dimensionality.
Expand Down Expand Up @@ -821,8 +825,7 @@ end

(** relation: ceval_list
**
** Do a constant evaluation on a number of expressions, and assert
** that they are all of the same type.
** This relation does a constant evaluation on a number of expressions.
**)

relation ceval_list : (Env.Env, Exp.Exp list) => Values.Value list =
Expand Down Expand Up @@ -1047,6 +1050,7 @@ end
** it means to add, say, an integer and a real number, the
** expressions have to be de-overloaded, with one operator for each
** distinct operation.
** FIXME: Better motivation
**)

(** relation: elab_arglist
Expand All @@ -1072,6 +1076,11 @@ end
**
** This is the relation that takes care of the type conversions. All
** type conversion rules are described in this relation.
**
** The first argument is the expected type. The second and third
** arguments are the given expression and its type, respectively.
** When a type case is required, an `Exp.CAST()' is wrapped around
** the expressions.
**)

relation elab_arg : (Types.Type, Exp.Exp, Types.Type) => Exp.Exp =
Expand Down

0 comments on commit ce88dbf

Please sign in to comment.