removed superflous gen_unique_string and narrowed some types in the generated POs

git-svn-id: https://projects.brucker.ch/su4sml/svn/su4sml/trunk@7821 3260e6d1-4efc-4170-b0a7-36055960796d
This commit is contained in:
Achim D. Brucker 2008-04-30 07:10:04 +00:00
parent 540f76c072
commit 92d3cdcfcb
2 changed files with 5 additions and 24 deletions

View File

@ -72,19 +72,18 @@ exception WFCPO_DataModelError
fun c_allInstance_term (c:Classifier) =
let
val _ = trace function_calls ("WF_data_CS.c_allInstances\n")
val uni_name_x = HolOcl_Namespace.gen_unique_string()
val x = Variable (uni_name_x,DummyT)
val class_type = type_of c
val x_name = ("c_"^(varcounter.nextStr()))
val x = Variable (x_name,class_type)
(* get class as an holocl term *)
val holocl_class_name = get_class_of (name_of c)
val class_type = type_of c
val uni_name_c = HolOcl_Namespace.gen_unique_string()
val class = Variable(uni_name_c,class_type)
val class = Variable("annonAllInstancesVariable_"^(varcounter.nextStr()),class_type)
(* OclAny.allInstances() *)
val allInstances = OperationCall (class,class_type,["oclLib","OclAny","allInstances"],[],Set (class_type))
(* x.oclIsTypeOf(c) *)
val oclIsTypeOf = OperationWithType (x,DummyT,"oclIsTypeOf",class_type,Boolean)
(* Iterator exists *)
val exists = Iterator("exists",[(uni_name_x,DummyT)],allInstances,Set(class_type),oclIsTypeOf,Boolean,Boolean)
val exists = Iterator("exists",[(x_name,class_type)],allInstances,Set(class_type),oclIsTypeOf,Boolean,Boolean)
val _ = trace function_ends ("WF_data_CS.c_allInstances\n")
in
exists

View File

@ -89,7 +89,6 @@ sig
val name_of_pre : Rep_Core.Classifier -> Rep_Core.operation -> Rep_OclType.Path
val name_of_post : Rep_Core.Classifier -> Rep_Core.operation -> Rep_OclType.Path
val gen_unique_string : unit -> string
end
@ -105,23 +104,6 @@ struct
val id = ref 0;
fun gen_unique_string () =
let
val _ = id:=(!id+1)
in
("var"^Int.toString(!id))
end
fun init_id () =
let
val _ = id:= 0
val _ = Rep_Logger.trace 10 ("id reseted ...\n")
in
()
end
fun listin _ [] = false
| listin e (x::xs) = if e=x then true else listin e xs