Initial commit.

This commit is contained in:
2018-12-06 16:01:56 +01:00
parent 10867b60c2
commit 18eb3f6047
1011 changed files with 345688 additions and 10 deletions

View File

@@ -0,0 +1,17 @@
type FState is union NOMINAL | LOST | ERROR end
type FailureType is union Err | Loss | Ok end
type Flows is record I:FailureType, O:FailureType end
function update(S : FState, env : Flows) : Flows is
var f : Flows := {I=env.I, O=env.O}
begin
f.O := (S = NOMINAL ? f.I : (S = LOST ? Loss : Err));
return f
end
process Function(&S : FState, &env : Flows) is
states s0
from s0 select
on (S != LOST); S := LOST; env := update(S, env); loop
[] on (S = NOMINAL); S := ERROR; env := update(S, env); loop
end

View File

@@ -0,0 +1,12 @@
domain FState = {NOMINAL, LOST, ERROR} ;
domain FailureType = {Err, Loss, Ok} ;
node Function
flow I : FailureType : in ; O : FailureType : out ;
state S : FState ;
event fail_loss, fail_err ;
init S := NOMINAL ;
trans S != LOST |- fail_loss -> S := LOST ;
S = NOMINAL |- fail_err -> S := ERROR ;
assert O = case { S = NOMINAL : I, S = LOST : Loss, else Err } ;
edon

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,12 @@
domain BType = {Empty, Full} ;
node Pre
flow I : FailureType : in; O: FailureType : out;
state Stored, Delayed : FailureType, S : BType;
event pre_read, pre_wait;
init Stored := Ok, Delayed := Ok, S := Empty;
trans
(Stored != I) & (S = Empty) |- pre_read -> Stored := I, S = Full;
(S = Full) |- pre_wait -> Delayed := Stored, S = Empty;
assert O = Delayed;
extern law (pre_read) = "[0,0]"; law (pre_wait) = "[a,b]";
edon

View File

@@ -0,0 +1,8 @@
type BType is union Empty | Full end
process Pre(&Stored, &Delayed : FailureType, S : BType, &env : Flows) is
states s0
from s0 select
on (Stored != env.I and S = Empty); wait [0,0]; Stored := I; ...
[] on (S = Full); wait [a,b]; Delayed := Stored; S := Empty; ...
end

View File

@@ -0,0 +1,22 @@
process Pre(&Stored, &Delayed : FailureType, S : BType, &env : Flows) is
states s0
from s0 select
on (Stored != env.I and S = Empty); wait [0,0]; Stored := env.I; $\ldots$
[] on (S = Full); wait [a,b]; Delayed := Stored; S := Empty; $\ldots$
end
process delay[go : in FailureType](&O : FailureType) is
states sEmpty, sFull
var delayed : FailureType := Ok
from sEmpty go?delayed; to sFull
from sFull wait [a,b]; O := delayed; to sEmpty
process front[p,q : out FailureType](&I : FailureType) is
states s
var stored : FailureType := Ok
from s on (I != stored); stored := I; select p!I [] q!I end; loop
component Pre_2(&I, &O: FailureType) is
port go1, go2 : FailureType in [0,0]
priority go1 > go2
par * in front[go1,go2](&I) || delay[go1](&O) || delay[go2](&O) end