spot: Add 'langmap' option with dichotomy (it helps to choose min val)

* python/spot/__init__.py: Handle 'dicho' option in 'sat_minimize'.
* spot/priv/satcommon.cc: Implement get_number_of_distinct_vals.
* spot/priv/satcommon.hh: Declare get_number_of_distinct_vals.
* spot/twaalgos/dtbasat.cc: Use get_number_of_distinct_vals.
* spot/twaalgos/dtbasat.hh: Change dichotomy function's prototype.
* spot/twaalgos/dtwasat.cc: Use get_number_of_distinct_vals.
* spot/twaalgos/dtwasat.hh: Change dichotomy function's prototype.
Handle options.
* spot/twaalgos/postproc.cc: Handle options.
* spot/twaalgos/postproc.hh: Add dicho_langmap_ var for options.
* tests/core/satmin2.test: Add tests for dichotomy.
* tests/core/satmin.test: Add tests for dichotomy.
* tests/python/satmin.py: Replace 'dichotomy' with 'dicho' option.
This commit is contained in:
Alexandre GBAGUIDI AISSE 2016-12-14 10:57:56 +01:00
parent 7046a49622
commit 67e3a4f28e
12 changed files with 229 additions and 31 deletions

View file

@ -61,16 +61,22 @@ diff output expected
ltl2tgba -BD -x sat-minimize "GF(a <-> XXb)" -H >out
grep 'properties:.*state-acc' out
grep 'properties:.*deterministic' out
ltl2tgba -BD -x 'sat-minimize=3,param=0' "GF(a <-> XXb)" -H >out
ltl2tgba -BD -x sat-minimize=2 "GF(a <-> XXb)" -H >out
grep 'properties:.*state-acc' out
grep 'properties:.*deterministic' out
ltl2tgba -BD -x 'sat-minimize=3,param=1' "GF(a <-> XXb)" -H >out
ltl2tgba -BD -x 'sat-minimize=2,langmap' "GF(a <-> XXb)" -H >out
grep 'properties:.*state-acc' out
grep 'properties:.*deterministic' out
ltl2tgba -BD -x 'sat-minimize=3,param=2' "GF(a <-> XXb)" -H >out
ltl2tgba -BD -x 'sat-minimize=4,param=0' "GF(a <-> XXb)" -H >out
grep 'properties:.*state-acc' out
grep 'properties:.*deterministic' out
ltl2tgba -BD -x 'sat-minimize=3,param=50' "GF(a <-> XXb)" -H >out
ltl2tgba -BD -x 'sat-minimize=4,param=1' "GF(a <-> XXb)" -H >out
grep 'properties:.*state-acc' out
grep 'properties:.*deterministic' out
ltl2tgba -BD -x 'sat-minimize=4,param=2' "GF(a <-> XXb)" -H >out
grep 'properties:.*state-acc' out
grep 'properties:.*deterministic' out
ltl2tgba -BD -x 'sat-minimize=4,param=50' "GF(a <-> XXb)" -H >out
grep 'properties:.*state-acc' out
grep 'properties:.*deterministic' out
ltl2tgba -BD -x 'sat-minimize=3,param=-1' "GF(a <-> XXb)" -H >out
@ -128,6 +134,11 @@ EOF
# automata.
$autfilt --sat-minimize='acc="Fin(0)|Inf(1)"' test.hoa --stats=%s >output
test `cat output` = 1
$autfilt --sat-minimize='dicho,acc="Fin(0)|Inf(1)"' test.hoa --stats=%s >output
test `cat output` = 1
$autfilt --sat-minimize='dicho,langmap,acc="Fin(0)|Inf(1)"' test.hoa \
--stats=%s >output
test `cat output` = 1
$autfilt --sat-minimize='acc="Fin(0)|Inf(1)",assume,param=0' test.hoa \
--stats=%s >output
test `cat output` = 1
@ -161,6 +172,12 @@ test `cat output` = 1
$autfilt -S --sat-minimize='acc="Fin(0)|Inf(1)"' test.hoa \
--stats=%s > output
test `cat output` = 3
$autfilt -S --sat-minimize='dicho,acc="Fin(0)|Inf(1)"' test.hoa \
--stats=%s > output
test `cat output` = 3
$autfilt -S --sat-minimize='dicho,langmap,acc="Fin(0)|Inf(1)"' test.hoa \
--stats=%s > output
test `cat output` = 3
$autfilt -S --sat-minimize='acc="Fin(0)|Inf(1)",assume,param=0' test.hoa \
--stats=%s > output
test `cat output` = 3
@ -199,6 +216,22 @@ grep 'States: 3' output
grep 'acc-name: parity max even 3' output
grep 'Acceptance: 3 Inf(2) | (Fin(1) & Inf(0))' output
test 3 = `grep -c 'State: [012] {[012]}' output`
$autfilt -S --sat-minimize='acc="parity max even 3",colored,dicho' -H \
test.hoa > output
cat output
grep 'properties:.*colored' output
grep 'States: 3' output
grep 'acc-name: parity max even 3' output
grep 'Acceptance: 3 Inf(2) | (Fin(1) & Inf(0))' output
test 3 = `grep -c 'State: [012] {[012]}' output`
$autfilt -S --sat-minimize='acc="parity max even 3",colored,dicho,langmap' -H \
test.hoa > output
cat output
grep 'properties:.*colored' output
grep 'States: 3' output
grep 'acc-name: parity max even 3' output
grep 'Acceptance: 3 Inf(2) | (Fin(1) & Inf(0))' output
test 3 = `grep -c 'State: [012] {[012]}' output`
$autfilt -S --sat-minimize='acc="parity max even 3",colored,assume,param=0' \
-H test.hoa > output
cat output
@ -306,6 +339,10 @@ State: 0
EOF
$autfilt -H --sat-minimize special.hoa > output
diff output expected
$autfilt -H --sat-minimize='dicho' special.hoa > output
diff output expected
$autfilt -H --sat-minimize='dicho,langmap' special.hoa > output
diff output expected
$autfilt -H --sat-minimize='assume,param=0' special.hoa > output
diff output expected
$autfilt -H --sat-minimize='assume,param=1' special.hoa > output
@ -343,6 +380,12 @@ EOF
$autfilt --sat-minimize='acc="Streett 1",max-states=2' foo.hoa \
--stats=%s >out
test "`cat out`" = 1
$autfilt --sat-minimize='acc="Streett 1",max-states=2,dicho' foo.hoa \
--stats=%s >out
test "`cat out`" = 1
$autfilt --sat-minimize='acc="Streett 1",max-states=2,dicho,langmap' foo.hoa \
--stats=%s >out
test "`cat out`" = 1
$autfilt --sat-minimize='acc="Streett 1",max-states=2,assume,param=0' foo.hoa \
--stats=%s >out
test "`cat out`" = 1
@ -375,6 +418,12 @@ test "`cat out`" = 1
$autfilt --sat-minimize='acc="Rabin 1",max-states=4' foo.hoa \
--stats=%s >out && exit 1
test -z "`cat out`"
$autfilt --sat-minimize='acc="Rabin 1",max-states=4,dicho' foo.hoa \
--stats=%s >out && exit 1
test -z "`cat out`"
$autfilt --sat-minimize='acc="Rabin 1",max-states=4,dicho,langmap' foo.hoa \
--stats=%s >out && exit 1
test -z "`cat out`"
$autfilt --sat-minimize='acc="Rabin 1",max-states=4,assume,param=0' foo.hoa \
--stats=%s >out && exit 1
test -z "`cat out`"
@ -407,6 +456,12 @@ test -z "`cat out`"
$autfilt --sat-minimize='acc="Inf(0)&Fin(1)|Inf(2)",states=1' foo.hoa \
--stats=%s >out
test "`cat out`" = 1
$autfilt --sat-minimize='acc="Inf(0)&Fin(1)|Inf(2)",states=1,dicho' foo.hoa \
--stats=%s >out
test "`cat out`" = 1
$autfilt --sat-minimize='acc="Inf(0)&Fin(1)|Inf(2)",states=1,dicho,langmap' \
foo.hoa --stats=%s >out
test "`cat out`" = 1
$autfilt --sat-minimize='acc="Inf(0)&Fin(1)|Inf(2)",states=1,assume,param=0' \
foo.hoa --stats=%s >out
test "`cat out`" = 1