-
Notifications
You must be signed in to change notification settings - Fork 0
/
Example1_Simple.tla
43 lines (32 loc) · 1.48 KB
/
Example1_Simple.tla
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---------------------------- MODULE Example1_Simple -------------------------------
\**********************************************************************************
\* Instantiate and model check a simple Petri Net. The net has a source place, a sink place,
\* 1 transition, and an initial marking with 1 token in the source place.
\*
\* `. ------
\* source -> | t1 | -> sink
\* ------ .'
\**********************************************************************************
Places == {"source", "sink"} (* Define the net. *)
Transitions == {"t1"}
Arcs == [
source |-> {"t1"},
t1 |-> {"sink"}
]
ArcWeights == <<>> \* Unspecified arc weights default to 1.
InitialMarking == [source |-> 1]
VARIABLE Marking
PN == INSTANCE PetriNet (* Instantiate it within a namespace. *)
Spec == PN!Spec (* Make Spec and Invariants available for the config file. *)
Invariants == PN!Invariants
-----------------------------------------------------------------------------------
\**********************************************************************************
\* Properties
\**********************************************************************************
\* Eventually, we arrive as a expected final marking...
ReachableMarking == PN!Reachable([sink |-> 1])
\* and we never leave it.
FinalMarking == PN!FinalMarking([sink |-> 1])
BoundOne == PN!Bound(1)
IsStateMachine == PN!IsStateMachine
===================================================================================