utwente-fmt / ltsmin

The LTSmin model checking toolset
http://ltsmin.utwente.nl
BSD 3-Clause "New" or "Revised" License
51 stars 30 forks source link

--ltl-semantics=spin not working for edge labels #109

Closed Meijuh closed 6 years ago

Meijuh commented 7 years ago

A system without a deadlock should give the same answer with --ltl-semantics=spin, --ltl-semantics=ltsmin.

In the following commandline: pnml2lts-mc example.pnml --ltl='[]<>(action=="t_3_a_1")' --ltl-semantics=ltsmin the ltl formula holds. Which is correct; ("a_1") can always fire in the future. Changing the semantics to spin: pnml2lts-mc example.pnml --ltl='[]<>(action=="t_3_a_1")' --ltl-semantics=spin, the formula does not hold.

Some things that I find peculiar:

The Petri-net can be found below.

https://gist.github.com/Meijuh/6bc2251c5494c33d89ae127983c13955

alaarman commented 7 years ago

The net doesn't work for me:

$ db pins2lts-mc/pnml2lts-mc example.pnml --ltl='[]<>(action=="t_3_a_1")'
(lldb) target create "pins2lts-mc/pnml2lts-mc" Current executable set to 'pins2lts-mc/pnml2lts-mc' (x86_64). (lldb) settings set -- target.run-args "example.pnml" "--ltl=[]<>(action==\"t_3_a_1\")" (lldb) r Process 53333 launched: '/Users/laarman/Projects/Workspace/ltsmin/src/pins2lts-mc/pnml2lts-mc' (x86_64) pnml2lts-mc( 0/ 4): Loading model from example.pnml pnml2lts-mc( 0/ 4): Edge label is id pnml2lts-mc( 0/ 4): Petri net has 8 places, 7 transitions and 24 arcs pnml2lts-mc( 0/ 4): Petri net processes_0_1_min_lang.dot analyzed pnml2lts-mc( 0/ 4): There are safe places Process 53333 stopped

Meijuh commented 6 years ago

@alaarman I have finally fixed the issue (it is on the next branch), you should now be able run the example on OSX. If we are unable to implement spin semantics for edge-based atomic predicates, we should probably disallow spin semantics for edge-based atomic predicates, and remove the "edge-based" code from the spins next-state function in pins2pins-ltl.c.

alaarman commented 6 years ago

I agree, the edge-based semantics are not worked out corrrectly for POR either.

Meijuh commented 6 years ago

So doing action based LTL + POR + any deadlock semantics should be forbidden? That is a separate issue, right?

Meijuh commented 6 years ago

I shall fix the first issue then...

alaarman commented 6 years ago

It might be a separate issue, but it is a reason to remove the edge-based code as you suggested. Its implementation is incomplete wrt POR (at least the invalid combination should be caught and raised as an error).

Meijuh commented 6 years ago

@alaarman regarding the first issue (disabling spin semantics for action-based LTL), do you think it is okay to set the ltsmin semantics by default? These semantics can namely handle both cases (state-based, action-based). If someone wants to enable spin semantics for action-based LTL I can simply raise an error.

alaarman commented 6 years ago

This will break comparisons with SPIN on Promela models (not sure how big of a deal that is). Perhaps we can switch to ltsmin semantics for action-based? Is action-based already well-defined? Otherwise we can set ltsmin semantics as default and raise one warning once a deadlock is found in the LTS (not in the cross-product). This can be done in the LTL layer with a CAS operation.

Meijuh commented 6 years ago

I don't know how well action based LTL (without POR) with ltsmin semantics is implemented? You tell me, at least I have not encountered any issues with it during this years RERS challenge. If there are no deadlocks in the system I guess ltsmin semantics and spin semantics are equivalent no? If that is the case, we could set the semantics to auto, meaning LTSmin will decide for itself (to use ltsmin semantics in case action-based atomic predicates are found.

alaarman commented 6 years ago

Ok, so the earlier issues are only related to POR. In absence of deadlocks the two are indeed equivalent.

Meijuh commented 6 years ago

@alaarman what do you think?

yanntm commented 6 years ago

Hi,

I'm not sure if it is the same issue, but with basic state based predicates I've had some change of behavior causing regression in my test suite recently.

../../lts_install_dir/bin/pins2lts-mc ./gal.so --threads=1 --when --ltl 'X(<>(X([]((LTLAP15==true)))))' --ltl-semantics=textbook

gives a correct answer (finds an accepted counter-example) but both semantics=ltsmin and semantics=spin fail to detect an accepting cycle.

