sat_minimize: improve logs and document Python bindings

* spot/priv/satcommon.cc, spot/priv/satcommon.hh: Make it possible to
set the log file without setting the environment variable.  Adjust
print_log to take the input state and print it as a new column.
* spot/twaalgos/dtbasat.cc, spot/twaalgos/dtwasat.cc: Adjust all
calls to print_log.  Fix log output for incremental approaches.
Prefer purge_unreachable_states() over stats_reachable().  Do
not call scc_filter() on colored automata.
* spot/twaalgos/dtwasat.hh: Document the new "log" option.
* NEWS: Mention the changes.
* tests/python/satmin.ipynb: New file.
* tests/Makefile.am: Add it.
* doc/org/satmin.org, doc/org/tut.org: Link to it.
* doc/org/satmin.org, bin/man/spot-x.x: Adjust description
of CSV files.
* bench/dtgbasat/gen.py, bench/dtgbasat/tabl.pl,
bench/dtgbasat/tabl1.pl, bench/dtgbasat/tabl2.pl,
bench/dtgbasat/tabl3.pl, bench/dtgbasat/tabl4.pl: Adjust for
the new column.
* spot/misc/satsolver.cc, spot/misc/satsolver.hh (stats): Make it
const.
* python/spot/__init__.py (sat_minimize): Add display_log and
return_log options.
* tests/python/ipnbdoctest.py: Adjust to not compare SAT-minimization
logs as they contain timings.
This commit is contained in:
Alexandre Duret-Lutz 2018-03-30 11:31:46 +02:00
parent 5266010889
commit c766f58d5d
21 changed files with 5076 additions and 177 deletions

View file

@ -342,6 +342,7 @@ TESTS_ipython = \
python/product.ipynb \
python/randaut.ipynb \
python/randltl.ipynb \
python/satmin.ipynb \
python/stutter-inv.ipynb \
python/testingaut.ipynb \
python/word.ipynb

View file

@ -118,6 +118,10 @@ def canonicalize(s, type, ignores):
# Different Pandas versions produce different CSS styles (when there is a
# style).
s = re.sub(r'<style[ a-z]*>.*</style>\n', '', s, flags=re.DOTALL)
# Table that contains enc.user are log from the SAT-solver. They contain
# timing result we cannot compare between runs.
s = re.sub(r'<table.*dataframe.*enc.user.*</table>', '<table></table>', s,
flags=re.DOTALL)
for n, p in enumerate(ignores):
s = re.sub(p, 'IGN{}'.format(n), s)
@ -134,8 +138,11 @@ def canonical_dict(dict, ignores):
dict['text'] = canonicalize(dict['text'], 'text', ignores)
if 'data' in dict:
for k in dict['data']:
dict['data'][k] = canonicalize(dict['data'][k], k, ignores)
d = dict['data']
if "text/html" in d and "text/plain" in d:
del d["text/plain"]
for k in d:
d[k] = canonicalize(d[k], k, ignores)
if ('ename' in dict and
dict['ename'] == 'SystemExit' and dict['evalue'] == '77'):

4819
tests/python/satmin.ipynb Normal file

File diff suppressed because it is too large Load diff