Support reading the new style of neverclaim output by Spin 6.24+.
* src/neverparse/neverclaimparse.yy, src/neverparse/neverclaimscan.ll: Allow transitions between do..od, recognize atomic and assert. * src/neverparse/parsedecl.hh: Pass the error_list to the lexer. * src/tgbatest/neverclaimread.test: Add a test case.
This commit is contained in:
parent
ff102d3d94
commit
327bd2d621
4 changed files with 162 additions and 28 deletions
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (C) 2010, 2011, 2012 Laboratoire de Recherche et
|
||||
# Copyright (C) 2010, 2011, 2012, 2013 Laboratoire de Recherche et
|
||||
# Développement de l'Epita (LRDE).
|
||||
#
|
||||
# This file is part of Spot, a model checking library.
|
||||
|
|
@ -68,6 +68,51 @@ diff stdout expected
|
|||
rm input stdout expected
|
||||
|
||||
|
||||
# Same test, but with the newer syntax output since Spin 6.24
|
||||
cat >input <<EOF
|
||||
never {
|
||||
T2_init:
|
||||
do
|
||||
:: (1) -> goto T2_init
|
||||
:: (p1 && p0) -> goto T1
|
||||
od;
|
||||
T1:
|
||||
do
|
||||
:: atomic { (p1 && (! p0)) -> assert(!(p1 && (! p0))) }
|
||||
:: !(p1) -> goto T1
|
||||
:: ! (p1) -> goto T2_init
|
||||
od;
|
||||
}
|
||||
EOF
|
||||
|
||||
run 0 ../ltl2tgba -XN input > stdout
|
||||
|
||||
cat >expected <<EOF
|
||||
digraph G {
|
||||
0 [label="", style=invis, height=0]
|
||||
0 -> 1
|
||||
1 [label="T2_init"]
|
||||
1 -> 1 [label="1\n"]
|
||||
1 -> 2 [label="p0 & p1\n"]
|
||||
2 [label="T1"]
|
||||
2 -> 3 [label="p1 & !p0\n"]
|
||||
2 -> 2 [label="!p1\n"]
|
||||
2 -> 1 [label="!p1\n"]
|
||||
3 [label="accept_all", peripheries=2]
|
||||
3 -> 3 [label="1\n{Acc[1]}"]
|
||||
}
|
||||
EOF
|
||||
|
||||
# Sort out some possible inversions in the output.
|
||||
# (The order is not guaranteed by SPOT.)
|
||||
sed -e 's/!p0 & p1/p1 \& !p0/g' -e 's/p1 & p0/p0 \& p1/g' stdout \
|
||||
> tmp_ && mv tmp_ stdout
|
||||
diff stdout expected
|
||||
|
||||
rm input stdout expected
|
||||
|
||||
|
||||
|
||||
# Test broken guards in input
|
||||
cat >input <<EOF
|
||||
never {
|
||||
|
|
@ -93,9 +138,8 @@ EOF
|
|||
# that "p1 && " is an atomic property.
|
||||
|
||||
run 2 ../ltl2tgba -XN input > stdout 2>stderr
|
||||
cat >expected <<EOF
|
||||
input:9.16: syntax error, unexpected closing parenthesis
|
||||
input:9.16: ignoring trailing garbage
|
||||
cat >expected <<\EOF
|
||||
input:9.16: syntax error, unexpected $undefined, expecting fi or ':'
|
||||
EOF
|
||||
grep input: stderr >> stderrfilt
|
||||
diff stderrfilt expected
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue