-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.tla
57 lines (31 loc) · 1019 Bytes
/
test.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
-------------------------------- MODULE test --------------------------------
EXTENDS Naturals, Integers, FiniteSets, Bags, Sequences, TLC
Remove(i,seq) == [ j \in 1..(Len(seq)-1) |-> IF j < i THEN seq[j] ELSE seq[j+1]]
tail(seq) == [i \in 1..Len(seq)-1 |-> seq[i+1]]
\* add[i, j \in Nat] == i+j
\*add == [i, j \in Nat |-> i+j]
(*
--algorithm test {
variable seq = <<10,11,12,13,14,15>>;
{
print <<seq, tail(seq)>>;
}
}
*)
\* BEGIN TRANSLATION
VARIABLES seq, pc
vars == << seq, pc >>
Init == (* Global variables *)
/\ seq = <<10,11,12,13,14,15>>
/\ pc = "Lbl_1"
Lbl_1 == /\ pc = "Lbl_1"
/\ PrintT(<<seq, tail(seq)>>)
/\ pc' = "Done"
/\ seq' = seq
Next == Lbl_1
\/ (* Disjunct to prevent deadlock on termination *)
(pc = "Done" /\ UNCHANGED vars)
Spec == Init /\ [][Next]_vars
Termination == <>(pc = "Done")
\* END TRANSLATION
=============================================================================