Commit e3c492c4 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent b829d90b
...@@ -3,22 +3,24 @@ EXTENDS Integers, TLC ...@@ -3,22 +3,24 @@ EXTENDS Integers, TLC
S == 1..2 S == 1..2
Max(s) == CHOOSE x \in s : \A y \in s : x >= y
(*** (***
--algorithm PrintSet { --algorithm PrintSet {
variable X = S; variable X = S;
{ {
e: print ""; e: print "";
a: while (X /= {}) { b: with (x = Max(X)) {
b: with (x \in X) {
print x; print x;
print X; print X;
X := X \ {x} X := X \ {x}
} }
}
} }
} }
***) ***)
\* BEGIN TRANSLATION (chksum(pcal) = "9746c50d" /\ chksum(tla) = "7a93560d") \* BEGIN TRANSLATION (chksum(pcal) = "e2897145" /\ chksum(tla) = "a33ba03b")
VARIABLES X, pc VARIABLES X, pc
vars == << X, pc >> vars == << X, pc >>
...@@ -29,26 +31,20 @@ Init == (* Global variables *) ...@@ -29,26 +31,20 @@ Init == (* Global variables *)
e == /\ pc = "e" e == /\ pc = "e"
/\ PrintT("") /\ PrintT("")
/\ pc' = "a" /\ pc' = "b"
/\ X' = X
a == /\ pc = "a"
/\ IF X /= {}
THEN /\ pc' = "b"
ELSE /\ pc' = "Done"
/\ X' = X /\ X' = X
b == /\ pc = "b" b == /\ pc = "b"
/\ \E x \in X: /\ LET x == Max(X) IN
/\ PrintT(x) /\ PrintT(x)
/\ PrintT(X) /\ PrintT(X)
/\ X' = X \ {x} /\ X' = X \ {x}
/\ pc' = "a" /\ pc' = "Done"
(* Allow infinite stuttering to prevent deadlock on termination. *) (* Allow infinite stuttering to prevent deadlock on termination. *)
Terminating == pc = "Done" /\ UNCHANGED vars Terminating == pc = "Done" /\ UNCHANGED vars
Next == e \/ a \/ b Next == e \/ b
\/ Terminating \/ Terminating
Spec == Init /\ [][Next]_vars Spec == Init /\ [][Next]_vars
...@@ -58,6 +54,3 @@ Termination == <>(pc = "Done") ...@@ -58,6 +54,3 @@ Termination == <>(pc = "Done")
\* END TRANSLATION \* END TRANSLATION
============================================================================= =============================================================================
\* Modification History
\* Last modified Fri Feb 11 13:45:43 MSK 2022 by kirr
\* Created Fri Feb 11 13:28:53 MSK 2022 by kirr
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.lamport.tla.toolbox.tool.tlc.modelCheck"> <launchConfiguration type="org.lamport.tla.toolbox.tool.tlc.modelCheck">
<stringAttribute key="configurationName" value="Model_1"/> <stringAttribute key="configurationName" value="Model_1"/>
<intAttribute key="fpIndex" value="101"/> <intAttribute key="fpIndex" value="97"/>
<stringAttribute key="modelBehaviorSpec" value="Spec"/> <stringAttribute key="modelBehaviorSpec" value="Spec"/>
<intAttribute key="modelBehaviorSpecType" value="1"/> <intAttribute key="modelBehaviorSpecType" value="1"/>
<listAttribute key="modelCorrectnessProperties"> <listAttribute key="modelCorrectnessProperties">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment