ltlsynt: fix a few issues with --csv

Some columns were superfluous, other had inconsistent names, and some
times where not tracked.

* spot/twaalgos/synthesis.cc: Improve tracking of times and verbose
messages.
* bin/ltlsynt.cc (print_csv): Adjust CSV columns.
* tests/core/ltlsynt.test, tests/core/ltlsynt2.test,
tests/core/ltlsynt-pgame.test: Adjust expected CSV and verbose
messages.
* doc/org/ltlsynt.org: Give some example.
This commit is contained in:
Alexandre Duret-Lutz 2024-09-04 22:47:50 +02:00
parent a22a05b8ec
commit b729aa3f30
7 changed files with 175 additions and 54 deletions

View file

@ -143,12 +143,11 @@ test 4 = `wc -l < out.csv`
ltlsynt --from-pgame starve.ehoa \
--from-pgame UnderapproxDemo2.ehoa \
--from-pgame aut7.hoa --csv=out.csv >result || :
--from-pgame aut7.hoa --csv-without-formula=out.csv >result || :
test 4 = `wc -l < out.csv`
cut -d, -f 9,10,11,12,13 <out.csv >right
end='"strat_num_states","strat_num_edges"'
cat >expect <<EOF
"realizable","dpa_num_states","dpa_num_states_env",$end
"realizable","game_states","game_states_env","strat_states","strat_edges"
1,4,2,1,2
0,9,4,0,0
0,10,5,0,0

View file

@ -211,7 +211,7 @@ there are 1 subformulas
trying to create strategy directly for GFa <-> GFb
translating formula done in X seconds
direct strategy was found.
direct strat has 1 states, 2 edges and 0 colors
direct strategy has 1 states and 1 edges
simplification took X seconds
EOF
ltlsynt --ins=a --outs=b -f 'GFa <-> GFb' --verbose --algo=ps 2> out
@ -660,7 +660,7 @@ there are 1 subformulas
trying to create strategy directly for GFa <-> GFb
translating formula done in X seconds
direct strategy was found.
direct strat has 1 states, 2 edges and 0 colors
direct strategy has 1 states and 1 edges
simplification took X seconds
EOF
ltlsynt -f '(GFa <-> GFb) && (G(c <-> d))' --outs=b,c --verbose 2> out
@ -676,7 +676,7 @@ do
trying to create strategy directly for $f
translating formula done in X seconds
direct strategy was found.
direct strat has 1 states, 2 edges and 0 colors
direct strategy has 1 states and 1 edges
simplification took X seconds
EOF
ltlsynt -f "$f" --outs=b,c --verbose --decompose=0 \
@ -705,7 +705,7 @@ cat >exp <<EOF
trying to create strategy directly for (GFb <-> GFa) & G((a & c) | (!a & !c))
translating formula done in X seconds
direct strategy was found.
direct strat has 1 states, 2 edges and 0 colors
direct strategy has 1 states and 1 edges
simplification took X seconds
EOF
ltlsynt -f '(GFb <-> GFa) && (G((a&c)|(!a&!c)))' --outs=b,c --verbose\
@ -719,7 +719,7 @@ cat >exp <<EOF
trying to create strategy directly for Fa <-> FGb
translating formula done in X seconds
direct strategy was found.
direct strat has 2 states, 3 edges and 0 colors
direct strategy has 2 states and 3 edges
simplification took X seconds
EOF
ltlsynt -f "Fa <-> FGb" --outs=b,c --verbose --decompose=0 --verify 2> out
@ -789,8 +789,9 @@ new formula: x & y
new formula: 1
there are 1 subformulas
trying to create strategy directly for 1
translating formula done in X seconds
direct strategy was found.
direct strat has 1 states, 1 edges and 0 colors
direct strategy has 1 states and 1 edges
simplification took X seconds
AIG circuit was created in X seconds and has 0 latches and 0 gates
EOF
@ -804,13 +805,15 @@ cat >exp <<EOF
there are 2 subformulas
working on subformula Gx
trying to create strategy directly for Gx
translating formula done in X seconds
direct strategy was found.
direct strat has 1 states, 1 edges and 0 colors
direct strategy has 1 states and 1 edges
simplification took X seconds
working on subformula Gy
trying to create strategy directly for Gy
translating formula done in X seconds
direct strategy was found.
direct strat has 1 states, 1 edges and 0 colors
direct strategy has 1 states and 1 edges
simplification took X seconds
AIG circuit was created in X seconds and has 0 latches and 0 gates
EOF
@ -1061,7 +1064,7 @@ there are 1 subformulas
trying to create strategy directly for GFi <-> GFo1
translating formula done in X seconds
direct strategy was found.
direct strat has 1 states, 2 edges and 0 colors
direct strategy has 1 states and 1 edges
simplification took X seconds
EOF
ltlsynt -f "G(o1|o2) & (GFi <-> GFo1)" --outs="o1,o2" --verbose\
@ -1255,8 +1258,9 @@ new formula: G(o1 | !o2) & G(!o1 | o2)
o2 := o1
new formula: G(o1 | !o1)
trying to create strategy directly for G(o1 | !o1)
translating formula done in X seconds
direct strategy was found.
direct strat has 1 states, 1 edges and 0 colors
direct strategy has 1 states and 1 edges
simplification took X seconds
working on subformula G(!i1 -> (o3 | !o4)) & G(!i2 -> (!o3 | o4))
the following signals can be temporarily removed:
@ -1266,8 +1270,9 @@ new formula: G(o3 | !o4) & G(!o3 | o4)
o4 := o3
new formula: G(o3 | !o3)
trying to create strategy directly for G(o3 | !o3)
translating formula done in X seconds
direct strategy was found.
direct strat has 1 states, 1 edges and 0 colors
direct strategy has 1 states and 1 edges
simplification took X seconds
REALIZABLE
HOA: v1
@ -1298,13 +1303,15 @@ new formula: G(i1->(o1 | !o2)) & G(!i1->(o3 | !o4)) & $gg
there are 2 subformulas
working on subformula G(i1->(o1 | !o2)) & G(i2->(!o1 | o2))
trying to create strategy directly for G(i1->(o1 | !o2)) & G(i2->(!o1 | o2))
translating formula done in X seconds
direct strategy was found.
direct strat has 1 states, 1 edges and 0 colors
direct strategy has 1 states and 1 edges
simplification took X seconds
working on subformula G(!i1->(o3 | !o4)) & G(!i2->(!o3 | o4))
trying to create strategy directly for G(!i1->(o3 | !o4)) & G(!i2->(!o3 | o4))
translating formula done in X seconds
direct strategy was found.
direct strat has 1 states, 1 edges and 0 colors
direct strategy has 1 states and 1 edges
simplification took X seconds
REALIZABLE
HOA: v1

