2005-09-08 09:26:32 +00:00
|
|
|
|
(*****************************************************************************
|
|
|
|
|
* su4sml - a SecureUML repository for SML
|
|
|
|
|
*
|
|
|
|
|
* xmi_umlcore.sig - XMI-UML-Core datatypes for the import interface for su4sml
|
|
|
|
|
* Copyright (C) 2005 Achim D. Brucker <brucker@inf.ethz.ch>
|
|
|
|
|
* J<EFBFBD>rgen Doser <doserj@inf.ethz.ch>
|
|
|
|
|
* Burkhart Wolff
|
|
|
|
|
*
|
|
|
|
|
* This file is part of su4sml.
|
|
|
|
|
*
|
|
|
|
|
* su4sml is free software; you can redistribute it and/or modify it under
|
|
|
|
|
* the terms of the GNU General Public License as published by the Free
|
|
|
|
|
* Software Foundation; either version 2 of the License, or (at your option)
|
|
|
|
|
* any later version.
|
|
|
|
|
*
|
|
|
|
|
* su4sml is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
|
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
|
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
|
|
|
* details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
******************************************************************************)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(* ---------------------------------------------------------------------------
|
|
|
|
|
* The types in these structures are supposed to define a representation of
|
|
|
|
|
* the XML elements found in UML-XMI files. It is reasonably close to the UML
|
|
|
|
|
* metamodel and the XMI representation of it, while simplifying some kinds
|
|
|
|
|
* of references.
|
|
|
|
|
* --------------------------------------------------------------------------*)
|
|
|
|
|
|
|
|
|
|
structure XMI_CommonBehavior =
|
|
|
|
|
struct
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
structure XMI_StateMachines =
|
|
|
|
|
struct
|
2005-10-28 14:39:09 +00:00
|
|
|
|
open XMI_ExtensionMechanisms XMI_CommonBehavior
|
|
|
|
|
exception IllFormed of string
|
2005-09-08 10:11:43 +00:00
|
|
|
|
|
|
|
|
|
type StateVertex_Id = string
|
|
|
|
|
type Transition_Id = string
|
2005-09-20 16:20:08 +00:00
|
|
|
|
type Stereotype_Id = string
|
2005-09-08 10:11:43 +00:00
|
|
|
|
|
2005-09-12 20:13:23 +00:00
|
|
|
|
datatype Procedure = mk_Procedure of
|
|
|
|
|
{xmiid : string,
|
|
|
|
|
isSpecification : bool,
|
|
|
|
|
name : string,
|
|
|
|
|
isAsynchronous : bool,
|
|
|
|
|
language : string,
|
|
|
|
|
body : string,
|
|
|
|
|
expression : string list
|
|
|
|
|
(* method : Method list, NOT YET IMPLEMENTED *)
|
|
|
|
|
(* isList : bool NOT SUPPORTED BY POSEIDON *)}
|
|
|
|
|
|
|
|
|
|
datatype Guard = mk_Guard of {xmiid : string,
|
|
|
|
|
isSpecification : bool,
|
|
|
|
|
name : string,
|
|
|
|
|
visibility : VisibilityKind,
|
|
|
|
|
language : string,
|
|
|
|
|
body : string,
|
|
|
|
|
expression : string list}
|
2005-09-08 10:11:43 +00:00
|
|
|
|
|
|
|
|
|
datatype Event = SignalEvent of Parameter list
|
|
|
|
|
| CallEvent of Parameter list
|
|
|
|
|
(* | TimeEvent of Parameter list *)
|
|
|
|
|
(* | ChangeEvent of Parameter list *)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
datatype Transition = mk_Transition of
|
2005-09-12 20:13:23 +00:00
|
|
|
|
{isSpecification : bool,
|
2005-09-08 17:00:46 +00:00
|
|
|
|
xmiid : string,
|
|
|
|
|
source : StateVertex_Id,
|
2005-09-08 10:11:43 +00:00
|
|
|
|
target : StateVertex_Id,
|
|
|
|
|
guard : Guard option,
|
|
|
|
|
trigger : Event option,
|
2005-09-13 20:15:00 +00:00
|
|
|
|
effect : Procedure option,
|
|
|
|
|
taggedValue : TaggedValue list
|
2005-09-08 10:11:43 +00:00
|
|
|
|
(* mmm : StateVertexId option *)
|
|
|
|
|
}
|
|
|
|
|
|
2005-09-20 16:20:08 +00:00
|
|
|
|
fun transition_source_of (mk_Transition{source,...}) = source
|
|
|
|
|
fun transition_target_of (mk_Transition{target,...}) = target
|
2005-09-08 10:11:43 +00:00
|
|
|
|
|
|
|
|
|
datatype PseudoStateVars = initial | deep | shallow |
|
|
|
|
|
join | fork |
|
|
|
|
|
junction | choice
|
|
|
|
|
|
|
|
|
|
datatype StateVertex =
|
2005-09-12 20:13:23 +00:00
|
|
|
|
CompositeState
|
2005-09-08 17:00:46 +00:00
|
|
|
|
of {xmiid : string,
|
|
|
|
|
name : string,
|
2005-09-20 16:20:08 +00:00
|
|
|
|
stereotype : Stereotype_Id list,
|
2005-09-12 20:13:23 +00:00
|
|
|
|
isSpecification : bool,
|
2005-09-08 17:00:46 +00:00
|
|
|
|
isConcurrent : bool,
|
2005-09-12 20:13:23 +00:00
|
|
|
|
entry : Procedure option,
|
|
|
|
|
exit : Procedure option,
|
|
|
|
|
doActivity : Procedure option,
|
2005-09-08 17:00:46 +00:00
|
|
|
|
outgoing : Transition_Id list,
|
2005-09-08 10:11:43 +00:00
|
|
|
|
incoming : Transition_Id list,
|
2005-09-13 20:15:00 +00:00
|
|
|
|
taggedValue : TaggedValue list,
|
2005-09-08 17:00:46 +00:00
|
|
|
|
subvertex : StateVertex list}
|
2005-09-12 20:13:23 +00:00
|
|
|
|
| SubactivityState
|
2005-09-08 17:00:46 +00:00
|
|
|
|
of {xmiid : string,
|
|
|
|
|
name : string,
|
2005-09-20 16:20:08 +00:00
|
|
|
|
stereotype : Stereotype_Id list,
|
2005-09-12 20:13:23 +00:00
|
|
|
|
isSpecification : bool,
|
2005-09-08 10:11:43 +00:00
|
|
|
|
isConcurrent : bool,
|
2005-09-12 20:13:23 +00:00
|
|
|
|
entry : Procedure option,
|
|
|
|
|
exit : Procedure option,
|
|
|
|
|
doActivity : Procedure option,
|
2005-09-08 17:00:46 +00:00
|
|
|
|
outgoing : Transition_Id list,
|
|
|
|
|
incoming : Transition_Id list,
|
|
|
|
|
subvertex : StateVertex list,
|
2005-09-09 14:58:20 +00:00
|
|
|
|
submachine : StateMachine,
|
2005-09-13 20:15:00 +00:00
|
|
|
|
taggedValue : TaggedValue list,
|
2005-09-08 17:00:46 +00:00
|
|
|
|
isDynamic : bool}
|
2005-09-12 20:13:23 +00:00
|
|
|
|
| SimpleState
|
2005-09-08 17:00:46 +00:00
|
|
|
|
of {xmiid : string,
|
|
|
|
|
name : string,
|
2005-09-20 16:20:08 +00:00
|
|
|
|
stereotype : Stereotype_Id list,
|
2005-09-12 20:13:23 +00:00
|
|
|
|
isSpecification : bool,
|
|
|
|
|
entry : Procedure option,
|
|
|
|
|
exit : Procedure option,
|
|
|
|
|
doActivity : Procedure option,
|
2005-09-13 20:15:00 +00:00
|
|
|
|
taggedValue : TaggedValue list,
|
2005-09-08 17:00:46 +00:00
|
|
|
|
outgoing : Transition_Id list,
|
|
|
|
|
incoming : Transition_Id list}
|
2005-09-12 20:13:23 +00:00
|
|
|
|
| ActionState (* from ActivityGraphs *)
|
2005-09-08 17:00:46 +00:00
|
|
|
|
of {xmiid : string,
|
|
|
|
|
name : string,
|
2005-09-20 16:20:08 +00:00
|
|
|
|
stereotype : Stereotype_Id list,
|
2005-09-12 20:13:23 +00:00
|
|
|
|
isSpecification : bool,
|
|
|
|
|
entry : Procedure option,
|
2005-09-08 17:00:46 +00:00
|
|
|
|
outgoing : Transition_Id list,
|
|
|
|
|
incoming : Transition_Id list,
|
2005-09-13 20:15:00 +00:00
|
|
|
|
taggedValue : TaggedValue list,
|
2005-09-08 17:00:46 +00:00
|
|
|
|
isDynamic : bool
|
2005-09-08 10:11:43 +00:00
|
|
|
|
(* + dynamicArguments + dynamicMultiplicity *)}
|
2005-09-12 20:13:23 +00:00
|
|
|
|
| ObjectFlowState (* from ActivityGraphs *)
|
2005-09-08 17:00:46 +00:00
|
|
|
|
of {xmiid : string,
|
|
|
|
|
name : string,
|
2005-09-20 16:20:08 +00:00
|
|
|
|
stereotype : Stereotype_Id list,
|
2005-09-12 20:13:23 +00:00
|
|
|
|
isSpecification : bool,
|
|
|
|
|
entry : Procedure option,
|
|
|
|
|
exit : Procedure option,
|
|
|
|
|
doActivity : Procedure option,
|
2005-09-08 17:00:46 +00:00
|
|
|
|
outgoing : Transition_Id list,
|
|
|
|
|
incoming : Transition_Id list,
|
|
|
|
|
isSynch : bool,
|
2005-09-08 10:11:43 +00:00
|
|
|
|
parameter : Parameter list,
|
2005-09-13 20:15:00 +00:00
|
|
|
|
taggedValue : TaggedValue list,
|
2005-10-05 17:18:41 +00:00
|
|
|
|
type_ : string}
|
2005-09-12 20:13:23 +00:00
|
|
|
|
| FinalState
|
2005-09-08 17:00:46 +00:00
|
|
|
|
of {xmiid : string,
|
|
|
|
|
name : string,
|
2005-09-20 16:20:08 +00:00
|
|
|
|
stereotype : Stereotype_Id list,
|
2005-09-12 20:13:23 +00:00
|
|
|
|
isSpecification : bool,
|
|
|
|
|
entry : Procedure option,
|
|
|
|
|
exit : Procedure option,
|
|
|
|
|
doActivity : Procedure option,
|
2005-09-13 20:15:00 +00:00
|
|
|
|
taggedValue : TaggedValue list,
|
2005-09-08 17:00:46 +00:00
|
|
|
|
incoming : Transition_Id list }
|
2005-09-08 10:11:43 +00:00
|
|
|
|
| PseudoState
|
2005-09-08 17:00:46 +00:00
|
|
|
|
of {xmiid : string,
|
|
|
|
|
name : string,
|
2005-09-20 16:20:08 +00:00
|
|
|
|
stereotype : Stereotype_Id list,
|
2005-09-12 20:13:23 +00:00
|
|
|
|
isSpecification : bool,
|
2005-09-08 17:00:46 +00:00
|
|
|
|
kind : PseudoStateVars,
|
2005-09-13 20:15:00 +00:00
|
|
|
|
taggedValue : TaggedValue list,
|
2005-09-08 10:11:43 +00:00
|
|
|
|
outgoing : Transition_Id list,
|
2005-09-08 17:00:46 +00:00
|
|
|
|
incoming : Transition_Id list }
|
2005-09-08 10:11:43 +00:00
|
|
|
|
| SyncState
|
2005-09-08 17:00:46 +00:00
|
|
|
|
of {xmiid : string,
|
|
|
|
|
name : string,
|
2005-09-20 16:20:08 +00:00
|
|
|
|
stereotype : Stereotype_Id list,
|
2005-09-12 20:13:23 +00:00
|
|
|
|
isSpecification : bool,
|
2005-09-08 17:00:46 +00:00
|
|
|
|
outgoing : Transition_Id list,
|
2005-09-08 10:11:43 +00:00
|
|
|
|
incoming : Transition_Id list,
|
2005-09-13 20:15:00 +00:00
|
|
|
|
taggedValue : TaggedValue list,
|
2005-09-08 17:00:46 +00:00
|
|
|
|
bound : int}
|
2005-09-20 13:26:26 +00:00
|
|
|
|
(* | StubState *)
|
2005-09-08 10:11:43 +00:00
|
|
|
|
and StateMachine = mk_StateMachine of
|
2005-09-08 17:00:46 +00:00
|
|
|
|
{xmiid : string,
|
|
|
|
|
contextxmiid : string,
|
2005-09-12 20:13:23 +00:00
|
|
|
|
isSpecification : bool,
|
2005-09-08 17:00:46 +00:00
|
|
|
|
top : StateVertex,
|
|
|
|
|
transitions : Transition list}
|
2005-09-08 10:11:43 +00:00
|
|
|
|
|
2005-10-05 17:18:41 +00:00
|
|
|
|
fun state_type_of (ObjectFlowState{type_,...}) = type_
|
|
|
|
|
| state_type_of _ = raise IllFormed "state_type_of called on a non-ObjectFlow state"
|
|
|
|
|
|
2005-10-05 16:13:49 +00:00
|
|
|
|
fun state_entry_of (CompositeState{entry,...}) = entry
|
|
|
|
|
| state_entry_of (SubactivityState{entry,...}) = entry
|
|
|
|
|
| state_entry_of (SimpleState{entry,...}) = entry
|
|
|
|
|
| state_entry_of (ActionState{entry,...}) = entry
|
|
|
|
|
| state_entry_of (ObjectFlowState{entry,...}) = entry
|
|
|
|
|
| state_entry_of (FinalState{entry,...}) = entry
|
2005-10-05 17:18:41 +00:00
|
|
|
|
| state_entry_of _ = raise IllFormed "state_entry_of called on a state that does not have entry actions"
|
2005-09-08 10:11:43 +00:00
|
|
|
|
|
2005-09-20 13:26:26 +00:00
|
|
|
|
fun state_xmiid_of (CompositeState{xmiid,...}) = xmiid
|
|
|
|
|
| state_xmiid_of (SubactivityState{xmiid,...}) = xmiid
|
|
|
|
|
| state_xmiid_of (SimpleState{xmiid,...}) = xmiid
|
|
|
|
|
| state_xmiid_of (ActionState{xmiid,...}) = xmiid
|
|
|
|
|
| state_xmiid_of (ObjectFlowState{xmiid,...}) = xmiid
|
|
|
|
|
| state_xmiid_of (FinalState{xmiid,...}) = xmiid
|
|
|
|
|
| state_xmiid_of (PseudoState{xmiid,...}) = xmiid
|
|
|
|
|
| state_xmiid_of (SyncState{xmiid,...}) = xmiid
|
|
|
|
|
|
2005-09-30 10:14:47 +00:00
|
|
|
|
fun state_name_of (CompositeState{name,...}) = name
|
|
|
|
|
| state_name_of (SubactivityState{name,...}) = name
|
|
|
|
|
| state_name_of (SimpleState{name,...}) = name
|
|
|
|
|
| state_name_of (ActionState{name,...}) = name
|
|
|
|
|
| state_name_of (ObjectFlowState{name,...}) = name
|
|
|
|
|
| state_name_of (FinalState{name,...}) = name
|
|
|
|
|
| state_name_of (PseudoState{name,...}) = name
|
|
|
|
|
| state_name_of (SyncState{name,...}) = name
|
|
|
|
|
|
2005-09-20 16:20:08 +00:00
|
|
|
|
fun state_subvertices_of (CompositeState{subvertex,...}) = subvertex
|
|
|
|
|
| state_subvertices_of (SubactivityState{subvertex,...}) = subvertex
|
2005-09-28 11:56:37 +00:00
|
|
|
|
| state_subvertices_of _ = raise IllFormed "state_subvertices_of called on a non-composite state"
|
2005-09-20 16:20:08 +00:00
|
|
|
|
|
|
|
|
|
fun state_outgoing_trans_of (CompositeState{outgoing,...}) = outgoing
|
|
|
|
|
| state_outgoing_trans_of (SubactivityState{outgoing,...}) = outgoing
|
|
|
|
|
| state_outgoing_trans_of (SimpleState{outgoing,...}) = outgoing
|
|
|
|
|
| state_outgoing_trans_of (ActionState{outgoing,...}) = outgoing
|
|
|
|
|
| state_outgoing_trans_of (ObjectFlowState{outgoing,...}) = outgoing
|
|
|
|
|
| state_outgoing_trans_of (PseudoState{outgoing,...}) = outgoing
|
|
|
|
|
| state_outgoing_trans_of (SyncState{outgoing,...}) = outgoing
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun state_incoming_trans_of (CompositeState{incoming,...}) = incoming
|
|
|
|
|
| state_incoming_trans_of (SubactivityState{incoming,...}) = incoming
|
|
|
|
|
| state_incoming_trans_of (SimpleState{incoming,...}) = incoming
|
|
|
|
|
| state_incoming_trans_of (ActionState{incoming,...}) = incoming
|
|
|
|
|
| state_incoming_trans_of (ObjectFlowState{incoming,...}) = incoming
|
|
|
|
|
| state_incoming_trans_of (FinalState{incoming,...}) = incoming
|
|
|
|
|
| state_incoming_trans_of (PseudoState{incoming,...}) = incoming
|
|
|
|
|
| state_incoming_trans_of (SyncState{incoming,...}) = incoming
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun state_stereotype_of (CompositeState{stereotype,...}) = stereotype
|
|
|
|
|
| state_stereotype_of (SubactivityState{stereotype,...}) = stereotype
|
|
|
|
|
| state_stereotype_of (SimpleState{stereotype,...}) = stereotype
|
|
|
|
|
| state_stereotype_of (ActionState{stereotype,...}) = stereotype
|
|
|
|
|
| state_stereotype_of (ObjectFlowState{stereotype,...}) = stereotype
|
|
|
|
|
| state_stereotype_of (FinalState{stereotype,...}) = stereotype
|
|
|
|
|
| state_stereotype_of (PseudoState{stereotype,...}) = stereotype
|
|
|
|
|
| state_stereotype_of (SyncState{stereotype,...}) = stereotype
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fun state_taggedValue_of (CompositeState{taggedValue,...}) = taggedValue
|
|
|
|
|
| state_taggedValue_of (SubactivityState{taggedValue,...}) = taggedValue
|
|
|
|
|
| state_taggedValue_of (SimpleState{taggedValue,...}) = taggedValue
|
|
|
|
|
| state_taggedValue_of (ActionState{taggedValue,...}) = taggedValue
|
|
|
|
|
| state_taggedValue_of (ObjectFlowState{taggedValue,...}) = taggedValue
|
|
|
|
|
| state_taggedValue_of (FinalState{taggedValue,...}) = taggedValue
|
|
|
|
|
| state_taggedValue_of (PseudoState{taggedValue,...}) = taggedValue
|
|
|
|
|
| state_taggedValue_of (SyncState{taggedValue,...}) = taggedValue
|
|
|
|
|
|
2005-10-07 17:04:26 +00:00
|
|
|
|
fun state_is_fork (PseudoState{kind=fork,...}) = true
|
|
|
|
|
| state_is_fork _ = false
|
|
|
|
|
|
|
|
|
|
fun state_is_join (PseudoState{kind=join,...}) = true
|
|
|
|
|
| state_is_join _ = false
|
|
|
|
|
|
2005-09-08 09:26:32 +00:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|