hhu-stups / prob-issues

ProB issues (for probcli, ProB Tcl/Tk, ProB2, ProB2UI)
6 stars 0 forks source link

ProB v1.13.0 Error using revised example FourCounters.mch #349

Closed AndreaPasconcino closed 1 month ago

AndreaPasconcino commented 4 months ago

Please could anyone help me to understand the reason of raised error when a little change invoking operation of included TwoCounters.mch(see attached source code) ?

raised error messages: (Line:12 Col:2): Could not infer type of r1: (Line:12 Col:5): Could not infer type of r2: (Line:12 Col:36): Illegal use of operation identifier "t1.getcnt": (Line:12 Col:28): different number of variables on left and right side of a substitution : MachineRenamingRevised.zip

iTitus commented 1 month ago

It works for me when I change this:

13c13
<   r1,r2 <-- getfcnt = BEGIN r1,r2:= t1.getcnt  END
---
>   r1,r2 <-- getfcnt = BEGIN r1,r2<-- t1.getcnt  END

The := expects the same number of variables/expressins on the left and right side. If you want to get the "return values" of an operation you need to use the arrow syntax.