ltlcross: add option --strength and --ambiguous

Suggested by František Blahoudek.

* bin/ltlcross.cc: Implement the two options.
* doc/org/ltlcross.org, NEWS: Document them.
* tests/core/complementation.test: Adjust test case.
* tests/core/ltlcross3.test, tests/core/unambig.test: More tests.
This commit is contained in:
Alexandre Duret-Lutz 2016-10-13 15:41:49 +02:00
parent cc1191cd66
commit 3b5fa22a3b
6 changed files with 212 additions and 118 deletions

View file

@ -38,7 +38,7 @@ EOF
ltlcross -F input 'ltl2tgba --generic -D' --csv=out.csv
# Make sure all the automata produced where deterministic
cut -d, -f16 < out.csv > det.csv
cut -d, -f12 < out.csv > det.csv
cat >expected <<EOF
"nondet_aut"
0

View file

@ -62,6 +62,39 @@ test `grep 'error:.*returned exit code 1' stderr | wc -l` -eq 2
test `grep '"exit code",1' out.csv | wc -l` -eq 0
check_csv out.csv
# Additional columns should not be an issue
run 1 ltlcross "$ltl2tgba -s %f >%N" 'false %f >%N' \
-f a --csv=out.csv --strength 2>stderr
grep '"exit_status"' out.csv
grep '"exit_code"' out.csv
grep '"nonacc_scc","terminal_scc","weak_scc","strong_scc"' out.csv
grep '"terminal_aut","weak_aut","strong_aut"' out.csv
grep -v '"ambiguous_aut"' out.csv
test `grep 'error:.*returned exit code 1' stderr | wc -l` -eq 2
test `grep '"exit code",1' out.csv | wc -l` -eq 2
check_csv out.csv
run 1 ltlcross "$ltl2tgba -s %f >%N" 'false %f >%N' \
-f a --csv=out.csv --ambiguous 2>stderr
grep '"exit_status"' out.csv
grep '"exit_code"' out.csv
grep '"ambiguous_aut"' out.csv
grep -v '"terminal_aut"' out.csv
test `grep 'error:.*returned exit code 1' stderr | wc -l` -eq 2
test `grep '"exit code",1' out.csv | wc -l` -eq 2
check_csv out.csv
run 1 ltlcross "$ltl2tgba -s %f >%N" 'false %f >%N' \
-f a --csv=out.csv --ambiguous --strength 2>stderr
grep '"exit_status"' out.csv
grep '"exit_code"' out.csv
grep '"nonacc_scc","terminal_scc","weak_scc","strong_scc"' out.csv
grep '"terminal_aut","weak_aut","strong_aut"' out.csv
grep '"ambiguous_aut"' out.csv
test `grep 'error:.*returned exit code 1' stderr | wc -l` -eq 2
test `grep '"exit code",1' out.csv | wc -l` -eq 2
check_csv out.csv
# Likewise for timeouts
echo foo >bug
run 0 ltlcross 'sleep 5; false %f >%N' 'false %f >%N' \

View file

@ -228,3 +228,19 @@ State: 2
--END--
EOF
diff output expected
ltlcross --ambiguous --automata 'ltl2tgba -U' ltl2tgba -fFGa -fGFa --csv=out
cut -d, -f13 out >ltlcross.res
cat >expected <<EOF
"ambiguous_aut"
0
1
0
0
0
0
0
1
EOF
diff expected ltlcross.res