Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config option to prevent transitions where start and target are equal #22

Merged
merged 3 commits into from
Dec 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Modelling/StateDiagram/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ data SDConfig
, preventNestedEndNodes :: Bool
, multiEdgesPresentInOriginalDiagram :: Maybe Bool
, compoundsHaveNames :: Maybe Bool
, preventSelfLoops :: Bool
, preventNormalAndHierarchicalStatesWithoutOutgoingEdges :: Bool
, chartLimits :: ChartLimits
, extraConstraint :: String
Expand Down Expand Up @@ -91,6 +92,7 @@ defaultSDConfigScenario1
, preventNestedEndNodes = False
, multiEdgesPresentInOriginalDiagram = Nothing
, compoundsHaveNames = Just False
, preventSelfLoops = False
, preventNormalAndHierarchicalStatesWithoutOutgoingEdges = True
, chartLimits =
ChartLimits { regionsStates = 0
Expand Down Expand Up @@ -128,6 +130,7 @@ defaultSDConfigScenario2
, preventNestedEndNodes = True
, multiEdgesPresentInOriginalDiagram = Nothing
, compoundsHaveNames = Just False
, preventSelfLoops = False
, preventNormalAndHierarchicalStatesWithoutOutgoingEdges = True
, chartLimits =
ChartLimits { regionsStates = 1
Expand Down Expand Up @@ -165,6 +168,7 @@ defaultSDConfigScenario3
, preventNestedEndNodes = False
, multiEdgesPresentInOriginalDiagram = Nothing
, compoundsHaveNames = Just False
, preventSelfLoops = False
, preventNormalAndHierarchicalStatesWithoutOutgoingEdges = True
, chartLimits =
ChartLimits { regionsStates = 0
Expand Down Expand Up @@ -303,6 +307,7 @@ sdConfigToAlloy SDConfig { bitwidth
, preventNestedEndNodes
, multiEdgesPresentInOriginalDiagram
, compoundsHaveNames
, preventSelfLoops
, preventNormalAndHierarchicalStatesWithoutOutgoingEdges
, chartLimits = ChartLimits { regionsStates
, hierarchicalStates
Expand Down Expand Up @@ -354,6 +359,7 @@ pred scenarioConfig #{oB}
"all n1, n2 : Nodes | lone (Flows & from.n1 & to.n2)")
multiEdgesPresentInOriginalDiagram}
#{if preventNestedEndNodes then "disj[EndNodes, allContainedNodes]" else ""}
#{if preventSelfLoops then "no s : States | s in (Flows <: from).s.to" else ""}
#{if preventNormalAndHierarchicalStatesWithoutOutgoingEdges then "all s : (NormalStates + HierarchicalStates) | some (Flows <: from).s" else ""}
#{lowerBound startNodes "StartNodes"}
#{lowerBound shallowHistoryNodes "ShallowHistoryNodes"}
Expand Down
Loading