View file

@ -48,7 +48,7 @@ except ImportError:
x = pandas.read_csv("out.csv")
x.to_csv('filtered.csv',
columns=('source', 'formula', 'algo',
'realizable', 'strat_num_states'),
'realizable', 'strat_states'),
index=False)
EOF
@ -56,7 +56,7 @@ EOF
$PYTHON test.py
cat >expected <<EOF
source,formula,algo,realizable,strat_num_states
source,formula,algo,realizable,strat_states
formulas.ltl:1,G(i1 <-> Xo1),lar,1,3
formulas.ltl:2,F(i1 xor i2) <-> Fo1,lar,1,2
formulas.ltl:3,i1 <-> F(o1 xor o2),lar,1,3
@ -72,7 +72,7 @@ ltlsynt --ins=i1,i2 -F input.csv/-2 --csv=out.csv -q && exit 2
test $? -eq 1
$PYTHON test.py
cat >expected <<EOF
source,formula,algo,realizable,strat_num_states
source,formula,algo,realizable,strat_states
input.csv:2,G(i1 <-> Xo1),lar,1,3
input.csv:3,F(i1 xor i2) <-> Fo1,lar,1,2
input.csv:4,i1 <-> F(o1 xor o2),lar,1,3
@ -85,7 +85,7 @@ grep -v 0,0 filtered.csv >input.csv
ltlsynt -F input.csv/-2 --csv=out.csv -q
$PYTHON test.py
cat >expected <<EOF
source,formula,algo,realizable,strat_num_states
source,formula,algo,realizable,strat_states
input.csv:2,G(i1 <-> Xo1),lar,1,3
input.csv:3,F(i1 xor i2) <-> Fo1,lar,1,2
input.csv:4,i1 <-> F(o1 xor o2),lar,1,3