Closed pglvdm closed 9 years ago
Sorry I found a smaller model where I can reproduce this issue:
types
Aircraft = token
channels
init, success, failure
givePermission, recordLanding, recordTakeOff : Aircraft
getLanded, getPermission : set of Aircraft
numberWaiting : nat
process Airport =
begin
functions
permitted: Aircraft -> bool
permitted(a) ==
true
down: Aircraft -> bool
down(a) ==
false
PreRecordLanding: Aircraft -> bool
PreRecordLanding(a) ==
permitted(a) and not down(a)
operations
GivePermission : Aircraft ==> ()
GivePermission(a) ==
return
pre not permitted(a)
actions
Cycle =
givePermission?a ->
( [not PreRecordLanding(a)] & success -> GivePermission(a)
[]
[permitted(a)] & failure -> Cycle)
@
init -> Cycle
end
What is the issue that this bug is suppose to represent? scope rules? What function is or should not be in scope where?
The error report I get is that the "permitted" function is not in scope when the "PreRecordLanding" function is invoked.
Minimised this further:
process P =
begin
functions
nested: () -> bool
nested() == true
outer: () -> bool
outer() == nested()
@
[outer()] & Skip
-- This is ok:
-- [nested()] & Skip
end
error at end of trace <c,c>
is:
Error 4034: Name 'nested()' not in scope in '/Users/jwc/Development/symphony/ide/product/target/products/eu.compassresearch.ide.product/macosx/cocoa/x86_64/SymphonyIDE/Symphony IDE.app/Contents/MacOS/workspace/a/a.cml' at line 11:15 at in '/Users/jwc/Development/symphony/ide/product/target/products/eu.compassresearch.ide.product/macosx/cocoa/x86_64/SymphonyIDE/Symphony IDE.app/Contents/MacOS/workspace/a/a.cml' at line 11:15
I have tried to cut it down to a small model but failed. So I can say that it fails for a CML model like:
With a trace like: [init, recordLanding.mk_token(7)] one gets:
which to me indicate that the scope rules are not r´correctly handled when functions in guards call other functions...