Open pjljvandelaar opened 5 years ago
TXS >> TorXakis :: Model-Based Testing
TXS >> txsserver starting: "PC-31093.tsn.tno.nl" : 55355 TXS >> Solver "z3" initialized : Z3 [4.6.0] TXS >> TxsCore initialized TXS >> input files parsed: TXS >> p1.txs TXS >> info TXS >> TorXakis version : 0.6.0 (commit: 6f02370) TXS >> Build time : Thu 04/05/2018 9:05:20.97 TXS >> stepper M TXS >> Stepper started TXS >> step 10 TXS >> .....1: Act { { ( Input1, [ 0 ] ) } } TXS >> .....2: Act { { ( Input2, [ 1 ] ) } } TXS >> .....3: Act { { ( Input1, [ 0 ] ) ( Input2, [ 0 ] ) ( Output, [ 1 ] ) } } TXS >> .....4: Act { { ( Output, [ 0 ] ) } } TXS >> no state or deadlock TXS >> FAIL: No Output (Quiescence) TXS >>
Note that I had to change the model:
CHAN IN
CHAN OUT Input1, Input2, Output
SYNC {Input1},{Input2},{Output},{Output | Input1 | Input2}
is not allowed with combinations of inputs and outputs. A set of SYNC actions must be input or output (what should a tester otherwise do with it?). Another bug in the new compiler.
So according to Jan, in a multi action,
So the rewrite rule
A ! x <==> A ? A$1 [[ A$1 == x ]]
is more complicated
A ! x | B ? x [[ x>0 ]] >-> p <==> A ? A$1 | B ? B$1 [[ (A$1 == x) /\ (B$1 > 0) ]] >-> p [x/B$1]
And the context can change back and forth, like in the following example
Input1 ?x
| Input2 ?y
| Output ! x + y
[[ x == y ]]
For single actions, I could easily accept these rules. For multi-actions, I have my doubts whether these are the easiest ones for our users (both in the TorXakis language and at our API where you first make an ActOffer and then combine it into an ActionPref and use it in a large behaviour).
At 2. you state use before declaration which other people consider as counter-intuitive.
I have no problem with forbidding using newly defined variables in exclamation marks, since
one could easily write the more clear statement Output ? z | Input1 ?x | Input2 ?y [[ (x == y) /\ (z == x+y) ]]
I agree that the syntax should be clearly defined in the corner cases. Since one can put curly brackets around the actions to create a single multi action, for me a multi action hints at a shared scope. See e.g.
{ Input1 ?x
| Input2 ?y
| Output ! x + y
} [[ x == y ]]
Implementing the current behaviour of torxakis is easy given the name and a unique id that distinguished the one x
from the other x
.
However, in the new implementation, we removed this unique id and want to rely on the name only.
Since the code is bad / difficult to read anyway, it is insufficient reason for me to go back and add the unique id.
Discussed with Corado. He came up with
A ? y [[y >0]] >-> { B ?x | C !x } [[ x > 5]] >-> ....
We have now five choices
A!x | B?x
.Let's discuss on monday!
Note LPE handles it fine (some small changes for readability):
PROCDEF LPE_proxyProcess [ Input1 :: Int; Input2 :: Int; Output :: Int ] ( pc :: Int; x1 :: Int; x2 :: Int; y1 :: Int; x3 :: Int; y2 :: Int; x4 :: Int; y3 :: Int )
::=
( { Input1 ? Input1$1 :: Int } [[ ( 0 == pc ) ]]
>-> ( LPE_proxyProcess [Input1,Input2,Output] ( 1, Input1$1, x2, y1, x3, y2, x4, y3 )
) )
##
( { Input2 ? Input2$1 :: Int } [[ ( IF ( 1 == pc ) THEN (not (( Input2$1 == x1 )) ) ELSE False FI ) ]]
>-> ( LPE_proxyProcess [Input1,Input2,Output] ( 2, x1, x1, Input2$1, x3, y2, x4, y3 )
) )
##
( { Input1 ? Input1$1 :: Int | Input2 ? Input2$1 :: Int | Output ? Output$1 :: Int } [[ ( IF ( 2 == pc ) THEN ( IF ( Input1$1 == Input2$1 ) THEN ( Output$1 == ( x2 + y1 ) ) ELSE False FI ) ELSE False FI ) ]]
>-> ( LPE_proxyProcess [Input1,Input2,Output] ( 3, x1, x2, y1, x2, y1, Input1$1, Input2$1 )
) )
##
( { Output ? Output$1 :: Int } [[ ( IF ( 3 == pc ) THEN ( Output$1 == ( x4 + y3 ) ) ELSE False FI ) ]]
>-> ( LPE_proxyProcess [Input1,Input2,Output] ( -1, (ANY :: Int), (ANY :: Int), (ANY :: Int), (ANY :: Int), (ANY :: Int), (ANY :: Int), (ANY :: Int) )
) )
ENDDEF
The following model is accepted by TorXakis:
However when doing
one obtains
[]
.The scoping rules according to Jan should be:
I don't know whether I agree: I think an act offer should be a single data structure. Furthermore, we often use the following transformation as well:
Applying this in
p
yieldsmaking it even stranger that the x and y should be different (due to their scope)!
I think we should make a decision that is also clear to our users. I have no problems with even forbidding this construct (declaring variable using ? and communicating its value using ! in a single ActOffer).