From 65ccb737daaa2bb015f3009e10d5bb29c48d44ea Mon Sep 17 00:00:00 2001 From: Michael Leuschel <leuschel@uni-duesseldorf.de> Date: Tue, 23 Feb 2021 09:26:18 +0100 Subject: [PATCH] add TLA button example --- .gitignore | 4 ++++ Button/TLA/button.json | 30 ++++++++++++++++++++++++++++++ Button/TLA/button.tla | 16 ++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 Button/TLA/button.json create mode 100644 Button/TLA/button.tla diff --git a/.gitignore b/.gitignore index de3a0f6..cade3bf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ *.prob *.DS_Store +*.aux +*.fuzz +*.log +*_tla.txt diff --git a/Button/TLA/button.json b/Button/TLA/button.json new file mode 100644 index 0000000..30b8886 --- /dev/null +++ b/Button/TLA/button.json @@ -0,0 +1,30 @@ +{ + "svg": "../button.svg", + "items": [ + { + "id": "button", + "attr": "fill", + "value": "IF button=TRUE THEN \"green\" ELSE \"red\" END" + }, + { + "id": "button", + "attr": "stroke-width", + "value": "IF ENABLED(\"press_button\") THEN 6 ELSE 1 END", + "ignore": "is now used in hover below" + }, + { + "id": "button_%0", + "attr": "visibility", + "value": "\"hidden\"", + "repeat": [ "TRUE", "FALSE" ] + } + ], + "events": [ + { + "id": "button", + "event": "toggle_button", + "hovers": [{ "attr":"stroke-width", "enter":"6", "leave":"1"}, + { "attr":"opacity", "enter":"0.8", "leave":"1.0"}] + } + ] +} diff --git a/Button/TLA/button.tla b/Button/TLA/button.tla new file mode 100644 index 0000000..922c1bc --- /dev/null +++ b/Button/TLA/button.tla @@ -0,0 +1,16 @@ +------------------------------- MODULE button ------------------------------- + +VARIABLES button + +Init == button = FALSE + +Press_Button == button' = TRUE + +toggle_button == button' = \lnot button + +Next == \/ Press_Button + \/ toggle_button + +Spec == Init /\ [][Next]_button + +============================================================================= \ No newline at end of file -- GitLab