Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NPTAV2Maude
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
real-time maude
NPTAV2Maude
Commits
90cf5cea
Commit
90cf5cea
authored
1 year ago
by
Jaime Arias
Browse files
Options
Downloads
Patches
Plain Diff
revert files
parent
faceaf86
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
maude/semantics.maude
+32
-32
32 additions, 32 deletions
maude/semantics.maude
maude/state.maude
+6
-8
6 additions, 8 deletions
maude/state.maude
maude/syntax.maude
+3
-5
3 additions, 5 deletions
maude/syntax.maude
with
41 additions
and
45 deletions
maude/semantics.maude
+
32
−
32
View file @
90cf5cea
...
...
@@ -17,7 +17,7 @@ mod NPTAD-INTERPRETER is
var TS : TickState .
vars L1 L2 L1' L2' : Location .
var ACT : Action .
var A
I
A
I
1 A
I
2 : A
utoId
.
var A
G
A
G
1 A
G
2 : A
gent
.
vars RESET RESET1 RESET2 : Resets .
vars G G1 G2 INV INV1 INV2 : Constraint .
vars R1 R2 : RExpr .
...
...
@@ -47,12 +47,12 @@ mod NPTAD-INTERPRETER is
.
crl [local] :
{ NET, < A
I
| ( @ L1 inv INV : (when G local ACT do { RESET } goto L1' , TRANS )), SSTDEF > }
< tick: tickNotOk locs: (A
I
@ L1, LOCS)
{ NET, < A
G
| ( @ L1 inv INV : (when G local ACT do { RESET } goto L1' , TRANS )), SSTDEF > }
< tick: tickNotOk locs: (A
G
@ L1, LOCS)
clocks: CVALUES parameters: PVALUES dvariables: DVVALUES constraint: CONS n: N >
=>
{ NET, < A
I
| ( @ L1 inv INV : (when G local ACT do { RESET } goto L1' , TRANS )), SSTDEF > }
< tick: tickOk locs: (A
I
@ L1', LOCS)
{ NET, < A
G
| ( @ L1 inv INV : (when G local ACT do { RESET } goto L1' , TRANS )), SSTDEF > }
< tick: tickOk locs: (A
G
@ L1', LOCS)
clocks: CVALUES' parameters: PVALUES dvariables: DVVALUES' constraint: CONS' n: N >
if
CVALUES' := reset-clocks(RESET, CVALUES) /\
...
...
@@ -60,20 +60,20 @@ mod NPTAD-INTERPRETER is
--- Guard evaluated with the current values and the invariant at L1' with the new values
CONS' := CONS and
eval(G, CVALUES, PVALUES, DVVALUES) and
inv( ( NET, < A
I
| ( @ L1 inv INV : (when G local ACT do { RESET } goto L1' , TRANS )), SSTDEF > ),
(A
I
@ L1') , CVALUES', PVALUES, DVVALUES') /\
inv( ( NET, < A
G
| ( @ L1 inv INV : (when G local ACT do { RESET } goto L1' , TRANS )), SSTDEF > ),
(A
G
@ L1') , CVALUES', PVALUES, DVVALUES') /\
smtCheck(CONS')
.
crl [binary] :
{ NET, < A
I
1 | ( @ L1 inv INV1 : (when G1 sync ACT do { RESET1 } goto L1' , TRANS1 )), SSTDEF1 >
, < A
I
2 | ( @ L2 inv INV2 : (when G2 sync ACT do { RESET2 } goto L2' , TRANS2 )), SSTDEF2 > }
< tick: tickNotOk locs: (A
I
1 @ L1, A
I
2 @ L2, LOCS)
{ NET, < A
G
1 | ( @ L1 inv INV1 : (when G1 sync ACT do { RESET1 } goto L1' , TRANS1 )), SSTDEF1 >
, < A
G
2 | ( @ L2 inv INV2 : (when G2 sync ACT do { RESET2 } goto L2' , TRANS2 )), SSTDEF2 > }
< tick: tickNotOk locs: (A
G
1 @ L1, A
G
2 @ L2, LOCS)
clocks: CVALUES parameters: PVALUES dvariables: DVVALUES constraint: CONS n: N >
=>
{ NET, < A
I
1 | ( @ L1 inv INV1 : (when G1 sync ACT do { RESET1 } goto L1' , TRANS1 )), SSTDEF1 >
, < A
I
2 | ( @ L2 inv INV2 : (when G2 sync ACT do { RESET2 } goto L2' , TRANS2 )), SSTDEF2 > }
< tick: tickOk locs: (A
I
1 @ L1', A
I
2 @ L2', LOCS)
{ NET, < A
G
1 | ( @ L1 inv INV1 : (when G1 sync ACT do { RESET1 } goto L1' , TRANS1 )), SSTDEF1 >
, < A
G
2 | ( @ L2 inv INV2 : (when G2 sync ACT do { RESET2 } goto L2' , TRANS2 )), SSTDEF2 > }
< tick: tickOk locs: (A
G
1 @ L1', A
G
2 @ L2', LOCS)
clocks: CVALUES' parameters: PVALUES dvariables: DVVALUES' constraint: CONS' n: N >
if
CVALUES' := reset-clocks(RESET2, reset-clocks(RESET1, CVALUES)) /\
...
...
@@ -82,9 +82,9 @@ mod NPTAD-INTERPRETER is
CONS' := CONS and
eval(G1, CVALUES, PVALUES, DVVALUES)
and eval(G2, CVALUES, PVALUES, DVVALUES)
and inv( ( NET, < A
I
1 | ( @ L1 inv INV1 : (when G1 sync ACT do { RESET1 } goto L1' , TRANS1 )), SSTDEF1 >
, < A
I
2 | ( @ L2 inv INV2 : (when G2 sync ACT do { RESET2 } goto L2' , TRANS2 )), SSTDEF2 > ),
(A
I
1 @ L1', A
I
2 @ L2'), CVALUES', PVALUES, DVVALUES') /\
and inv( ( NET, < A
G
1 | ( @ L1 inv INV1 : (when G1 sync ACT do { RESET1 } goto L1' , TRANS1 )), SSTDEF1 >
, < A
G
2 | ( @ L2 inv INV2 : (when G2 sync ACT do { RESET2 } goto L2' , TRANS2 )), SSTDEF2 > ),
(A
G
1 @ L1', A
G
2 @ L2'), CVALUES', PVALUES, DVVALUES') /\
smtCheck(CONS')
.
endm
...
...
@@ -97,7 +97,7 @@ mod NPTAD-INTERPRETER-FME is
var TS : TickState .
vars L1 L2 L1' L2' : Location .
var ACT : Action .
var A
I
A
I
1 A
I
2 : A
utoId
.
var A
G
A
G
1 A
G
2 : A
gent
.
vars RESET RESET1 RESET2 : Resets .
vars G G1 G2 INV INV1 INV2 : Constraint .
vars R1 R2 : RExpr .
...
...
@@ -127,12 +127,12 @@ mod NPTAD-INTERPRETER-FME is
.
crl [local] :
{ NET, < A
I
| ( @ L1 inv INV : (when G local ACT do { RESET } goto L1' , TRANS )), SSTDEF > }
< tick: tickNotOk locs: (A
I
@ L1, LOCS)
{ NET, < A
G
| ( @ L1 inv INV : (when G local ACT do { RESET } goto L1' , TRANS )), SSTDEF > }
< tick: tickNotOk locs: (A
G
@ L1, LOCS)
clocks: CVALUES parameters: PVALUES dvariables: DVVALUES constraint: CONS n: N >
=>
{ NET, < A
I
| ( @ L1 inv INV : (when G local ACT do { RESET } goto L1' , TRANS )), SSTDEF > }
< tick: tickOk locs: (A
I
@ L1', LOCS)
{ NET, < A
G
| ( @ L1 inv INV : (when G local ACT do { RESET } goto L1' , TRANS )), SSTDEF > }
< tick: tickOk locs: (A
G
@ L1', LOCS)
clocks: CVALUES' parameters: PVALUES dvariables: DVVALUES' constraint: CONS' n: N >
if
CVALUES' := reset-clocks(RESET, CVALUES) /\
...
...
@@ -142,20 +142,20 @@ mod NPTAD-INTERPRETER-FME is
fme-all( (vars-in-clocks(CVALUES) \ vars-in-clocks(CVALUES')),
CONS and
eval(G, CVALUES, PVALUES, DVVALUES) and
inv( ( NET, < A
I
| ( @ L1 inv INV : (when G local ACT do { RESET } goto L1' , TRANS )), SSTDEF > ),
(A
I
@ L1') , CVALUES', PVALUES, DVVALUES')) /\
inv( ( NET, < A
G
| ( @ L1 inv INV : (when G local ACT do { RESET } goto L1' , TRANS )), SSTDEF > ),
(A
G
@ L1') , CVALUES', PVALUES, DVVALUES')) /\
smtCheck(CONS')
.
crl [binary] :
{ NET, < A
I
1 | ( @ L1 inv INV1 : (when G1 sync ACT do { RESET1 } goto L1' , TRANS1 )), SSTDEF1 >
, < A
I
2 | ( @ L2 inv INV2 : (when G2 sync ACT do { RESET2 } goto L2' , TRANS2 )), SSTDEF2 > }
< tick: tickNotOk locs: (A
I
1 @ L1, A
I
2 @ L2, LOCS)
{ NET, < A
G
1 | ( @ L1 inv INV1 : (when G1 sync ACT do { RESET1 } goto L1' , TRANS1 )), SSTDEF1 >
, < A
G
2 | ( @ L2 inv INV2 : (when G2 sync ACT do { RESET2 } goto L2' , TRANS2 )), SSTDEF2 > }
< tick: tickNotOk locs: (A
G
1 @ L1, A
G
2 @ L2, LOCS)
clocks: CVALUES parameters: PVALUES dvariables: DVVALUES constraint: CONS n: N >
=>
{ NET, < A
I
1 | ( @ L1 inv INV1 : (when G1 sync ACT do { RESET1 } goto L1' , TRANS1 )), SSTDEF1 >
, < A
I
2 | ( @ L2 inv INV2 : (when G2 sync ACT do { RESET2 } goto L2' , TRANS2 )), SSTDEF2 > }
< tick: tickOk locs: (A
I
1 @ L1', A
I
2 @ L2', LOCS)
{ NET, < A
G
1 | ( @ L1 inv INV1 : (when G1 sync ACT do { RESET1 } goto L1' , TRANS1 )), SSTDEF1 >
, < A
G
2 | ( @ L2 inv INV2 : (when G2 sync ACT do { RESET2 } goto L2' , TRANS2 )), SSTDEF2 > }
< tick: tickOk locs: (A
G
1 @ L1', A
G
2 @ L2', LOCS)
clocks: CVALUES' parameters: PVALUES dvariables: DVVALUES' constraint: CONS' n: N >
if
CVALUES' := reset-clocks(RESET2, reset-clocks(RESET1, CVALUES)) /\
...
...
@@ -166,9 +166,9 @@ mod NPTAD-INTERPRETER-FME is
CONS
and eval(G1, CVALUES, PVALUES, DVVALUES)
and eval(G2, CVALUES, PVALUES, DVVALUES)
and inv( ( NET, < A
I
1 | ( @ L1 inv INV1 : (when G1 sync ACT do { RESET1 } goto L1' , TRANS1 )), SSTDEF1 >
, < A
I
2 | ( @ L2 inv INV2 : (when G2 sync ACT do { RESET2 } goto L2' , TRANS2 )), SSTDEF2 > ),
(A
I
1 @ L1', A
I
2 @ L2'), CVALUES', PVALUES, DVVALUES')) /\
and inv( ( NET, < A
G
1 | ( @ L1 inv INV1 : (when G1 sync ACT do { RESET1 } goto L1' , TRANS1 )), SSTDEF1 >
, < A
G
2 | ( @ L2 inv INV2 : (when G2 sync ACT do { RESET2 } goto L2' , TRANS2 )), SSTDEF2 > ),
(A
G
1 @ L1', A
G
2 @ L2'), CVALUES', PVALUES, DVVALUES')) /\
smtCheck(CONS')
.
endm
This diff is collapsed.
Click to expand it.
maude/state.maude
+
6
−
8
View file @
90cf5cea
...
...
@@ -14,7 +14,7 @@ load fme .
--- Definition of the state of a PTA: values for discrete variables and clocks
--- as well as the current location for each automaton
--- as well as the current location for each
agent/
automaton
fmod VALUATION is
pr NETWORK .
pr FOURIER-MOTZKIN .
...
...
@@ -22,8 +22,8 @@ fmod VALUATION is
--- From parameters, clocks, variables and locations to their current values
sorts LocValuation ClockValuation ParValuation DVarValuation .
--- Current location for a given automaton
op _@_ : A
utoId
Location -> LocValuation [ctor prec 10 format(g g g o)] .
--- Current location for a given automaton
/agent
op _@_ : A
gent
Location -> LocValuation [ctor prec 10 format(g g g o)] .
--- Current value for a clock
op _:_ : Clock RExpr -> ClockValuation [ctor prec 10] .
--- Current value for a parameter
...
...
@@ -153,7 +153,7 @@ fmod STATE is
var N : Nat .
var TS : TickState .
vars L1 L2 L1' L2' : Location .
var A
I
: A
utoId
.
var A
G AG1 AG2
: A
gent
.
vars C1 C2 CLOCK : Clock .
vars RESET RESET1 RESET2 : Resets .
vars G G1 G2 INV INV1 INV2 : Constraint .
...
...
@@ -235,8 +235,6 @@ fmod STATE is
eq eval(DVAR != R, CVALUES, PVALUES, DVVALUES) = eval(DVAR, DVVALUES) =/== R .
eq eval(DVAR > R, CVALUES, PVALUES, DVVALUES) = eval(DVAR, DVVALUES) > R .
eq eval(DVAR < R, CVALUES, PVALUES, DVVALUES) = eval(DVAR, DVVALUES) < R .
eq eval(DVAR >= R, CVALUES, PVALUES, DVVALUES) = eval(DVAR, DVVALUES) >= R .
eq eval(DVAR <= R, CVALUES, PVALUES, DVVALUES) = eval(DVAR, DVVALUES) <= R .
--- Discrete Variables
eq eval(DVAR, ((DVAR : R), DVVALUES)) = R .
...
...
@@ -256,7 +254,7 @@ fmod STATE is
--- Extracting the invariants
op inv : Network SetLocValuation SetClockValuation SetParValuation SetDVarValuation -> BoolExpr .
eq inv(NET, empty, CVALUES, PVALUES, DVVALUES) = true .
eq inv( (< A
I
| (@ L1 inv INV : TRANS ), SSTDEF >, NET),
((A
I
@ L1) , LOCS) , CVALUES, PVALUES, DVVALUES) =
eq inv( (< A
G
| (@ L1 inv INV : TRANS ), SSTDEF >, NET),
((A
G
@ L1) , LOCS) , CVALUES, PVALUES, DVVALUES) =
eval(INV, CVALUES, PVALUES, DVVALUES) and inv(NET, LOCS, CVALUES, PVALUES, DVVALUES) .
endfm
This diff is collapsed.
Click to expand it.
maude/syntax.maude
+
3
−
5
View file @
90cf5cea
...
...
@@ -13,7 +13,7 @@ networks of PTAs.
fmod BASE is
sort Location .
sorts Action .
sort A
utoId
. --- Identifiers for automata
sort A
gent
. --- Identifiers for automata
sort Clock .
sort Parameter .
sort DVariable . --- Discrete/integer variables
...
...
@@ -61,12 +61,10 @@ fmod CONSTRAINT is
op _>_ : ClockRExpr PTA-LinRExpr -> Constraint [ctor] .
op _>=_ : ClockRExpr PTA-LinRExpr -> Constraint [ctor] .
op _=_ : ClockRExpr PTA-LinRExpr -> Constraint [ctor] .
op _!=_ : DVariable Rat -> Constraint [ctor] .
op _=_ : DVariable Rat -> Constraint [ctor] .
op _!=_ : DVariable Rat -> Constraint [ctor] .
op _<_ : DVariable Rat -> Constraint [ctor] .
op _<=_ : DVariable Rat -> Constraint [ctor] .
op _>_ : DVariable Rat -> Constraint [ctor] .
op _>=_ : DVariable Rat -> Constraint [ctor] .
endfm
--- Reset expressions (including changing values for discrete variables)
...
...
@@ -115,7 +113,7 @@ fmod AUTOMATON is
--- Automaton as a set of locations and transitions
sort Automaton .
op <_|_> : A
utoId
SetStateDef -> Automaton [ctor] .
op <_|_> : A
gent
SetStateDef -> Automaton [ctor] .
endfm
view Automaton from TRIV to AUTOMATON is sort Elt to Automaton . endv
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment