diff --git a/WitnessTestGeneration.hs b/BlackboxTestGenerator.hs similarity index 100% rename from WitnessTestGeneration.hs rename to BlackboxTestGenerator.hs diff --git a/Main.hs b/CodeGenerator.hs similarity index 100% rename from Main.hs rename to CodeGenerator.hs diff --git a/README.md b/README.md index dba6d30..192eb40 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,5 @@ # TLA+ Transmutation -Elixir code generation from TLA+ specifications - -I've started to work on this for my bachelor thesis, which can be found [here](https://github.com/bugarela/bachelor-thesis) (Portuguese only). - -The formalization of the translation rules are available at [rules.pdf](rules.pdf) - -Notice that this covers only a small portion of TLA+ definitions and it is yet to be incremented with more translations. The Parser itself isn't able to recognize much. Contributions are welcome :D. +Elixir code and test generation from TLA+ specifications ## Dependencies @@ -20,27 +14,24 @@ Notice that this covers only a small portion of TLA+ definitions and it is yet t [Instructions for installation with asdf package manager](https://elixirgirls.com/install-guides/linux.html) ## Build -```sh -ghc Main.hs + +``` sh +make compile ``` ## Run -This currently supports partially 2 forms of parsing: -1. From `.tla` files: this is deprecated and supports a minimal fragment of the language -2. From `.json` files produced by [Apalache](https://github.com/informalsystems/apalache)'s parsing: Work in progress. +The best parsing implementation takes JSON files previously parsed from TLA with [Apalache](https://github.com/informalsystems/apalache): -To generate code, specify the args: -1. Mode (`tla` or `json`) -2. Filepath (for the `.tla` or `.json` file) -3. Init definition name (i.e. `MyInit`) -4. Next definition name (i.e. `MyNext`) - -Some examples: -```sh -./Main json tla_specifications/token-transfer/TokenTransfer1.json Init Next +``` sh +apalache-mc parse --output=file.json file.tla ``` +All compliled files (`CodeGenerator`, `WhiteboxTestGenerator` and `BlackboxTestGenerator`) take a single argument which is a JSON-formatted configuration file similar to [config-sample.json](./config-sample.json) + +Folders inside [tla_specifications](./tla_specifications) are examples containing the required files for running the three executables. You can `cd` into any of them and run: + ``` sh -./Main tla tla_specifications/EfetivacaoEmDuasFases.tla DFInit DFNext +../../CodeGenerator config.json && ../../BlackboxTestGenerator config.json && ../../WhiteboxTestGenerator config.json ``` + diff --git a/StateGraphParser.hs b/WhiteboxTestGenerator.hs similarity index 97% rename from StateGraphParser.hs rename to WhiteboxTestGenerator.hs index 4ecf7d4..7408ef3 100644 --- a/StateGraphParser.hs +++ b/WhiteboxTestGenerator.hs @@ -64,7 +64,7 @@ testForNode ms g Node {nodeId = i, label = l} = do , " expectedStates = [" ++ intercalate ",\n" ss ++ "]" , "" , " actions = List.flatten([" ++ intercalate ", " (map (++ ".next(variables)") ms) ++ "])" - , " states = Enum.map(actions, fn action -> action[:state] end)" + , " states = Enum.map(actions, fn action -> action[:transition].(variables) end)" , "" , " assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates))" , "end" diff --git a/config-sample.json b/config-sample.json index 6c0e943..172d1a8 100644 --- a/config-sample.json +++ b/config-sample.json @@ -25,5 +25,19 @@ ] } ], - "shared_variables": ["tcolor", "tpos", "active"] + "shared_variables": ["tcolor", "tpos", "active"], + "constants": [ + { + "name": "N", + "value": "3" + } + ], + "init": "Init", + "next": "Next", + "module_name": "EWD840", + "input_format": "json", + "input_file": "EWD840.json", + "state_graph": "states.json", + "blackbox_tests": [{"name": "Termination", "trace": "trace.out"}], + "destination_folder": "../../elixir" } diff --git a/elixir/lib/generated_code/apaew_d840.ex b/elixir/lib/generated_code/ew_d840.ex similarity index 99% rename from elixir/lib/generated_code/apaew_d840.ex rename to elixir/lib/generated_code/ew_d840.ex index 16135c0..a7dcc48 100644 --- a/elixir/lib/generated_code/apaew_d840.ex +++ b/elixir/lib/generated_code/ew_d840.ex @@ -1,4 +1,4 @@ -defmodule APAEWD840 do +defmodule EWD840 do def shared_variables do [ :tcolor, diff --git a/elixir/lib/generated_code/apaew_d840_node0.ex b/elixir/lib/generated_code/ew_d840_node0.ex similarity index 95% rename from elixir/lib/generated_code/apaew_d840_node0.ex rename to elixir/lib/generated_code/ew_d840_node0.ex index 4b2f3fb..b4f4aad 100644 --- a/elixir/lib/generated_code/apaew_d840_node0.ex +++ b/elixir/lib/generated_code/ew_d840_node0.ex @@ -1,7 +1,7 @@ -defmodule APAEWD840_node0 do +defmodule EWD840_node0 do require Oracle - import APAEWD840 + import EWD840 def next(variables) do Enum.filter( diff --git a/elixir/lib/generated_code/apaew_d840_node1.ex b/elixir/lib/generated_code/ew_d840_node1.ex similarity index 95% rename from elixir/lib/generated_code/apaew_d840_node1.ex rename to elixir/lib/generated_code/ew_d840_node1.ex index 762b177..8d8602d 100644 --- a/elixir/lib/generated_code/apaew_d840_node1.ex +++ b/elixir/lib/generated_code/ew_d840_node1.ex @@ -1,7 +1,7 @@ -defmodule APAEWD840_node1 do +defmodule EWD840_node1 do require Oracle - import APAEWD840 + import EWD840 def next(variables) do Enum.filter( diff --git a/elixir/lib/generated_code/apaew_d840_node2.ex b/elixir/lib/generated_code/ew_d840_node2.ex similarity index 95% rename from elixir/lib/generated_code/apaew_d840_node2.ex rename to elixir/lib/generated_code/ew_d840_node2.ex index 8fe07c0..ce41ed9 100644 --- a/elixir/lib/generated_code/apaew_d840_node2.ex +++ b/elixir/lib/generated_code/ew_d840_node2.ex @@ -1,7 +1,7 @@ -defmodule APAEWD840_node2 do +defmodule EWD840_node2 do require Oracle - import APAEWD840 + import EWD840 def next(variables) do Enum.filter( diff --git a/elixir/lib/generated_code/jarros_de_agua.ex b/elixir/lib/generated_code/jarros_de_agua.ex deleted file mode 100644 index 0898da5..0000000 --- a/elixir/lib/generated_code/jarros_de_agua.ex +++ /dev/null @@ -1,166 +0,0 @@ -defmodule JarrosDeAgua do - @moduledoc """ - TypeOK == /\ jarro_pequeno \in 0..3 - /\ jarro_grande \in 0..5 - """ - require Oracle - # @oracle spawn(Oracle, :start, []) - - def enche_pequeno_condition(variables) do - True - end - - def enche_pequeno(variables) do - %{ - jarro_pequeno: 3, - jarro_grande: variables[:jarro_grande] - } - end - - def enche_grande_condition(variables) do - True - end - - def enche_grande(variables) do - %{ - jarro_grande: 5, - jarro_pequeno: variables[:jarro_pequeno] - } - end - - def esvazia_pequeno_condition(variables) do - True - end - - def esvazia_pequeno(variables) do - %{ - jarro_pequeno: 0, - jarro_grande: variables[:jarro_grande] - } - end - - def esvazia_grande_condition(variables) do - True - end - - def esvazia_grande(variables) do - %{ - jarro_grande: 0, - jarro_pequeno: variables[:jarro_pequeno] - } - end - - def pequeno_para_grande_condition(variables) do - if variables[:jarro_grande] + variables[:jarro_pequeno] <= 5 do - True - else - True - end - end - - def pequeno_para_grande(variables) do - if variables[:jarro_grande] + variables[:jarro_pequeno] <= 5 do - %{ - jarro_grande: variables[:jarro_grande] + variables[:jarro_pequeno], - jarro_pequeno: 0 - } - else - %{ - jarro_grande: 5, - jarro_pequeno: variables[:jarro_pequeno] - (5 - variables[:jarro_grande]) - } - end - end - - def grande_para_pequeno_condition(variables) do - if variables[:jarro_grande] + variables[:jarro_pequeno] <= 3 do - True - else - True - end - end - - def grande_para_pequeno(variables) do - if variables[:jarro_grande] + variables[:jarro_pequeno] <= 3 do - %{ - jarro_grande: 0, - jarro_pequeno: variables[:jarro_grande] + variables[:jarro_pequeno] - } - else - %{ - jarro_grande: variables[:jarro_pequeno] - (3 - variables[:jarro_grande]), - jarro_pequeno: 3 - } - end - end - - def next(variables) do - List.flatten([ - %{ - action: "EnchePequeno()", - condition: enche_pequeno_condition(variables), - state: enche_pequeno(variables) - }, - %{ - action: "EncheGrande()", - condition: enche_grande_condition(variables), - state: enche_grande(variables) - }, - %{ - action: "EsvaziaPequeno()", - condition: esvazia_pequeno_condition(variables), - state: esvazia_pequeno(variables) - }, - %{ - action: "EsvaziaGrande()", - condition: esvazia_grande_condition(variables), - state: esvazia_grande(variables) - }, - %{ - action: "PequenoParaGrande()", - condition: pequeno_para_grande_condition(variables), - state: pequeno_para_grande(variables) - }, - %{ - action: "GrandeParaPequeno()", - condition: grande_para_pequeno_condition(variables), - state: grande_para_pequeno(variables) - } - ]) - end - - def main(oracle, variables, step) do - IO.puts(inspect(variables)) - - actions = next(variables) - - next_variables = decide_action(oracle, actions, step) - send(oracle, {:notify, step, variables, next_variables}) - - main(oracle, next_variables, step + 1) - end - - def decide_action(oracle, actions, step) do - possible_actions = Enum.filter(actions, fn action -> action[:condition] end) - different_states = Enum.uniq_by(possible_actions, fn action -> action[:state] end) - - cond do - Enum.count(different_states) == 1 -> Enum.at(possible_actions, 0)[:state] - Enum.count(different_states) == 0 -> - IO.puts("DEADLOCK") - exit(0) - true -> - # actions_names = Enum.map(possible_actions, fn action -> action[:action] end) - IO.inspect(different_states) - send(oracle, {:choose, self(), step, possible_actions}) - - n = - receive do - {:ok, n} -> n - {:stop} -> exit(0) - end - - Enum.at(possible_actions, n)[:state] - end - end -end diff --git a/elixir/lib/generated_code/traffic_semaphores.ex b/elixir/lib/generated_code/traffic_semaphores.ex index 5993126..93cf6db 100644 --- a/elixir/lib/generated_code/traffic_semaphores.ex +++ b/elixir/lib/generated_code/traffic_semaphores.ex @@ -6,18 +6,18 @@ defmodule TrafficSemaphores do ] end require Oracle - @semaphores "" + @semaphores MapSet.new([0, 1]) def semaphores, do: @semaphores def turn_green_condition(variables, s) do - Enum.all?(@semaphores, fn(s2) -> variables[:colors][s2] == "red" end) + Enum.all?([Enum.all?(@semaphores, fn(s2) -> variables[:colors][s2] == "red" end), variables[:next_to_open] == s]) end def turn_green(variables, s) do %{ - colors: Map.put(variables[:colors], s, "green"), - next_to_open: variables[:next_to_open] + colors: variables[:colors]|>Map.put(s, "green"), + next_to_open: rem((s + 1), (Enum.count(@semaphores))) } end @@ -28,7 +28,7 @@ defmodule TrafficSemaphores do def turn_yellow(variables, s) do %{ - colors: Map.put(variables[:colors], s, "yellow"), + colors: variables[:colors]|>Map.put(s, "yellow"), next_to_open: variables[:next_to_open] } end @@ -40,24 +40,25 @@ defmodule TrafficSemaphores do def turn_red(variables, s) do %{ - colors: Map.put(variables[:colors], s, "red"), + colors: variables[:colors]|>Map.put(s, "red"), next_to_open: variables[:next_to_open] } end + # "Spec": OperEx "AND" [OperEx "OPER_APP" [NameEx "Init"],OperEx "GLOBALLY" [OperEx "STUTTER" [OperEx "OPER_APP" [NameEx "Next"],OperEx "TUPLE" [NameEx "colors",NameEx "next_to_open"]]]] def decide_action(oracle, variables, actions, step) do - different_states = Enum.uniq_by(actions, fn(action) -> action[:state] end) + different_states = Enum.uniq(Enum.map(actions, fn(action) -> action[:transition].(variables) end)) cond do Enum.count(different_states) == 1 -> - Enum.at(actions, 0)[:state] + Enum.at(different_states, 0) true -> - send oracle, {:choose, self(), actions} + send oracle, {:choose, self(), different_states} receive do - {:ok, n} -> Enum.at(actions, n)[:state] + {:ok, n} -> Enum.at(different_states, n) {:cancel} -> variables {:stop} -> exit(0) end diff --git a/elixir/lib/generated_code/traffic_semaphores_main.ex b/elixir/lib/generated_code/traffic_semaphores_main.ex index bd96dd3..bd66894 100644 --- a/elixir/lib/generated_code/traffic_semaphores_main.ex +++ b/elixir/lib/generated_code/traffic_semaphores_main.ex @@ -6,10 +6,10 @@ defmodule TrafficSemaphores_main do def next(variables) do Enum.filter( List.flatten([ - Enum.map(MapSet.new([0, 1]), fn (s) -> [ - %{ action: "TurnGreen(#{inspect s})", condition: turn_green_condition(variables, s), state: turn_green(variables, s) }, - %{ action: "TurnYellow(#{inspect s})", condition: turn_yellow_condition(variables, s), state: turn_yellow(variables, s) }, - %{ action: "TurnRed(#{inspect s})", condition: turn_red_condition(variables, s), state: turn_red(variables, s) } + Enum.map(TrafficSemaphores.semaphores, fn (s) -> [ + %{ action: "TurnGreen(#{inspect s})", condition: turn_green_condition(variables, s), transition: fn (variables) -> turn_green(variables, s) end }, + %{ action: "TurnYellow(#{inspect s})", condition: turn_yellow_condition(variables, s), transition: fn (variables) -> turn_yellow(variables, s) end }, + %{ action: "TurnRed(#{inspect s})", condition: turn_red_condition(variables, s), transition: fn (variables) -> turn_red(variables, s) end } ] end ) ]), @@ -21,11 +21,10 @@ defmodule TrafficSemaphores_main do shared_state = wait_lock(oracle) variables = Map.merge(private_variables, shared_state) - IO.puts(inspect(variables)) actions = next(variables) next_variables = decide_action(oracle, variables, actions, step) - send(oracle, {:notify, step, variables, next_variables}) + send(oracle, {:notify, self(), variables, next_variables}) Process.sleep(2000) main(oracle, next_variables, step + 1) diff --git a/elixir/lib/generated_code/two_phase_commit.ex b/elixir/lib/generated_code/two_phase_commit.ex deleted file mode 100644 index 8f7f689..0000000 --- a/elixir/lib/generated_code/two_phase_commit.ex +++ /dev/null @@ -1,266 +0,0 @@ -defmodule TwoPhaseCommit do - @moduledoc """ - ************************************************************************* - This specification is discussed in "Two-Phase Commit", Lecture 6 of the - TLA+ Video Course. It describes the Two-Phase Commit protocol, in - which a transaction manager (TM) coordinates the resource managers - (RMs) to implement the Transaction Commit specification of module - TCommit. In this specification, RMs spontaneously issue Prepared - messages. We ignore the Prepare messages that the TM can send to the - RMs. - - For simplicity, we also eliminate Abort messages sent by an RM when it - decides to abort. Such a message would cause the TM to abort the - transaction, an event represented here by the TM spontaneously deciding - to abort. - ************************************************************************* - """ - - @rm MapSet.new(["r1", "r2"]) - def rm, do: @rm - - - # ********************************************************************* - # In the protocol, processes communicate with one another by sending - # messages. For simplicity, we represent message passing with the - # variable msgs whose value is the set of all messages that have been - # sent. A message is sent by adding it to the set msgs. An action - # that, in an implementation, would be enabled by the receipt of a - # certain message is here enabled by the presence of that message in - # msgs. For simplicity, messages are never removed from msgs. This - # allows a single message to be received by multiple receivers. - # Receipt of the same message twice is therefore allowed; but in this - # particular protocol, that's not a problem. - # ********************************************************************* - # Messages == - # *********************************************************************** - # The set of all possible messages. Messages of type "Prepared" are - # sent from the RM indicated by the message's rm field to the TM. - # Messages of type "Commit" and "Abort" are broadcast by the TM, to be - # received by all RMs. The set msgs contains just a single copy of - # such a message. - # *********************************************************************** - # [type : {"Prepared"}, rm : RM] \cup [type : {"Commit", "Abort"}] - # TPTypeOK == - # *********************************************************************** - # The type-correctness invariant - # *********************************************************************** - # /\ rmState \in [RM -> {"working", "prepared", "committed", "aborted"}] - # /\ tmState \in {"init", "done"} - # /\ tmPrepared \subseteq RM - # /\ msgs \subseteq Messages - # ************************************************************************* - # We now define the actions that may be performed by the processes, first - # the TM's actions, then the RMs' actions. - # ************************************************************************* - @doc """ - *********************************************************************** - The TM receives a "Prepared" message from resource manager r. We - could add the additional enabling condition r \notin tmPrepared, - which disables the action if the TM has already received this - message. But there is no need, because in that case the action has - no effect; it leaves the state unchanged. - *********************************************************************** - """ - def tm_rcv_prepared_condition(variables, r) do - Enum.all?([variables[:tm_state] == "init", Enum.member?(variables[:msgs], %{ type: "Prepared", rm: r })]) - end - - def tm_rcv_prepared(variables, r) do - %{ - tm_prepared: MapSet.put(variables[:tm_prepared], r), - rm_state: variables[:rm_state], - tm_state: variables[:tm_state], - msgs: variables[:msgs] - } - end - - - @doc """ - *********************************************************************** - The TM commits the transaction; enabled iff the TM is in its initial - state and every RM has sent a "Prepared" message. - *********************************************************************** - """ - def tm_commit_condition(variables) do - Enum.all?([variables[:tm_state] == "init", variables[:tm_prepared] == @rm]) - end - - def tm_commit(variables) do - %{ - tm_state: "done", - msgs: MapSet.put(variables[:msgs], %{ type: "Commit" }), - rm_state: variables[:rm_state], - tm_prepared: variables[:tm_prepared] - } - end - - - @doc """ - *********************************************************************** - The TM spontaneously aborts the transaction. - *********************************************************************** - """ - def tm_abort_condition(variables) do - variables[:tm_state] == "init" - end - - def tm_abort(variables) do - %{ - tm_state: "done", - msgs: MapSet.put(variables[:msgs], %{ type: "Abort" }), - rm_state: variables[:rm_state], - tm_prepared: variables[:tm_prepared] - } - end - - - @doc """ - *********************************************************************** - Resource manager r prepares. - *********************************************************************** - """ - def rm_prepare_condition(variables, r) do - variables[:rm_state][r] == "working" - end - - def rm_prepare(variables, r) do - %{ - rm_state: Map.put(variables[:rm_state], r, "prepared"), - msgs: MapSet.put(variables[:msgs], %{ type: "Prepared", rm: r }), - tm_state: variables[:tm_state], - tm_prepared: variables[:tm_prepared] - } - end - - - @doc """ - *********************************************************************** - Resource manager r spontaneously decides to abort. As noted above, r - does not send any message in our simplified spec. - *********************************************************************** - """ - def rm_choose_to_abort_condition(variables, r) do - variables[:rm_state][r] == "working" - end - - def rm_choose_to_abort(variables, r) do - %{ - rm_state: Map.put(variables[:rm_state], r, "aborted"), - tm_state: variables[:tm_state], - tm_prepared: variables[:tm_prepared], - msgs: variables[:msgs] - } - end - - - @doc """ - *********************************************************************** - Resource manager r is told by the TM to commit. - *********************************************************************** - """ - def rm_rcv_commit_msg_condition(variables, r) do - Enum.member?(variables[:msgs], %{ type: "Commit" }) - end - - def rm_rcv_commit_msg(variables, r) do - %{ - rm_state: Map.put(variables[:rm_state], r, "committed"), - tm_state: variables[:tm_state], - tm_prepared: variables[:tm_prepared], - msgs: variables[:msgs] - } - end - - - @doc """ - *********************************************************************** - Resource manager r is told by the TM to abort. - *********************************************************************** - """ - def rm_rcv_abort_msg_condition(variables, r) do - Enum.member?(variables[:msgs], %{ type: "Abort" }) - end - - def rm_rcv_abort_msg(variables, r) do - %{ - rm_state: Map.put(variables[:rm_state], r, "aborted"), - tm_state: variables[:tm_state], - tm_prepared: variables[:tm_prepared], - msgs: variables[:msgs] - } - end - - - # ************************************************************************* - # The material below this point is not discussed in Video Lecture 6. It - # will be explained in Video Lecture 8. - # ************************************************************************* - # TPSpec == TPInit /\ [][TPNext]_<> - # *********************************************************************** - # The complete spec of the Two-Phase Commit protocol. - # *********************************************************************** - # *********************************************************************** - # This theorem asserts that the type-correctness predicate TPTypeOK is - # an invariant of the specification. - # *********************************************************************** - # ************************************************************************* - # We now assert that the Two-Phase Commit protocol implements the - # Transaction Commit protocol of module TCommit. The following statement - # imports all the definitions from module TCommit into the current - # module. - # ************************************************************************* - # *********************************************************************** - # This theorem asserts that the specification TPSpec of the Two-Phase - # Commit protocol implements the specification TCSpec of the - # Transaction Commit protocol. - # *********************************************************************** - # ************************************************************************* - # The two theorems in this module have been checked with TLC for six - # RMs, a configuration with 50816 reachable states, in a little over a - # minute on a 1 GHz PC. - # ************************************************************************* - def next(variables) do - List.flatten([ - %{ action: "TMCommit()", condition: tm_commit_condition(variables), state: tm_commit(variables) }, - %{ action: "TMAbort()", condition: tm_abort_condition(variables), state: tm_abort(variables) }, - Enum.map(@rm, fn (r) -> [ - %{ action: "TMRcvPrepared(#{inspect r})", condition: tm_rcv_prepared_condition(variables, r), state: tm_rcv_prepared(variables, r) }, - %{ action: "RMPrepare(#{inspect r})", condition: rm_prepare_condition(variables, r), state: rm_prepare(variables, r) }, - %{ action: "RMChooseToAbort(#{inspect r})", condition: rm_choose_to_abort_condition(variables, r), state: rm_choose_to_abort(variables, r) }, - %{ action: "RMRcvCommitMsg(#{inspect r})", condition: rm_rcv_commit_msg_condition(variables, r), state: rm_rcv_commit_msg(variables, r) }, - %{ action: "RMRcvAbortMsg(#{inspect r})", condition: rm_rcv_abort_msg_condition(variables, r), state: rm_rcv_abort_msg(variables, r) } - ] end - ) - ]) - end - - def main(variables) do - IO.puts(inspect(variables)) - - actions = next(variables) - - decide_action(actions) - end - - def decide_action(actions) do - possible_actions = Enum.filter(actions, fn(action) -> action[:condition] end) - different_states = Enum.uniq_by(possible_actions, fn(action) -> action[:state] end) - - cond do - Enum.count(different_states) == 1 -> - Enum.at(possible_actions, 0)[:state] - Enum.empty?(different_states) -> - %{} - true -> - actions_names = Enum.map(possible_actions, fn(action) -> action[:action] end) - send @oracle, {self(), actions_names} - - n = receive do - {:ok, n} -> n - end - - Enum.at(possible_actions, n)[:state] - end - end -end diff --git a/elixir/lib/mix/tasks/apaew_d840_node1_starter.ex b/elixir/lib/mix/tasks/ew_d840_node0_starter.ex similarity index 88% rename from elixir/lib/mix/tasks/apaew_d840_node1_starter.ex rename to elixir/lib/mix/tasks/ew_d840_node0_starter.ex index 8254bc1..07b3a0f 100644 --- a/elixir/lib/mix/tasks/apaew_d840_node1_starter.ex +++ b/elixir/lib/mix/tasks/ew_d840_node0_starter.ex @@ -1,9 +1,9 @@ -defmodule Mix.Tasks.ApaewD840Node1Starter do +defmodule Mix.Tasks.EwD840Node0Starter do @moduledoc "Printed when the user requests `mix help echo`" @shortdoc "Echoes arguments" use Mix.Task - import APAEWD840 - import APAEWD840_node1 + import EWD840 + import EWD840_node0 @impl Mix.Task def run(args) do diff --git a/elixir/lib/mix/tasks/apaew_d840_node0_starter.ex b/elixir/lib/mix/tasks/ew_d840_node1_starter.ex similarity index 88% rename from elixir/lib/mix/tasks/apaew_d840_node0_starter.ex rename to elixir/lib/mix/tasks/ew_d840_node1_starter.ex index f42f731..340b416 100644 --- a/elixir/lib/mix/tasks/apaew_d840_node0_starter.ex +++ b/elixir/lib/mix/tasks/ew_d840_node1_starter.ex @@ -1,9 +1,9 @@ -defmodule Mix.Tasks.ApaewD840Node0Starter do +defmodule Mix.Tasks.EwD840Node1Starter do @moduledoc "Printed when the user requests `mix help echo`" @shortdoc "Echoes arguments" use Mix.Task - import APAEWD840 - import APAEWD840_node0 + import EWD840 + import EWD840_node1 @impl Mix.Task def run(args) do diff --git a/elixir/lib/mix/tasks/apaew_d840_node2_starter.ex b/elixir/lib/mix/tasks/ew_d840_node2_starter.ex similarity index 88% rename from elixir/lib/mix/tasks/apaew_d840_node2_starter.ex rename to elixir/lib/mix/tasks/ew_d840_node2_starter.ex index 02346cc..f0d93e9 100644 --- a/elixir/lib/mix/tasks/apaew_d840_node2_starter.ex +++ b/elixir/lib/mix/tasks/ew_d840_node2_starter.ex @@ -1,9 +1,9 @@ -defmodule Mix.Tasks.ApaewD840Node2Starter do +defmodule Mix.Tasks.EwD840Node2Starter do @moduledoc "Printed when the user requests `mix help echo`" @shortdoc "Echoes arguments" use Mix.Task - import APAEWD840 - import APAEWD840_node2 + import EWD840 + import EWD840_node2 @impl Mix.Task def run(args) do diff --git a/elixir/lib/mix/tasks/level_equals_four.ex b/elixir/lib/mix/tasks/level_equals_four.ex deleted file mode 100644 index 6c39e36..0000000 --- a/elixir/lib/mix/tasks/level_equals_four.ex +++ /dev/null @@ -1,42 +0,0 @@ -defmodule Mix.Tasks.LevelEqualsFour do - @moduledoc "Runs blackblox testing using the oracle" - @shortdoc "Runs trace checking for a witness" - use Mix.Task - - @impl Mix.Task - def run(_) do - trace = [ -%{ - jarro_pequeno: 0, - jarro_grande: 0 -}, -%{ - jarro_pequeno: 0, - jarro_grande: 5 -}, -%{ - jarro_pequeno: 3, - jarro_grande: 2 -}, -%{ - jarro_pequeno: 0, - jarro_grande: 2 -}, -%{ - jarro_pequeno: 2, - jarro_grande: 0 -}, -%{ - jarro_pequeno: 2, - jarro_grande: 5 -}, -%{ - jarro_pequeno: 3, - jarro_grande: 4 -} - ] - - oracle = spawn(TraceCheckerOracle, :start, [trace]) - JarrosDeAgua.main(oracle, Enum.at(trace, 0), 0) - end -end diff --git a/elixir/lib/mix/tasks/no_alternation.ex b/elixir/lib/mix/tasks/no_alternation.ex deleted file mode 100644 index 2f05182..0000000 --- a/elixir/lib/mix/tasks/no_alternation.ex +++ /dev/null @@ -1,34 +0,0 @@ -defmodule Mix.Tasks.NoAlternation do - @moduledoc "Runs blackblox testing using the oracle" - @shortdoc "Runs trace checking for a witness" - use Mix.Task - - @impl Mix.Task - def run(_) do - trace = [ - %{ - colors: %{0 => "red", 1 => "red"}, - next_to_open: 0 - }, - %{ - colors: %{0 => "red", 1 => "green"}, - next_to_open: 0 - }, - %{ - colors: %{0 => "red", 1 => "yellow"}, - next_to_open: 0 - }, - %{ - colors: %{0 => "red", 1 => "red"}, - next_to_open: 0 - } - ] - - modules = [ - TrafficSemaphores_main - ] - - pids = Enum.map(modules, fn m -> spawn(m, :main, [self(), Enum.at(trace, 0), 0]) end) - TraceCheckerOracle.start(trace, 0, nil, pids) - end -end diff --git a/elixir/lib/mix/tasks/single_semaphore_loop.ex b/elixir/lib/mix/tasks/single_semaphore_loop.ex new file mode 100644 index 0000000..f31123a --- /dev/null +++ b/elixir/lib/mix/tasks/single_semaphore_loop.ex @@ -0,0 +1,33 @@ +defmodule Mix.Tasks.SingleSemaphoreLoop do + @moduledoc "Runs blackblox testing using the oracle" + @shortdoc "Runs trace checking for a witness" + use Mix.Task + + @impl Mix.Task + def run(_) do + trace = [ +%{ + colors: %{ 0 => "red", 1 => "red" }, + next_to_open: 0 +}, +%{ + colors: %{ 0 => "red", 1 => "green" }, + next_to_open: 0 +}, +%{ + colors: %{ 0 => "red", 1 => "yellow" }, + next_to_open: 0 +}, +%{ + colors: %{ 0 => "red", 1 => "red" }, + next_to_open: 0 +} + ] + + modules = [ + TrafficSemaphores_main + ] + pids = Enum.map(modules, fn m -> spawn(m, :main, [self(), Enum.at(trace, 0), 0]) end) + TraceCheckerOracle.start(trace, 0, nil, pids) + end +end diff --git a/elixir/lib/mix/tasks/startmodel.ex b/elixir/lib/mix/tasks/startmodel.ex deleted file mode 100644 index 8b476ab..0000000 --- a/elixir/lib/mix/tasks/startmodel.ex +++ /dev/null @@ -1,21 +0,0 @@ -defmodule Mix.Tasks.Startmodel do - @moduledoc "Printed when the user requests `mix help echo`" - @shortdoc "Echoes arguments" - use Mix.Task - - @impl Mix.Task - def run(_) do - trace = [ - %{ jarro_pequeno: 0, jarro_grande: 0 }, - %{ jarro_pequeno: 0, jarro_grande: 5 }, - %{ jarro_pequeno: 3, jarro_grande: 2 }, - %{ jarro_pequeno: 0, jarro_grande: 2 }, - %{ jarro_pequeno: 2, jarro_grande: 0 }, - %{ jarro_pequeno: 2, jarro_grande: 5 }, - %{ jarro_pequeno: 3, jarro_grande: 4 }, - ] - - oracle = spawn(TraceCheckerOracle, :start, [trace]) - JarrosDeAgua.main(oracle, Enum.at(trace, 0), 0) - end -end diff --git a/elixir/lib/mix/tasks/termination.ex b/elixir/lib/mix/tasks/termination.ex index 761d32c..d5607a7 100644 --- a/elixir/lib/mix/tasks/termination.ex +++ b/elixir/lib/mix/tasks/termination.ex @@ -51,9 +51,9 @@ defmodule Mix.Tasks.Termination do ] modules = [ - APAEWD840_node0, - APAEWD840_node1, - APAEWD840_node2 + EWD840_node0, + EWD840_node1, + EWD840_node2 ] pids = Enum.map(modules, fn m -> spawn(m, :main, [self(), Enum.at(trace, 0), 0]) end) TraceCheckerOracle.start(trace, 0, nil, pids) diff --git a/elixir/lib/mix/tasks/traffic_semaphores_main_starter.ex b/elixir/lib/mix/tasks/traffic_semaphores_main_starter.ex new file mode 100644 index 0000000..ea3034f --- /dev/null +++ b/elixir/lib/mix/tasks/traffic_semaphores_main_starter.ex @@ -0,0 +1,30 @@ +defmodule Mix.Tasks.TrafficSemaphoresMainStarter do + @moduledoc "Printed when the user requests `mix help echo`" + @shortdoc "Echoes arguments" + use Mix.Task + import TrafficSemaphores + import TrafficSemaphores_main + + @impl Mix.Task + def run(args) do + variables = %{} + initial_state = %{ + colors: Map.new(TrafficSemaphores.semaphores, fn(s) -> {s, "red"} end), + next_to_open: 0 +} + oracle_host = String.to_atom(Enum.at(args, 0)) + Node.connect(oracle_host) + oracle_pid = find_oracle() + IO.puts(inspect(oracle_pid)) + main(oracle_pid, initial_state, 0) + end + + def find_oracle() do + o = :global.whereis_name("oracle") + if o == :undefined do + find_oracle() + else + o + end + end +end diff --git a/elixir/test/generated_code/apaew_d840_test.exs b/elixir/test/generated_code/ew_d840_test.exs similarity index 81% rename from elixir/test/generated_code/apaew_d840_test.exs rename to elixir/test/generated_code/ew_d840_test.exs index 6c446a3..e2890f3 100644 --- a/elixir/test/generated_code/apaew_d840_test.exs +++ b/elixir/test/generated_code/ew_d840_test.exs @@ -1,6 +1,6 @@ -defmodule APAEWD840Test do +defmodule EWD840Test do use ExUnit.Case - doctest APAEWD840 + doctest EWD840 test "fromState 12" do variables = %{ tpos: 0, @@ -52,8 +52,8 @@ test "fromState 12" do color: %{ 0 => "white", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -103,8 +103,8 @@ test "fromState 13" do color: %{ 0 => "white", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -154,8 +154,8 @@ test "fromState 14" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -205,8 +205,8 @@ test "fromState 15" do color: %{ 0 => "white", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -256,8 +256,8 @@ test "fromState 16" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -313,8 +313,8 @@ test "fromState 17" do color: %{ 0 => "white", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -370,8 +370,8 @@ test "fromState 18" do color: %{ 0 => "white", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -415,8 +415,8 @@ test "fromState 19" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -460,8 +460,8 @@ test "fromState 20" do color: %{ 0 => "white", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -505,8 +505,8 @@ test "fromState 21" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -556,8 +556,8 @@ test "fromState 22" do color: %{ 0 => "white", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -613,8 +613,8 @@ test "fromState 23" do color: %{ 0 => "white", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -664,8 +664,8 @@ test "fromState 24" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -709,8 +709,8 @@ test "fromState 25" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -754,8 +754,8 @@ test "fromState 26" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -805,8 +805,8 @@ test "fromState 27" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -850,8 +850,8 @@ test "fromState 28" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -889,8 +889,8 @@ test "fromState 29" do color: %{ 0 => "white", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -928,8 +928,8 @@ test "fromState 30" do color: %{ 0 => "white", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -985,8 +985,8 @@ test "fromState 31" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -1042,8 +1042,8 @@ test "fromState 32" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -1081,8 +1081,8 @@ test "fromState 33" do color: %{ 0 => "white", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -1126,8 +1126,8 @@ test "fromState 34" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -1165,8 +1165,8 @@ test "fromState 35" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -1204,8 +1204,8 @@ test "fromState 36" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -1255,8 +1255,8 @@ test "fromState 37" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -1294,8 +1294,8 @@ test "fromState 38" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -1327,8 +1327,8 @@ test "fromState 39" do color: %{ 0 => "white", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -1366,8 +1366,8 @@ test "fromState 40" do color: %{ 0 => "white", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -1417,8 +1417,8 @@ test "fromState 41" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -1474,8 +1474,8 @@ test "fromState 42" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -1513,8 +1513,8 @@ test "fromState 43" do color: %{ 0 => "white", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -1564,8 +1564,8 @@ test "fromState 44" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -1609,8 +1609,8 @@ test "fromState 45" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -1648,8 +1648,8 @@ test "fromState 46" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -1687,8 +1687,8 @@ test "fromState 47" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -1732,8 +1732,8 @@ test "fromState 48" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -1777,8 +1777,8 @@ test "fromState 49" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -1816,8 +1816,8 @@ test "fromState 50" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -1855,8 +1855,8 @@ test "fromState 51" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -1894,8 +1894,8 @@ test "fromState 52" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -1915,8 +1915,8 @@ test "fromState 53" do color: %{ 0 => "white", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -1954,8 +1954,8 @@ test "fromState 54" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -1993,8 +1993,8 @@ test "fromState 55" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2026,8 +2026,8 @@ test "fromState 56" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2065,8 +2065,8 @@ test "fromState 57" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2104,8 +2104,8 @@ test "fromState 58" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2149,8 +2149,8 @@ test "fromState 59" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2188,8 +2188,8 @@ test "fromState 60" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2233,8 +2233,8 @@ test "fromState 61" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2266,8 +2266,8 @@ test "fromState 62" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2305,8 +2305,8 @@ test "fromState 63" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2326,8 +2326,8 @@ test "fromState 64" do color: %{ 0 => "white", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2359,8 +2359,8 @@ test "fromState 65" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2398,8 +2398,8 @@ test "fromState 66" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2455,8 +2455,8 @@ test "fromState 67" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2494,8 +2494,8 @@ test "fromState 68" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2539,8 +2539,8 @@ test "fromState 69" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2590,8 +2590,8 @@ test "fromState 70" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2629,8 +2629,8 @@ test "fromState 71" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2668,8 +2668,8 @@ test "fromState 72" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2689,8 +2689,8 @@ test "fromState 73" do color: %{ 0 => "white", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2728,8 +2728,8 @@ test "fromState 74" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2749,8 +2749,8 @@ test "fromState 75" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2782,8 +2782,8 @@ test "fromState 76" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2821,8 +2821,8 @@ test "fromState 77" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2842,8 +2842,8 @@ test "fromState 78" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2875,8 +2875,8 @@ test "fromState 79" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2914,8 +2914,8 @@ test "fromState 80" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2959,8 +2959,8 @@ test "fromState 81" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -2998,8 +2998,8 @@ test "fromState 82" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3043,8 +3043,8 @@ test "fromState 83" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3064,8 +3064,8 @@ test "fromState 84" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3103,8 +3103,8 @@ test "fromState 85" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3124,8 +3124,8 @@ test "fromState 86" do color: %{ 0 => "white", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3169,8 +3169,8 @@ test "fromState 87" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3208,8 +3208,8 @@ test "fromState 88" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3241,8 +3241,8 @@ test "fromState 89" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3286,8 +3286,8 @@ test "fromState 90" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3331,8 +3331,8 @@ test "fromState 91" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3388,8 +3388,8 @@ test "fromState 92" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3409,8 +3409,8 @@ test "fromState 93" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3430,8 +3430,8 @@ test "fromState 94" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3469,8 +3469,8 @@ test "fromState 95" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3490,8 +3490,8 @@ test "fromState 96" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3535,8 +3535,8 @@ test "fromState 97" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3574,8 +3574,8 @@ test "fromState 98" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3613,8 +3613,8 @@ test "fromState 99" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3658,8 +3658,8 @@ test "fromState 100" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3679,8 +3679,8 @@ test "fromState 101" do color: %{ 0 => "white", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3695,8 +3695,8 @@ test "fromState 102" do expectedStates = [] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3734,8 +3734,8 @@ test "fromState 103" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3785,8 +3785,8 @@ test "fromState 104" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3830,8 +3830,8 @@ test "fromState 105" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3869,8 +3869,8 @@ test "fromState 106" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3890,8 +3890,8 @@ test "fromState 107" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3911,8 +3911,8 @@ test "fromState 108" do color: %{ 0 => "white", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -3950,8 +3950,8 @@ test "fromState 109" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -4001,8 +4001,8 @@ test "fromState 110" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -4040,8 +4040,8 @@ test "fromState 111" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -4085,8 +4085,8 @@ test "fromState 112" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -4124,8 +4124,8 @@ test "fromState 113" do color: %{ 0 => "black", 1 => "white", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -4175,8 +4175,8 @@ test "fromState 114" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -4220,8 +4220,8 @@ test "fromState 115" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -4265,8 +4265,8 @@ test "fromState 116" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -4310,8 +4310,8 @@ test "fromState 117" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -4349,8 +4349,8 @@ test "fromState 118" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -4388,8 +4388,8 @@ test "fromState 119" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -4427,8 +4427,8 @@ test "fromState 120" do color: %{ 0 => "black", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -4448,8 +4448,8 @@ test "fromState 121" do color: %{ 0 => "white", 1 => "black", 2 => "white" } }] - actions = List.flatten([APAEWD840_node0.next(variables), APAEWD840_node1.next(variables), APAEWD840_node2.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + actions = List.flatten([EWD840_node0.next(variables), EWD840_node1.next(variables), EWD840_node2.next(variables)]) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end diff --git a/elixir/test/generated_code/traffic_semaphores_test.exs b/elixir/test/generated_code/traffic_semaphores_test.exs index 2133564..8f3480e 100644 --- a/elixir/test/generated_code/traffic_semaphores_test.exs +++ b/elixir/test/generated_code/traffic_semaphores_test.exs @@ -13,7 +13,7 @@ test "fromState 7" do }] actions = List.flatten([TrafficSemaphores_main.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -30,7 +30,7 @@ test "fromState 8" do }] actions = List.flatten([TrafficSemaphores_main.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -47,7 +47,7 @@ test "fromState 9" do }] actions = List.flatten([TrafficSemaphores_main.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -64,7 +64,7 @@ test "fromState 10" do }] actions = List.flatten([TrafficSemaphores_main.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -81,7 +81,7 @@ test "fromState 11" do }] actions = List.flatten([TrafficSemaphores_main.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end @@ -98,7 +98,7 @@ test "fromState 12" do }] actions = List.flatten([TrafficSemaphores_main.next(variables)]) - states = Enum.map(actions, fn action -> action[:state] end) + states = Enum.map(actions, fn action -> action[:transition].(variables) end) assert Enum.sort(Enum.uniq(states)) == Enum.sort(Enum.uniq(expectedStates)) end diff --git a/tla_specifications/ERC20/ERC20.cfg b/tla_specifications/ERC20/ERC20.cfg index 1e20424..2c3b9da 100644 --- a/tla_specifications/ERC20/ERC20.cfg +++ b/tla_specifications/ERC20/ERC20.cfg @@ -3,7 +3,7 @@ ADDR = {"Alice_OF_ADDR", "Bob_OF_ADDR"} AMOUNTS = {0, 100} INVARIANT -NoApprove +Full INIT Init diff --git a/tla_specifications/ERC20/ERC20.tla b/tla_specifications/ERC20/ERC20.tla index 4521c9a..92c4dc6 100644 --- a/tla_specifications/ERC20/ERC20.tla +++ b/tla_specifications/ERC20/ERC20.tla @@ -14,7 +14,7 @@ *) -EXTENDS Integers, Apalache, ERC20_typedef +EXTENDS Integers, Apalache CONSTANTS \* Set of all addresses. @@ -299,4 +299,5 @@ NoTransferAboveApproved(trace) == IN sumTransfers > 0 => existsApprovalForSumInPast +Full == nextTxId <= 5 =============================================================================== diff --git a/tla_specifications/EfetivacaoEmDuasFases.tla b/tla_specifications/EfetivacaoEmDuasFases.tla deleted file mode 100755 index ddf9759..0000000 --- a/tla_specifications/EfetivacaoEmDuasFases.tla +++ /dev/null @@ -1,65 +0,0 @@ ------------------------ MODULE EfetivacaoEmDuasFases ----------------------- -CONSTANT GR - -VARIABLES estadoGR, estadoGT, GRsPreparados, msgs - -DFInit == - /\ estadoGR = [g \in GR |-> "trabalhando"] - /\ estadoGT = "inicio" - /\ GRsPreparados = {} - /\ msgs = {} - -GTRecebePrepara(g) == - /\ estadoGT = "inicio" - /\ [tipo |-> "EstouPreparado", gr |-> g] \in msgs - /\ GRsPreparados' = GRsPreparados \cup {g} - /\ UNCHANGED <> - -GTEfetiva == - /\ estadoGT = "inicio" - /\ GRsPreparados = GR - /\ estadoGT' = "termino" - /\ msgs' = msgs \cup {[tipo |-> "Efetive"]} - /\ UNCHANGED <> - -GTAborta == - /\ estadoGT = "inicio" - /\ estadoGT' = "termino" - /\ msgs' = msgs \cup {[tipo |-> "Aborte"]} - /\ UNCHANGED <> - -GRPrepara(g) == - /\ estadoGR[g] = "trabalhando" - /\ estadoGR' = [estadoGR EXCEPT ![g] = "preparado"] - /\ msgs' = msgs \cup {[tipo |-> "EstouPreparado", gr |-> g]} - /\ UNCHANGED <> - -GREcolheAbortar(g) == - /\ estadoGR[g] = "trabalhando" - /\ estadoGR' = [estadoGR EXCEPT ![g] = "abortado"] - /\ UNCHANGED <> - -GRRecebeMsgEfetive(g) == - /\ [tipo |-> "Efetive"] \in msgs - /\ estadoGR' = [estadoGR EXCEPT ![g] = "efetivado"] - /\ UNCHANGED <> - -GRRecebeMsgAborte(g) == - /\ [tipo |-> "Aborte"] \in msgs - /\ estadoGR' = [estadoGR EXCEPT ![g] = "abortado"] - /\ UNCHANGED <> - -DFNext == - \/ GTEfetiva \/ GTAborta - \/ \E g \in GR : - GTRecebePrepara(g) \/ GRPrepara(g) \/ GREcolheAbortar(g) - \/ GRRecebeMsgEfetive(g) \/ GRRecebeMsgAborte(g) - - -THEOREM DFSpec => []DFTypeOK - -INSTANCE TransacoesBD - -THEOREM DFSpec => TBDSpec - -============================================================================= diff --git a/tla_specifications/ewd840/APAEWD840.tla b/tla_specifications/ewd840/APAEWD840.tla deleted file mode 100644 index 6f0ff75..0000000 --- a/tla_specifications/ewd840/APAEWD840.tla +++ /dev/null @@ -1,186 +0,0 @@ -------------------------------- MODULE APAEWD840 ------------------------------- -(***************************************************************************) -(* TLA+ specification of an algorithm for distributed termination *) -(* detection on a ring, due to Dijkstra, published as EWD 840: *) -(* Derivation of a termination detection algorithm for distributed *) -(* computations (with W.H.J.Feijen and A.J.M. van Gasteren). *) -(***************************************************************************) -EXTENDS Naturals - -CONSTANT - \* @type: Int; - N - -MaxN == 20 -CInit3 == N = 3 -ConstInit4 == N \in {4} -ConstInit10 == N \in {10} -ConstInitAll20 == N \in 2..50 - -(*ASSUME NAssumption == N \in Nat \ {0}*) - -VARIABLES - \* @type: Int -> Bool; - active, - \* @type: Int -> Str; - color, - \* @type: Int; - tpos, - \* @type: Str; - tcolor - -Nodes == {i \in 0..MaxN : i < N } \* 0 .. N-1 -Color == {"white", "black"} - -\* TypeOK == -\* /\ active \in [Nodes -> BOOLEAN] \* status of nodes (active or passive) -\* /\ color \in [Nodes -> Color] \* color of nodes -\* /\ tpos \in Nodes \* token position -\* /\ tcolor \in Color \* token color - -(***************************************************************************) -(* Initially the token is black. The other variables may take any *) -(* "type-correct" values. *) -(***************************************************************************) -Init == - /\ active = [n \in Nodes |-> TRUE] - /\ color = [n \in Nodes |-> "white"] - /\ tpos = 0 - /\ tcolor = "black" - -(***************************************************************************) -(* Node 0 may initiate a probe when it has the token and when either it is *) -(* black or the token is black. It passes a white token to node N-1 and *) -(* paints itself white. *) -(***************************************************************************) -InitiateProbe == - /\ tpos = 0 - /\ tcolor = "black" \/ color[0] = "black" - /\ tpos' = N-1 - /\ tcolor' = "white" - /\ active' = active - /\ color' = [color EXCEPT ![0] = "white"] - -(***************************************************************************) -(* A node i different from 0 that possesses the token may pass it to node *) -(* i-1 under the following circumstances: *) -(* - node i is inactive or *) -(* - node i is colored black or *) -(* - the token is black. *) -(* Note that the last two conditions will result in an inconclusive round, *) -(* since the token will be black. The token will be stained if node i is *) -(* black, otherwise its color is unchanged. Node i will be made white. *) -(***************************************************************************) -PassToken(i) == - /\ tpos = i - /\ ~ active[i] \/ color[i] = "black" \/ tcolor = "black" - /\ tpos' = i-1 - /\ tcolor' = IF color[i] = "black" THEN "black" ELSE tcolor - /\ active' = active - /\ color' = [color EXCEPT ![i] = "white"] - -(***************************************************************************) -(* An active node i may activate another node j by sending it a message. *) -(* If j>i (hence activation goes against the direction of the token being *) -(* passed), then node i becomes black. *) -(***************************************************************************) -SendMsg(i, j) == - /\ active[i] - /\ active' = [active EXCEPT ![j] = TRUE] - /\ color' = [color EXCEPT ![i] = IF j>i THEN "black" ELSE @] - /\ UNCHANGED <> - -(***************************************************************************) -(* Any active node may become inactive at any moment. *) -(***************************************************************************) -Deactivate(i) == - /\ active[i] - /\ active' = [active EXCEPT ![i] = FALSE] - /\ UNCHANGED <> - - -(***************************************************************************) -(* next-state relation: disjunction of above actions *) -(***************************************************************************) -Next == \/ InitiateProbe - \/ \E i \in Nodes \ {0} : PassToken(i) - \/ \E i \in Nodes : \/ \E j \in Nodes \ {i} : SendMsg(i, j) - \/ Deactivate(i) - -vars == <> - ------------------------------------------------------------------------------ - -(***************************************************************************) -(* Non-properties, useful for validating the specification with TLC. *) -(***************************************************************************) -TokenAlwaysBlack == tcolor = "black" - -Test == TRUE - -NeverChangeColor == [][ UNCHANGED color ]_vars - -(***************************************************************************) -(* Main safety property: if there is a white token at node 0 then every *) -(* node is inactive. *) -(***************************************************************************) -terminationDetected == - /\ tpos = 0 /\ tcolor = "white" - /\ color[0] = "white" /\ ~ active[0] - -TerminationDetection == - terminationDetected => \A i \in Nodes : ~ active[i] - -NotTerminationDetection == - terminationDetected => \E i \in Nodes : active[i] -(***************************************************************************) -(* Liveness property: termination is eventually detected. *) -(***************************************************************************) -Liveness == - (\A i \in Nodes : ~ active[i]) ~> terminationDetected - -(***************************************************************************) -(* The following property asserts that when every process always *) -(* eventually terminates then eventually termination will be detected. *) -(* It does not hold since processes can wake up each other. *) -(***************************************************************************) -FalseLiveness == - (\A i \in Nodes : []<> ~ active[i]) ~> terminationDetected - -full == TRUE - -(***************************************************************************) -(* The following property says that eventually all nodes will terminate *) -(* assuming that from some point onwards no messages are sent. It is *) -(* not supposed to hold: any node may indefinitely perform local *) -(* computations. However, this property is verified if the fairness *) -(* condition WF_vars(Next) is used instead of only WF_vars(System) that *) -(* requires fairness of the actions controlled by termination detection. *) -(***************************************************************************) - -SpecWFNext == Init /\ [][Next]_vars /\ WF_vars(Next) - -(***************************************************************************) -(* Dijkstra's inductive invariant *) -(***************************************************************************) -Inv == - \/ P0:: \A i \in Nodes : tpos < i => ~ active[i] - \/ P1:: \E j \in Nodes: (0 <= j /\ j <= tpos) => color[j] = "black" - \/ P2:: tcolor = "black" - - (*\/ P1:: \E j \in 0 .. tpos : color[j] = "black"*) - -(* InvAndTypeOK == TypeOK /\ Inv *) - -(***************************************************************************) -(* Use the following specification to let TLC check that the predicate *) -(* TypeOK /\ Inv is inductive for EWD 840: verify that it is an *) -(* (ordinary) invariant of a specification obtained by replacing the *) -(* initial condition by that conjunction. *) -(***************************************************************************) -CheckInductiveSpec == Inv /\ [][Next]_vars -============================================================================= -\* Modification History -\* Last modified Wed Mar 20 16:57:55 CET 2019 by igor -\* Last modified Tue Jun 28 18:17:45 CEST 2016 by merz -\* Created Mon Sep 09 11:33:10 CEST 2013 by merz diff --git a/tla_specifications/ewd840/APAEWD840.cfg b/tla_specifications/ewd840/EWD840.cfg similarity index 100% rename from tla_specifications/ewd840/APAEWD840.cfg rename to tla_specifications/ewd840/EWD840.cfg diff --git a/tla_specifications/ewd840/APAEWD840.json b/tla_specifications/ewd840/EWD840.json similarity index 91% rename from tla_specifications/ewd840/APAEWD840.json rename to tla_specifications/ewd840/EWD840.json index 69cde81..3e23506 100644 --- a/tla_specifications/ewd840/APAEWD840.json +++ b/tla_specifications/ewd840/EWD840.json @@ -5,11 +5,11 @@ "modules": [ { "kind": "TlaModule", - "name": "APAEWD840", + "name": "EWD840", "declarations": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 12, "column": 5 @@ -25,7 +25,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 27, "column": 5 @@ -41,7 +41,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 23, "column": 5 @@ -57,7 +57,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 29, "column": 5 @@ -73,7 +73,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 25, "column": 5 @@ -89,7 +89,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 14, "column": 1 @@ -108,7 +108,7 @@ "isRecursive": false, "body": { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 14, "column": 9 @@ -128,7 +128,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 32, "column": 1 @@ -147,7 +147,7 @@ "isRecursive": false, "body": { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 32, "column": 10 @@ -163,7 +163,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 32, "column": 11 @@ -182,7 +182,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 32, "column": 20 @@ -204,7 +204,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 15, "column": 1 @@ -223,7 +223,7 @@ "isRecursive": false, "body": { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 15, "column": 15 @@ -239,7 +239,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 15, "column": 15 @@ -255,7 +255,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 15, "column": 21 @@ -271,7 +271,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 15, "column": 22 @@ -295,7 +295,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 16, "column": 1 @@ -314,7 +314,7 @@ "isRecursive": false, "body": { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 16, "column": 16 @@ -330,7 +330,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 16, "column": 16 @@ -346,7 +346,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 16, "column": 22 @@ -362,7 +362,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 16, "column": 23 @@ -386,7 +386,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 17, "column": 1 @@ -405,7 +405,7 @@ "isRecursive": false, "body": { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 17, "column": 19 @@ -421,7 +421,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 17, "column": 19 @@ -437,7 +437,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 17, "column": 25 @@ -453,7 +453,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 17, "column": 25 @@ -472,7 +472,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 17, "column": 28 @@ -496,7 +496,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 31, "column": 1 @@ -515,7 +515,7 @@ "isRecursive": false, "body": { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 31, "column": 10 @@ -531,7 +531,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 31, "column": 10 @@ -547,7 +547,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 31, "column": 17 @@ -563,7 +563,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 31, "column": 17 @@ -582,7 +582,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 31, "column": 20 @@ -598,7 +598,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 31, "column": 20 @@ -618,7 +618,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 31, "column": 27 @@ -634,7 +634,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 31, "column": 27 @@ -650,7 +650,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 31, "column": 31 @@ -671,7 +671,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 55, "column": 1 @@ -690,7 +690,7 @@ "isRecursive": false, "body": { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 56, "column": 3 @@ -706,7 +706,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 56, "column": 6 @@ -722,7 +722,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 56, "column": 6 @@ -738,7 +738,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 56, "column": 13 @@ -759,7 +759,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 57, "column": 6 @@ -775,7 +775,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 57, "column": 6 @@ -791,7 +791,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 57, "column": 6 @@ -807,7 +807,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 57, "column": 15 @@ -828,7 +828,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 57, "column": 26 @@ -844,7 +844,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 57, "column": 26 @@ -860,7 +860,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 57, "column": 26 @@ -876,7 +876,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 57, "column": 32 @@ -897,7 +897,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 57, "column": 37 @@ -920,7 +920,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 58, "column": 6 @@ -936,7 +936,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 58, "column": 6 @@ -952,7 +952,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 58, "column": 6 @@ -970,7 +970,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 58, "column": 14 @@ -986,7 +986,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 58, "column": 14 @@ -1002,7 +1002,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 58, "column": 16 @@ -1025,7 +1025,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 59, "column": 6 @@ -1041,7 +1041,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 59, "column": 6 @@ -1057,7 +1057,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 59, "column": 6 @@ -1075,7 +1075,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 59, "column": 16 @@ -1096,7 +1096,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 60, "column": 6 @@ -1112,7 +1112,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 60, "column": 6 @@ -1128,7 +1128,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 60, "column": 6 @@ -1146,7 +1146,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 60, "column": 16 @@ -1164,7 +1164,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 61, "column": 6 @@ -1180,7 +1180,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 61, "column": 6 @@ -1196,7 +1196,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 61, "column": 6 @@ -1214,7 +1214,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 61, "column": 15 @@ -1230,7 +1230,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 61, "column": 16 @@ -1246,7 +1246,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 61, "column": 29 @@ -1262,7 +1262,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 61, "column": 31 @@ -1283,7 +1283,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 61, "column": 36 @@ -1309,7 +1309,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 73, "column": 1 @@ -1332,7 +1332,7 @@ "isRecursive": false, "body": { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 74, "column": 3 @@ -1348,7 +1348,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 74, "column": 6 @@ -1364,7 +1364,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 74, "column": 6 @@ -1380,7 +1380,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 74, "column": 13 @@ -1398,7 +1398,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 75, "column": 6 @@ -1414,7 +1414,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 75, "column": 6 @@ -1430,7 +1430,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 75, "column": 6 @@ -1446,7 +1446,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 75, "column": 8 @@ -1462,7 +1462,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 75, "column": 8 @@ -1478,7 +1478,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 75, "column": 15 @@ -1498,7 +1498,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 75, "column": 21 @@ -1514,7 +1514,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 75, "column": 21 @@ -1530,7 +1530,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 75, "column": 21 @@ -1546,7 +1546,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 75, "column": 27 @@ -1564,7 +1564,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 75, "column": 32 @@ -1587,7 +1587,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 75, "column": 43 @@ -1603,7 +1603,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 75, "column": 43 @@ -1619,7 +1619,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 75, "column": 52 @@ -1642,7 +1642,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 76, "column": 6 @@ -1658,7 +1658,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 76, "column": 6 @@ -1674,7 +1674,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 76, "column": 6 @@ -1692,7 +1692,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 76, "column": 14 @@ -1708,7 +1708,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 76, "column": 14 @@ -1724,7 +1724,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 76, "column": 16 @@ -1747,7 +1747,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 77, "column": 6 @@ -1763,7 +1763,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 77, "column": 6 @@ -1779,7 +1779,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 77, "column": 6 @@ -1797,7 +1797,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 77, "column": 16 @@ -1813,7 +1813,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 77, "column": 19 @@ -1829,7 +1829,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 77, "column": 19 @@ -1845,7 +1845,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 77, "column": 19 @@ -1861,7 +1861,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 77, "column": 25 @@ -1879,7 +1879,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 77, "column": 30 @@ -1900,7 +1900,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 77, "column": 43 @@ -1919,7 +1919,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 77, "column": 56 @@ -1939,7 +1939,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 78, "column": 6 @@ -1955,7 +1955,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 78, "column": 6 @@ -1971,7 +1971,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 78, "column": 6 @@ -1989,7 +1989,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 78, "column": 16 @@ -2007,7 +2007,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 79, "column": 6 @@ -2023,7 +2023,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 79, "column": 6 @@ -2039,7 +2039,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 79, "column": 6 @@ -2057,7 +2057,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 79, "column": 15 @@ -2073,7 +2073,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 79, "column": 16 @@ -2089,7 +2089,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 79, "column": 29 @@ -2105,7 +2105,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 79, "column": 31 @@ -2123,7 +2123,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 79, "column": 36 @@ -2149,7 +2149,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 86, "column": 1 @@ -2177,7 +2177,7 @@ "isRecursive": false, "body": { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 87, "column": 3 @@ -2193,7 +2193,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 87, "column": 6 @@ -2209,7 +2209,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 87, "column": 6 @@ -2225,7 +2225,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 87, "column": 13 @@ -2243,7 +2243,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 88, "column": 6 @@ -2259,7 +2259,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 88, "column": 6 @@ -2275,7 +2275,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 88, "column": 6 @@ -2293,7 +2293,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 88, "column": 16 @@ -2309,7 +2309,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 88, "column": 17 @@ -2325,7 +2325,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 88, "column": 31 @@ -2341,7 +2341,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 88, "column": 33 @@ -2359,7 +2359,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 88, "column": 38 @@ -2382,7 +2382,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 89, "column": 6 @@ -2398,7 +2398,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 89, "column": 6 @@ -2414,7 +2414,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 89, "column": 6 @@ -2432,7 +2432,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 89, "column": 15 @@ -2448,7 +2448,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 89, "column": 16 @@ -2464,7 +2464,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 89, "column": 29 @@ -2480,7 +2480,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 89, "column": 31 @@ -2498,7 +2498,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 89, "column": 36 @@ -2514,7 +2514,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 89, "column": 39 @@ -2530,7 +2530,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 89, "column": 39 @@ -2546,7 +2546,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 89, "column": 41 @@ -2564,7 +2564,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 89, "column": 48 @@ -2583,7 +2583,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 89, "column": 29 @@ -2599,7 +2599,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 89, "column": 16 @@ -2615,7 +2615,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 89, "column": 31 @@ -2639,7 +2639,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 90, "column": 6 @@ -2655,7 +2655,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 90, "column": 16 @@ -2671,7 +2671,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 90, "column": 18 @@ -2687,7 +2687,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 90, "column": 24 @@ -2710,7 +2710,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 95, "column": 1 @@ -2733,7 +2733,7 @@ "isRecursive": false, "body": { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 96, "column": 3 @@ -2749,7 +2749,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 96, "column": 6 @@ -2765,7 +2765,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 96, "column": 6 @@ -2781,7 +2781,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 96, "column": 13 @@ -2799,7 +2799,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 97, "column": 6 @@ -2815,7 +2815,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 97, "column": 6 @@ -2831,7 +2831,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 97, "column": 6 @@ -2849,7 +2849,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 97, "column": 16 @@ -2865,7 +2865,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 97, "column": 17 @@ -2881,7 +2881,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 97, "column": 31 @@ -2897,7 +2897,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 97, "column": 33 @@ -2915,7 +2915,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 97, "column": 38 @@ -2938,7 +2938,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 98, "column": 6 @@ -2954,7 +2954,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 98, "column": 16 @@ -2970,7 +2970,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 98, "column": 18 @@ -2986,7 +2986,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 98, "column": 25 @@ -3002,7 +3002,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 98, "column": 31 @@ -3025,7 +3025,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 109, "column": 1 @@ -3044,7 +3044,7 @@ "isRecursive": false, "body": { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 109, "column": 9 @@ -3060,7 +3060,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 109, "column": 11 @@ -3076,7 +3076,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 109, "column": 19 @@ -3092,7 +3092,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 109, "column": 26 @@ -3108,7 +3108,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 109, "column": 32 @@ -3127,7 +3127,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 116, "column": 1 @@ -3146,7 +3146,7 @@ "isRecursive": false, "body": { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 116, "column": 21 @@ -3162,7 +3162,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 116, "column": 21 @@ -3178,7 +3178,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 116, "column": 30 @@ -3200,7 +3200,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 124, "column": 1 @@ -3219,7 +3219,7 @@ "isRecursive": false, "body": { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 125, "column": 3 @@ -3235,7 +3235,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 125, "column": 6 @@ -3251,7 +3251,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 125, "column": 6 @@ -3267,7 +3267,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 125, "column": 6 @@ -3283,7 +3283,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 125, "column": 13 @@ -3304,7 +3304,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 125, "column": 18 @@ -3320,7 +3320,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 125, "column": 18 @@ -3336,7 +3336,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 125, "column": 27 @@ -3359,7 +3359,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 126, "column": 6 @@ -3375,7 +3375,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 126, "column": 6 @@ -3391,7 +3391,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 126, "column": 6 @@ -3407,7 +3407,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 126, "column": 6 @@ -3423,7 +3423,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 126, "column": 12 @@ -3444,7 +3444,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 126, "column": 17 @@ -3465,7 +3465,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 126, "column": 28 @@ -3481,7 +3481,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 126, "column": 30 @@ -3497,7 +3497,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 126, "column": 30 @@ -3513,7 +3513,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 126, "column": 37 @@ -3541,7 +3541,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 44, "column": 1 @@ -3560,7 +3560,7 @@ "isRecursive": false, "body": { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 45, "column": 3 @@ -3576,7 +3576,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 45, "column": 6 @@ -3592,7 +3592,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 45, "column": 6 @@ -3608,7 +3608,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 45, "column": 15 @@ -3624,7 +3624,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 45, "column": 32 @@ -3643,7 +3643,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 45, "column": 15 @@ -3659,7 +3659,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 45, "column": 22 @@ -3675,7 +3675,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 45, "column": 22 @@ -3697,7 +3697,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 46, "column": 6 @@ -3713,7 +3713,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 46, "column": 6 @@ -3729,7 +3729,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 46, "column": 14 @@ -3745,7 +3745,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 46, "column": 31 @@ -3764,7 +3764,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 46, "column": 14 @@ -3780,7 +3780,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 46, "column": 21 @@ -3796,7 +3796,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 46, "column": 21 @@ -3818,7 +3818,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 47, "column": 6 @@ -3834,7 +3834,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 47, "column": 6 @@ -3850,7 +3850,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 47, "column": 13 @@ -3871,7 +3871,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 48, "column": 6 @@ -3887,7 +3887,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 48, "column": 6 @@ -3903,7 +3903,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 48, "column": 15 @@ -3927,7 +3927,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 104, "column": 1 @@ -3946,7 +3946,7 @@ "isRecursive": false, "body": { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 104, "column": 9 @@ -3962,7 +3962,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 104, "column": 12 @@ -3978,7 +3978,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 104, "column": 12 @@ -3996,7 +3996,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 105, "column": 12 @@ -4012,7 +4012,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 105, "column": 12 @@ -4028,7 +4028,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 105, "column": 21 @@ -4044,7 +4044,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 105, "column": 21 @@ -4060,7 +4060,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 105, "column": 21 @@ -4078,7 +4078,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 105, "column": 29 @@ -4094,7 +4094,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 105, "column": 30 @@ -4117,7 +4117,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 105, "column": 35 @@ -4133,7 +4133,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 105, "column": 35 @@ -4149,7 +4149,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 105, "column": 45 @@ -4169,7 +4169,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 106, "column": 12 @@ -4185,7 +4185,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 106, "column": 12 @@ -4201,7 +4201,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 106, "column": 21 @@ -4217,7 +4217,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 106, "column": 21 @@ -4235,7 +4235,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 106, "column": 29 @@ -4251,7 +4251,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 106, "column": 32 @@ -4267,7 +4267,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 106, "column": 32 @@ -4283,7 +4283,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 106, "column": 41 @@ -4299,7 +4299,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 106, "column": 41 @@ -4315,7 +4315,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 106, "column": 41 @@ -4333,7 +4333,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 106, "column": 49 @@ -4349,7 +4349,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 106, "column": 50 @@ -4369,7 +4369,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 106, "column": 55 @@ -4385,7 +4385,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 106, "column": 55 @@ -4401,7 +4401,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 106, "column": 63 @@ -4417,7 +4417,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 106, "column": 66 @@ -4437,7 +4437,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 107, "column": 32 @@ -4453,7 +4453,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 107, "column": 32 @@ -4469,7 +4469,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 107, "column": 43 @@ -4494,7 +4494,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 118, "column": 1 @@ -4513,7 +4513,7 @@ "isRecursive": false, "body": { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 118, "column": 21 @@ -4529,7 +4529,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 118, "column": 23 @@ -4545,7 +4545,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 118, "column": 25 @@ -4561,7 +4561,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 118, "column": 35 @@ -4579,7 +4579,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 118, "column": 43 @@ -4595,7 +4595,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 118, "column": 43 @@ -4618,7 +4618,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 128, "column": 1 @@ -4637,7 +4637,7 @@ "isRecursive": false, "body": { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 129, "column": 3 @@ -4653,7 +4653,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 129, "column": 3 @@ -4669,7 +4669,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 129, "column": 3 @@ -4687,7 +4687,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 129, "column": 26 @@ -4703,7 +4703,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 129, "column": 26 @@ -4719,7 +4719,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 129, "column": 35 @@ -4735,7 +4735,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 129, "column": 35 @@ -4753,7 +4753,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 129, "column": 43 @@ -4769,7 +4769,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 129, "column": 45 @@ -4785,7 +4785,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 129, "column": 45 @@ -4801,7 +4801,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 129, "column": 52 @@ -4826,7 +4826,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 134, "column": 1 @@ -4845,7 +4845,7 @@ "isRecursive": false, "body": { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 135, "column": 3 @@ -4861,7 +4861,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 135, "column": 4 @@ -4877,7 +4877,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 135, "column": 4 @@ -4893,7 +4893,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 135, "column": 13 @@ -4909,7 +4909,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 135, "column": 13 @@ -4927,7 +4927,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 135, "column": 21 @@ -4943,7 +4943,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 135, "column": 23 @@ -4959,7 +4959,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 135, "column": 23 @@ -4975,7 +4975,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 135, "column": 30 @@ -4997,7 +4997,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 135, "column": 37 @@ -5013,7 +5013,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 135, "column": 37 @@ -5034,7 +5034,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 142, "column": 1 @@ -5053,7 +5053,7 @@ "isRecursive": false, "body": { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 143, "column": 3 @@ -5069,7 +5069,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 143, "column": 4 @@ -5085,7 +5085,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 143, "column": 4 @@ -5101,7 +5101,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 143, "column": 13 @@ -5117,7 +5117,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 143, "column": 13 @@ -5135,7 +5135,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 143, "column": 21 @@ -5151,7 +5151,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 143, "column": 23 @@ -5167,7 +5167,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 143, "column": 26 @@ -5183,7 +5183,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 143, "column": 28 @@ -5199,7 +5199,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 143, "column": 28 @@ -5215,7 +5215,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 143, "column": 35 @@ -5241,7 +5241,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 143, "column": 42 @@ -5257,7 +5257,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 143, "column": 42 @@ -5278,7 +5278,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 159, "column": 1 @@ -5297,7 +5297,7 @@ "isRecursive": false, "body": { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 160, "column": 3 @@ -5313,7 +5313,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 160, "column": 6 @@ -5329,7 +5329,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 160, "column": 11 @@ -5345,7 +5345,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 160, "column": 11 @@ -5361,7 +5361,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 160, "column": 20 @@ -5377,7 +5377,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 160, "column": 20 @@ -5395,7 +5395,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 160, "column": 28 @@ -5411,7 +5411,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 160, "column": 28 @@ -5427,7 +5427,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 160, "column": 28 @@ -5443,7 +5443,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 160, "column": 35 @@ -5461,7 +5461,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 160, "column": 40 @@ -5477,7 +5477,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 160, "column": 42 @@ -5493,7 +5493,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 160, "column": 42 @@ -5509,7 +5509,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 160, "column": 49 @@ -5533,7 +5533,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 160, "column": 6 @@ -5554,7 +5554,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 161, "column": 6 @@ -5570,7 +5570,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 161, "column": 11 @@ -5586,7 +5586,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 161, "column": 11 @@ -5602,7 +5602,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 161, "column": 20 @@ -5618,7 +5618,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 161, "column": 20 @@ -5636,7 +5636,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 161, "column": 27 @@ -5652,7 +5652,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 161, "column": 28 @@ -5668,7 +5668,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 161, "column": 28 @@ -5684,7 +5684,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 161, "column": 28 @@ -5703,7 +5703,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 161, "column": 33 @@ -5721,7 +5721,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 161, "column": 38 @@ -5737,7 +5737,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 161, "column": 38 @@ -5753,7 +5753,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 161, "column": 43 @@ -5773,7 +5773,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 161, "column": 52 @@ -5789,7 +5789,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 161, "column": 52 @@ -5805,7 +5805,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 161, "column": 52 @@ -5821,7 +5821,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 161, "column": 58 @@ -5839,7 +5839,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 161, "column": 63 @@ -5864,7 +5864,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 161, "column": 6 @@ -5885,7 +5885,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 162, "column": 6 @@ -5901,7 +5901,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 162, "column": 11 @@ -5917,7 +5917,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 162, "column": 11 @@ -5933,7 +5933,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 162, "column": 20 @@ -5954,7 +5954,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 162, "column": 6 @@ -5978,7 +5978,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 154, "column": 1 @@ -5997,7 +5997,7 @@ "isRecursive": false, "body": { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 154, "column": 15 @@ -6013,7 +6013,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 154, "column": 15 @@ -6029,7 +6029,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 154, "column": 15 @@ -6045,7 +6045,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 154, "column": 15 @@ -6063,7 +6063,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 154, "column": 23 @@ -6079,7 +6079,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 154, "column": 25 @@ -6095,7 +6095,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 154, "column": 26 @@ -6111,7 +6111,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 154, "column": 26 @@ -6129,7 +6129,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 154, "column": 32 @@ -6145,7 +6145,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 154, "column": 32 @@ -6169,7 +6169,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 154, "column": 40 @@ -6185,7 +6185,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 154, "column": 43 @@ -6201,7 +6201,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 154, "column": 43 @@ -6219,7 +6219,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 154, "column": 48 @@ -6235,7 +6235,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 154, "column": 48 @@ -6258,7 +6258,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 174, "column": 1 @@ -6277,7 +6277,7 @@ "isRecursive": false, "body": { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 174, "column": 23 @@ -6293,7 +6293,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 174, "column": 23 @@ -6309,7 +6309,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 174, "column": 23 @@ -6327,7 +6327,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 174, "column": 30 @@ -6343,7 +6343,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 174, "column": 32 @@ -6359,7 +6359,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 174, "column": 33 @@ -6375,7 +6375,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 174, "column": 33 @@ -6393,7 +6393,7 @@ }, { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 174, "column": 39 @@ -6409,7 +6409,7 @@ "args": [ { "source": { - "filename": "APAEWD840", + "filename": "EWD840", "from": { "line": 174, "column": 39 @@ -6435,4 +6435,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/tla_specifications/ewd840/MC.cfg b/tla_specifications/ewd840/MC.cfg deleted file mode 100644 index 449e8c8..0000000 --- a/tla_specifications/ewd840/MC.cfg +++ /dev/null @@ -1,9 +0,0 @@ -\* CONSTANT definitions -CONSTANT -N <- MC_N -INIT -MC_Init -NEXT -Next -INVARIANT -MC_Inv diff --git a/tla_specifications/ewd840/MC10.tla b/tla_specifications/ewd840/MC10.tla deleted file mode 100644 index 554b8f8..0000000 --- a/tla_specifications/ewd840/MC10.tla +++ /dev/null @@ -1,9 +0,0 @@ ----- MODULE MC10 ---- -EXTENDS APAEWD840, TLC - -MC_N == 10 -MC_Init == Init -MC_Inv == Inv -============================================================================= -\* Modification History -\* Created Mon Mar 11 13:36:00 CET 2019 by igor diff --git a/tla_specifications/ewd840/MC4.tla b/tla_specifications/ewd840/MC4.tla deleted file mode 100644 index eb861df..0000000 --- a/tla_specifications/ewd840/MC4.tla +++ /dev/null @@ -1,9 +0,0 @@ ----- MODULE MC4 ---- -EXTENDS APAEWD840, TLC - -MC_N == 4 -MC_Init == Init -MC_Inv == Inv -============================================================================= -\* Modification History -\* Created Mon Mar 11 13:36:00 CET 2019 by igor diff --git a/tla_specifications/ewd840/MC4Inv.tla b/tla_specifications/ewd840/MC4Inv.tla deleted file mode 100644 index 373d609..0000000 --- a/tla_specifications/ewd840/MC4Inv.tla +++ /dev/null @@ -1,9 +0,0 @@ ----- MODULE MC4Inv ---- -EXTENDS APAEWD840, TLC - -MC_N == 4 -MC_Init == InvAndTypeOK -MC_Inv == InvAndTypeOK -============================================================================= -\* Modification History -\* Created Mon Mar 11 13:36:00 CET 2019 by igor diff --git a/tla_specifications/ewd840/README.md b/tla_specifications/ewd840/README.md index 1f4f28b..efe96ce 100644 --- a/tla_specifications/ewd840/README.md +++ b/tla_specifications/ewd840/README.md @@ -2,8 +2,3 @@ Examples imported from https://github.com/informalsystems/apalache-bench/tree/trunk/performance/ewd840 -JSON files are parsed with [Apalache](https://github.com/informalsystems/apalache): - -``` sh -apalache-mc parse --output=APAEWD840.json APAEWD840.tla -``` diff --git a/tla_specifications/ewd840/config.json b/tla_specifications/ewd840/config.json index 24621a8..172d1a8 100644 --- a/tla_specifications/ewd840/config.json +++ b/tla_specifications/ewd840/config.json @@ -34,9 +34,9 @@ ], "init": "Init", "next": "Next", - "module_name": "APAEWD840", + "module_name": "EWD840", "input_format": "json", - "input_file": "APAEWD840.json", + "input_file": "EWD840.json", "state_graph": "states.json", "blackbox_tests": [{"name": "Termination", "trace": "trace.out"}], "destination_folder": "../../elixir" diff --git a/tla_specifications/ewd998/_apalache-out/EWD998.tla/2022-05-30T19-31-02_2403299086312393506/detailed.log b/tla_specifications/ewd998/_apalache-out/EWD998.tla/2022-05-30T19-31-02_2403299086312393506/detailed.log deleted file mode 100644 index 090a7d1..0000000 --- a/tla_specifications/ewd998/_apalache-out/EWD998.tla/2022-05-30T19-31-02_2403299086312393506/detailed.log +++ /dev/null @@ -1,12 +0,0 @@ -19:31:02.721 [main] INFO a.f.a.t.Tool$ - Parse EWD998.tla -19:31:02.724 [main] INFO a.f.a.i.p.PassChainExecutor - PASS #0: SanyParser -19:31:02.877 [main] ERROR a.f.a.t.Tool$ - Error by TLA+ parser: *** Abort messages: 1 - -Unknown location - -Cannot find source file for module Folds imported in module Functions. - - - -19:31:02.878 [main] INFO a.f.a.t.Tool$ - It took me 0 days 0 hours 0 min 0 sec -19:31:02.878 [main] INFO a.f.a.t.Tool$ - Total time: 0.435 sec diff --git a/tla_specifications/ewd998/_apalache-out/EWD998.tla/2022-05-30T19-31-02_2403299086312393506/run.txt b/tla_specifications/ewd998/_apalache-out/EWD998.tla/2022-05-30T19-31-02_2403299086312393506/run.txt deleted file mode 100644 index 771697d..0000000 --- a/tla_specifications/ewd998/_apalache-out/EWD998.tla/2022-05-30T19-31-02_2403299086312393506/run.txt +++ /dev/null @@ -1 +0,0 @@ - parse --output=EWD998.json EWD998.tla diff --git a/tla_specifications/ewd998/_apalache-out/EWD998.tla/2022-05-30T19-40-54_13663850801108245253/detailed.log b/tla_specifications/ewd998/_apalache-out/EWD998.tla/2022-05-30T19-40-54_13663850801108245253/detailed.log deleted file mode 100644 index 572fb59..0000000 --- a/tla_specifications/ewd998/_apalache-out/EWD998.tla/2022-05-30T19-40-54_13663850801108245253/detailed.log +++ /dev/null @@ -1,12 +0,0 @@ -19:40:54.691 [main] INFO a.f.a.t.Tool$ - Parse EWD998.tla -19:40:54.694 [main] INFO a.f.a.i.p.PassChainExecutor - PASS #0: SanyParser -19:40:54.814 [main] ERROR a.f.a.t.Tool$ - Error by TLA+ parser: *** Abort messages: 1 - -Unknown location - -Cannot find source file for module Folds imported in module Functions. - - - -19:40:54.815 [main] INFO a.f.a.t.Tool$ - It took me 0 days 0 hours 0 min 0 sec -19:40:54.815 [main] INFO a.f.a.t.Tool$ - Total time: 0.342 sec diff --git a/tla_specifications/ewd998/_apalache-out/EWD998.tla/2022-05-30T19-40-54_13663850801108245253/run.txt b/tla_specifications/ewd998/_apalache-out/EWD998.tla/2022-05-30T19-40-54_13663850801108245253/run.txt deleted file mode 100644 index 771697d..0000000 --- a/tla_specifications/ewd998/_apalache-out/EWD998.tla/2022-05-30T19-40-54_13663850801108245253/run.txt +++ /dev/null @@ -1 +0,0 @@ - parse --output=EWD998.json EWD998.tla diff --git a/tla_specifications/ewd998/_apalache-out/EWD998.tla/2022-05-30T19-41-37_10917989166388192710/detailed.log b/tla_specifications/ewd998/_apalache-out/EWD998.tla/2022-05-30T19-41-37_10917989166388192710/detailed.log deleted file mode 100644 index b861739..0000000 --- a/tla_specifications/ewd998/_apalache-out/EWD998.tla/2022-05-30T19-41-37_10917989166388192710/detailed.log +++ /dev/null @@ -1,9 +0,0 @@ -19:41:37.649 [main] INFO a.f.a.t.Tool$ - # APALACHE version: v0.22.0-1262-gf8b7a9c40 | build: v0.22.0-1262-gf8b7a9c40 -19:41:37.743 [main] INFO a.f.a.t.Tool$ - Parse EWD998.tla -19:41:37.745 [main] INFO a.f.a.i.p.PassChainExecutor - PASS #0: SanyParser -19:41:38.170 [main] WARN a.f.a.t.i.SubstTranslator - Substitution of LEADS_TO needs care. The current implementation may fail to work. -19:41:38.354 [main] DEBUG a.f.a.i.p.PassChainExecutor - PASS #0: SanyParser [OK] -19:41:38.355 [main] INFO a.f.a.t.Tool$ - Parsed successfully -Root module: EWD998 with 100 declarations. -19:41:38.355 [main] INFO a.f.a.t.Tool$ - It took me 0 days 0 hours 0 min 0 sec -19:41:38.356 [main] INFO a.f.a.t.Tool$ - Total time: 0.705 sec diff --git a/tla_specifications/ewd998/_apalache-out/EWD998.tla/2022-05-30T19-41-37_10917989166388192710/run.txt b/tla_specifications/ewd998/_apalache-out/EWD998.tla/2022-05-30T19-41-37_10917989166388192710/run.txt deleted file mode 100644 index 771697d..0000000 --- a/tla_specifications/ewd998/_apalache-out/EWD998.tla/2022-05-30T19-41-37_10917989166388192710/run.txt +++ /dev/null @@ -1 +0,0 @@ - parse --output=EWD998.json EWD998.tla diff --git a/tla_specifications/JarrosDeAgua.cfg b/tla_specifications/old/JarrosDeAgua.cfg similarity index 100% rename from tla_specifications/JarrosDeAgua.cfg rename to tla_specifications/old/JarrosDeAgua.cfg diff --git a/tla_specifications/JarrosDeAgua.tla b/tla_specifications/old/JarrosDeAgua.tla similarity index 100% rename from tla_specifications/JarrosDeAgua.tla rename to tla_specifications/old/JarrosDeAgua.tla diff --git a/tla_specifications/token-transfer/TokenTransfer2.json b/tla_specifications/old/TransactionCommit.json similarity index 52% rename from tla_specifications/token-transfer/TokenTransfer2.json rename to tla_specifications/old/TransactionCommit.json index d2e11b3..8440f43 100644 --- a/tla_specifications/token-transfer/TokenTransfer2.json +++ b/tla_specifications/old/TransactionCommit.json @@ -5,156 +5,101 @@ "modules": [ { "kind": "TlaModule", - "name": "TokenTransfer2", + "name": "a", "declarations": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 20, - "column": 5 + "line": 6, + "column": 10 }, "to": { - "line": 20, - "column": 12 + "line": 6, + "column": 11 } }, "type": "Untyped", "kind": "TlaConstDecl", - "name": "ACCOUNTS" + "name": "RM" }, { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 17, - "column": 5 - }, - "to": { - "line": 17, + "line": 7, "column": 10 - } - }, - "type": "Untyped", - "kind": "TlaConstDecl", - "name": "CHAINS" - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 25, - "column": 5 }, "to": { - "line": 25, - "column": 9 + "line": 7, + "column": 16 } }, "type": "Untyped", "kind": "TlaVarDecl", - "name": "banks" - }, - { - "source": { - "filename": "typedefs", - "from": { - "line": 16, - "column": 1 - }, - "to": { - "line": 16, - "column": 25 - } - }, - "type": "Untyped", - "kind": "TlaOperDecl", - "name": "typedefs_included", - "formalParams": [ - - ], - "isRecursive": false, - "body": { - "source": { - "filename": "typedefs", - "from": { - "line": 16, - "column": 22 - }, - "to": { - "line": 16, - "column": 25 - } - }, - "type": "Untyped", - "kind": "ValEx", - "value": { - "kind": "TlaBool", - "value": true - } - } + "name": "rmState" }, { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 28, + "line": 9, "column": 1 }, "to": { - "line": 32, - "column": 20 + "line": 13, + "column": 69 } }, "type": "Untyped", "kind": "TlaOperDecl", - "name": "Init", + "name": "TCTypeOK", "formalParams": [ ], "isRecursive": false, "body": { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 29, - "column": 5 + "line": 13, + "column": 3 }, "to": { - "line": 32, - "column": 20 + "line": 13, + "column": 69 } }, "type": "Untyped", "kind": "OperEx", - "oper": "EXISTS3", + "oper": "SET_IN", "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 29, - "column": 5 + "line": 13, + "column": 3 }, "to": { - "line": 32, - "column": 20 + "line": 13, + "column": 9 } }, "type": "Untyped", "kind": "NameEx", - "name": "b" + "name": "rmState" }, { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 29, - "column": 14 + "line": 13, + "column": 15 }, "to": { - "line": 29, - "column": 42 + "line": 13, + "column": 69 } }, "type": "Untyped", @@ -163,311 +108,111 @@ "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 29, + "line": 13, "column": 16 }, "to": { - "line": 29, - "column": 33 - } - }, - "type": "Untyped", - "kind": "OperEx", - "oper": "SET_TIMES", - "args": [ - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 29, - "column": 16 - }, - "to": { - "line": 29, - "column": 21 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "CHAINS" - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 29, - "column": 26 - }, - "to": { - "line": 29, - "column": 33 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "ACCOUNTS" - } - ] - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 29, - "column": 38 - }, - "to": { - "line": 29, - "column": 40 + "line": 13, + "column": 17 } }, "type": "Untyped", - "kind": "ValEx", - "value": { - "kind": "TlaNatSet" - } - } - ] - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 30, - "column": 9 + "kind": "NameEx", + "name": "RM" }, - "to": { - "line": 32, - "column": 20 - } - }, - "type": "Untyped", - "kind": "OperEx", - "oper": "AND", - "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 30, - "column": 12 + "line": 13, + "column": 22 }, "to": { - "line": 31, - "column": 32 + "line": 13, + "column": 68 } }, "type": "Untyped", "kind": "OperEx", - "oper": "FORALL3", + "oper": "SET_ENUM", "args": [ { "source": { - "filename": "TokenTransfer2", - "from": { - "line": 30, - "column": 12 - }, - "to": { - "line": 31, - "column": 32 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "c" - }, - { - "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 30, - "column": 21 + "line": 13, + "column": 23 }, "to": { - "line": 30, - "column": 26 + "line": 13, + "column": 31 } }, "type": "Untyped", - "kind": "NameEx", - "name": "CHAINS" + "kind": "ValEx", + "value": { + "kind": "TlaStr", + "value": "working" + } }, { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 31, - "column": 14 + "line": 13, + "column": 34 }, "to": { - "line": 31, - "column": 32 + "line": 13, + "column": 43 } }, "type": "Untyped", - "kind": "OperEx", - "oper": "GT", - "args": [ - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 31, - "column": 14 - }, - "to": { - "line": 31, - "column": 28 - } - }, - "type": "Untyped", - "kind": "OperEx", - "oper": "FUN_APP", - "args": [ - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 31, - "column": 14 - }, - "to": { - "line": 31, - "column": 14 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "b" - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 31, - "column": 14 - }, - "to": { - "line": 31, - "column": 28 - } - }, - "type": "Untyped", - "kind": "OperEx", - "oper": "TUPLE", - "args": [ - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 31, - "column": 16 - }, - "to": { - "line": 31, - "column": 16 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "c" - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 31, - "column": 19 - }, - "to": { - "line": 31, - "column": 27 - } - }, - "type": "Untyped", - "kind": "ValEx", - "value": { - "kind": "TlaStr", - "value": "reserve" - } - } - ] - } - ] - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 31, - "column": 32 - }, - "to": { - "line": 31, - "column": 32 - } - }, - "type": "Untyped", - "kind": "ValEx", - "value": { - "kind": "TlaInt", - "value": 0 - } - } - ] - } - ] - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 32, - "column": 12 + "kind": "ValEx", + "value": { + "kind": "TlaStr", + "value": "prepared" + } }, - "to": { - "line": 32, - "column": 20 - } - }, - "type": "Untyped", - "kind": "OperEx", - "oper": "EQ", - "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 32, - "column": 12 + "line": 13, + "column": 46 }, "to": { - "line": 32, - "column": 16 + "line": 13, + "column": 56 } }, "type": "Untyped", - "kind": "NameEx", - "name": "banks" + "kind": "ValEx", + "value": { + "kind": "TlaStr", + "value": "committed" + } }, { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 32, - "column": 20 + "line": 13, + "column": 59 }, "to": { - "line": 32, - "column": 20 + "line": 13, + "column": 67 } }, "type": "Untyped", - "kind": "NameEx", - "name": "b" + "kind": "ValEx", + "value": { + "kind": "TlaStr", + "value": "aborted" + } } ] } @@ -478,116 +223,696 @@ }, { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 35, + "line": 15, "column": 1 }, "to": { - "line": 42, - "column": 9 + "line": 15, + "column": 46 } }, "type": "Untyped", "kind": "TlaOperDecl", - "name": "LocalTransfer", + "name": "TCInit", "formalParams": [ - { - "kind": "OperParam", - "name": "chain", - "arity": 0 - }, - { - "kind": "OperParam", - "name": "from", - "arity": 0 - }, - { - "kind": "OperParam", - "name": "to", - "arity": 0 - }, - { - "kind": "OperParam", - "name": "amount", - "arity": 0 - } + ], "isRecursive": false, "body": { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 36, - "column": 5 + "line": 15, + "column": 13 }, "to": { - "line": 42, - "column": 9 + "line": 15, + "column": 46 } }, "type": "Untyped", "kind": "OperEx", - "oper": "AND", + "oper": "EQ", "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 36, - "column": 8 + "line": 15, + "column": 13 }, "to": { - "line": 36, - "column": 35 + "line": 15, + "column": 19 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "rmState" + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 15, + "column": 23 + }, + "to": { + "line": 15, + "column": 46 } }, "type": "Untyped", "kind": "OperEx", - "oper": "GE", + "oper": "FUN_CTOR", "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 36, - "column": 8 + "line": 15, + "column": 37 }, "to": { - "line": 36, - "column": 25 + "line": 15, + "column": 45 } }, "type": "Untyped", - "kind": "OperEx", - "oper": "FUN_APP", - "args": [ - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 36, - "column": 8 - }, - "to": { - "line": 36, - "column": 12 - } + "kind": "ValEx", + "value": { + "kind": "TlaStr", + "value": "working" + } + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 15, + "column": 23 + }, + "to": { + "line": 15, + "column": 46 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "r" + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 15, + "column": 30 + }, + "to": { + "line": 15, + "column": 31 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "RM" + } + ] + } + ] + } + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 20, + "column": 1 + }, + "to": { + "line": 20, + "column": 67 + } + }, + "type": "Untyped", + "kind": "TlaOperDecl", + "name": "canCommit", + "formalParams": [ + + ], + "isRecursive": false, + "body": { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 20, + "column": 14 + }, + "to": { + "line": 20, + "column": 67 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "FORALL3", + "args": [ + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 20, + "column": 14 + }, + "to": { + "line": 20, + "column": 67 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "r" + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 20, + "column": 23 + }, + "to": { + "line": 20, + "column": 24 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "RM" + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 20, + "column": 28 + }, + "to": { + "line": 20, + "column": 67 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "SET_IN", + "args": [ + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 20, + "column": 28 + }, + "to": { + "line": 20, + "column": 37 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "FUN_APP", + "args": [ + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 20, + "column": 28 + }, + "to": { + "line": 20, + "column": 34 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "rmState" + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 20, + "column": 36 + }, + "to": { + "line": 20, + "column": 36 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "r" + } + ] + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 20, + "column": 43 + }, + "to": { + "line": 20, + "column": 67 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "SET_ENUM", + "args": [ + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 20, + "column": 44 + }, + "to": { + "line": 20, + "column": 53 + } + }, + "type": "Untyped", + "kind": "ValEx", + "value": { + "kind": "TlaStr", + "value": "prepared" + } + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 20, + "column": 56 + }, + "to": { + "line": 20, + "column": 66 + } + }, + "type": "Untyped", + "kind": "ValEx", + "value": { + "kind": "TlaStr", + "value": "committed" + } + } + ] + } + ] + } + ] + } + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 25, + "column": 1 + }, + "to": { + "line": 25, + "column": 54 + } + }, + "type": "Untyped", + "kind": "TlaOperDecl", + "name": "notCommitted", + "formalParams": [ + + ], + "isRecursive": false, + "body": { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 25, + "column": 17 + }, + "to": { + "line": 25, + "column": 54 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "FORALL3", + "args": [ + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 25, + "column": 17 + }, + "to": { + "line": 25, + "column": 54 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "r" + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 25, + "column": 26 + }, + "to": { + "line": 25, + "column": 27 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "RM" + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 25, + "column": 31 + }, + "to": { + "line": 25, + "column": 54 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "NE", + "args": [ + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 25, + "column": 31 + }, + "to": { + "line": 25, + "column": 40 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "FUN_APP", + "args": [ + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 25, + "column": 31 + }, + "to": { + "line": 25, + "column": 37 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "rmState" + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 25, + "column": 39 + }, + "to": { + "line": 25, + "column": 39 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "r" + } + ] + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 25, + "column": 44 + }, + "to": { + "line": 25, + "column": 54 + } + }, + "type": "Untyped", + "kind": "ValEx", + "value": { + "kind": "TlaStr", + "value": "committed" + } + } + ] + } + ] + } + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 35, + "column": 1 + }, + "to": { + "line": 36, + "column": 62 + } + }, + "type": "Untyped", + "kind": "TlaOperDecl", + "name": "Prepare", + "formalParams": [ + { + "kind": "OperParam", + "name": "r", + "arity": 0 + } + ], + "isRecursive": false, + "body": { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 35, + "column": 15 + }, + "to": { + "line": 36, + "column": 62 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "AND", + "args": [ + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 35, + "column": 18 + }, + "to": { + "line": 35, + "column": 39 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "EQ", + "args": [ + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 35, + "column": 18 + }, + "to": { + "line": 35, + "column": 27 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "FUN_APP", + "args": [ + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 35, + "column": 18 + }, + "to": { + "line": 35, + "column": 24 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "rmState" + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 35, + "column": 26 + }, + "to": { + "line": 35, + "column": 26 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "r" + } + ] + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 35, + "column": 31 + }, + "to": { + "line": 35, + "column": 39 + } + }, + "type": "Untyped", + "kind": "ValEx", + "value": { + "kind": "TlaStr", + "value": "working" + } + } + ] + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 36, + "column": 18 + }, + "to": { + "line": 36, + "column": 62 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "EQ", + "args": [ + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 36, + "column": 18 + }, + "to": { + "line": 36, + "column": 25 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "PRIME", + "args": [ + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 36, + "column": 18 + }, + "to": { + "line": 36, + "column": 24 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "rmState" + } + ] + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 36, + "column": 29 + }, + "to": { + "line": 36, + "column": 62 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "EXCEPT", + "args": [ + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 36, + "column": 30 + }, + "to": { + "line": 36, + "column": 36 + } }, "type": "Untyped", "kind": "NameEx", - "name": "banks" + "name": "rmState" }, { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { "line": 36, - "column": 8 + "column": 45 }, "to": { "line": 36, - "column": 25 + "column": 61 } }, "type": "Untyped", @@ -596,150 +921,459 @@ "args": [ { "source": { - "filename": "TokenTransfer2", - "from": { - "line": 36, - "column": 14 - }, - "to": { - "line": 36, - "column": 18 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "chain" - }, - { - "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { "line": 36, - "column": 21 + "column": 47 }, "to": { "line": 36, - "column": 24 + "column": 47 } }, "type": "Untyped", "kind": "NameEx", - "name": "from" + "name": "r" } ] - } - ] - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 36, - "column": 30 }, - "to": { - "line": 36, - "column": 35 + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 36, + "column": 52 + }, + "to": { + "line": 36, + "column": 61 + } + }, + "type": "Untyped", + "kind": "ValEx", + "value": { + "kind": "TlaStr", + "value": "prepared" + } } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "amount" + ] } ] + } + ] + } + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 50, + "column": 1 + }, + "to": { + "line": 56, + "column": 51 + } + }, + "type": "Untyped", + "kind": "TlaOperDecl", + "name": "TCConsistent", + "formalParams": [ + + ], + "isRecursive": false, + "body": { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 55, + "column": 3 }, + "to": { + "line": 56, + "column": 51 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "FORALL3", + "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 37, - "column": 8 + "line": 55, + "column": 3 }, "to": { - "line": 37, + "line": 56, + "column": 51 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "r1" + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 55, "column": 17 + }, + "to": { + "line": 55, + "column": 18 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "RM" + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 55, + "column": 3 + }, + "to": { + "line": 56, + "column": 51 } }, "type": "Untyped", "kind": "OperEx", - "oper": "NE", + "oper": "FORALL3", "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 37, - "column": 8 + "line": 55, + "column": 3 }, "to": { - "line": 37, - "column": 11 + "line": 56, + "column": 51 } }, "type": "Untyped", "kind": "NameEx", - "name": "from" + "name": "r2" }, { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 37, - "column": 16 + "line": 55, + "column": 17 }, "to": { - "line": 37, - "column": 17 + "line": 55, + "column": 18 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "RM" + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 55, + "column": 22 + }, + "to": { + "line": 56, + "column": 51 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "NOT", + "args": [ + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 55, + "column": 24 + }, + "to": { + "line": 56, + "column": 51 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "AND", + "args": [ + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 55, + "column": 27 + }, + "to": { + "line": 55, + "column": 49 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "EQ", + "args": [ + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 55, + "column": 27 + }, + "to": { + "line": 55, + "column": 37 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "FUN_APP", + "args": [ + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 55, + "column": 27 + }, + "to": { + "line": 55, + "column": 33 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "rmState" + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 55, + "column": 35 + }, + "to": { + "line": 55, + "column": 36 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "r1" + } + ] + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 55, + "column": 41 + }, + "to": { + "line": 55, + "column": 49 + } + }, + "type": "Untyped", + "kind": "ValEx", + "value": { + "kind": "TlaStr", + "value": "aborted" + } + } + ] + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 56, + "column": 27 + }, + "to": { + "line": 56, + "column": 51 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "EQ", + "args": [ + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 56, + "column": 27 + }, + "to": { + "line": 56, + "column": 37 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "FUN_APP", + "args": [ + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 56, + "column": 27 + }, + "to": { + "line": 56, + "column": 33 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "rmState" + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 56, + "column": 35 + }, + "to": { + "line": 56, + "column": 36 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "r2" + } + ] + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 56, + "column": 41 + }, + "to": { + "line": 56, + "column": 51 + } + }, + "type": "Untyped", + "kind": "ValEx", + "value": { + "kind": "TlaStr", + "value": "committed" + } + } + ] + } + ] } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "to" + ] } ] + } + ] + } + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 38, + "column": 1 + }, + "to": { + "line": 43, + "column": 64 + } + }, + "type": "Untyped", + "kind": "TlaOperDecl", + "name": "Decide", + "formalParams": [ + { + "kind": "OperParam", + "name": "r", + "arity": 0 + } + ], + "isRecursive": false, + "body": { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 38, + "column": 15 }, + "to": { + "line": 43, + "column": 64 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "OR", + "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { "line": 38, - "column": 8 + "column": 18 }, "to": { - "line": 38, - "column": 39 + "line": 40, + "column": 66 } }, "type": "Untyped", "kind": "OperEx", - "oper": "GE", + "oper": "AND", "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { "line": 38, - "column": 8 + "column": 21 }, "to": { "line": 38, - "column": 34 + "column": 43 } }, "type": "Untyped", "kind": "OperEx", - "oper": "MINUS", + "oper": "EQ", "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { "line": 38, - "column": 8 + "column": 21 }, "to": { "line": 38, - "column": 25 + "column": 30 } }, "type": "Untyped", @@ -748,469 +1382,338 @@ "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { "line": 38, - "column": 8 + "column": 21 }, "to": { "line": 38, - "column": 12 + "column": 27 } }, "type": "Untyped", "kind": "NameEx", - "name": "banks" + "name": "rmState" }, { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { "line": 38, - "column": 8 + "column": 29 }, "to": { "line": 38, - "column": 25 + "column": 29 } }, "type": "Untyped", - "kind": "OperEx", - "oper": "TUPLE", - "args": [ - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 38, - "column": 14 - }, - "to": { - "line": 38, - "column": 18 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "chain" - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 38, - "column": 21 - }, - "to": { - "line": 38, - "column": 24 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "from" - } - ] + "kind": "NameEx", + "name": "r" } ] }, { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { "line": 38, - "column": 29 + "column": 34 }, "to": { "line": 38, - "column": 34 + "column": 43 } }, "type": "Untyped", - "kind": "NameEx", - "name": "amount" + "kind": "ValEx", + "value": { + "kind": "TlaStr", + "value": "prepared" + } } ] }, { "source": { - "filename": "TokenTransfer2", - "from": { - "line": 38, - "column": 39 - }, - "to": { - "line": 38, - "column": 39 - } - }, - "type": "Untyped", - "kind": "ValEx", - "value": { - "kind": "TlaInt", - "value": 0 - } - } - ] - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 39, - "column": 8 - }, - "to": { - "line": 42, - "column": 9 - } - }, - "type": "Untyped", - "kind": "OperEx", - "oper": "EQ", - "args": [ - { - "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { "line": 39, - "column": 8 + "column": 21 }, "to": { "line": 39, - "column": 13 + "column": 29 } }, "type": "Untyped", "kind": "OperEx", - "oper": "PRIME", + "oper": "OPER_APP", "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { "line": 39, - "column": 8 + "column": 21 }, "to": { "line": 39, - "column": 12 + "column": 29 } }, "type": "Untyped", "kind": "NameEx", - "name": "banks" + "name": "canCommit" } ] }, { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 39, - "column": 17 + "line": 40, + "column": 21 }, "to": { - "line": 42, - "column": 9 + "line": 40, + "column": 66 } }, "type": "Untyped", "kind": "OperEx", - "oper": "EXCEPT", + "oper": "EQ", "args": [ { "source": { - "filename": "TokenTransfer2", - "from": { - "line": 39, - "column": 18 - }, - "to": { - "line": 39, - "column": 22 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "banks" - }, - { - "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { "line": 40, - "column": 13 + "column": 21 }, "to": { "line": 40, - "column": 56 + "column": 28 } }, "type": "Untyped", "kind": "OperEx", - "oper": "TUPLE", + "oper": "PRIME", "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { "line": 40, - "column": 14 + "column": 21 }, "to": { "line": 40, - "column": 26 + "column": 27 } }, "type": "Untyped", - "kind": "OperEx", - "oper": "TUPLE", - "args": [ - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 40, - "column": 15 - }, - "to": { - "line": 40, - "column": 19 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "chain" - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 40, - "column": 22 - }, - "to": { - "line": 40, - "column": 25 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "from" - } - ] + "kind": "NameEx", + "name": "rmState" } ] }, { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { "line": 40, - "column": 30 + "column": 32 }, "to": { "line": 40, - "column": 56 + "column": 66 } }, "type": "Untyped", "kind": "OperEx", - "oper": "MINUS", + "oper": "EXCEPT", "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { "line": 40, - "column": 30 + "column": 33 }, "to": { "line": 40, - "column": 47 + "column": 39 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "rmState" + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 40, + "column": 48 + }, + "to": { + "line": 40, + "column": 65 } }, "type": "Untyped", "kind": "OperEx", - "oper": "FUN_APP", + "oper": "TUPLE", "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { "line": 40, - "column": 30 + "column": 50 }, "to": { "line": 40, - "column": 34 + "column": 50 } }, "type": "Untyped", "kind": "NameEx", - "name": "banks" - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 40, - "column": 30 - }, - "to": { - "line": 40, - "column": 47 - } - }, - "type": "Untyped", - "kind": "OperEx", - "oper": "TUPLE", - "args": [ - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 40, - "column": 36 - }, - "to": { - "line": 40, - "column": 40 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "chain" - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 40, - "column": 43 - }, - "to": { - "line": 40, - "column": 46 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "from" - } - ] + "name": "r" } ] }, { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { "line": 40, - "column": 51 + "column": 55 }, "to": { "line": 40, - "column": 56 + "column": 65 } }, "type": "Untyped", - "kind": "NameEx", - "name": "amount" + "kind": "ValEx", + "value": { + "kind": "TlaStr", + "value": "committed" + } } ] + } + ] + } + ] + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 41, + "column": 18 + }, + "to": { + "line": 43, + "column": 64 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "AND", + "args": [ + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 41, + "column": 21 }, + "to": { + "line": 41, + "column": 58 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "SET_IN", + "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { "line": 41, - "column": 13 + "column": 21 }, "to": { "line": 41, - "column": 56 + "column": 30 } }, "type": "Untyped", "kind": "OperEx", - "oper": "TUPLE", + "oper": "FUN_APP", "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { "line": 41, - "column": 14 + "column": 21 }, "to": { "line": 41, - "column": 24 + "column": 27 } }, "type": "Untyped", - "kind": "OperEx", - "oper": "TUPLE", - "args": [ - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 41, - "column": 15 - }, - "to": { - "line": 41, - "column": 19 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "chain" + "kind": "NameEx", + "name": "rmState" + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 41, + "column": 29 }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 41, - "column": 22 - }, - "to": { - "line": 41, - "column": 23 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "to" + "to": { + "line": 41, + "column": 29 } - ] + }, + "type": "Untyped", + "kind": "NameEx", + "name": "r" } ] }, { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { "line": 41, - "column": 30 + "column": 36 }, "to": { "line": 41, - "column": 56 + "column": 58 } }, "type": "Untyped", "kind": "OperEx", - "oper": "PLUS", + "oper": "SET_ENUM", "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { "line": 41, - "column": 30 + "column": 37 }, "to": { "line": 41, @@ -1218,290 +1721,207 @@ } }, "type": "Untyped", - "kind": "OperEx", - "oper": "FUN_APP", - "args": [ - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 41, - "column": 30 - }, - "to": { - "line": 41, - "column": 34 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "banks" - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 41, - "column": 30 - }, - "to": { - "line": 41, - "column": 45 - } - }, - "type": "Untyped", - "kind": "OperEx", - "oper": "TUPLE", - "args": [ - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 41, - "column": 36 - }, - "to": { - "line": 41, - "column": 40 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "chain" - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 41, - "column": 43 - }, - "to": { - "line": 41, - "column": 44 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "to" - } - ] - } - ] + "kind": "ValEx", + "value": { + "kind": "TlaStr", + "value": "working" + } }, { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { "line": 41, - "column": 51 + "column": 48 }, "to": { "line": 41, - "column": 56 + "column": 57 } }, "type": "Untyped", - "kind": "NameEx", - "name": "amount" + "kind": "ValEx", + "value": { + "kind": "TlaStr", + "value": "prepared" + } } ] } ] - } - ] - } - ] - } - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 52, - "column": 1 - }, - "to": { - "line": 54, - "column": 35 - } - }, - "type": "Untyped", - "kind": "TlaOperDecl", - "name": "ReservesInv", - "formalParams": [ - - ], - "isRecursive": false, - "body": { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 53, - "column": 5 - }, - "to": { - "line": 54, - "column": 35 - } - }, - "type": "Untyped", - "kind": "OperEx", - "oper": "FORALL3", - "args": [ - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 53, - "column": 5 - }, - "to": { - "line": 54, - "column": 35 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "chain" - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 53, - "column": 18 - }, - "to": { - "line": 53, - "column": 23 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "CHAINS" - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 54, - "column": 9 }, - "to": { - "line": 54, - "column": 35 - } - }, - "type": "Untyped", - "kind": "OperEx", - "oper": "GT", - "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 54, - "column": 9 + "line": 42, + "column": 21 }, "to": { - "line": 54, - "column": 31 + "line": 42, + "column": 32 } }, "type": "Untyped", "kind": "OperEx", - "oper": "FUN_APP", + "oper": "OPER_APP", "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 54, - "column": 9 + "line": 42, + "column": 21 }, "to": { - "line": 54, - "column": 13 + "line": 42, + "column": 32 } }, "type": "Untyped", "kind": "NameEx", - "name": "banks" + "name": "notCommitted" + } + ] + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 43, + "column": 21 }, + "to": { + "line": 43, + "column": 64 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "EQ", + "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 54, - "column": 9 + "line": 43, + "column": 21 }, "to": { - "line": 54, - "column": 31 + "line": 43, + "column": 28 } }, "type": "Untyped", "kind": "OperEx", - "oper": "TUPLE", + "oper": "PRIME", + "args": [ + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 43, + "column": 21 + }, + "to": { + "line": 43, + "column": 27 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "rmState" + } + ] + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 43, + "column": 32 + }, + "to": { + "line": 43, + "column": 64 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "EXCEPT", "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", + "from": { + "line": 43, + "column": 33 + }, + "to": { + "line": 43, + "column": 39 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "rmState" + }, + { + "source": { + "filename": "TransactionCommit", "from": { - "line": 54, - "column": 15 + "line": 43, + "column": 48 }, "to": { - "line": 54, - "column": 19 + "line": 43, + "column": 63 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "TUPLE", + "args": [ + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 43, + "column": 50 + }, + "to": { + "line": 43, + "column": 50 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "r" } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "chain" + ] }, { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 54, - "column": 22 + "line": 43, + "column": 55 }, "to": { - "line": 54, - "column": 30 + "line": 43, + "column": 63 } }, "type": "Untyped", "kind": "ValEx", "value": { "kind": "TlaStr", - "value": "reserve" + "value": "aborted" } } ] } ] - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 54, - "column": 35 - }, - "to": { - "line": 54, - "column": 35 - } - }, - "type": "Untyped", - "kind": "ValEx", - "value": { - "kind": "TlaInt", - "value": 0 - } } ] } @@ -1510,173 +1930,186 @@ }, { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 57, + "line": 45, "column": 1 }, "to": { - "line": 59, - "column": 27 + "line": 45, + "column": 47 } }, "type": "Untyped", "kind": "TlaOperDecl", - "name": "NoNegativeAccounts", + "name": "TCNext", "formalParams": [ ], "isRecursive": false, "body": { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 58, - "column": 5 + "line": 45, + "column": 11 }, "to": { - "line": 59, - "column": 27 + "line": 45, + "column": 47 } }, "type": "Untyped", "kind": "OperEx", - "oper": "FORALL3", + "oper": "EXISTS3", "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 58, - "column": 5 + "line": 45, + "column": 11 }, "to": { - "line": 59, - "column": 27 + "line": 45, + "column": 47 } }, "type": "Untyped", "kind": "NameEx", - "name": "address" + "name": "r" }, { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 58, + "line": 45, "column": 20 }, "to": { - "line": 58, - "column": 31 + "line": 45, + "column": 21 } }, "type": "Untyped", - "kind": "OperEx", - "oper": "DOMAIN", - "args": [ - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 58, - "column": 27 - }, - "to": { - "line": 58, - "column": 31 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "banks" - } - ] + "kind": "NameEx", + "name": "RM" }, { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 59, - "column": 9 + "line": 45, + "column": 25 }, "to": { - "line": 59, - "column": 27 + "line": 45, + "column": 47 } }, "type": "Untyped", "kind": "OperEx", - "oper": "GE", + "oper": "OR", "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 59, - "column": 9 + "line": 45, + "column": 25 }, "to": { - "line": 59, - "column": 22 + "line": 45, + "column": 34 } }, "type": "Untyped", "kind": "OperEx", - "oper": "FUN_APP", + "oper": "OPER_APP", "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 59, - "column": 9 + "line": 45, + "column": 25 }, "to": { - "line": 59, - "column": 13 + "line": 45, + "column": 34 } }, "type": "Untyped", "kind": "NameEx", - "name": "banks" + "name": "Prepare" }, { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 59, - "column": 15 + "line": 45, + "column": 33 }, "to": { - "line": 59, - "column": 21 + "line": 45, + "column": 33 } }, "type": "Untyped", "kind": "NameEx", - "name": "address" + "name": "r" } ] }, { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 59, - "column": 27 + "line": 45, + "column": 39 }, "to": { - "line": 59, - "column": 27 + "line": 45, + "column": 47 } }, "type": "Untyped", - "kind": "ValEx", - "value": { - "kind": "TlaInt", - "value": 0 - } + "kind": "OperEx", + "oper": "OPER_APP", + "args": [ + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 45, + "column": 39 + }, + "to": { + "line": 45, + "column": 47 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "Decide" + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 45, + "column": 46 + }, + "to": { + "line": 45, + "column": 46 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "r" + } + ] } ] } @@ -1685,316 +2118,154 @@ }, { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 45, + "line": 62, "column": 1 }, "to": { - "line": 47, - "column": 46 + "line": 62, + "column": 38 } }, "type": "Untyped", "kind": "TlaOperDecl", - "name": "Next", + "name": "TCSpec", "formalParams": [ ], "isRecursive": false, "body": { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 46, - "column": 5 + "line": 62, + "column": 11 }, "to": { - "line": 47, - "column": 46 + "line": 62, + "column": 38 } }, "type": "Untyped", "kind": "OperEx", - "oper": "EXISTS3", + "oper": "AND", "args": [ { "source": { - "filename": "TokenTransfer2", - "from": { - "line": 46, - "column": 5 - }, - "to": { - "line": 47, - "column": 46 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "chain" - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 46, - "column": 18 - }, - "to": { - "line": 46, - "column": 23 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "CHAINS" - }, - { - "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 46, - "column": 5 + "line": 62, + "column": 11 }, "to": { - "line": 47, - "column": 46 + "line": 62, + "column": 16 } }, "type": "Untyped", "kind": "OperEx", - "oper": "EXISTS3", + "oper": "OPER_APP", "args": [ { "source": { - "filename": "TokenTransfer2", - "from": { - "line": 46, - "column": 5 - }, - "to": { - "line": 47, - "column": 46 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "from" - }, - { - "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 46, - "column": 39 + "line": 62, + "column": 11 }, "to": { - "line": 46, - "column": 46 + "line": 62, + "column": 16 } }, "type": "Untyped", "kind": "NameEx", - "name": "ACCOUNTS" + "name": "TCInit" + } + ] + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 62, + "column": 21 }, + "to": { + "line": 62, + "column": 38 + } + }, + "type": "Untyped", + "kind": "OperEx", + "oper": "GLOBALLY", + "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 46, - "column": 5 + "line": 62, + "column": 23 }, "to": { - "line": 47, - "column": 46 + "line": 62, + "column": 38 } }, "type": "Untyped", "kind": "OperEx", - "oper": "EXISTS3", + "oper": "STUTTER", "args": [ { "source": { - "filename": "TokenTransfer2", - "from": { - "line": 46, - "column": 5 - }, - "to": { - "line": 47, - "column": 46 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "to" - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 46, - "column": 39 - }, - "to": { - "line": 46, - "column": 46 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "ACCOUNTS" - }, - { - "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 46, - "column": 5 + "line": 62, + "column": 24 }, "to": { - "line": 47, - "column": 46 + "line": 62, + "column": 29 } }, "type": "Untyped", "kind": "OperEx", - "oper": "EXISTS3", + "oper": "OPER_APP", "args": [ { "source": { - "filename": "TokenTransfer2", + "filename": "TransactionCommit", "from": { - "line": 46, - "column": 5 + "line": 62, + "column": 24 }, "to": { - "line": 47, - "column": 46 + "line": 62, + "column": 29 } }, "type": "Untyped", "kind": "NameEx", - "name": "amount" - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 46, - "column": 60 - }, - "to": { - "line": 46, - "column": 62 - } - }, - "type": "Untyped", - "kind": "ValEx", - "value": { - "kind": "TlaNatSet" - } - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 47, - "column": 9 - }, - "to": { - "line": 47, - "column": 46 - } - }, - "type": "Untyped", - "kind": "OperEx", - "oper": "OPER_APP", - "args": [ - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 47, - "column": 9 - }, - "to": { - "line": 47, - "column": 46 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "LocalTransfer" - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 47, - "column": 23 - }, - "to": { - "line": 47, - "column": 27 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "chain" - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 47, - "column": 30 - }, - "to": { - "line": 47, - "column": 33 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "from" - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 47, - "column": 36 - }, - "to": { - "line": 47, - "column": 37 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "to" - }, - { - "source": { - "filename": "TokenTransfer2", - "from": { - "line": 47, - "column": 40 - }, - "to": { - "line": 47, - "column": 45 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "amount" - } - ] + "name": "TCNext" } ] + }, + { + "source": { + "filename": "TransactionCommit", + "from": { + "line": 62, + "column": 32 + }, + "to": { + "line": 62, + "column": 38 + } + }, + "type": "Untyped", + "kind": "NameEx", + "name": "rmState" } ] } @@ -2006,4 +2277,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/tla_specifications/TransactionCommit.tla b/tla_specifications/old/TransactionCommit.tla similarity index 100% rename from tla_specifications/TransactionCommit.tla rename to tla_specifications/old/TransactionCommit.tla diff --git a/tla_specifications/old/TwoPhaseCommit/TCommit.tla b/tla_specifications/old/TwoPhaseCommit/TCommit.tla new file mode 100644 index 0000000..a6c9351 --- /dev/null +++ b/tla_specifications/old/TwoPhaseCommit/TCommit.tla @@ -0,0 +1,83 @@ +\* This code originally comes from Leslie Lamport's video series +\* http://lamport.azurewebsites.net/video/videos.html +------------------------------ MODULE TCommit ------------------------------ +(***************************************************************************) +(* This specification is explained in "Transaction Commit", Lecture 5 of *) +(* the TLA+ Video Course. *) +(***************************************************************************) +CONSTANT RM \* The set of participating resource managers + +VARIABLE rmState \* rmState[rm] is the state of resource manager r. +----------------------------------------------------------------------------- +TCTypeOK == + (*************************************************************************) + (* The type-correctness invariant *) + (*************************************************************************) + rmState \in [RM -> {"working", "prepared", "committed", "aborted"}] + +TCInit == rmState = [r \in RM |-> "working"] + (*************************************************************************) + (* The initial predicate. *) + (*************************************************************************) + +canCommit == \A r \in RM : rmState[r] \in {"prepared", "committed"} + (*************************************************************************) + (* True iff all RMs are in the "prepared" or "committed" state. *) + (*************************************************************************) + +notCommitted == \A r \in RM : rmState[r] # "committed" + (*************************************************************************) + (* True iff no resource manager has decided to commit. *) + (*************************************************************************) +----------------------------------------------------------------------------- +(***************************************************************************) +(* We now define the actions that may be performed by the RMs, and then *) +(* define the complete next-state action of the specification to be the *) +(* disjunction of the possible RM actions. *) +(***************************************************************************) +Prepare(r) == /\ rmState[r] = "working" + /\ rmState' = [rmState EXCEPT ![r] = "prepared"] + +Decide(r) == \/ /\ rmState[r] = "prepared" + /\ canCommit + /\ rmState' = [rmState EXCEPT ![r] = "committed"] + \/ /\ rmState[r] \in {"working", "prepared"} + /\ notCommitted + /\ rmState' = [rmState EXCEPT ![r] = "aborted"] + +TCNext == \E r \in RM : Prepare(r) \/ Decide(r) + (*************************************************************************) + (* The next-state action. *) + (*************************************************************************) +----------------------------------------------------------------------------- +TCConsistent == + (*************************************************************************) + (* A state predicate asserting that two RMs have not arrived at *) + (* conflicting decisions. It is an invariant of the specification. *) + (*************************************************************************) + \A r1, r2 \in RM : ~ /\ rmState[r1] = "aborted" + /\ rmState[r2] = "committed" +----------------------------------------------------------------------------- +(***************************************************************************) +(* The following part of the spec is not discussed in Video Lecture 5. It *) +(* will be explained in Video Lecture 8. *) +(***************************************************************************) +TCSpec == TCInit /\ [][TCNext]_rmState + (*************************************************************************) + (* The complete specification of the protocol written as a temporal *) + (* formula. *) + (*************************************************************************) + +THEOREM TCSpec => [](TCTypeOK /\ TCConsistent) + (*************************************************************************) + (* This theorem asserts the truth of the temporal formula whose meaning *) + (* is that the state predicate TCTypeOK /\ TCInvariant is an invariant *) + (* of the specification TCSpec. Invariance of this conjunction is *) + (* equivalent to invariance of both of the formulas TCTypeOK and *) + (* TCConsistent. *) + (*************************************************************************) + +============================================================================= +\* Modification History +\* Last modified Thu Sep 14 22:04:45 EDT 2017 by jay1512 +\* Created Thu Sep 14 22:04:25 EDT 2017 by jay1512 diff --git a/tla_specifications/old/TwoPhaseCommit/TwoPhaseCommit.cfg b/tla_specifications/old/TwoPhaseCommit/TwoPhaseCommit.cfg new file mode 100644 index 0000000..6b7d70e --- /dev/null +++ b/tla_specifications/old/TwoPhaseCommit/TwoPhaseCommit.cfg @@ -0,0 +1,13 @@ +CONSTANT +RM = {"r1", "r2"} + +INVARIANTS +TPTypeOK + +PROPERTY + +INIT +TPInit + +NEXT +TPNext diff --git a/tla_specifications/old/TwoPhaseCommit/TwoPhaseCommit.tla b/tla_specifications/old/TwoPhaseCommit/TwoPhaseCommit.tla new file mode 100644 index 0000000..acf5cf4 --- /dev/null +++ b/tla_specifications/old/TwoPhaseCommit/TwoPhaseCommit.tla @@ -0,0 +1,176 @@ +---- MODULE TwoPhaseCommit---------------------------------------------------- +(***************************************************************************) +(* This specification is discussed in "Two-Phase Commit", Lecture 6 of the *) +(* TLA+ Video Course. It describes the Two-Phase Commit protocol, in *) +(* which a transaction manager (TM) coordinates the resource managers *) +(* (RMs) to implement the Transaction Commit specification of module *) +(* TCommit. In this specification, RMs spontaneously issue Prepared *) +(* messages. We ignore the Prepare messages that the TM can send to the *) +(* RMs. *) +(* *) +(* For simplicity, we also eliminate Abort messages sent by an RM when it *) +(* decides to abort. Such a message would cause the TM to abort the *) +(* transaction, an event represented here by the TM spontaneously deciding *) +(* to abort. *) +(***************************************************************************) +CONSTANT RM + +VARIABLES + rmState, + tmState, + tmPrepared, + msgs + (***********************************************************************) + (* In the protocol, processes communicate with one another by sending *) + (* messages. For simplicity, we represent message passing with the *) + (* variable msgs whose value is the set of all messages that have been *) + (* sent. A message is sent by adding it to the set msgs. An action *) + (* that, in an implementation, would be enabled by the receipt of a *) + (* certain message is here enabled by the presence of that message in *) + (* msgs. For simplicity, messages are never removed from msgs. This *) + (* allows a single message to be received by multiple receivers. *) + (* Receipt of the same message twice is therefore allowed; but in this *) + (* particular protocol, that's not a problem. *) + (***********************************************************************) + +Messages == + (*************************************************************************) + (* The set of all possible messages. Messages of type "Prepared" are *) + (* sent from the RM indicated by the message's rm field to the TM. *) + (* Messages of type "Commit" and "Abort" are broadcast by the TM, to be *) + (* received by all RMs. The set msgs contains just a single copy of *) + (* such a message. *) + (*************************************************************************) + [type : {"Prepared"}, rm : RM] \cup [type : {"Commit", "Abort"}] + +TPTypeOK == + (*************************************************************************) + (* The type-correctness invariant *) + (*************************************************************************) + /\ rmState \in [RM -> {"working", "prepared", "committed", "aborted"}] + /\ tmState \in {"init", "done"} + /\ tmPrepared \subseteq RM + /\ msgs \subseteq Messages + +TPInit == + (*************************************************************************) + (* The initial predicate. *) + (*************************************************************************) + /\ rmState = [r \in RM |-> "working"] + /\ tmState = "init" + /\ tmPrepared = {} + /\ msgs = {} +----------------------------------------------------------------------------- +(***************************************************************************) +(* We now define the actions that may be performed by the processes, first *) +(* the TM's actions, then the RMs' actions. *) +(***************************************************************************) +TMRcvPrepared(r) == + (*************************************************************************) + (* The TM receives a "Prepared" message from resource manager r. We *) + (* could add the additional enabling condition r \notin tmPrepared, *) + (* which disables the action if the TM has already received this *) + (* message. But there is no need, because in that case the action has *) + (* no effect; it leaves the state unchanged. *) + (*************************************************************************) + /\ tmState = "init" + /\ [type |-> "Prepared", rm |-> r] \in msgs + /\ tmPrepared' = tmPrepared \cup {r} + /\ UNCHANGED <> + +TMCommit == + (*************************************************************************) + (* The TM commits the transaction; enabled iff the TM is in its initial *) + (* state and every RM has sent a "Prepared" message. *) + (*************************************************************************) + /\ tmState = "init" + /\ tmPrepared = RM + /\ tmState' = "done" + /\ msgs' = msgs \cup {[type |-> "Commit"]} + /\ UNCHANGED <> + +TMAbort == + (*************************************************************************) + (* The TM spontaneously aborts the transaction. *) + (*************************************************************************) + /\ tmState = "init" + /\ tmState' = "done" + /\ msgs' = msgs \cup {[type |-> "Abort"]} + /\ UNCHANGED <> + +RMPrepare(r) == + (*************************************************************************) + (* Resource manager r prepares. *) + (*************************************************************************) + /\ rmState[r] = "working" + /\ rmState' = [rmState EXCEPT ![r] = "prepared"] + /\ msgs' = msgs \cup {[type |-> "Prepared", rm |-> r]} + /\ UNCHANGED <> + +RMChooseToAbort(r) == + (*************************************************************************) + (* Resource manager r spontaneously decides to abort. As noted above, r *) + (* does not send any message in our simplified spec. *) + (*************************************************************************) + /\ rmState[r] = "working" + /\ rmState' = [rmState EXCEPT ![r] = "aborted"] + /\ UNCHANGED <> + +RMRcvCommitMsg(r) == + (*************************************************************************) + (* Resource manager r is told by the TM to commit. *) + (*************************************************************************) + /\ [type |-> "Commit"] \in msgs + /\ rmState' = [rmState EXCEPT ![r] = "committed"] + /\ UNCHANGED <> + +RMRcvAbortMsg(r) == + (*************************************************************************) + (* Resource manager r is told by the TM to abort. *) + (*************************************************************************) + /\ [type |-> "Abort"] \in msgs + /\ rmState' = [rmState EXCEPT ![r] = "aborted"] + /\ UNCHANGED <> + +TPNext == + \/ TMCommit \/ TMAbort + \/ \E r \in RM : + TMRcvPrepared(r) \/ RMPrepare(r) \/ RMChooseToAbort(r) + \/ RMRcvCommitMsg(r) \/ RMRcvAbortMsg(r) +----------------------------------------------------------------------------- +(***************************************************************************) +(* The material below this point is not discussed in Video Lecture 6. It *) +(* will be explained in Video Lecture 8. *) +(***************************************************************************) + +TPSpec == TPInit /\ [][TPNext]_<> + (*************************************************************************) + (* The complete spec of the Two-Phase Commit protocol. *) + (*************************************************************************) + +THEOREM TPSpec => []TPTypeOK + (*************************************************************************) + (* This theorem asserts that the type-correctness predicate TPTypeOK is *) + (* an invariant of the specification. *) + (*************************************************************************) +----------------------------------------------------------------------------- +(***************************************************************************) +(* We now assert that the Two-Phase Commit protocol implements the *) +(* Transaction Commit protocol of module TCommit. The following statement *) +(* imports all the definitions from module TCommit into the current *) +(* module. *) +(***************************************************************************) +INSTANCE TCommit + +THEOREM TPSpec => TCSpec + (*************************************************************************) + (* This theorem asserts that the specification TPSpec of the Two-Phase *) + (* Commit protocol implements the specification TCSpec of the *) + (* Transaction Commit protocol. *) + (*************************************************************************) +(***************************************************************************) +(* The two theorems in this module have been checked with TLC for six *) +(* RMs, a configuration with 50816 reachable states, in a little over a *) +(* minute on a 1 GHz PC. *) +(***************************************************************************) +================================================================================ diff --git a/tla_specifications/old/TwoPhaseCommit/states.dot b/tla_specifications/old/TwoPhaseCommit/states.dot new file mode 100644 index 0000000..f3e6912 --- /dev/null +++ b/tla_specifications/old/TwoPhaseCommit/states.dot @@ -0,0 +1,223 @@ +strict digraph DiskGraph { +nodesep=0.35; +subgraph cluster_graph { +color="white"; +7874020032919045563 [label="/\\ msgs = {}\n/\\ rmState = [r1 |-> \"working\", r2 |-> \"working\"]\n/\\ tmState = \"init\"\n/\\ tmPrepared = {}",style = filled] +7874020032919045563 -> -8698169546048413126 [label="",color="black",fontcolor="black"]; +-8698169546048413126 [label="/\\ msgs = {[type |-> \"Abort\"]}\n/\\ rmState = [r1 |-> \"working\", r2 |-> \"working\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {}"]; +7874020032919045563 -> -7188886234662266909 [label="",color="black",fontcolor="black"]; +-7188886234662266909 [label="/\\ msgs = {[type |-> \"Prepared\", rm |-> \"r1\"]}\n/\\ rmState = [r1 |-> \"prepared\", r2 |-> \"working\"]\n/\\ tmState = \"init\"\n/\\ tmPrepared = {}"]; +7874020032919045563 -> -3956051273038780754 [label="",color="black",fontcolor="black"]; +-3956051273038780754 [label="/\\ msgs = {}\n/\\ rmState = [r1 |-> \"aborted\", r2 |-> \"working\"]\n/\\ tmState = \"init\"\n/\\ tmPrepared = {}"]; +7874020032919045563 -> -7534704057278587206 [label="",color="black",fontcolor="black"]; +-7534704057278587206 [label="/\\ msgs = {[type |-> \"Prepared\", rm |-> \"r2\"]}\n/\\ rmState = [r1 |-> \"working\", r2 |-> \"prepared\"]\n/\\ tmState = \"init\"\n/\\ tmPrepared = {}"]; +7874020032919045563 -> -3916034036636070853 [label="",color="black",fontcolor="black"]; +-3916034036636070853 [label="/\\ msgs = {}\n/\\ rmState = [r1 |-> \"working\", r2 |-> \"aborted\"]\n/\\ tmState = \"init\"\n/\\ tmPrepared = {}"]; +-8698169546048413126 -> 5864509549516116913 [label="",color="black",fontcolor="black"]; +5864509549516116913 [label="/\\ msgs = {[type |-> \"Abort\"], [type |-> \"Prepared\", rm |-> \"r1\"]}\n/\\ rmState = [r1 |-> \"prepared\", r2 |-> \"working\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {}"]; +-8698169546048413126 -> 2528365687178543407 [label="",color="black",fontcolor="black"]; +2528365687178543407 [label="/\\ msgs = {[type |-> \"Abort\"]}\n/\\ rmState = [r1 |-> \"aborted\", r2 |-> \"working\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {}"]; +-8698169546048413126 -> 2528365687178543407 [label="",color="black",fontcolor="black"]; +-8698169546048413126 -> 6500458735503071976 [label="",color="black",fontcolor="black"]; +6500458735503071976 [label="/\\ msgs = {[type |-> \"Abort\"], [type |-> \"Prepared\", rm |-> \"r2\"]}\n/\\ rmState = [r1 |-> \"working\", r2 |-> \"prepared\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {}"]; +-8698169546048413126 -> 2569502234990422970 [label="",color="black",fontcolor="black"]; +2569502234990422970 [label="/\\ msgs = {[type |-> \"Abort\"]}\n/\\ rmState = [r1 |-> \"working\", r2 |-> \"aborted\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {}"]; +-8698169546048413126 -> 2569502234990422970 [label="",color="black",fontcolor="black"]; +-7188886234662266909 -> 5864509549516116913 [label="",color="black",fontcolor="black"]; +-7188886234662266909 -> -7027200773262226656 [label="",color="black",fontcolor="black"]; +-7027200773262226656 [label="/\\ msgs = {[type |-> \"Prepared\", rm |-> \"r1\"]}\n/\\ rmState = [r1 |-> \"prepared\", r2 |-> \"working\"]\n/\\ tmState = \"init\"\n/\\ tmPrepared = {\"r1\"}"]; +-7188886234662266909 -> -7782353987749645977 [label="",color="black",fontcolor="black"]; +-7782353987749645977 [label="/\\ msgs = {[type |-> \"Prepared\", rm |-> \"r1\"], [type |-> \"Prepared\", rm |-> \"r2\"]}\n/\\ rmState = [r1 |-> \"prepared\", r2 |-> \"prepared\"]\n/\\ tmState = \"init\"\n/\\ tmPrepared = {}"]; +-7188886234662266909 -> 4096765224286576227 [label="",color="black",fontcolor="black"]; +4096765224286576227 [label="/\\ msgs = {[type |-> \"Prepared\", rm |-> \"r1\"]}\n/\\ rmState = [r1 |-> \"prepared\", r2 |-> \"aborted\"]\n/\\ tmState = \"init\"\n/\\ tmPrepared = {}"]; +-3956051273038780754 -> 2528365687178543407 [label="",color="black",fontcolor="black"]; +-3956051273038780754 -> -2004949214875501955 [label="",color="black",fontcolor="black"]; +-2004949214875501955 [label="/\\ msgs = {[type |-> \"Prepared\", rm |-> \"r2\"]}\n/\\ rmState = [r1 |-> \"aborted\", r2 |-> \"prepared\"]\n/\\ tmState = \"init\"\n/\\ tmPrepared = {}"]; +-3956051273038780754 -> 7924110040025165614 [label="",color="black",fontcolor="black"]; +7924110040025165614 [label="/\\ msgs = {}\n/\\ rmState = [r1 |-> \"aborted\", r2 |-> \"aborted\"]\n/\\ tmState = \"init\"\n/\\ tmPrepared = {}"]; +-7534704057278587206 -> 6500458735503071976 [label="",color="black",fontcolor="black"]; +-7534704057278587206 -> -7782353987749645977 [label="",color="black",fontcolor="black"]; +-7534704057278587206 -> -2004949214875501955 [label="",color="black",fontcolor="black"]; +-7534704057278587206 -> -4110840605195938910 [label="",color="black",fontcolor="black"]; +-4110840605195938910 [label="/\\ msgs = {[type |-> \"Prepared\", rm |-> \"r2\"]}\n/\\ rmState = [r1 |-> \"working\", r2 |-> \"prepared\"]\n/\\ tmState = \"init\"\n/\\ tmPrepared = {\"r2\"}"]; +-3916034036636070853 -> 2569502234990422970 [label="",color="black",fontcolor="black"]; +-3916034036636070853 -> 4096765224286576227 [label="",color="black",fontcolor="black"]; +-3916034036636070853 -> 7924110040025165614 [label="",color="black",fontcolor="black"]; +5864509549516116913 -> -211740210435451420 [label="",color="black",fontcolor="black"]; +-211740210435451420 [label="/\\ msgs = {[type |-> \"Abort\"], [type |-> \"Prepared\", rm |-> \"r1\"]}\n/\\ rmState = [r1 |-> \"aborted\", r2 |-> \"working\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {}"]; +5864509549516116913 -> 3706366211759909640 [label="",color="black",fontcolor="black"]; +3706366211759909640 [label="/\\ msgs = { [type |-> \"Abort\"],\n [type |-> \"Prepared\", rm |-> \"r1\"],\n [type |-> \"Prepared\", rm |-> \"r2\"] }\n/\\ rmState = [r1 |-> \"prepared\", r2 |-> \"prepared\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {}"]; +5864509549516116913 -> -755553501650642383 [label="",color="black",fontcolor="black"]; +-755553501650642383 [label="/\\ msgs = {[type |-> \"Abort\"], [type |-> \"Prepared\", rm |-> \"r1\"]}\n/\\ rmState = [r1 |-> \"prepared\", r2 |-> \"aborted\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {}"]; +5864509549516116913 -> -755553501650642383 [label="",color="black",fontcolor="black"]; +2528365687178543407 -> 2528365687178543407 [label="",color="black",fontcolor="black"]; +2528365687178543407 -> 2987543638204775983 [label="",color="black",fontcolor="black"]; +2987543638204775983 [label="/\\ msgs = {[type |-> \"Abort\"], [type |-> \"Prepared\", rm |-> \"r2\"]}\n/\\ rmState = [r1 |-> \"aborted\", r2 |-> \"prepared\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {}"]; +2528365687178543407 -> -8649198850385082193 [label="",color="black",fontcolor="black"]; +-8649198850385082193 [label="/\\ msgs = {[type |-> \"Abort\"]}\n/\\ rmState = [r1 |-> \"aborted\", r2 |-> \"aborted\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {}"]; +2528365687178543407 -> -8649198850385082193 [label="",color="black",fontcolor="black"]; +6500458735503071976 -> 3706366211759909640 [label="",color="black",fontcolor="black"]; +6500458735503071976 -> 2987543638204775983 [label="",color="black",fontcolor="black"]; +6500458735503071976 -> 2987543638204775983 [label="",color="black",fontcolor="black"]; +6500458735503071976 -> -1952815200352826650 [label="",color="black",fontcolor="black"]; +-1952815200352826650 [label="/\\ msgs = {[type |-> \"Abort\"], [type |-> \"Prepared\", rm |-> \"r2\"]}\n/\\ rmState = [r1 |-> \"working\", r2 |-> \"aborted\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {}"]; +2569502234990422970 -> -755553501650642383 [label="",color="black",fontcolor="black"]; +2569502234990422970 -> -8649198850385082193 [label="",color="black",fontcolor="black"]; +2569502234990422970 -> -8649198850385082193 [label="",color="black",fontcolor="black"]; +2569502234990422970 -> 2569502234990422970 [label="",color="black",fontcolor="black"]; +-7027200773262226656 -> 7565554828950564673 [label="",color="black",fontcolor="black"]; +7565554828950564673 [label="/\\ msgs = {[type |-> \"Abort\"], [type |-> \"Prepared\", rm |-> \"r1\"]}\n/\\ rmState = [r1 |-> \"prepared\", r2 |-> \"working\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {\"r1\"}"]; +-7027200773262226656 -> -7027200773262226656 [label="",color="black",fontcolor="black"]; +-7027200773262226656 -> 7403773559957481454 [label="",color="black",fontcolor="black"]; +7403773559957481454 [label="/\\ msgs = {[type |-> \"Prepared\", rm |-> \"r1\"], [type |-> \"Prepared\", rm |-> \"r2\"]}\n/\\ rmState = [r1 |-> \"prepared\", r2 |-> \"prepared\"]\n/\\ tmState = \"init\"\n/\\ tmPrepared = {\"r1\"}"]; +-7027200773262226656 -> 7837289527367030507 [label="",color="black",fontcolor="black"]; +7837289527367030507 [label="/\\ msgs = {[type |-> \"Prepared\", rm |-> \"r1\"]}\n/\\ rmState = [r1 |-> \"prepared\", r2 |-> \"aborted\"]\n/\\ tmState = \"init\"\n/\\ tmPrepared = {\"r1\"}"]; +-7782353987749645977 -> 3706366211759909640 [label="",color="black",fontcolor="black"]; +-7782353987749645977 -> 7403773559957481454 [label="",color="black",fontcolor="black"]; +-7782353987749645977 -> -3032423870890199359 [label="",color="black",fontcolor="black"]; +-3032423870890199359 [label="/\\ msgs = {[type |-> \"Prepared\", rm |-> \"r1\"], [type |-> \"Prepared\", rm |-> \"r2\"]}\n/\\ rmState = [r1 |-> \"prepared\", r2 |-> \"prepared\"]\n/\\ tmState = \"init\"\n/\\ tmPrepared = {\"r2\"}"]; +4096765224286576227 -> -755553501650642383 [label="",color="black",fontcolor="black"]; +4096765224286576227 -> 7837289527367030507 [label="",color="black",fontcolor="black"]; +-2004949214875501955 -> 2987543638204775983 [label="",color="black",fontcolor="black"]; +-2004949214875501955 -> 8967122241408577862 [label="",color="black",fontcolor="black"]; +8967122241408577862 [label="/\\ msgs = {[type |-> \"Prepared\", rm |-> \"r2\"]}\n/\\ rmState = [r1 |-> \"aborted\", r2 |-> \"prepared\"]\n/\\ tmState = \"init\"\n/\\ tmPrepared = {\"r2\"}"]; +7924110040025165614 -> -8649198850385082193 [label="",color="black",fontcolor="black"]; +-4110840605195938910 -> 3492332704262223811 [label="",color="black",fontcolor="black"]; +3492332704262223811 [label="/\\ msgs = {[type |-> \"Abort\"], [type |-> \"Prepared\", rm |-> \"r2\"]}\n/\\ rmState = [r1 |-> \"working\", r2 |-> \"prepared\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {\"r2\"}"]; +-4110840605195938910 -> -3032423870890199359 [label="",color="black",fontcolor="black"]; +-4110840605195938910 -> 8967122241408577862 [label="",color="black",fontcolor="black"]; +-4110840605195938910 -> -4110840605195938910 [label="",color="black",fontcolor="black"]; +-211740210435451420 -> -211740210435451420 [label="",color="black",fontcolor="black"]; +-211740210435451420 -> -4214264680366874788 [label="",color="black",fontcolor="black"]; +-4214264680366874788 [label="/\\ msgs = { [type |-> \"Abort\"],\n [type |-> \"Prepared\", rm |-> \"r1\"],\n [type |-> \"Prepared\", rm |-> \"r2\"] }\n/\\ rmState = [r1 |-> \"aborted\", r2 |-> \"prepared\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {}"]; +-211740210435451420 -> 6480379887194528868 [label="",color="black",fontcolor="black"]; +6480379887194528868 [label="/\\ msgs = {[type |-> \"Abort\"], [type |-> \"Prepared\", rm |-> \"r1\"]}\n/\\ rmState = [r1 |-> \"aborted\", r2 |-> \"aborted\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {}"]; +-211740210435451420 -> 6480379887194528868 [label="",color="black",fontcolor="black"]; +3706366211759909640 -> -4214264680366874788 [label="",color="black",fontcolor="black"]; +3706366211759909640 -> 4281244082456948642 [label="",color="black",fontcolor="black"]; +4281244082456948642 [label="/\\ msgs = { [type |-> \"Abort\"],\n [type |-> \"Prepared\", rm |-> \"r1\"],\n [type |-> \"Prepared\", rm |-> \"r2\"] }\n/\\ rmState = [r1 |-> \"prepared\", r2 |-> \"aborted\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {}"]; +-755553501650642383 -> 6480379887194528868 [label="",color="black",fontcolor="black"]; +-755553501650642383 -> -755553501650642383 [label="",color="black",fontcolor="black"]; +2987543638204775983 -> 2987543638204775983 [label="",color="black",fontcolor="black"]; +2987543638204775983 -> 4663863584781314547 [label="",color="black",fontcolor="black"]; +4663863584781314547 [label="/\\ msgs = {[type |-> \"Abort\"], [type |-> \"Prepared\", rm |-> \"r2\"]}\n/\\ rmState = [r1 |-> \"aborted\", r2 |-> \"aborted\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {}"]; +-8649198850385082193 -> -8649198850385082193 [label="",color="black",fontcolor="black"]; +-8649198850385082193 -> -8649198850385082193 [label="",color="black",fontcolor="black"]; +-1952815200352826650 -> 4281244082456948642 [label="",color="black",fontcolor="black"]; +-1952815200352826650 -> 4663863584781314547 [label="",color="black",fontcolor="black"]; +-1952815200352826650 -> 4663863584781314547 [label="",color="black",fontcolor="black"]; +-1952815200352826650 -> -1952815200352826650 [label="",color="black",fontcolor="black"]; +7565554828950564673 -> -1472525471783742357 [label="",color="black",fontcolor="black"]; +-1472525471783742357 [label="/\\ msgs = {[type |-> \"Abort\"], [type |-> \"Prepared\", rm |-> \"r1\"]}\n/\\ rmState = [r1 |-> \"aborted\", r2 |-> \"working\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {\"r1\"}"]; +7565554828950564673 -> -5637694536440205059 [label="",color="black",fontcolor="black"]; +-5637694536440205059 [label="/\\ msgs = { [type |-> \"Abort\"],\n [type |-> \"Prepared\", rm |-> \"r1\"],\n [type |-> \"Prepared\", rm |-> \"r2\"] }\n/\\ rmState = [r1 |-> \"prepared\", r2 |-> \"prepared\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {\"r1\"}"]; +7565554828950564673 -> -7329683823294811510 [label="",color="black",fontcolor="black"]; +-7329683823294811510 [label="/\\ msgs = {[type |-> \"Abort\"], [type |-> \"Prepared\", rm |-> \"r1\"]}\n/\\ rmState = [r1 |-> \"prepared\", r2 |-> \"aborted\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {\"r1\"}"]; +7565554828950564673 -> -7329683823294811510 [label="",color="black",fontcolor="black"]; +7403773559957481454 -> -5637694536440205059 [label="",color="black",fontcolor="black"]; +7403773559957481454 -> 7403773559957481454 [label="",color="black",fontcolor="black"]; +7403773559957481454 -> -994395611828435698 [label="",color="black",fontcolor="black"]; +-994395611828435698 [label="/\\ msgs = {[type |-> \"Prepared\", rm |-> \"r1\"], [type |-> \"Prepared\", rm |-> \"r2\"]}\n/\\ rmState = [r1 |-> \"prepared\", r2 |-> \"prepared\"]\n/\\ tmState = \"init\"\n/\\ tmPrepared = {\"r1\", \"r2\"}"]; +7837289527367030507 -> -7329683823294811510 [label="",color="black",fontcolor="black"]; +7837289527367030507 -> 7837289527367030507 [label="",color="black",fontcolor="black"]; +-3032423870890199359 -> 186676104131469778 [label="",color="black",fontcolor="black"]; +186676104131469778 [label="/\\ msgs = { [type |-> \"Abort\"],\n [type |-> \"Prepared\", rm |-> \"r1\"],\n [type |-> \"Prepared\", rm |-> \"r2\"] }\n/\\ rmState = [r1 |-> \"prepared\", r2 |-> \"prepared\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {\"r2\"}"]; +-3032423870890199359 -> -994395611828435698 [label="",color="black",fontcolor="black"]; +-3032423870890199359 -> -3032423870890199359 [label="",color="black",fontcolor="black"]; +8967122241408577862 -> -8433693973643160281 [label="",color="black",fontcolor="black"]; +-8433693973643160281 [label="/\\ msgs = {[type |-> \"Abort\"], [type |-> \"Prepared\", rm |-> \"r2\"]}\n/\\ rmState = [r1 |-> \"aborted\", r2 |-> \"prepared\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {\"r2\"}"]; +8967122241408577862 -> 8967122241408577862 [label="",color="black",fontcolor="black"]; +3492332704262223811 -> 186676104131469778 [label="",color="black",fontcolor="black"]; +3492332704262223811 -> -8433693973643160281 [label="",color="black",fontcolor="black"]; +3492332704262223811 -> -8433693973643160281 [label="",color="black",fontcolor="black"]; +3492332704262223811 -> -6170171625877229058 [label="",color="black",fontcolor="black"]; +-6170171625877229058 [label="/\\ msgs = {[type |-> \"Abort\"], [type |-> \"Prepared\", rm |-> \"r2\"]}\n/\\ rmState = [r1 |-> \"working\", r2 |-> \"aborted\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {\"r2\"}"]; +-4214264680366874788 -> -4214264680366874788 [label="",color="black",fontcolor="black"]; +-4214264680366874788 -> -7507051944255437576 [label="",color="black",fontcolor="black"]; +-7507051944255437576 [label="/\\ msgs = { [type |-> \"Abort\"],\n [type |-> \"Prepared\", rm |-> \"r1\"],\n [type |-> \"Prepared\", rm |-> \"r2\"] }\n/\\ rmState = [r1 |-> \"aborted\", r2 |-> \"aborted\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {}"]; +6480379887194528868 -> 6480379887194528868 [label="",color="black",fontcolor="black"]; +6480379887194528868 -> 6480379887194528868 [label="",color="black",fontcolor="black"]; +4281244082456948642 -> -7507051944255437576 [label="",color="black",fontcolor="black"]; +4281244082456948642 -> 4281244082456948642 [label="",color="black",fontcolor="black"]; +4663863584781314547 -> 4663863584781314547 [label="",color="black",fontcolor="black"]; +4663863584781314547 -> 4663863584781314547 [label="",color="black",fontcolor="black"]; +-1472525471783742357 -> -1472525471783742357 [label="",color="black",fontcolor="black"]; +-1472525471783742357 -> 1029269111951428636 [label="",color="black",fontcolor="black"]; +1029269111951428636 [label="/\\ msgs = { [type |-> \"Abort\"],\n [type |-> \"Prepared\", rm |-> \"r1\"],\n [type |-> \"Prepared\", rm |-> \"r2\"] }\n/\\ rmState = [r1 |-> \"aborted\", r2 |-> \"prepared\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {\"r1\"}"]; +-1472525471783742357 -> 1813106284897929632 [label="",color="black",fontcolor="black"]; +1813106284897929632 [label="/\\ msgs = {[type |-> \"Abort\"], [type |-> \"Prepared\", rm |-> \"r1\"]}\n/\\ rmState = [r1 |-> \"aborted\", r2 |-> \"aborted\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {\"r1\"}"]; +-1472525471783742357 -> 1813106284897929632 [label="",color="black",fontcolor="black"]; +-5637694536440205059 -> 1029269111951428636 [label="",color="black",fontcolor="black"]; +-5637694536440205059 -> 7524954574781098049 [label="",color="black",fontcolor="black"]; +7524954574781098049 [label="/\\ msgs = { [type |-> \"Abort\"],\n [type |-> \"Prepared\", rm |-> \"r1\"],\n [type |-> \"Prepared\", rm |-> \"r2\"] }\n/\\ rmState = [r1 |-> \"prepared\", r2 |-> \"aborted\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {\"r1\"}"]; +-7329683823294811510 -> 1813106284897929632 [label="",color="black",fontcolor="black"]; +-7329683823294811510 -> -7329683823294811510 [label="",color="black",fontcolor="black"]; +-994395611828435698 -> 7085003091732402826 [label="",color="black",fontcolor="black"]; +7085003091732402826 [label="/\\ msgs = { [type |-> \"Commit\"],\n [type |-> \"Prepared\", rm |-> \"r1\"],\n [type |-> \"Prepared\", rm |-> \"r2\"] }\n/\\ rmState = [r1 |-> \"prepared\", r2 |-> \"prepared\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {\"r1\", \"r2\"}"]; +-994395611828435698 -> 3080036412988806550 [label="",color="black",fontcolor="black"]; +3080036412988806550 [label="/\\ msgs = { [type |-> \"Abort\"],\n [type |-> \"Prepared\", rm |-> \"r1\"],\n [type |-> \"Prepared\", rm |-> \"r2\"] }\n/\\ rmState = [r1 |-> \"prepared\", r2 |-> \"prepared\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {\"r1\", \"r2\"}"]; +-994395611828435698 -> -994395611828435698 [label="",color="black",fontcolor="black"]; +-994395611828435698 -> -994395611828435698 [label="",color="black",fontcolor="black"]; +186676104131469778 -> -4819585452455961293 [label="",color="black",fontcolor="black"]; +-4819585452455961293 [label="/\\ msgs = { [type |-> \"Abort\"],\n [type |-> \"Prepared\", rm |-> \"r1\"],\n [type |-> \"Prepared\", rm |-> \"r2\"] }\n/\\ rmState = [r1 |-> \"aborted\", r2 |-> \"prepared\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {\"r2\"}"]; +186676104131469778 -> -2649290806743369362 [label="",color="black",fontcolor="black"]; +-2649290806743369362 [label="/\\ msgs = { [type |-> \"Abort\"],\n [type |-> \"Prepared\", rm |-> \"r1\"],\n [type |-> \"Prepared\", rm |-> \"r2\"] }\n/\\ rmState = [r1 |-> \"prepared\", r2 |-> \"aborted\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {\"r2\"}"]; +-8433693973643160281 -> -8433693973643160281 [label="",color="black",fontcolor="black"]; +-8433693973643160281 -> -6756367780411680206 [label="",color="black",fontcolor="black"]; +-6756367780411680206 [label="/\\ msgs = {[type |-> \"Abort\"], [type |-> \"Prepared\", rm |-> \"r2\"]}\n/\\ rmState = [r1 |-> \"aborted\", r2 |-> \"aborted\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {\"r2\"}"]; +-6170171625877229058 -> -2649290806743369362 [label="",color="black",fontcolor="black"]; +-6170171625877229058 -> -6756367780411680206 [label="",color="black",fontcolor="black"]; +-6170171625877229058 -> -6756367780411680206 [label="",color="black",fontcolor="black"]; +-6170171625877229058 -> -6170171625877229058 [label="",color="black",fontcolor="black"]; +-7507051944255437576 -> -7507051944255437576 [label="",color="black",fontcolor="black"]; +-7507051944255437576 -> -7507051944255437576 [label="",color="black",fontcolor="black"]; +1029269111951428636 -> 1029269111951428636 [label="",color="black",fontcolor="black"]; +1029269111951428636 -> 1417684027827081254 [label="",color="black",fontcolor="black"]; +1417684027827081254 [label="/\\ msgs = { [type |-> \"Abort\"],\n [type |-> \"Prepared\", rm |-> \"r1\"],\n [type |-> \"Prepared\", rm |-> \"r2\"] }\n/\\ rmState = [r1 |-> \"aborted\", r2 |-> \"aborted\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {\"r1\"}"]; +1813106284897929632 -> 1813106284897929632 [label="",color="black",fontcolor="black"]; +1813106284897929632 -> 1813106284897929632 [label="",color="black",fontcolor="black"]; +7524954574781098049 -> 1417684027827081254 [label="",color="black",fontcolor="black"]; +7524954574781098049 -> 7524954574781098049 [label="",color="black",fontcolor="black"]; +7085003091732402826 -> -8662634262231965091 [label="",color="black",fontcolor="black"]; +-8662634262231965091 [label="/\\ msgs = { [type |-> \"Commit\"],\n [type |-> \"Prepared\", rm |-> \"r1\"],\n [type |-> \"Prepared\", rm |-> \"r2\"] }\n/\\ rmState = [r1 |-> \"committed\", r2 |-> \"prepared\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {\"r1\", \"r2\"}"]; +7085003091732402826 -> 2641273521331073715 [label="",color="black",fontcolor="black"]; +2641273521331073715 [label="/\\ msgs = { [type |-> \"Commit\"],\n [type |-> \"Prepared\", rm |-> \"r1\"],\n [type |-> \"Prepared\", rm |-> \"r2\"] }\n/\\ rmState = [r1 |-> \"prepared\", r2 |-> \"committed\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {\"r1\", \"r2\"}"]; +3080036412988806550 -> -2832168646120870194 [label="",color="black",fontcolor="black"]; +-2832168646120870194 [label="/\\ msgs = { [type |-> \"Abort\"],\n [type |-> \"Prepared\", rm |-> \"r1\"],\n [type |-> \"Prepared\", rm |-> \"r2\"] }\n/\\ rmState = [r1 |-> \"aborted\", r2 |-> \"prepared\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {\"r1\", \"r2\"}"]; +3080036412988806550 -> -2757031198378880297 [label="",color="black",fontcolor="black"]; +-2757031198378880297 [label="/\\ msgs = { [type |-> \"Abort\"],\n [type |-> \"Prepared\", rm |-> \"r1\"],\n [type |-> \"Prepared\", rm |-> \"r2\"] }\n/\\ rmState = [r1 |-> \"prepared\", r2 |-> \"aborted\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {\"r1\", \"r2\"}"]; +-4819585452455961293 -> -4819585452455961293 [label="",color="black",fontcolor="black"]; +-4819585452455961293 -> -6847311734412312311 [label="",color="black",fontcolor="black"]; +-6847311734412312311 [label="/\\ msgs = { [type |-> \"Abort\"],\n [type |-> \"Prepared\", rm |-> \"r1\"],\n [type |-> \"Prepared\", rm |-> \"r2\"] }\n/\\ rmState = [r1 |-> \"aborted\", r2 |-> \"aborted\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {\"r2\"}"]; +-2649290806743369362 -> -6847311734412312311 [label="",color="black",fontcolor="black"]; +-2649290806743369362 -> -2649290806743369362 [label="",color="black",fontcolor="black"]; +-6756367780411680206 -> -6756367780411680206 [label="",color="black",fontcolor="black"]; +-6756367780411680206 -> -6756367780411680206 [label="",color="black",fontcolor="black"]; +1417684027827081254 -> 1417684027827081254 [label="",color="black",fontcolor="black"]; +1417684027827081254 -> 1417684027827081254 [label="",color="black",fontcolor="black"]; +-8662634262231965091 -> -8662634262231965091 [label="",color="black",fontcolor="black"]; +-8662634262231965091 -> -3746838357429135120 [label="",color="black",fontcolor="black"]; +-3746838357429135120 [label="/\\ msgs = { [type |-> \"Commit\"],\n [type |-> \"Prepared\", rm |-> \"r1\"],\n [type |-> \"Prepared\", rm |-> \"r2\"] }\n/\\ rmState = [r1 |-> \"committed\", r2 |-> \"committed\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {\"r1\", \"r2\"}"]; +2641273521331073715 -> -3746838357429135120 [label="",color="black",fontcolor="black"]; +2641273521331073715 -> 2641273521331073715 [label="",color="black",fontcolor="black"]; +-2832168646120870194 -> -2832168646120870194 [label="",color="black",fontcolor="black"]; +-2832168646120870194 -> -657319676234508207 [label="",color="black",fontcolor="black"]; +-657319676234508207 [label="/\\ msgs = { [type |-> \"Abort\"],\n [type |-> \"Prepared\", rm |-> \"r1\"],\n [type |-> \"Prepared\", rm |-> \"r2\"] }\n/\\ rmState = [r1 |-> \"aborted\", r2 |-> \"aborted\"]\n/\\ tmState = \"done\"\n/\\ tmPrepared = {\"r1\", \"r2\"}"]; +-2757031198378880297 -> -657319676234508207 [label="",color="black",fontcolor="black"]; +-2757031198378880297 -> -2757031198378880297 [label="",color="black",fontcolor="black"]; +-6847311734412312311 -> -6847311734412312311 [label="",color="black",fontcolor="black"]; +-6847311734412312311 -> -6847311734412312311 [label="",color="black",fontcolor="black"]; +-3746838357429135120 -> -3746838357429135120 [label="",color="black",fontcolor="black"]; +-3746838357429135120 -> -3746838357429135120 [label="",color="black",fontcolor="black"]; +-657319676234508207 -> -657319676234508207 [label="",color="black",fontcolor="black"]; +-657319676234508207 -> -657319676234508207 [label="",color="black",fontcolor="black"]; +{rank = same; 7874020032919045563;} +{rank = same; -3916034036636070853;-7188886234662266909;-7534704057278587206;-8698169546048413126;-3956051273038780754;} +{rank = same; -7027200773262226656;7924110040025165614;2569502234990422970;5864509549516116913;-4110840605195938910;6500458735503071976;-7782353987749645977;2528365687178543407;4096765224286576227;-2004949214875501955;} +{rank = same; 7565554828950564673;7403773559957481454;-8649198850385082193;3492332704262223811;8967122241408577862;-1952815200352826650;-211740210435451420;-3032423870890199359;-755553501650642383;2987543638204775983;3706366211759909640;7837289527367030507;} +{rank = same; 4281244082456948642;-1472525471783742357;-8433693973643160281;6480379887194528868;-4214264680366874788;4663863584781314547;186676104131469778;-994395611828435698;-5637694536440205059;-7329683823294811510;-6170171625877229058;} +{rank = same; -7507051944255437576;3080036412988806550;-2649290806743369362;-4819585452455961293;1813106284897929632;-6756367780411680206;7524954574781098049;1029269111951428636;7085003091732402826;} +{rank = same; -8662634262231965091;-2832168646120870194;-2757031198378880297;1417684027827081254;2641273521331073715;-6847311734412312311;} +{rank = same; -657319676234508207;-3746838357429135120;} +} +} \ No newline at end of file diff --git a/tla_specifications/old/TwoPhaseCommit/states.png b/tla_specifications/old/TwoPhaseCommit/states.png new file mode 100644 index 0000000..4596d8e Binary files /dev/null and b/tla_specifications/old/TwoPhaseCommit/states.png differ diff --git a/tla_specifications/old/die_hard.cfg b/tla_specifications/old/die_hard.cfg new file mode 100644 index 0000000..0b5895a --- /dev/null +++ b/tla_specifications/old/die_hard.cfg @@ -0,0 +1,12 @@ +CONSTANT + +INVARIANTS +TypeOK + +PROPERTY + +INIT +Init + +NEXT +Next diff --git a/tla_specifications/die_hard.tla b/tla_specifications/old/die_hard.tla similarity index 100% rename from tla_specifications/die_hard.tla rename to tla_specifications/old/die_hard.tla diff --git a/tla_specifications/ewd998/ATD.cfg b/tla_specifications/old/ewd998/ATD.cfg similarity index 100% rename from tla_specifications/ewd998/ATD.cfg rename to tla_specifications/old/ewd998/ATD.cfg diff --git a/tla_specifications/ewd998/AsyncTerminationDetection.tla b/tla_specifications/old/ewd998/AsyncTerminationDetection.tla similarity index 100% rename from tla_specifications/ewd998/AsyncTerminationDetection.tla rename to tla_specifications/old/ewd998/AsyncTerminationDetection.tla diff --git a/tla_specifications/ewd998/EWD998.json b/tla_specifications/old/ewd998/EWD998.json similarity index 100% rename from tla_specifications/ewd998/EWD998.json rename to tla_specifications/old/ewd998/EWD998.json diff --git a/tla_specifications/ewd998/EWD998.tla b/tla_specifications/old/ewd998/EWD998.tla similarity index 100% rename from tla_specifications/ewd998/EWD998.tla rename to tla_specifications/old/ewd998/EWD998.tla diff --git a/tla_specifications/ewd998/Functions.tla b/tla_specifications/old/ewd998/Functions.tla similarity index 100% rename from tla_specifications/ewd998/Functions.tla rename to tla_specifications/old/ewd998/Functions.tla diff --git a/tla_specifications/ewd998/MC4_EWD998.cfg b/tla_specifications/old/ewd998/MC4_EWD998.cfg similarity index 100% rename from tla_specifications/ewd998/MC4_EWD998.cfg rename to tla_specifications/old/ewd998/MC4_EWD998.cfg diff --git a/tla_specifications/ewd998/README.md b/tla_specifications/old/ewd998/README.md similarity index 100% rename from tla_specifications/ewd998/README.md rename to tla_specifications/old/ewd998/README.md diff --git a/tla_specifications/ewd998/SequencesExt.tla b/tla_specifications/old/ewd998/SequencesExt.tla similarity index 100% rename from tla_specifications/ewd998/SequencesExt.tla rename to tla_specifications/old/ewd998/SequencesExt.tla diff --git a/tla_specifications/states.dot b/tla_specifications/states.dot deleted file mode 100644 index 3bd5ffe..0000000 --- a/tla_specifications/states.dot +++ /dev/null @@ -1,126 +0,0 @@ -strict digraph DiskGraph { -nodesep=0.35; -subgraph cluster_graph { -color="white"; --5484804798014709476 [label="/\\ jarro_pequeno = 0\n/\\ jarro_grande = 0",style = filled] --5484804798014709476 -> -6903141547663845486 [label="",color="black",fontcolor="black"]; --6903141547663845486 [label="/\\ jarro_pequeno = 3\n/\\ jarro_grande = 0"]; --5484804798014709476 -> -3139966685307173636 [label="",color="black",fontcolor="black"]; --3139966685307173636 [label="/\\ jarro_pequeno = 0\n/\\ jarro_grande = 5"]; --5484804798014709476 -> -5484804798014709476 [label="",color="black",fontcolor="black"]; --5484804798014709476 -> -5484804798014709476 [label="",color="black",fontcolor="black"]; --5484804798014709476 -> -5484804798014709476 [label="",color="black",fontcolor="black"]; --5484804798014709476 -> -5484804798014709476 [label="",color="black",fontcolor="black"]; --6903141547663845486 -> -6903141547663845486 [label="",color="black",fontcolor="black"]; --6903141547663845486 -> -4053931664713403790 [label="",color="black",fontcolor="black"]; --4053931664713403790 [label="/\\ jarro_pequeno = 3\n/\\ jarro_grande = 5"]; --6903141547663845486 -> -5484804798014709476 [label="",color="black",fontcolor="black"]; --6903141547663845486 -> -6903141547663845486 [label="",color="black",fontcolor="black"]; --6903141547663845486 -> 5458270148537692363 [label="",color="black",fontcolor="black"]; -5458270148537692363 [label="/\\ jarro_pequeno = 0\n/\\ jarro_grande = 3"]; --6903141547663845486 -> -6903141547663845486 [label="",color="black",fontcolor="black"]; --3139966685307173636 -> -4053931664713403790 [label="",color="black",fontcolor="black"]; --3139966685307173636 -> -3139966685307173636 [label="",color="black",fontcolor="black"]; --3139966685307173636 -> -3139966685307173636 [label="",color="black",fontcolor="black"]; --3139966685307173636 -> -5484804798014709476 [label="",color="black",fontcolor="black"]; --3139966685307173636 -> -3139966685307173636 [label="",color="black",fontcolor="black"]; --3139966685307173636 -> -3063024226093955969 [label="",color="black",fontcolor="black"]; --3063024226093955969 [label="/\\ jarro_pequeno = 3\n/\\ jarro_grande = 2"]; --4053931664713403790 -> -4053931664713403790 [label="",color="black",fontcolor="black"]; --4053931664713403790 -> -4053931664713403790 [label="",color="black",fontcolor="black"]; --4053931664713403790 -> -3139966685307173636 [label="",color="black",fontcolor="black"]; --4053931664713403790 -> -6903141547663845486 [label="",color="black",fontcolor="black"]; --4053931664713403790 -> -4053931664713403790 [label="",color="black",fontcolor="black"]; --4053931664713403790 -> -4053931664713403790 [label="",color="black",fontcolor="black"]; -5458270148537692363 -> 6372234522398623301 [label="",color="black",fontcolor="black"]; -6372234522398623301 [label="/\\ jarro_pequeno = 3\n/\\ jarro_grande = 3"]; -5458270148537692363 -> -3139966685307173636 [label="",color="black",fontcolor="black"]; -5458270148537692363 -> 5458270148537692363 [label="",color="black",fontcolor="black"]; -5458270148537692363 -> -5484804798014709476 [label="",color="black",fontcolor="black"]; -5458270148537692363 -> 5458270148537692363 [label="",color="black",fontcolor="black"]; -5458270148537692363 -> -6903141547663845486 [label="",color="black",fontcolor="black"]; --3063024226093955969 -> -3063024226093955969 [label="",color="black",fontcolor="black"]; --3063024226093955969 -> -4053931664713403790 [label="",color="black",fontcolor="black"]; --3063024226093955969 -> -4130678271262510351 [label="",color="black",fontcolor="black"]; --4130678271262510351 [label="/\\ jarro_pequeno = 0\n/\\ jarro_grande = 2"]; --3063024226093955969 -> -6903141547663845486 [label="",color="black",fontcolor="black"]; --3063024226093955969 -> -3139966685307173636 [label="",color="black",fontcolor="black"]; --3063024226093955969 -> -3063024226093955969 [label="",color="black",fontcolor="black"]; -6372234522398623301 -> 6372234522398623301 [label="",color="black",fontcolor="black"]; -6372234522398623301 -> -4053931664713403790 [label="",color="black",fontcolor="black"]; -6372234522398623301 -> 5458270148537692363 [label="",color="black",fontcolor="black"]; -6372234522398623301 -> -6903141547663845486 [label="",color="black",fontcolor="black"]; -6372234522398623301 -> -2676148449289922938 [label="",color="black",fontcolor="black"]; --2676148449289922938 [label="/\\ jarro_pequeno = 1\n/\\ jarro_grande = 5"]; -6372234522398623301 -> 6372234522398623301 [label="",color="black",fontcolor="black"]; --4130678271262510351 -> -3063024226093955969 [label="",color="black",fontcolor="black"]; --4130678271262510351 -> -3139966685307173636 [label="",color="black",fontcolor="black"]; --4130678271262510351 -> -4130678271262510351 [label="",color="black",fontcolor="black"]; --4130678271262510351 -> -5484804798014709476 [label="",color="black",fontcolor="black"]; --4130678271262510351 -> -4130678271262510351 [label="",color="black",fontcolor="black"]; --4130678271262510351 -> -5871589370185021976 [label="",color="black",fontcolor="black"]; --5871589370185021976 [label="/\\ jarro_pequeno = 2\n/\\ jarro_grande = 0"]; --2676148449289922938 -> -4053931664713403790 [label="",color="black",fontcolor="black"]; --2676148449289922938 -> -2676148449289922938 [label="",color="black",fontcolor="black"]; --2676148449289922938 -> -3139966685307173636 [label="",color="black",fontcolor="black"]; --2676148449289922938 -> -4804497626813582490 [label="",color="black",fontcolor="black"]; --4804497626813582490 [label="/\\ jarro_pequeno = 1\n/\\ jarro_grande = 0"]; --2676148449289922938 -> -2676148449289922938 [label="",color="black",fontcolor="black"]; --2676148449289922938 -> 6372234522398623301 [label="",color="black",fontcolor="black"]; --5871589370185021976 -> -6903141547663845486 [label="",color="black",fontcolor="black"]; --5871589370185021976 -> -3959372824750809080 [label="",color="black",fontcolor="black"]; --3959372824750809080 [label="/\\ jarro_pequeno = 2\n/\\ jarro_grande = 5"]; --5871589370185021976 -> -5484804798014709476 [label="",color="black",fontcolor="black"]; --5871589370185021976 -> -5871589370185021976 [label="",color="black",fontcolor="black"]; --5871589370185021976 -> -4130678271262510351 [label="",color="black",fontcolor="black"]; --5871589370185021976 -> -5871589370185021976 [label="",color="black",fontcolor="black"]; --4804497626813582490 -> -6903141547663845486 [label="",color="black",fontcolor="black"]; --4804497626813582490 -> -2676148449289922938 [label="",color="black",fontcolor="black"]; --4804497626813582490 -> -5484804798014709476 [label="",color="black",fontcolor="black"]; --4804497626813582490 -> -4804497626813582490 [label="",color="black",fontcolor="black"]; --4804497626813582490 -> 4535482304481829670 [label="",color="black",fontcolor="black"]; -4535482304481829670 [label="/\\ jarro_pequeno = 0\n/\\ jarro_grande = 1"]; --4804497626813582490 -> -4804497626813582490 [label="",color="black",fontcolor="black"]; --3959372824750809080 -> -4053931664713403790 [label="",color="black",fontcolor="black"]; --3959372824750809080 -> -3959372824750809080 [label="",color="black",fontcolor="black"]; --3959372824750809080 -> -3139966685307173636 [label="",color="black",fontcolor="black"]; --3959372824750809080 -> -5871589370185021976 [label="",color="black",fontcolor="black"]; --3959372824750809080 -> -3959372824750809080 [label="",color="black",fontcolor="black"]; --3959372824750809080 -> 5381450370688004168 [label="",color="black",fontcolor="black"]; -5381450370688004168 [label="/\\ jarro_pequeno = 3\n/\\ jarro_grande = 4"]; -4535482304481829670 -> 3251695063285994920 [label="",color="black",fontcolor="black"]; -3251695063285994920 [label="/\\ jarro_pequeno = 3\n/\\ jarro_grande = 1"]; -4535482304481829670 -> -3139966685307173636 [label="",color="black",fontcolor="black"]; -4535482304481829670 -> 4535482304481829670 [label="",color="black",fontcolor="black"]; -4535482304481829670 -> -5484804798014709476 [label="",color="black",fontcolor="black"]; -4535482304481829670 -> 4535482304481829670 [label="",color="black",fontcolor="black"]; -4535482304481829670 -> -4804497626813582490 [label="",color="black",fontcolor="black"]; -5381450370688004168 -> 5381450370688004168 [label="",color="black",fontcolor="black"]; -5381450370688004168 -> -4053931664713403790 [label="",color="black",fontcolor="black"]; -5381450370688004168 -> 6449105013082457798 [label="",color="black",fontcolor="black"]; -6449105013082457798 [label="/\\ jarro_pequeno = 0\n/\\ jarro_grande = 4"]; -5381450370688004168 -> -6903141547663845486 [label="",color="black",fontcolor="black"]; -5381450370688004168 -> -3959372824750809080 [label="",color="black",fontcolor="black"]; -5381450370688004168 -> 5381450370688004168 [label="",color="black",fontcolor="black"]; -3251695063285994920 -> 3251695063285994920 [label="",color="black",fontcolor="black"]; -3251695063285994920 -> -4053931664713403790 [label="",color="black",fontcolor="black"]; -3251695063285994920 -> 4535482304481829670 [label="",color="black",fontcolor="black"]; -3251695063285994920 -> -6903141547663845486 [label="",color="black",fontcolor="black"]; -3251695063285994920 -> 6449105013082457798 [label="",color="black",fontcolor="black"]; -3251695063285994920 -> 3251695063285994920 [label="",color="black",fontcolor="black"]; -6449105013082457798 -> 5381450370688004168 [label="",color="black",fontcolor="black"]; -6449105013082457798 -> -3139966685307173636 [label="",color="black",fontcolor="black"]; -6449105013082457798 -> 6449105013082457798 [label="",color="black",fontcolor="black"]; -6449105013082457798 -> -5484804798014709476 [label="",color="black",fontcolor="black"]; -6449105013082457798 -> 6449105013082457798 [label="",color="black",fontcolor="black"]; -6449105013082457798 -> 3251695063285994920 [label="",color="black",fontcolor="black"]; -{rank = same; -5484804798014709476;} -{rank = same; -6903141547663845486;-3139966685307173636;} -{rank = same; -4053931664713403790;-3063024226093955969;5458270148537692363;} -{rank = same; -4130678271262510351;6372234522398623301;} -{rank = same; -5871589370185021976;-2676148449289922938;} -{rank = same; -3959372824750809080;-4804497626813582490;} -{rank = same; 4535482304481829670;5381450370688004168;} -{rank = same; 6449105013082457798;3251695063285994920;} -} -} \ No newline at end of file diff --git a/tla_specifications/states.json b/tla_specifications/states.json deleted file mode 100644 index a88f45b..0000000 --- a/tla_specifications/states.json +++ /dev/null @@ -1,684 +0,0 @@ -{ - "name": "DiskGraph", - "directed": true, - "strict": true, - "nodesep": "0.35", - "_subgraph_cnt": 9, - "objects": [ - { - "_gvid": 9, - "name": "-5484804798014709476", - "label": "/\\\\ jarro_pequeno = 0\\n/\\\\ jarro_grande = 0", - "style": "filled" - }, - { - "_gvid": 10, - "name": "-6903141547663845486", - "label": "/\\\\ jarro_pequeno = 3\\n/\\\\ jarro_grande = 0" - }, - { - "_gvid": 11, - "name": "-3139966685307173636", - "label": "/\\\\ jarro_pequeno = 0\\n/\\\\ jarro_grande = 5" - }, - { - "_gvid": 12, - "name": "-4053931664713403790", - "label": "/\\\\ jarro_pequeno = 3\\n/\\\\ jarro_grande = 5" - }, - { - "_gvid": 13, - "name": "5458270148537692363", - "label": "/\\\\ jarro_pequeno = 0\\n/\\\\ jarro_grande = 3" - }, - { - "_gvid": 14, - "name": "-3063024226093955969", - "label": "/\\\\ jarro_pequeno = 3\\n/\\\\ jarro_grande = 2" - }, - { - "_gvid": 15, - "name": "6372234522398623301", - "label": "/\\\\ jarro_pequeno = 3\\n/\\\\ jarro_grande = 3" - }, - { - "_gvid": 16, - "name": "-4130678271262510351", - "label": "/\\\\ jarro_pequeno = 0\\n/\\\\ jarro_grande = 2" - }, - { - "_gvid": 17, - "name": "-2676148449289922938", - "label": "/\\\\ jarro_pequeno = 1\\n/\\\\ jarro_grande = 5" - }, - { - "_gvid": 18, - "name": "-5871589370185021976", - "label": "/\\\\ jarro_pequeno = 2\\n/\\\\ jarro_grande = 0" - }, - { - "_gvid": 19, - "name": "-4804497626813582490", - "label": "/\\\\ jarro_pequeno = 1\\n/\\\\ jarro_grande = 0" - }, - { - "_gvid": 20, - "name": "-3959372824750809080", - "label": "/\\\\ jarro_pequeno = 2\\n/\\\\ jarro_grande = 5" - }, - { - "_gvid": 21, - "name": "4535482304481829670", - "label": "/\\\\ jarro_pequeno = 0\\n/\\\\ jarro_grande = 1" - }, - { - "_gvid": 22, - "name": "5381450370688004168", - "label": "/\\\\ jarro_pequeno = 3\\n/\\\\ jarro_grande = 4" - }, - { - "_gvid": 23, - "name": "3251695063285994920", - "label": "/\\\\ jarro_pequeno = 3\\n/\\\\ jarro_grande = 1" - }, - { - "_gvid": 24, - "name": "6449105013082457798", - "label": "/\\\\ jarro_pequeno = 0\\n/\\\\ jarro_grande = 4" - } - ], - "edges": [ - { - "_gvid": 0, - "tail": 9, - "head": 9, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 1, - "tail": 9, - "head": 10, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 2, - "tail": 9, - "head": 11, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 3, - "tail": 10, - "head": 9, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 4, - "tail": 10, - "head": 10, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 5, - "tail": 10, - "head": 12, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 6, - "tail": 10, - "head": 13, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 7, - "tail": 11, - "head": 9, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 8, - "tail": 11, - "head": 11, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 9, - "tail": 11, - "head": 12, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 10, - "tail": 11, - "head": 14, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 11, - "tail": 12, - "head": 10, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 12, - "tail": 12, - "head": 11, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 13, - "tail": 12, - "head": 12, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 14, - "tail": 13, - "head": 9, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 15, - "tail": 13, - "head": 10, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 16, - "tail": 13, - "head": 11, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 17, - "tail": 13, - "head": 13, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 18, - "tail": 13, - "head": 15, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 19, - "tail": 14, - "head": 10, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 20, - "tail": 14, - "head": 11, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 21, - "tail": 14, - "head": 12, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 22, - "tail": 14, - "head": 14, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 23, - "tail": 14, - "head": 16, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 24, - "tail": 15, - "head": 10, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 25, - "tail": 15, - "head": 12, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 26, - "tail": 15, - "head": 13, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 27, - "tail": 15, - "head": 15, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 28, - "tail": 15, - "head": 17, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 29, - "tail": 16, - "head": 9, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 30, - "tail": 16, - "head": 11, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 31, - "tail": 16, - "head": 14, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 32, - "tail": 16, - "head": 16, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 33, - "tail": 16, - "head": 18, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 34, - "tail": 17, - "head": 11, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 35, - "tail": 17, - "head": 12, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 36, - "tail": 17, - "head": 15, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 37, - "tail": 17, - "head": 17, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 38, - "tail": 17, - "head": 19, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 39, - "tail": 18, - "head": 9, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 40, - "tail": 18, - "head": 10, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 41, - "tail": 18, - "head": 16, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 42, - "tail": 18, - "head": 18, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 43, - "tail": 18, - "head": 20, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 44, - "tail": 19, - "head": 9, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 45, - "tail": 19, - "head": 10, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 46, - "tail": 19, - "head": 17, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 47, - "tail": 19, - "head": 19, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 48, - "tail": 19, - "head": 21, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 49, - "tail": 20, - "head": 11, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 50, - "tail": 20, - "head": 12, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 51, - "tail": 20, - "head": 18, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 52, - "tail": 20, - "head": 20, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 53, - "tail": 20, - "head": 22, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 54, - "tail": 21, - "head": 9, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 55, - "tail": 21, - "head": 11, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 56, - "tail": 21, - "head": 19, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 57, - "tail": 21, - "head": 21, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 58, - "tail": 21, - "head": 23, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 59, - "tail": 22, - "head": 10, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 60, - "tail": 22, - "head": 12, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 61, - "tail": 22, - "head": 20, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 62, - "tail": 22, - "head": 22, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 63, - "tail": 22, - "head": 24, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 64, - "tail": 23, - "head": 10, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 65, - "tail": 23, - "head": 12, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 66, - "tail": 23, - "head": 21, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 67, - "tail": 23, - "head": 23, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 68, - "tail": 23, - "head": 24, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 69, - "tail": 24, - "head": 9, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 70, - "tail": 24, - "head": 11, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 71, - "tail": 24, - "head": 22, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 72, - "tail": 24, - "head": 23, - "color": "black", - "fontcolor": "black", - "label": "" - }, - { - "_gvid": 73, - "tail": 24, - "head": 24, - "color": "black", - "fontcolor": "black", - "label": "" - } - ] -} diff --git a/tla_specifications/token-transfer/README.md b/tla_specifications/token-transfer/README.md deleted file mode 100644 index 33fc3fc..0000000 --- a/tla_specifications/token-transfer/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Token Tranfer protocol - -Examples imported from https://github.com/informalsystems/tla-apalache-workshop - -JSON files are parsed with [Apalache](https://github.com/informalsystems/apalache): - -``` sh -apalache-mc parse --output=TokenTransferX.json TokenTransferX.tla -``` diff --git a/tla_specifications/token-transfer/TokenTransfer1.json b/tla_specifications/token-transfer/TokenTransfer1.json deleted file mode 100644 index 97ea93c..0000000 --- a/tla_specifications/token-transfer/TokenTransfer1.json +++ /dev/null @@ -1,344 +0,0 @@ -{ - "name": "ApalacheIR", - "version": "1.0", - "description": "https://apalache.informal.systems/docs/adr/005adr-json.html", - "modules": [ - { - "kind": "TlaModule", - "name": "TokenTransfer1", - "declarations": [ - { - "source": { - "filename": "TokenTransfer1", - "from": { - "line": 21, - "column": 5 - }, - "to": { - "line": 21, - "column": 12 - } - }, - "type": "Untyped", - "kind": "TlaConstDecl", - "name": "ACCOUNTS" - }, - { - "source": { - "filename": "TokenTransfer1", - "from": { - "line": 18, - "column": 5 - }, - "to": { - "line": 18, - "column": 10 - } - }, - "type": "Untyped", - "kind": "TlaConstDecl", - "name": "CHAINS" - }, - { - "source": { - "filename": "TokenTransfer1", - "from": { - "line": 26, - "column": 5 - }, - "to": { - "line": 26, - "column": 9 - } - }, - "type": "Untyped", - "kind": "TlaVarDecl", - "name": "banks" - }, - { - "source": { - "filename": "typedefs", - "from": { - "line": 16, - "column": 1 - }, - "to": { - "line": 16, - "column": 25 - } - }, - "type": "Untyped", - "kind": "TlaOperDecl", - "name": "typedefs_included", - "formalParams": [ - - ], - "isRecursive": false, - "body": { - "source": { - "filename": "typedefs", - "from": { - "line": 16, - "column": 22 - }, - "to": { - "line": 16, - "column": 25 - } - }, - "type": "Untyped", - "kind": "ValEx", - "value": { - "kind": "TlaBool", - "value": true - } - } - }, - { - "source": { - "filename": "TokenTransfer1", - "from": { - "line": 29, - "column": 1 - }, - "to": { - "line": 31, - "column": 17 - } - }, - "type": "Untyped", - "kind": "TlaOperDecl", - "name": "Init", - "formalParams": [ - - ], - "isRecursive": false, - "body": { - "source": { - "filename": "TokenTransfer1", - "from": { - "line": 30, - "column": 5 - }, - "to": { - "line": 31, - "column": 17 - } - }, - "type": "Untyped", - "kind": "OperEx", - "oper": "EXISTS3", - "args": [ - { - "source": { - "filename": "TokenTransfer1", - "from": { - "line": 30, - "column": 5 - }, - "to": { - "line": 31, - "column": 17 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "b" - }, - { - "source": { - "filename": "TokenTransfer1", - "from": { - "line": 30, - "column": 14 - }, - "to": { - "line": 30, - "column": 42 - } - }, - "type": "Untyped", - "kind": "OperEx", - "oper": "FUN_SET", - "args": [ - { - "source": { - "filename": "TokenTransfer1", - "from": { - "line": 30, - "column": 16 - }, - "to": { - "line": 30, - "column": 33 - } - }, - "type": "Untyped", - "kind": "OperEx", - "oper": "SET_TIMES", - "args": [ - { - "source": { - "filename": "TokenTransfer1", - "from": { - "line": 30, - "column": 16 - }, - "to": { - "line": 30, - "column": 21 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "CHAINS" - }, - { - "source": { - "filename": "TokenTransfer1", - "from": { - "line": 30, - "column": 26 - }, - "to": { - "line": 30, - "column": 33 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "ACCOUNTS" - } - ] - }, - { - "source": { - "filename": "TokenTransfer1", - "from": { - "line": 30, - "column": 38 - }, - "to": { - "line": 30, - "column": 40 - } - }, - "type": "Untyped", - "kind": "ValEx", - "value": { - "kind": "TlaIntSet" - } - } - ] - }, - { - "source": { - "filename": "TokenTransfer1", - "from": { - "line": 31, - "column": 9 - }, - "to": { - "line": 31, - "column": 17 - } - }, - "type": "Untyped", - "kind": "OperEx", - "oper": "EQ", - "args": [ - { - "source": { - "filename": "TokenTransfer1", - "from": { - "line": 31, - "column": 9 - }, - "to": { - "line": 31, - "column": 13 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "banks" - }, - { - "source": { - "filename": "TokenTransfer1", - "from": { - "line": 31, - "column": 17 - }, - "to": { - "line": 31, - "column": 17 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "b" - } - ] - } - ] - } - }, - { - "source": { - "filename": "TokenTransfer1", - "from": { - "line": 34, - "column": 1 - }, - "to": { - "line": 35, - "column": 19 - } - }, - "type": "Untyped", - "kind": "TlaOperDecl", - "name": "Next", - "formalParams": [ - - ], - "isRecursive": false, - "body": { - "source": { - "filename": "TokenTransfer1", - "from": { - "line": 35, - "column": 5 - }, - "to": { - "line": 35, - "column": 19 - } - }, - "type": "Untyped", - "kind": "OperEx", - "oper": "UNCHANGED", - "args": [ - { - "source": { - "filename": "TokenTransfer1", - "from": { - "line": 35, - "column": 15 - }, - "to": { - "line": 35, - "column": 19 - } - }, - "type": "Untyped", - "kind": "NameEx", - "name": "banks" - } - ] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/tla_specifications/token-transfer/TokenTransfer1.tla b/tla_specifications/token-transfer/TokenTransfer1.tla deleted file mode 100644 index b4c83ff..0000000 --- a/tla_specifications/token-transfer/TokenTransfer1.tla +++ /dev/null @@ -1,37 +0,0 @@ ------------------------ MODULE TokenTransfer1 --------------------------------- -(* - * This is an example of a very simplistic token transfer - * for presentation purposes. - * Do not use it in production, as it may lead to loss of tokens. - * - * Version 1: introducing data structures - * - * Igor Konnov, 2021 - *) -EXTENDS Integers, typedefs - -\* check typedefs.tla for type aliases - -CONSTANT - \* A set of blockchains, i.e., their names - \* @type: Set(CHAIN); - CHAINS, - \* A set of accounts, i.e., their names - \* @type: Set(ACCOUNTS); - ACCOUNTS - -VARIABLES - \* For every chain and account, store the amount of tokens in the account - \* @type: ADDR -> Int; - banks - -\* Initialize the world, e.g., from the last upgrade -Init == - \E b \in [ CHAINS \X ACCOUNTS -> Int ]: - banks = b - -\* Update the world -Next == - UNCHANGED banks - -=============================================================================== diff --git a/tla_specifications/token-transfer/TokenTransfer2.tla b/tla_specifications/token-transfer/TokenTransfer2.tla deleted file mode 100644 index 2ccc9b8..0000000 --- a/tla_specifications/token-transfer/TokenTransfer2.tla +++ /dev/null @@ -1,61 +0,0 @@ ------------------------ MODULE TokenTransfer2 --------------------------------- -(* - * This is an example of a very simplistic token transfer - * for presentation purposes. - * Do not use it in production, as it may lead to loss of tokens. - * - * Version 2: let the banks do the local banking - * Version 1: introducing data structures - * - * Igor Konnov, 2021 - *) -EXTENDS Integers, typedefs - -CONSTANT - \* A set of blockchains, i.e., their names - \* @type: Set(CHAIN); - CHAINS, - \* A set of accounts, i.e., their names - \* @type: Set(ACCOUNT); - ACCOUNTS - -VARIABLES - \* For every chain and account, store the amount of tokens in the account - \* @type: ADDR -> Int; - banks - -\* Initialize the world, e.g., from the last upgrade -Init == - \E b \in [ CHAINS \X ACCOUNTS -> Nat ]: - /\ \A c \in CHAINS: - b[c, "reserve"] > 0 - /\ banks = b - -\* Transfer the tokens from on account to another (on the same chain) -LocalTransfer(chain, from, to, amount) == - /\ banks[chain, from] >= amount - /\ from /= to - /\ banks[chain, from] - amount >= 0 - /\ banks' = [banks EXCEPT - ![chain, from] = banks[chain, from] - amount, - ![chain, to] = banks[chain, to] + amount - ] - -\* Update the world -Next == - \E chain \in CHAINS, from, to \in ACCOUNTS, amount \in Nat: - LocalTransfer(chain, from, to, amount) - -(************************** PROPERTIES ***************************************) - -\* every bank always has reserves -ReservesInv == - \A chain \in CHAINS: - banks[chain, "reserve"] > 0 - -\* no bank account goes negative -NoNegativeAccounts == - \A address \in DOMAIN banks: - banks[address] >= 0 - -=============================================================================== diff --git a/tla_specifications/token-transfer/typedefs.tla b/tla_specifications/token-transfer/typedefs.tla deleted file mode 100644 index 52d5574..0000000 --- a/tla_specifications/token-transfer/typedefs.tla +++ /dev/null @@ -1,17 +0,0 @@ --------------------------------- MODULE typedefs ------------------------------ -(* -## Type aliases - - We introduce the following aliases for the types that are used in this - specification. - - @typeAlias: CHAIN = Str; - @typeAlias: ACCOUNT = Str; - @typeAlias: ADDR = <>; - @typeAlias: BANK = (ADDR -> Int); - - @typeAlias: DENOM = Str; - @typeAlias: DADDR = <>; - *) -typedefs_included == TRUE -=============================================================================== diff --git a/tla_specifications/trace.out b/tla_specifications/trace.out deleted file mode 100644 index c635fe1..0000000 --- a/tla_specifications/trace.out +++ /dev/null @@ -1,27 +0,0 @@ -State 1: -/\ jarro_pequeno = 0 -/\ jarro_grande = 0 - -State 2: -/\ jarro_pequeno = 0 -/\ jarro_grande = 5 - -State 3: -/\ jarro_pequeno = 3 -/\ jarro_grande = 2 - -State 4: -/\ jarro_pequeno = 0 -/\ jarro_grande = 2 - -State 5: -/\ jarro_pequeno = 2 -/\ jarro_grande = 0 - -State 6: -/\ jarro_pequeno = 2 -/\ jarro_grande = 5 - -State 7: -/\ jarro_pequeno = 3 -/\ jarro_grande = 4 diff --git a/tla_specifications/traffic_semaphore/config.json b/tla_specifications/traffic_semaphore/config.json deleted file mode 100644 index 7398dcf..0000000 --- a/tla_specifications/traffic_semaphore/config.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "processes": [ - { - "process_id": "main", - "actions": [ - "\\E s \\in {0, 1} : TurnGreen(s) \\/ TurnYellow(s) \\/ TurnRed(s)" - ] - } - ], - "shared_variables": ["colors", "next_to_open"] -} diff --git a/tla_specifications/traffic_semaphore/states.dot b/tla_specifications/traffic_semaphore/states.dot deleted file mode 100644 index 5d9ef92..0000000 --- a/tla_specifications/traffic_semaphore/states.dot +++ /dev/null @@ -1,24 +0,0 @@ -strict digraph DiskGraph { -nodesep=0.35; -subgraph cluster_graph { -color="white"; -7210969400895743542 [label="/\\ colors = (0 :> \"red\" @@ 1 :> \"red\")\n/\\ next_to_open = 0",style = filled] -7210969400895743542 -> 8666215057606062623 [label="",color="black",fontcolor="black"]; -8666215057606062623 [label="/\\ colors = (0 :> \"green\" @@ 1 :> \"red\")\n/\\ next_to_open = 1"]; -8666215057606062623 -> -1145142259021417419 [label="",color="black",fontcolor="black"]; --1145142259021417419 [label="/\\ colors = (0 :> \"yellow\" @@ 1 :> \"red\")\n/\\ next_to_open = 1"]; --1145142259021417419 -> 7220866383477917723 [label="",color="black",fontcolor="black"]; -7220866383477917723 [label="/\\ colors = (0 :> \"red\" @@ 1 :> \"red\")\n/\\ next_to_open = 1"]; -7220866383477917723 -> 6003703145199322104 [label="",color="black",fontcolor="black"]; -6003703145199322104 [label="/\\ colors = (0 :> \"red\" @@ 1 :> \"green\")\n/\\ next_to_open = 0"]; -6003703145199322104 -> 5389667823581670897 [label="",color="black",fontcolor="black"]; -5389667823581670897 [label="/\\ colors = (0 :> \"red\" @@ 1 :> \"yellow\")\n/\\ next_to_open = 0"]; -5389667823581670897 -> 7210969400895743542 [label="",color="black",fontcolor="black"]; -{rank = same; 7210969400895743542;} -{rank = same; 8666215057606062623;} -{rank = same; -1145142259021417419;} -{rank = same; 7220866383477917723;} -{rank = same; 6003703145199322104;} -{rank = same; 5389667823581670897;} -} -} \ No newline at end of file diff --git a/tla_specifications/traffic_semaphore_with_problem/config.json b/tla_specifications/traffic_semaphore_with_problem/config.json deleted file mode 100644 index 7398dcf..0000000 --- a/tla_specifications/traffic_semaphore_with_problem/config.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "processes": [ - { - "process_id": "main", - "actions": [ - "\\E s \\in {0, 1} : TurnGreen(s) \\/ TurnYellow(s) \\/ TurnRed(s)" - ] - } - ], - "shared_variables": ["colors", "next_to_open"] -} diff --git a/tla_specifications/traffic_semaphore_with_problem/states/22-08-06-11-55-15/MC-0.st b/tla_specifications/traffic_semaphore_with_problem/states/22-08-06-11-55-15/MC-0.st deleted file mode 100644 index e69de29..0000000 diff --git a/tla_specifications/traffic_semaphore_with_problem/states/22-08-06-11-55-15/MC.st b/tla_specifications/traffic_semaphore_with_problem/states/22-08-06-11-55-15/MC.st deleted file mode 100644 index e69de29..0000000 diff --git a/tla_specifications/traffic_semaphore_with_problem/states/22-08-06-11-55-15/MC_0.fp b/tla_specifications/traffic_semaphore_with_problem/states/22-08-06-11-55-15/MC_0.fp deleted file mode 100644 index e69de29..0000000 diff --git a/tla_specifications/traffic_semaphore_with_problem/states/22-08-06-11-55-15/MC_1.fp b/tla_specifications/traffic_semaphore_with_problem/states/22-08-06-11-55-15/MC_1.fp deleted file mode 100644 index e69de29..0000000 diff --git a/tla_specifications/traffic_semaphore_with_problem/states/22-08-06-11-55-15/nodes_0 b/tla_specifications/traffic_semaphore_with_problem/states/22-08-06-11-55-15/nodes_0 deleted file mode 100644 index d8a5658..0000000 Binary files a/tla_specifications/traffic_semaphore_with_problem/states/22-08-06-11-55-15/nodes_0 and /dev/null differ diff --git a/tla_specifications/traffic_semaphore_with_problem/states/22-08-06-11-55-15/nodes_1 b/tla_specifications/traffic_semaphore_with_problem/states/22-08-06-11-55-15/nodes_1 deleted file mode 100644 index 0291999..0000000 Binary files a/tla_specifications/traffic_semaphore_with_problem/states/22-08-06-11-55-15/nodes_1 and /dev/null differ diff --git a/tla_specifications/traffic_semaphore_with_problem/states/22-08-06-11-55-15/ptrs_0 b/tla_specifications/traffic_semaphore_with_problem/states/22-08-06-11-55-15/ptrs_0 deleted file mode 100644 index e6a9f87..0000000 Binary files a/tla_specifications/traffic_semaphore_with_problem/states/22-08-06-11-55-15/ptrs_0 and /dev/null differ diff --git a/tla_specifications/traffic_semaphore_with_problem/states/22-08-06-11-55-15/ptrs_1 b/tla_specifications/traffic_semaphore_with_problem/states/22-08-06-11-55-15/ptrs_1 deleted file mode 100644 index 934df94..0000000 Binary files a/tla_specifications/traffic_semaphore_with_problem/states/22-08-06-11-55-15/ptrs_1 and /dev/null differ diff --git a/tla_specifications/traffic_semaphore/MC.cfg b/tla_specifications/traffic_semaphores/MC.cfg similarity index 100% rename from tla_specifications/traffic_semaphore/MC.cfg rename to tla_specifications/traffic_semaphores/MC.cfg diff --git a/tla_specifications/traffic_semaphore/MC.tla b/tla_specifications/traffic_semaphores/MC.tla similarity index 100% rename from tla_specifications/traffic_semaphore/MC.tla rename to tla_specifications/traffic_semaphores/MC.tla diff --git a/tla_specifications/traffic_semaphore/TrafficSemaphores.json b/tla_specifications/traffic_semaphores/TrafficSemaphores.json similarity index 100% rename from tla_specifications/traffic_semaphore/TrafficSemaphores.json rename to tla_specifications/traffic_semaphores/TrafficSemaphores.json diff --git a/tla_specifications/traffic_semaphore/TrafficSemaphores.tla b/tla_specifications/traffic_semaphores/TrafficSemaphores.tla similarity index 100% rename from tla_specifications/traffic_semaphore/TrafficSemaphores.tla rename to tla_specifications/traffic_semaphores/TrafficSemaphores.tla diff --git a/tla_specifications/traffic_semaphores/config.json b/tla_specifications/traffic_semaphores/config.json new file mode 100644 index 0000000..7edb66a --- /dev/null +++ b/tla_specifications/traffic_semaphores/config.json @@ -0,0 +1,25 @@ +{ + "processes": [ + { + "process_id": "main", + "actions": [ + "\\E s \\in SEMAPHORES : TurnGreen(s) \\/ TurnYellow(s) \\/ TurnRed(s)" + ] + } + ], + "shared_variables": ["colors", "next_to_open"], + "constants": [ + { + "name": "SEMAPHORES", + "value": "{0, 1}" + } + ], + "init": "Init", + "next": "Next", + "module_name": "TrafficSemaphores", + "input_format": "json", + "input_file": "TrafficSemaphores.json", + "state_graph": "states.json", + "blackbox_tests": [], + "destination_folder": "../../elixir" +} diff --git a/tla_specifications/traffic_semaphore/states.json b/tla_specifications/traffic_semaphores/states.json similarity index 100% rename from tla_specifications/traffic_semaphore/states.json rename to tla_specifications/traffic_semaphores/states.json diff --git a/tla_specifications/traffic_semaphore/states.png b/tla_specifications/traffic_semaphores/states.png similarity index 100% rename from tla_specifications/traffic_semaphore/states.png rename to tla_specifications/traffic_semaphores/states.png diff --git a/tla_specifications/traffic_semaphore_with_problem/MC.cfg b/tla_specifications/traffic_semaphores_with_problem/MC.cfg similarity index 100% rename from tla_specifications/traffic_semaphore_with_problem/MC.cfg rename to tla_specifications/traffic_semaphores_with_problem/MC.cfg diff --git a/tla_specifications/traffic_semaphore_with_problem/MC.tla b/tla_specifications/traffic_semaphores_with_problem/MC.tla similarity index 100% rename from tla_specifications/traffic_semaphore_with_problem/MC.tla rename to tla_specifications/traffic_semaphores_with_problem/MC.tla diff --git a/tla_specifications/traffic_semaphore_with_problem/TrafficSemaphores.json b/tla_specifications/traffic_semaphores_with_problem/TrafficSemaphores.json similarity index 100% rename from tla_specifications/traffic_semaphore_with_problem/TrafficSemaphores.json rename to tla_specifications/traffic_semaphores_with_problem/TrafficSemaphores.json diff --git a/tla_specifications/traffic_semaphore_with_problem/TrafficSemaphores.tla b/tla_specifications/traffic_semaphores_with_problem/TrafficSemaphores.tla similarity index 100% rename from tla_specifications/traffic_semaphore_with_problem/TrafficSemaphores.tla rename to tla_specifications/traffic_semaphores_with_problem/TrafficSemaphores.tla diff --git a/tla_specifications/traffic_semaphores_with_problem/config.json b/tla_specifications/traffic_semaphores_with_problem/config.json new file mode 100644 index 0000000..21a55bf --- /dev/null +++ b/tla_specifications/traffic_semaphores_with_problem/config.json @@ -0,0 +1,25 @@ +{ + "processes": [ + { + "process_id": "main", + "actions": [ + "\\E s \\in SEMAPHORES : TurnGreen(s) \\/ TurnYellow(s) \\/ TurnRed(s)" + ] + } + ], + "shared_variables": ["colors", "next_to_open"], + "constants": [ + { + "name": "SEMAPHORES", + "value": "{0, 1}" + } + ], + "init": "Init", + "next": "Next", + "module_name": "TrafficSemaphores", + "input_format": "json", + "input_file": "TrafficSemaphores.json", + "state_graph": "states.json", + "blackbox_tests": [{"name": "SingleSemaphoreLoop", "trace": "trace.out"}], + "destination_folder": "../../elixir" +} diff --git a/tla_specifications/traffic_semaphore_with_problem/states.dot b/tla_specifications/traffic_semaphores_with_problem/states.dot similarity index 100% rename from tla_specifications/traffic_semaphore_with_problem/states.dot rename to tla_specifications/traffic_semaphores_with_problem/states.dot diff --git a/tla_specifications/traffic_semaphore_with_problem/states.json b/tla_specifications/traffic_semaphores_with_problem/states.json similarity index 100% rename from tla_specifications/traffic_semaphore_with_problem/states.json rename to tla_specifications/traffic_semaphores_with_problem/states.json diff --git a/tla_specifications/traffic_semaphore_with_problem/states.png b/tla_specifications/traffic_semaphores_with_problem/states.png similarity index 100% rename from tla_specifications/traffic_semaphore_with_problem/states.png rename to tla_specifications/traffic_semaphores_with_problem/states.png diff --git a/tla_specifications/traffic_semaphore_with_problem/trace.out b/tla_specifications/traffic_semaphores_with_problem/trace.out similarity index 100% rename from tla_specifications/traffic_semaphore_with_problem/trace.out rename to tla_specifications/traffic_semaphores_with_problem/trace.out