|
| 1 | +module CTLLibrary |
| 2 | + |
| 3 | +import StandardLibrary |
| 4 | + |
| 5 | +export * |
| 6 | + |
| 7 | +signature: |
| 8 | + /*-----------CTL formulas------------*/ |
| 9 | + static eg: Boolean -> Boolean //exists globally |
| 10 | + static ex: Boolean -> Boolean //exists next state |
| 11 | + static ef: Boolean -> Boolean //exists finally |
| 12 | + static ag: Boolean -> Boolean //forall globally |
| 13 | + static ax: Boolean -> Boolean //forall next state |
| 14 | + static af: Boolean -> Boolean //forall finally |
| 15 | + static eu: Prod(Boolean, Boolean) -> Boolean //exists until |
| 16 | + static au: Prod(Boolean, Boolean) -> Boolean //forall until |
| 17 | + |
| 18 | + /*-----------Patterns------------*/ |
| 19 | + static ew: Prod(Boolean, Boolean) -> Boolean //exists weak until -- E[p U q] | EGp. |
| 20 | + static aw: Prod(Boolean, Boolean) -> Boolean //forall weak until -- !E[!q U !(p | q)]. |
| 21 | + |
| 22 | + |
| 23 | + //http://patterns.projects.cis.ksu.edu/documentation/patterns/ctl.shtml |
| 24 | + //Absence (P is false) |
| 25 | + //Globally - AG(!P) |
| 26 | + static absenceG: Boolean -> Boolean |
| 27 | + //(*) Before R - A[(!P | AG(!R)) W R] |
| 28 | + static absenceBefore: Prod(Boolean, Boolean) -> Boolean // absenceBefore(P, R) |
| 29 | + //After Q - AG(Q -> AG(!P)) |
| 30 | + static absenceAfter: Prod(Boolean, Boolean) -> Boolean // absenceAfter(P, Q) |
| 31 | + //(*) Between Q and R - AG(Q & !R -> A[(!P | AG(!R)) W R]) |
| 32 | + static absenceBetween: Prod(Boolean, Boolean, Boolean) -> Boolean // absenceBetween(P, Q, R) |
| 33 | + //(*) After Q until R - AG(Q & !R -> A[!P W R]) |
| 34 | + static absenceAfterUntil: Prod(Boolean, Boolean, Boolean) -> Boolean // absenceAfterUntil(P, Q, R) |
| 35 | + |
| 36 | + //Precedence (S precedes P) |
| 37 | + //(*) Globally |
| 38 | + //A[!P W S] |
| 39 | + static ap: Prod(Boolean, Boolean) -> Boolean // ap(P, S) |
| 40 | + //(*) Before R |
| 41 | + //A[(!P | AG(!R)) W (S | R)] |
| 42 | + static pb: Prod(Boolean, Boolean, Boolean) -> Boolean // pb(P, S, R) |
| 43 | + //(*) After Q |
| 44 | + //A[!Q W (Q & A[!P W S])] |
| 45 | + //(*) Between Q and R |
| 46 | + //AG(Q & !R -> A[(!P | AG(!R)) W (S | R)]) |
| 47 | + //(*) After Q until R |
| 48 | + //AG(Q & !R -> A[!P W (S | R)]) |
| 49 | + |
| 50 | + //Response (S responds to P) |
| 51 | + //Globally |
| 52 | + //AG(P -> AF(S)) |
| 53 | + //(*) Before R |
| 54 | + //A[((P -> A[!R U (S & !R)]) | AG(!R)) W R] |
| 55 | + //(*) After Q |
| 56 | + //A[!Q W (Q & AG(P -> AF(S))] |
| 57 | + //(*) Between Q and R |
| 58 | + //AG(Q & !R -> A[((P -> A[!R U (S & !R)]) | AG(!R)) W R]) |
| 59 | + //(*) After Q until R |
| 60 | + //AG(Q & !R -> A[(P -> A[!R U (S & !R)]) W R]) |
| 61 | + |
| 62 | + /*-----------My CTL formulas------------*/ |
| 63 | + static exN: Prod(Boolean, Natural) -> Boolean //exists after N states |
| 64 | + static axN: Prod(Boolean, Natural) -> Boolean //forall paths, after N states |
| 65 | +definitions: |
0 commit comments