NB : there are no deadlocks in the system. It's an example from MCC. NB2 : I never used the semantics flag before, behavior was fine wrt MCC@PN with default 'spin' semantics in previous tests NB3 : I'm unsure when the regression was introduced (within the last 2 months but that's not very precise). I'm building from next branch.

Trace below, sources attached

rail5.zip

Build an .so with

gcc -c -I/home/ythierry/git/ITS-Tools-pnmcc/lts_install_dir/include -I. -std=c99 -fPIC -O3 model.c
gcc -shared -o gal.so model.o

Traces : textbook is right, the other two are wrong per the MCC results.

[ythierry@oxygen Railroad-PT-005 (master)]$ ../../lts_install_dir/bin/pins2lts-mc  ./gal.so --threads=1 --when --ltl 'X(<>(X([]((LTLAP15==true)))))' --ltl-semantics=textbook
pins2lts-mc, 0.000: Registering PINS so language module
pins2lts-mc, 0.000, ** error **: Unable to open cgroup memory limit file /sys/fs/cgroup/memory/memory.limit_in_bytes: No such file or directory
pins2lts-mc, 0.000: Loading model from ./gal.so
pins2lts-mc, 0.000: library has no initializer
pins2lts-mc, 0.000: loading model GAL
pins2lts-mc, 0.000: completed loading model GAL
pins2lts-mc, 0.000: LTL layer: formula: X(<>(X([]((LTLAP15==true)))))
pins2lts-mc, 0.000: "X(<>(X([]((LTLAP15==true)))))" is not a file, parsing as formula...
pins2lts-mc, 0.000: buchi has 2 states
pins2lts-mc, 0.001: There are 76 state labels and 1 edge labels
pins2lts-mc, 0.001: State length is 55, there are 57 groups
pins2lts-mc, 0.001: Running cndfs using 1 core (sequential)
pins2lts-mc, 0.001: Using a tree table with 2^30 elements
pins2lts-mc, 0.001: Successor permutation: dynamic
pins2lts-mc, 0.001: Global bits: 2, count bits: 0, local bits: 0
pins2lts-mc, 0.014:  
pins2lts-mc, 0.014: Accepting cycle FOUND at depth 868!
pins2lts-mc, 0.014:  
pins2lts-mc, 0.014:  
pins2lts-mc, 0.014: Explored 909 states 3704 transitions, fanout: 4.075
pins2lts-mc, 0.014: Total exploration time 0.010 sec (0.010 sec minimum, 0.010 sec on average)
pins2lts-mc, 0.014: States per second: 90900, Transitions per second: 370400
pins2lts-mc, 0.014:  
pins2lts-mc, 0.014: State space has 1494 states, 0 are accepting
pins2lts-mc, 0.014: cndfs_1 (permutation: dynamic) stats:
pins2lts-mc, 0.014: blue states: 909 (60.84%), transitions: 0 (per worker)
pins2lts-mc, 0.014: red states: 0 (0.00%), bogus: 0  (0.00%), transitions: 0, waits: 0 (0.00 sec)
pins2lts-mc, 0.014: all-red states: 0 (0.00%), bogus 0 (0.00%)
pins2lts-mc, 0.014:  
pins2lts-mc, 0.014: Total memory used for local state coloring: 0.0MB
pins2lts-mc, 0.014:  
pins2lts-mc, 0.014: Queue width: 8B, total height: 867, memory: 0.01MB
pins2lts-mc, 0.014: Tree memory: 0.0MB, 22.5 B/state, compr.: 10.1%
pins2lts-mc, 0.014: Tree fill ratio (roots/leafs): 0.0%/0.0%
pins2lts-mc, 0.014: Stored 56 string chucks using 0MB
pins2lts-mc, 0.014: Total memory used for chunk indexing: 0MB
pins2lts-mc, 0.014: Est. total memory use: 0.0MB (~8192.0MB paged-in)
[ythierry@oxygen Railroad-PT-005 (master)]$ ../../lts_install_dir/bin/pins2lts-mc  ./gal.so --threads=1 --when --ltl 'X(<>(X([]((LTLAP15==true)))))' --ltl-semantics=spin
pins2lts-mc, 0.000: Registering PINS so language module
pins2lts-mc, 0.000, ** error **: Unable to open cgroup memory limit file /sys/fs/cgroup/memory/memory.limit_in_bytes: No such file or directory
pins2lts-mc, 0.000: Loading model from ./gal.so
pins2lts-mc, 0.000: library has no initializer
pins2lts-mc, 0.000: loading model GAL
pins2lts-mc, 0.000: completed loading model GAL
pins2lts-mc, 0.000: LTL layer: formula: X(<>(X([]((LTLAP15==true)))))
pins2lts-mc, 0.000: "X(<>(X([]((LTLAP15==true)))))" is not a file, parsing as formula...
pins2lts-mc, 0.000: buchi has 2 states
pins2lts-mc, 0.001: There are 76 state labels and 1 edge labels
pins2lts-mc, 0.001: State length is 55, there are 60 groups
pins2lts-mc, 0.001: Running cndfs using 1 core (sequential)
pins2lts-mc, 0.001: Using a tree table with 2^30 elements
pins2lts-mc, 0.001: Successor permutation: dynamic
pins2lts-mc, 0.001: Global bits: 2, count bits: 0, local bits: 0
pins2lts-mc, 0.017: [Blue] 920 levels 1000 states 4060 transitions
pins2lts-mc, 0.027:  
pins2lts-mc, 0.027: Explored 1853 states 7739 transitions, fanout: 4.176
pins2lts-mc, 0.027: Total exploration time 0.020 sec (0.020 sec minimum, 0.020 sec on average)
pins2lts-mc, 0.027: States per second: 92650, Transitions per second: 386950
pins2lts-mc, 0.027:  
pins2lts-mc, 0.027: State space has 1853 states, 0 are accepting
pins2lts-mc, 0.027: cndfs_1 (permutation: dynamic) stats:
pins2lts-mc, 0.027: blue states: 1853 (100.00%), transitions: 0 (per worker)
pins2lts-mc, 0.027: red states: 0 (0.00%), bogus: 0  (0.00%), transitions: 0, waits: 0 (0.00 sec)
pins2lts-mc, 0.027: all-red states: 0 (0.00%), bogus 0 (0.00%)
pins2lts-mc, 0.027:  
pins2lts-mc, 0.027: Total memory used for local state coloring: 0.0MB
pins2lts-mc, 0.027:  
pins2lts-mc, 0.027: Queue width: 8B, total height: 1273, memory: 0.01MB
pins2lts-mc, 0.027: Tree memory: 0.0MB, 21.8 B/state, compr.: 9.8%
pins2lts-mc, 0.027: Tree fill ratio (roots/leafs): 0.0%/0.0%
pins2lts-mc, 0.027: Stored 56 string chucks using 0MB
pins2lts-mc, 0.027: Total memory used for chunk indexing: 0MB
pins2lts-mc, 0.027: Est. total memory use: 0.0MB (~8192.0MB paged-in)
[ythierry@oxygen Railroad-PT-005 (master)]$ ../../lts_install_dir/bin/pins2lts-mc  ./gal.so --threads=1 --when --ltl 'X(<>(X([]((LTLAP15==true)))))' --ltl-semantics=ltsmin
pins2lts-mc, 0.000: Registering PINS so language module
pins2lts-mc, 0.000, ** error **: Unable to open cgroup memory limit file /sys/fs/cgroup/memory/memory.limit_in_bytes: No such file or directory
pins2lts-mc, 0.000: Loading model from ./gal.so
pins2lts-mc, 0.000: library has no initializer
pins2lts-mc, 0.000: loading model GAL
pins2lts-mc, 0.000: completed loading model GAL
pins2lts-mc, 0.000: LTL layer: formula: X(<>(X([]((LTLAP15==true)))))
pins2lts-mc, 0.000: "X(<>(X([]((LTLAP15==true)))))" is not a file, parsing as formula...
pins2lts-mc, 0.000: buchi has 2 states
pins2lts-mc, 0.001: There are 76 state labels and 1 edge labels
pins2lts-mc, 0.001: State length is 55, there are 56 groups
pins2lts-mc, 0.001: Running cndfs using 1 core (sequential)
pins2lts-mc, 0.001: Using a tree table with 2^30 elements
pins2lts-mc, 0.001: Successor permutation: dynamic
pins2lts-mc, 0.001: Global bits: 2, count bits: 0, local bits: 0
pins2lts-mc, 0.015: [Blue] 961 levels 1000 states 4126 transitions
pins2lts-mc, 0.025:  
pins2lts-mc, 0.025: Explored 1853 states 7739 transitions, fanout: 4.176
pins2lts-mc, 0.025: Total exploration time 0.020 sec (0.020 sec minimum, 0.020 sec on average)
pins2lts-mc, 0.025: States per second: 92650, Transitions per second: 386950
pins2lts-mc, 0.025:  
pins2lts-mc, 0.025: State space has 1853 states, 0 are accepting
pins2lts-mc, 0.025: cndfs_1 (permutation: dynamic) stats:
pins2lts-mc, 0.025: blue states: 1853 (100.00%), transitions: 0 (per worker)
pins2lts-mc, 0.025: red states: 0 (0.00%), bogus: 0  (0.00%), transitions: 0, waits: 0 (0.00 sec)
pins2lts-mc, 0.025: all-red states: 0 (0.00%), bogus 0 (0.00%)
pins2lts-mc, 0.025:  
pins2lts-mc, 0.025: Total memory used for local state coloring: 0.0MB
pins2lts-mc, 0.025:  
pins2lts-mc, 0.025: Queue width: 8B, total height: 1403, memory: 0.01MB
pins2lts-mc, 0.025: Tree memory: 0.0MB, 21.8 B/state, compr.: 9.8%
pins2lts-mc, 0.025: Tree fill ratio (roots/leafs): 0.0%/0.0%
pins2lts-mc, 0.025: Stored 56 string chucks using 0MB
pins2lts-mc, 0.025: Total memory used for chunk indexing: 0MB
pins2lts-mc, 0.025: Est. total memory use: 0.0MB (~8192.0MB paged-in)
yanntm commented 6 years ago

trying to trace, does'nt this seem suspicious to you ?

patch by Jeroen line 212