include "sequence_aux.csp"
include "function_aux.csp"
include "auxiliar.csp"
include "rules.csp"
datatype Direction = req | ack
Value = {0..3}
channel wrt : Direction.Value
channel rd : Direction.Value
PROT_CELL(e) = |~| v2:Value @ e.req?v1 -> e.ack.v2 -> PROT_CELL(e)
DUAL_PROT_CELL(e) = |~| v1:Value @ e.req.v1 -> e.ack?v2 -> DUAL_PROT_CELL(e)
GET_CHANNELS(P) =
let f =
<
(, { wrt,rd })
>
within apply(f,P )
inputs(P) =
let f =
<
( , {| |})
>
within apply(f, P )
outputs(P) =
let f =
<
( , {| |})
>
within apply(f,P)
--Condition A.1: Alphabets are disjont
--assert STOP [T= RUN(inter(events(),events()))
--Condition A.2: I/O Process
--Condition A.2.1: Every channel in P is an I/O Channel
assert not Test(inter(inputs(),outputs()) == {}) [T= ERROR
--Condition A.2.2: The contract has infinite set of traces
assert not HideAll():[divergence free [FD]]
--Condition A.2.3: The contract is divergence-free
assert :[divergence free [FD]]
--Condition A.2.4: The contract is input deterministic
assert LHS_InputDet() [F= RHS_InputDet()
--Condition A.2.5: The contract is strong output decisive
assert LHS_OutputDec_A() [F= RHS_OutputDec_A()
assert LHS_OutputDec_B(,wrt) [F= RHS_OutputDec_B(,wrt)
assert LHS_OutputDec_B(,rd) [F= RHS_OutputDec_B(,rd)