hierarchy: Rewrite is_recurrence(), is_persistence() and add tests
* spot/tl/hierarchy.cc: Rewrite is_recurrence(), is_persistence() * spot/tl/hierarchy.hh: Fix typo. * tests/core/hierarchy.test: Add tests.
This commit is contained in:
parent
d89579321f
commit
7e0fc448c5
3 changed files with 86 additions and 47 deletions
|
|
@ -66,3 +66,37 @@ diff out expected
|
|||
|
||||
test B = `ltlfilt --format=%h -f '(Gb R (b xor Gb)) W (a W Xa)'`
|
||||
ltlfilt -q --safety --guarantee -f '(Gb R (b xor Gb)) W (a W Xa)'
|
||||
|
||||
# make sure SPOT_PR_CHECK is read.
|
||||
randltl -n -1 a b c | ltlfilt -v --syntactic-safety --syntactic-guarantee \
|
||||
--syntactic-obligation --syntactic-recurrence --syntactic-persistence \
|
||||
-n 100 > res
|
||||
cat res | SPOT_PR_CHECK=x ltlfilt --recurrence 2>err && exit 1
|
||||
cat res | SPOT_PR_CHECK=9 ltlfilt --recurrence 2>err && exit 1
|
||||
grep SPOT_PR_CHECK err
|
||||
|
||||
# Testing Recurrence.
|
||||
cat res | ltlfilt --recurrence > r0
|
||||
for i in 1 2; do
|
||||
cat res | SPOT_PR_CHECK=$i ltlfilt --recurrence > r$i
|
||||
done
|
||||
diff r0 r2
|
||||
diff r1 r2
|
||||
cat res | ltlfilt -o %h.ltl
|
||||
cat R.ltl O.ltl G.ltl S.ltl B.ltl | sort > rogsb.ltl
|
||||
sort r2 > r3
|
||||
diff r3 rogsb.ltl
|
||||
|
||||
# Testing Persistence.
|
||||
cat res | ltlfilt --persistence > p0
|
||||
for i in 1 2; do
|
||||
cat res | SPOT_PR_CHECK=$i ltlfilt --persistence > p$i
|
||||
done
|
||||
diff p0 p2
|
||||
diff p1 p2
|
||||
cat res | ltlfilt -o %h.ltl
|
||||
cat P.ltl O.ltl G.ltl S.ltl B.ltl | sort > pogsb.ltl
|
||||
sort p2 > p3
|
||||
diff p3 pogsb.ltl
|
||||
|
||||
exit 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue