Update NEWS and documentations

* NEWS: Update.
* doc/org/satmin.org: Update satmin page.
* bin/man/spot-x.x: Document SPOT_XCNF and edit SPOT_SATSOLVER.
* bin/spot-x.cc: Update satmin options.
* bin/autfilt.cc: Update satmin related documentations.
* bin/man/autfilt.x: Update autfilt options.
This commit is contained in:
Alexandre GBAGUIDI AISSE 2016-12-27 21:30:59 +01:00
parent bd37625e49
commit 823dc56e6b
6 changed files with 245 additions and 42 deletions

View file

@ -143,6 +143,8 @@ enum {
OPT_WEAK_SCCS,
};
#define DOC(NAME, TXT) NAME, 0, nullptr, OPTION_DOC | OPTION_NO_USAGE, TXT, 0
static const argp_option options[] =
{
/**************************************************/
@ -317,9 +319,13 @@ static const argp_option options[] =
"Fin(x) by a new Fin(y) and adjust the automaton", 0 },
{ "sat-minimize", OPT_SAT_MINIMIZE, "options", OPTION_ARG_OPTIONAL,
"minimize the automaton using a SAT solver (only works for deterministic"
" automata)", 0 },
/**************************************************/
{ nullptr, 0, nullptr, 0, "Decorations (for -d and -H1.1 output):", 8 },
" automata). Supported options are acc=STRING, states=N, max-states=N, "
"sat-incr=N, sat-incr-steps=N, sat-langmap, sat-naive, colored, preproc=N"
". Spot uses by default its PicoSAT distribution but an external SAT"
"solver can be set thanks to the SPOT_SATSOLVER environment variable"
"(see spot-x)."
, 0 },
{ nullptr, 0, nullptr, 0, "Decorations (for -d and -H1.1 output):", 9 },
{ "highlight-nondet-states", OPT_HIGHLIGHT_NONDET_STATES, "NUM",
OPTION_ARG_OPTIONAL, "highlight nondeterministic states with color NUM",
0 },

View file

@ -3,6 +3,70 @@
autfilt \- filter, convert, and transform omega-automata
[DESCRIPTION]
.\" Add any additional description here
[OPTIONS FOR SAT\-MINIMIZATION]
.TP
\fB\fP
By default, SAT\-based minimization executes a binary search, checking N/2 etc.
The upper bound being N (the size of the starting automaton), the lower bound
is always 1 except when \fBsat-langmap\fR option is used.
.TP
\fBacc=DOUBLEQUOTEDSTRING\fP
DOUBLEQUOTEDSTRING is an acceptance formula in the HOA syntax, or a
parametrized acceptance name (the different acc\-name: options from HOA).
.TP
\fBcolored\fP
force all transitions (or all states if \fB\-S\fR is used) to belong to exactly
one acceptance condition.
.TP
\fBmax\-states=M\fP
M is an upper-bound on the maximum number of states of the constructed
automaton.
.TP
\fBsat\-incr=M\fP
use an incremental approach for SAT-based minimization algorithm. M can be
either \fB1\fR or \fB2\fR. They correspond respectively to
\fB\-x sat\-minimize=2\fR and \fB\-x sat\-minimize=3\fR options. They restart
the encoding only after (N\-1)\-\fBsat\-incr\-steps\fR states have been won.
Each iterations of both starts by encoding the research of an N\-1 automaton,
N being the size of the starting automaton. \fB1\fR uses Picosat assumptions.
It additionally assumes that the last \fBsat-incr-steps\fR states are
unnecessary. On failure, it relax the assumptions to do a binary search
between N\-1 and (N\-1)\-\fBsat-incr-steps\fR. \fBsat-incr-steps\fR defaults
to 6. \fB2\fR, as for it, after an N-1 state automaton has been found, uses
incremental solving for the next \fBsat\-incr\-steps\fR iterations by forbidding
the usage of an additional state without reencoding the problem again. A full
encoding occurs after \fBsat\-incr\-steps\fR iterations unless
\fBsat\-incr\-steps=\-1\fR (see SPOT_XCNF environment variable described in
spot\-x). It defaults to 2.
.TP
\fBsat\-incr\-steps=M\fP
set the value of \fBsat\-incr\-steps\fR to M. This is used by \fBsat\-incr\fR
option.
.TP
\fBsat-naive\fP
use the naive algorithm to find a smaller automaton. It starts from N (N being
the size of the starting automaton) and then checks N\-1, N\-2, etc. until the
last successful check.
.TP
\fBsat-langmap\fP
Find the lower bound of default sat\-minimize procedure (1). This relies on the
fact that the size of the minimal automaton is at least equal to the total
number of different languages recognized by the automaton's states.
.TP
\fBstates=M\fP
M is a fixed number of states to use in the result (all the states needs
not be accessible in the result. Therefore, the output might be smaller
nonetheless). The SAT\-based procedure is just used once to synthesize
one automaton, and no further minimization is attempted.
[BIBLIOGRAPHY]
The following papers are related to some of the transformations implemented
in autfilt.

View file

@ -9,8 +9,36 @@ spot-x \- Common fine-tuning options and environment variables.
[DESCRIPTION]
.\" Add any additional description here
[ENVIRONMENT VARIABLES]
[SAT\-MINIMIZE VALUES]
.TP
\fB1\fR
Used by default, \fB1\fR performs a binary search, checking N/2, etc.
The upper bound being N (the size of the starting automaton), the lower bound
is always 1 except when \fBsat-langmap\fR option is used.
.TP
\fB2\fR
Use PicoSAT assumptions. Each iteration encodes the search of an (N\-1) state
equivalent automaton, and additionally assumes that the last
\fBsat\-incr\-steps\fR states are unnecessary. On failure, relax the assumptions
to do a binary search between N\-1 and N\-1\-\fBsat\-incr\-steps\fR.
\fBsat\-incr\-steps\fR defaults to 6.
.TP
\fB3\fR
After an (N\-1) state automaton has been found, use incremental solving for
the next \fBsat\-incr\-steps\fR iterations by forbidding the usage of an
additional state without reencoding the problem again. A full encoding will
occur after \fBsat\-incr\-steps\fR iterations unless \fBsat\-incr\-steps=-1\fR
(see \fBSPOT_XCNF\fR environment variable). \fBsat\-incr\-steps\fR defaults to
2.
.TP
\fB4\fR
This naive method tries to reduce the size of the automaton one state at a
time. Note that it restarts all the encoding each time.
[ENVIRONMENT VARIABLES]
.TP
\fBSPOT_DEFAULT_FORMAT\fR
Set to a value of \fBdot\fR or \fBhoa\fR to override the default
@ -67,14 +95,14 @@ problem.
.TP
\fBSPOT_SATSOLVER\fR
If set, this variable should indicate how to call a SAT\-solver. This
is used by the sat\-minimize option described above. The default
value is \f(CW"glucose -verb=0 -model %I >%O"\fR, it is correct for
glucose version 3.0 (for older versions, remove the \fCW(-model\fR
option). The escape sequences \f(CW%I\fR and \f(CW%O\fR respectively
If set, this variable should indicate how to call an external
SAT\-solver \- by default, Spot uses PicoSAT, which is distributed
with. This is used by the sat\-minimize option described above.
The format to follow is the following: \f(CW"<sat_solver> [options] %I >%O"\fR.
The escape sequences \f(CW%I\fR and \f(CW%O\fR respectively
denote the names of the input and output files. These temporary files
are created in the directory specified by \fBSPOT_TMPDIR\fR or
\fBTMPDIR\fR (see below). The SAT-solver should follow the convention
\fBTMPDIR\fR (see below). The SAT\-solver should follow the convention
of the SAT Competition for its input and output format.
.TP
@ -115,6 +143,17 @@ current directory.
When this variable is defined, temporary files are not removed.
This is mostly useful for debugging.
.TP
\fBSPOT_XCNF\fR
Assign a folder path to this variable to generate XCNF files whenever
SAT\-based minimization is used \- the file is outputed as "incr.xcnf"
in the specified directory. This feature works only with an external
SAT\-solver. See \fBSPOT_SATSOLVER\fR to know how to provide one. Also note
that this needs an incremental approach without restarting the encoding i.e
"sat\-minimize=3,param=-1" for ltl2tgba and ltl2tgta or "incr,param=-1" for
autfilt (see sat\-minimize options described above or autfilt man page).
The XCNF format is the one used by the SAT incremental competition.
[BIBLIOGRAPHY]
.TP
1.

View file

@ -113,15 +113,20 @@ Enabled by default.") },
if the TGBA is not already deterministic. Doing so will degeneralize \
the automaton. This is disabled by default, unless sat-minimize is set.") },
{ DOC("sat-minimize",
"Set to 1 to enable SAT-based minimization of deterministic \
TGBA: it starts with the number of states of the input, and iteratively \
tries to find a deterministic TGBA with one less state. Set to 2 to perform \
a binary search instead. Disabled (0) by default. The sat solver to use \
can be set with the SPOT_SATSOLVER environment variable (see below). By \
default the procedure looks for a TGBA with the same number of acceptance \
set; this can be changed with the sat-acc option, or of course by using -B \
to construct a Büchi automaton. Enabling SAT-based minimization will \
also enable tba-det.") },
"Set it to enable SAT-based minimization of deterministic \
TGBA. Depending on its value (from 1 to 4) it changes the algorithm \
to perform. The default value is (1) and it proves to be the most effective \
method. SAT-based minimization uses PicoSAT (distributed with Spot), but \
another installed SAT-solver can be set thanks to the SPOT_SATSOLVER \
environment variable. Enabling SAT-based minimization will also enable \
tba-det.") },
{ DOC("sat-incr-steps", "Set the value of sat-incr-steps. This variable \
is used by two SAT-based minimization algorithms: (2) and (3). They are both \
described below.") },
{ DOC("sat-langmap", "Find the lower bound of default sat-minimize \
procedure (1). This relies on the fact that the size of the minimal automaton \
is at least equal to the total number of different languages recognized by \
the automaton's states.") },
{ DOC("sat-states",
"When this is set to some positive integer, the SAT-based \
minimization will attempt to construct a TGBA with the given number of \