-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4d4db56
commit 0f4147e
Showing
1 changed file
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
(************************************************************ | ||
* IMITATOR MODEL | ||
* | ||
* Title : Toy model to test AF | ||
* Description : Toy model to test AF: example where all paths syntactically reach the accepting location, but some of them violate AF due to timelocks | ||
* Correctness : AF accepting | ||
* Scalable : no | ||
* Generated : no | ||
* Categories : TBD | ||
* Source : Own work | ||
* bibkey : | ||
* Author : Étienne André | ||
* Modeling : Étienne André | ||
* Input by : Étienne André | ||
* License : Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) | ||
* | ||
* Created : 2024/01/19 | ||
* Last modified : 2024/01/19 | ||
* Model version : 0.1 | ||
* | ||
* IMITATOR version : 3.4-beta | ||
************************************************************) | ||
|
||
var | ||
|
||
(* Clocks *) | ||
x, | ||
: clock; | ||
|
||
(* Parameters *) | ||
p, | ||
: parameter; | ||
|
||
|
||
|
||
(************************************************************) | ||
automaton pta | ||
(************************************************************) | ||
actions: ; | ||
|
||
loc l1: invariant x <= 5 | ||
when x = p goto lF; (* AF holds if p = 5 *) | ||
when x = p & x <= 4 goto l2; (* AF holds if 0 <= p <= 4 *) | ||
when x = p & x = 1 goto l3; (* AF does not hold if p = 1 *) | ||
when x = p & 2 <= x & x <= 3 goto l4; (* AF does not hold if p \in [2, 3] *) | ||
|
||
loc l2: invariant x <= 3 | ||
when True goto lF; | ||
|
||
(* AF does not hold for any p *) | ||
loc l3: invariant x <= 10 | ||
when x = 5 goto lF; | ||
|
||
(* AF does not hold for any p *) | ||
loc l4: invariant x <= p | ||
when x < p goto lF; | ||
|
||
accepting loc lF: invariant True | ||
|
||
end (* pta *) | ||
|
||
|
||
|
||
(************************************************************) | ||
(* Initial state *) | ||
(************************************************************) | ||
|
||
init := { | ||
|
||
discrete = | ||
(*------------------------------------------------------------*) | ||
(* Initial location *) | ||
(*------------------------------------------------------------*) | ||
loc[pta] := l1, | ||
|
||
(*------------------------------------------------------------*) | ||
(* Initial discrete variables assignments *) | ||
(*------------------------------------------------------------*) | ||
|
||
; | ||
|
||
continuous = | ||
(*------------------------------------------------------------*) | ||
(* Initial clock constraints *) | ||
(*------------------------------------------------------------*) | ||
& x = 0 | ||
|
||
(*------------------------------------------------------------*) | ||
(* Parameter constraints *) | ||
(*------------------------------------------------------------*) | ||
& 0 <= p & p <= 10 | ||
; | ||
} | ||
|
||
|
||
(************************************************************) | ||
(* The end *) | ||
(************************************************************) | ||
end |