From 92d3cdcfcb066985ec3fc22889a952c5831d3a5b Mon Sep 17 00:00:00 2001 From: "Achim D. Brucker" Date: Wed, 30 Apr 2008 07:10:04 +0000 Subject: [PATCH] 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 --- su4sml/src/wfcpog/data_model_consistency.sml | 11 +++++------ su4sml/src/wfcpog/holocl_namespace.sml | 18 ------------------ 2 files changed, 5 insertions(+), 24 deletions(-) diff --git a/su4sml/src/wfcpog/data_model_consistency.sml b/su4sml/src/wfcpog/data_model_consistency.sml index e70ab8a..89b4730 100644 --- a/su4sml/src/wfcpog/data_model_consistency.sml +++ b/su4sml/src/wfcpog/data_model_consistency.sml @@ -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 diff --git a/su4sml/src/wfcpog/holocl_namespace.sml b/su4sml/src/wfcpog/holocl_namespace.sml index 923a1b2..0a848a9 100644 --- a/su4sml/src/wfcpog/holocl_namespace.sml +++ b/su4sml/src/wfcpog/holocl_namespace.sml @@ -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