1dd316f188d267617b690145f58ebd6628aff83a.svn-base 1.26 KB
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
include "auxiliar.csp"
include "rules.csp"

datatype Direction = req | ack
Value = {1..3}
channel write : Direction.Value
channel read : Direction.Value

BUF = write.req?x -> read.req.x -> write.ack!x -> read.ack.x -> BUF


GET_CHANNELS(P) =
let f =
<
(BUF, { write,read })
>

within apply(f,P )

inputs(P) =
let f =

<
( BUF, {| write.req, read.req |})
>

within apply(f, P )

outputs(P) =
let f =
<
( BUF, {| write.ack, read.ack |})
>
within apply(f,P)

--Condition A.1: Alphabets are disjont
--assert STOP [T= RUN(inter(events(BUF),events(BUF)))

--Condition A.2: I/O Process
--Condition A.2.1: Every channel in P is an I/O Channel
assert not Test(inter(inputs(BUF),outputs(BUF)) == {}) [T= ERROR

--Condition A.2.2: The contract has infinite set of traces
assert HideAll(BUF):[divergence free [FD]]

--Condition A.2.3: The contract is divergence-free
assert BUF:[divergence free [FD]]

--Condition A.2.4: The contract is input deterministic
assert LHS_InputDet(BUF) [F= RHS_InputDet(BUF)

--Condition A.2.5: The contract is strong output decisive
assert LHS_OutputDec_A(BUF) [F= RHS_OutputDec_A(BUF)
assert LHS_OutputDec_B(BUF,write) [F= RHS_OutputDec_B(BUF,write)
assert LHS_OutputDec_B(BUF,read) [F= RHS_OutputDec_B(BUF,read)