Introduce new ways to split an automaton
The explicit way of splitting suffers if there are too many input APs, two new ways of splitting are introduced as well as a heuristic to chose between them. * NEWS: update * spot/twaalgos/synthesis.cc, spot/twaalgos/synthesis.hh: New fonctions * bin/ltlsynt.cc: Add corresponding option * tests/core/gamehoa.test, tests/core/ltlsynt.test, tests/python/_partitioned_relabel.ipynb, tests/python/_synthesis.ipynb, tests/python/game.py, tests/python/split.py, tests/python/synthesis.py: Adjusting and adding test
This commit is contained in:
parent
2274308cad
commit
5ddac258e1
11 changed files with 1372 additions and 138 deletions
9
NEWS
9
NEWS
|
|
@ -86,6 +86,15 @@ New in spot 2.12 (2024-05-16)
|
||||||
|
|
||||||
Library:
|
Library:
|
||||||
|
|
||||||
|
- split_2step has now multiple ways to split for improved performance.
|
||||||
|
The option can be controlled via the synthesis_info::splittype
|
||||||
|
- EXPL: explicit splitting of each state as before
|
||||||
|
- SEMISYM: The outgoing transition of each state are encoded
|
||||||
|
as a bdd; Works better for larger number of input APs
|
||||||
|
- FULLYSYM: The automaton is first translated into a
|
||||||
|
fully symbolic version, then split.
|
||||||
|
- AUTO: Let the heuristic decide what to do.
|
||||||
|
|
||||||
- The following new trivial simplifications have been implemented for SEREs:
|
- The following new trivial simplifications have been implemented for SEREs:
|
||||||
- f|[+] = [+] if f rejects [*0]
|
- f|[+] = [+] if f rejects [*0]
|
||||||
- f|[*] = [*] if f accepts [*0]
|
- f|[*] = [*] if f accepts [*0]
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,7 @@ enum
|
||||||
OPT_PRINT_HOA,
|
OPT_PRINT_HOA,
|
||||||
OPT_REAL,
|
OPT_REAL,
|
||||||
OPT_SIMPLIFY,
|
OPT_SIMPLIFY,
|
||||||
|
OPT_SPLITTYPE,
|
||||||
OPT_TLSF,
|
OPT_TLSF,
|
||||||
OPT_VERBOSE,
|
OPT_VERBOSE,
|
||||||
OPT_VERIFY
|
OPT_VERIFY
|
||||||
|
|
@ -118,6 +119,9 @@ static const argp_option options[] =
|
||||||
"reduction with output assignment, (sat) SAT-based minimization, "
|
"reduction with output assignment, (sat) SAT-based minimization, "
|
||||||
"(bisim-sat) SAT after bisim, (bwoa-sat) SAT after bwoa. Defaults "
|
"(bisim-sat) SAT after bisim, (bwoa-sat) SAT after bwoa. Defaults "
|
||||||
"to 'bwoa'.", 0 },
|
"to 'bwoa'.", 0 },
|
||||||
|
{ "splittype", OPT_SPLITTYPE, "expl|semisym|fullysym|auto", 0,
|
||||||
|
"Selects the algorithm to use to transform the automaton into "
|
||||||
|
"a game graph. Defaults to 'auto'.", 0},
|
||||||
/**************************************************/
|
/**************************************************/
|
||||||
{ nullptr, 0, nullptr, 0, "Output options:", 20 },
|
{ nullptr, 0, nullptr, 0, "Output options:", 20 },
|
||||||
{ "print-pg", OPT_PRINT, nullptr, 0,
|
{ "print-pg", OPT_PRINT, nullptr, 0,
|
||||||
|
|
@ -295,6 +299,23 @@ static unsigned simplify_values[] =
|
||||||
};
|
};
|
||||||
ARGMATCH_VERIFY(simplify_args, simplify_values);
|
ARGMATCH_VERIFY(simplify_args, simplify_values);
|
||||||
|
|
||||||
|
static const char* const splittype_args[] =
|
||||||
|
{
|
||||||
|
"expl",
|
||||||
|
"semisym",
|
||||||
|
"fullysym",
|
||||||
|
"auto",
|
||||||
|
nullptr
|
||||||
|
};
|
||||||
|
static spot::synthesis_info::splittype splittype_values[] =
|
||||||
|
{
|
||||||
|
spot::synthesis_info::splittype::EXPL,
|
||||||
|
spot::synthesis_info::splittype::SEMISYM,
|
||||||
|
spot::synthesis_info::splittype::FULLYSYM,
|
||||||
|
spot::synthesis_info::splittype::AUTO,
|
||||||
|
};
|
||||||
|
ARGMATCH_VERIFY(splittype_args, splittype_values);
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
static bool want_game()
|
static bool want_game()
|
||||||
|
|
@ -909,7 +930,7 @@ namespace
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
if (!arena->get_named_prop<std::vector<bool>>("state-player"))
|
if (!arena->get_named_prop<std::vector<bool>>("state-player"))
|
||||||
arena = spot::split_2step(arena, true);
|
arena = spot::split_2step(arena, gi);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Check if the game is alternating and fix trivial cases
|
// Check if the game is alternating and fix trivial cases
|
||||||
|
|
@ -1127,6 +1148,10 @@ parse_opt(int key, char *arg, struct argp_state *)
|
||||||
gi->minimize_lvl = XARGMATCH("--simplify", arg,
|
gi->minimize_lvl = XARGMATCH("--simplify", arg,
|
||||||
simplify_args, simplify_values);
|
simplify_args, simplify_values);
|
||||||
break;
|
break;
|
||||||
|
case OPT_SPLITTYPE:
|
||||||
|
gi->sp = XARGMATCH("--splittype", arg,
|
||||||
|
splittype_args, splittype_values);
|
||||||
|
break;
|
||||||
case OPT_TLSF:
|
case OPT_TLSF:
|
||||||
jobs.emplace_back(arg, job_type::TLSF_FILENAME);
|
jobs.emplace_back(arg, job_type::TLSF_FILENAME);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -25,55 +25,6 @@
|
||||||
|
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
/// \addtogroup synthesis Reactive Synthesis
|
|
||||||
/// \ingroup twa_algorithms
|
|
||||||
|
|
||||||
/// \ingroup synthesis
|
|
||||||
/// \brief make each transition a 2-step transition, transforming
|
|
||||||
/// the graph into an alternating arena
|
|
||||||
///
|
|
||||||
/// Given a set of atomic propositions I, split each transition
|
|
||||||
/// p -- cond --> q cond in 2^2^AP
|
|
||||||
/// into a set of transitions of the form
|
|
||||||
/// p -- {a} --> (p,a) -- o --> q
|
|
||||||
/// for each a in cond ∪ 2^2^I
|
|
||||||
/// and where o = (cond & a) ∪ 2^2^O.
|
|
||||||
///
|
|
||||||
/// By definition, the states p are deterministic,
|
|
||||||
/// only the states of the form
|
|
||||||
/// (p,a) may be non-deterministic.
|
|
||||||
/// This function is used to transform an automaton into a turn-based game in
|
|
||||||
/// the context of LTL reactive synthesis.
|
|
||||||
/// The player of inputs (aka environment) plays first.
|
|
||||||
///
|
|
||||||
/// \param aut automaton to be transformed
|
|
||||||
/// \param output_bdd conjunction of all output AP, all APs not present
|
|
||||||
/// are treated as inputs
|
|
||||||
/// \param complete_env Whether the automaton should be complete for the
|
|
||||||
/// environment, i.e. the player of inputs
|
|
||||||
/// \note This function also computes the state players
|
|
||||||
/// \note If the automaton is to be completed, sink states will
|
|
||||||
/// be added for both env and player if necessary
|
|
||||||
SPOT_API twa_graph_ptr
|
|
||||||
split_2step(const const_twa_graph_ptr& aut,
|
|
||||||
const bdd& output_bdd, bool complete_env = true);
|
|
||||||
|
|
||||||
/// \ingroup synthesis
|
|
||||||
/// \brief Like split_2step but relying on the named property
|
|
||||||
/// 'synthesis-outputs'
|
|
||||||
SPOT_API twa_graph_ptr
|
|
||||||
split_2step(const const_twa_graph_ptr& aut, bool complete_env = true);
|
|
||||||
|
|
||||||
/// \ingroup synthesis
|
|
||||||
/// \brief the inverse of split_2step
|
|
||||||
///
|
|
||||||
/// \pre aut is an alternating arena
|
|
||||||
/// \post All edge conditions in the returned automaton are of the form
|
|
||||||
/// ins&outs, with ins/outs being a condition over the input/output
|
|
||||||
/// propositions
|
|
||||||
/// \note This function relies on the named property "state-player"
|
|
||||||
SPOT_API twa_graph_ptr
|
|
||||||
unsplit_2step(const const_twa_graph_ptr& aut);
|
|
||||||
|
|
||||||
/// \ingroup synthesis
|
/// \ingroup synthesis
|
||||||
/// \brief Benchmarking data and options for synthesis
|
/// \brief Benchmarking data and options for synthesis
|
||||||
|
|
@ -89,6 +40,14 @@ namespace spot
|
||||||
ACD,
|
ACD,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum class splittype
|
||||||
|
{
|
||||||
|
AUTO=0, // Uses a heuristic to choose
|
||||||
|
EXPL, // Explicit enumerations of inputs
|
||||||
|
SEMISYM, // Works on one bdd per env state
|
||||||
|
FULLYSYM // Works on a fully symbolic version of the automaton
|
||||||
|
};
|
||||||
|
|
||||||
struct bench_var
|
struct bench_var
|
||||||
{
|
{
|
||||||
double total_time = 0.0;
|
double total_time = 0.0;
|
||||||
|
|
@ -114,6 +73,7 @@ namespace spot
|
||||||
: force_sbacc{false},
|
: force_sbacc{false},
|
||||||
s{algo::LAR},
|
s{algo::LAR},
|
||||||
minimize_lvl{2},
|
minimize_lvl{2},
|
||||||
|
sp{splittype::AUTO},
|
||||||
bv{},
|
bv{},
|
||||||
verbose_stream{nullptr},
|
verbose_stream{nullptr},
|
||||||
dict(make_bdd_dict())
|
dict(make_bdd_dict())
|
||||||
|
|
@ -123,12 +83,78 @@ namespace spot
|
||||||
bool force_sbacc;
|
bool force_sbacc;
|
||||||
algo s;
|
algo s;
|
||||||
int minimize_lvl;
|
int minimize_lvl;
|
||||||
|
splittype sp;
|
||||||
std::optional<bench_var> bv;
|
std::optional<bench_var> bv;
|
||||||
std::ostream* verbose_stream;
|
std::ostream* verbose_stream;
|
||||||
option_map opt;
|
option_map opt;
|
||||||
bdd_dict_ptr dict;
|
bdd_dict_ptr dict;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// \addtogroup synthesis Reactive Synthesis
|
||||||
|
/// \ingroup twa_algorithms
|
||||||
|
|
||||||
|
/// \ingroup synthesis
|
||||||
|
/// \brief make each transition a 2-step transition, transforming
|
||||||
|
/// the graph into an alternating arena
|
||||||
|
///
|
||||||
|
/// Given a set of atomic propositions I, split each transition
|
||||||
|
/// p -- cond --> q cond in 2^2^AP
|
||||||
|
/// into a set of transitions of the form
|
||||||
|
/// p -- {a} --> (p,a) -- o --> q
|
||||||
|
/// for each a in cond ∪ 2^2^I
|
||||||
|
/// and where o = (cond & a) ∪ 2^2^O.
|
||||||
|
///
|
||||||
|
/// By definition, the states p are deterministic,
|
||||||
|
/// only the states of the form
|
||||||
|
/// (p,a) may be non-deterministic.
|
||||||
|
/// This function is used to transform an automaton into a turn-based game in
|
||||||
|
/// the context of LTL reactive synthesis.
|
||||||
|
/// The player of inputs (aka environment) plays first.
|
||||||
|
///
|
||||||
|
/// \param aut automaton to be transformed
|
||||||
|
/// \param output_bdd conjunction of all output AP, all APs not present
|
||||||
|
/// are treated as inputs
|
||||||
|
/// \param complete_env Whether the automaton should be complete for the
|
||||||
|
/// environment, i.e. the player of inputs
|
||||||
|
/// \param sp Defines which splitting algo to use
|
||||||
|
/// \note This function also computes the state players
|
||||||
|
/// \note If the automaton is to be completed, sink states will
|
||||||
|
/// be added for both env and player if necessary
|
||||||
|
SPOT_API twa_graph_ptr
|
||||||
|
split_2step(const const_twa_graph_ptr& aut,
|
||||||
|
const bdd& output_bdd, bool complete_env = true,
|
||||||
|
synthesis_info::splittype sp
|
||||||
|
= synthesis_info::splittype::AUTO);
|
||||||
|
|
||||||
|
/// \ingroup synthesis
|
||||||
|
/// \brief Like split_2step but relying on the named property
|
||||||
|
/// 'synthesis-outputs'
|
||||||
|
SPOT_API twa_graph_ptr
|
||||||
|
split_2step(const const_twa_graph_ptr& aut, bool complete_env = true,
|
||||||
|
synthesis_info::splittype sp
|
||||||
|
= synthesis_info::splittype::AUTO);
|
||||||
|
|
||||||
|
/// \ingroup synthesis
|
||||||
|
/// \brief Like split_2step but allows to fine-tune the splitting
|
||||||
|
/// via the options set in \a gi, always completes the
|
||||||
|
/// environment states and relies on the named property to
|
||||||
|
/// extract the output proposition
|
||||||
|
SPOT_API twa_graph_ptr
|
||||||
|
split_2step(const const_twa_graph_ptr& aut,
|
||||||
|
synthesis_info& gi);
|
||||||
|
|
||||||
|
|
||||||
|
/// \ingroup synthesis
|
||||||
|
/// \brief the inverse of split_2step
|
||||||
|
///
|
||||||
|
/// \pre aut is an alternating arena
|
||||||
|
/// \post All edge conditions in the returned automaton are of the form
|
||||||
|
/// ins&outs, with ins/outs being a condition over the input/output
|
||||||
|
/// propositions
|
||||||
|
/// \note This function relies on the named property "state-player"
|
||||||
|
SPOT_API twa_graph_ptr
|
||||||
|
unsplit_2step(const const_twa_graph_ptr& aut);
|
||||||
|
|
||||||
/// \ingroup synthesis
|
/// \ingroup synthesis
|
||||||
/// \brief Stream algo
|
/// \brief Stream algo
|
||||||
SPOT_API std::ostream&
|
SPOT_API std::ostream&
|
||||||
|
|
|
||||||
|
|
@ -21,11 +21,13 @@
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
ltlsynt --ins=a,c --outs=b -f 'GF(a <-> XXXc) <-> GFb' --print-game-hoa >out
|
ltlsynt --ins=a,c --outs=b -f 'GF(a <-> XXXc) <-> GFb' --print-game-hoa \
|
||||||
|
--splittype=expl >out
|
||||||
grep spot-state-player: out
|
grep spot-state-player: out
|
||||||
autfilt out >out2
|
autfilt out >out2
|
||||||
diff out out2
|
diff out out2
|
||||||
ltlsynt --ins=a,c --outs=b -f 'GF(a <-> XXXc) <-> GFb' --print-game-hoa=l >out3
|
ltlsynt --ins=a,c --outs=b -f 'GF(a <-> XXXc) <-> GFb' --print-game-hoa=l \
|
||||||
|
--splittype=expl >out3
|
||||||
test 1 = `wc -l < out3`
|
test 1 = `wc -l < out3`
|
||||||
cmp out out3 && exit 1
|
cmp out out3 && exit 1
|
||||||
autfilt out3 >out2
|
autfilt out3 >out2
|
||||||
|
|
|
||||||
|
|
@ -485,9 +485,21 @@ o0 o0
|
||||||
o1 o1
|
o1 o1
|
||||||
EOF
|
EOF
|
||||||
ltlsynt -f "G((i0 && i1)<->X(o0)) && G((i2|i3)<->X(o1))" --outs="o0,o1" \
|
ltlsynt -f "G((i0 && i1)<->X(o0)) && G((i2|i3)<->X(o1))" --outs="o0,o1" \
|
||||||
--aiger=isop+ud --algo=lar --decompose=no --simpl=no >out
|
--aiger=isop+ud --algo=lar --decompose=no --simpl=no \
|
||||||
|
--splittype=expl >out
|
||||||
diff out exp
|
diff out exp
|
||||||
|
|
||||||
|
for splitt in expl semisym fullysym auto
|
||||||
|
do
|
||||||
|
res=$(ltlsynt -f "G((i0 && i1)<->X(o0)) && G((i2|i3)<->X(o1))" \
|
||||||
|
--outs="o0,o1" --aiger=isop+ud --algo=lar --decompose=no \
|
||||||
|
--simpl=no --splittype="$splitt" --realizability)
|
||||||
|
if [[ "$res" != "REALIZABLE" ]]; then
|
||||||
|
echo "Expected realizable"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
cat >exp <<EOF
|
cat >exp <<EOF
|
||||||
REALIZABLE
|
REALIZABLE
|
||||||
aag 54 4 3 2 47
|
aag 54 4 3 2 47
|
||||||
|
|
@ -555,7 +567,8 @@ o0 o0
|
||||||
o1 o1
|
o1 o1
|
||||||
EOF
|
EOF
|
||||||
ltlsynt -f "G((i0 && i1)<->X(o0)) && G((i2|i3)<->X(o1))" --outs="o0,o1"\
|
ltlsynt -f "G((i0 && i1)<->X(o0)) && G((i2|i3)<->X(o1))" --outs="o0,o1"\
|
||||||
--aiger=isop --algo=lar --decompose=no --simpl=no >out
|
--aiger=isop --algo=lar --decompose=no --simpl=no \
|
||||||
|
--splittype=expl >out
|
||||||
diff out exp
|
diff out exp
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -590,10 +603,10 @@ o0 o0
|
||||||
o1 o1
|
o1 o1
|
||||||
EOF
|
EOF
|
||||||
ltlsynt -f "G((i0 && i1)<->X(o0)) && G((i2|i3)<->X(o1))" --outs="o0,o1"\
|
ltlsynt -f "G((i0 && i1)<->X(o0)) && G((i2|i3)<->X(o1))" --outs="o0,o1"\
|
||||||
--aiger=isop+ud --algo=lar --decompose=yes --simpl=no >out
|
--aiger=isop+ud --algo=lar --decompose=yes --simpl=no --splittype=expl >out
|
||||||
diff out exp
|
diff out exp
|
||||||
ltlsynt -f "G((i0 && i1)<->X(o0)) && G((i2|i3)<->X(o1))" --outs="o0,o1"\
|
ltlsynt -f "G((i0 && i1)<->X(o0)) && G((i2|i3)<->X(o1))" --outs="o0,o1"\
|
||||||
--aiger=isop+ud --algo=lar --simpl=no >out
|
--aiger=isop+ud --algo=lar --simpl=no --splittype=expl >out
|
||||||
diff out exp
|
diff out exp
|
||||||
|
|
||||||
# Issue #477
|
# Issue #477
|
||||||
|
|
|
||||||
|
|
@ -203,7 +203,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f483c46fc00> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f0fd837fe10> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 2,
|
"execution_count": 2,
|
||||||
|
|
@ -411,7 +411,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f483c46fc00> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f0fd837fe10> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 3,
|
"execution_count": 3,
|
||||||
|
|
@ -597,7 +597,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f483c46fc00> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f0fd837fe10> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 4,
|
"execution_count": 4,
|
||||||
|
|
@ -782,7 +782,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f483c46dfb0> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f0fd8394990> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
|
|
@ -1052,7 +1052,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f483c46dfb0> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f0fd8394990> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 5,
|
"execution_count": 5,
|
||||||
|
|
@ -1326,7 +1326,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f483c46dfb0> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f0fd8394990> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 6,
|
"execution_count": 6,
|
||||||
|
|
@ -1537,7 +1537,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f483c46e9d0> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f0fd83943c0> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
|
|
@ -1760,7 +1760,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f483c46e9d0> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f0fd83943c0> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 7,
|
"execution_count": 7,
|
||||||
|
|
@ -2023,7 +2023,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f483c46e9d0> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f0fd83943c0> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 8,
|
"execution_count": 8,
|
||||||
|
|
@ -2055,7 +2055,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 9,
|
"execution_count": 14,
|
||||||
"id": "296a93d3",
|
"id": "296a93d3",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [
|
"outputs": [
|
||||||
|
|
@ -2304,7 +2304,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f483c46f4b0> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f0fd8395590> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
|
|
@ -2718,7 +2718,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f483c46eca0> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f0fd837fcf0> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
|
|
@ -3312,7 +3312,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f483c46eca0> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f0fd837fcf0> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
|
|
@ -3346,7 +3346,7 @@
|
||||||
"display(aut)\n",
|
"display(aut)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# Convert to split mealy machine\n",
|
"# Convert to split mealy machine\n",
|
||||||
"auts = spot.split_2step(aut)\n",
|
"auts = spot.split_2step(aut, True, spot.synthesis_info.splittype_EXPL)\n",
|
||||||
"print(auts.to_str(\"hoa\"))\n",
|
"print(auts.to_str(\"hoa\"))\n",
|
||||||
"display(auts)\n",
|
"display(auts)\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
|
@ -3951,7 +3951,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f483c46eca0> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f0fd8396b20> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
|
|
@ -4020,7 +4020,7 @@
|
||||||
" for relabel_player in [True, False]:\n",
|
" for relabel_player in [True, False]:\n",
|
||||||
" for split_env in [True, False]:\n",
|
" for split_env in [True, False]:\n",
|
||||||
" for split_player in [True, False]:\n",
|
" for split_player in [True, False]:\n",
|
||||||
" auts = spot.split_2step(aut)\n",
|
" auts = spot.split_2step(aut, True, spot.synthesis_info.splittype_EXPL)\n",
|
||||||
" rel_dicts = spot.partitioned_game_relabel_here(auts, relabel_env, relabel_player, split_env, split_player, 10000, 10000)\n",
|
" rel_dicts = spot.partitioned_game_relabel_here(auts, relabel_env, relabel_player, split_env, split_player, 10000, 10000)\n",
|
||||||
" spot.relabel_game_here(auts, rel_dicts)\n",
|
" spot.relabel_game_here(auts, rel_dicts)\n",
|
||||||
" print(spot.are_equivalent(aut, spot.unsplit_2step(auts)))"
|
" print(spot.are_equivalent(aut, spot.unsplit_2step(auts)))"
|
||||||
|
|
@ -4051,7 +4051,7 @@
|
||||||
"name": "python",
|
"name": "python",
|
||||||
"nbconvert_exporter": "python",
|
"nbconvert_exporter": "python",
|
||||||
"pygments_lexer": "ipython3",
|
"pygments_lexer": "ipython3",
|
||||||
"version": "3.11.7"
|
"version": "3.11.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nbformat": 4,
|
"nbformat": 4,
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@
|
||||||
"source": [
|
"source": [
|
||||||
"si = spot.synthesis_info()\n",
|
"si = spot.synthesis_info()\n",
|
||||||
"si.s = spot.synthesis_info.algo_LAR # Use LAR algorithm\n",
|
"si.s = spot.synthesis_info.algo_LAR # Use LAR algorithm\n",
|
||||||
|
"si.sp = spot.synthesis_info.splittype_EXPL\n",
|
||||||
"game = spot.ltl_to_game(\"G((F(i0) && F(i1))->(G(i1<->(X(o0)))))\", [\"o0\"], si)\n",
|
"game = spot.ltl_to_game(\"G((F(i0) && F(i1))->(G(i1<->(X(o0)))))\", [\"o0\"], si)\n",
|
||||||
"spot.solve_game(game)"
|
"spot.solve_game(game)"
|
||||||
]
|
]
|
||||||
|
|
@ -787,7 +788,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f08a8777750> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x75e94c292280> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 8,
|
"execution_count": 8,
|
||||||
|
|
@ -930,7 +931,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f08a8777750> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x75e94c292280> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 9,
|
"execution_count": 9,
|
||||||
|
|
@ -1149,7 +1150,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f08a8777660> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x75e94c290c30> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 10,
|
"execution_count": 10,
|
||||||
|
|
@ -1158,7 +1159,7 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"source": [
|
"source": [
|
||||||
"a_s = spot.split_2step(a, True)\n",
|
"a_s = spot.split_2step(a, True, spot.synthesis_info.splittype_EXPL)\n",
|
||||||
"print(a.acc())\n",
|
"print(a.acc())\n",
|
||||||
"a_s"
|
"a_s"
|
||||||
]
|
]
|
||||||
|
|
@ -1322,7 +1323,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f08a8774840> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x75e94c293a20> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 11,
|
"execution_count": 11,
|
||||||
|
|
@ -1618,7 +1619,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f08a8774930> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x75e94fe9f090> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 12,
|
"execution_count": 12,
|
||||||
|
|
@ -1627,7 +1628,7 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"source": [
|
"source": [
|
||||||
"a_snc = spot.split_2step(a, False)\n",
|
"a_snc = spot.split_2step(a, False, spot.synthesis_info.splittype_EXPL)\n",
|
||||||
"print(a_snc.acc())\n",
|
"print(a_snc.acc())\n",
|
||||||
"a_snc"
|
"a_snc"
|
||||||
]
|
]
|
||||||
|
|
@ -2006,7 +2007,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f08a8776f10> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x75e94c292880> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 13,
|
"execution_count": 13,
|
||||||
|
|
@ -2015,7 +2016,7 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"source": [
|
"source": [
|
||||||
"a_s = spot.split_2step(a, True)\n",
|
"a_s = spot.split_2step(a, True, spot.synthesis_info.splittype_EXPL)\n",
|
||||||
"print(a_s.acc())\n",
|
"print(a_s.acc())\n",
|
||||||
"a_s"
|
"a_s"
|
||||||
]
|
]
|
||||||
|
|
@ -2289,7 +2290,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f08a9ff0db0> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x75e94c2910b0> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 14,
|
"execution_count": 14,
|
||||||
|
|
@ -2531,7 +2532,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f08a9ff0db0> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x75e94c2910b0> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 15,
|
"execution_count": 15,
|
||||||
|
|
@ -2803,7 +2804,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f08a8775800> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x75e94c293720> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 16,
|
"execution_count": 16,
|
||||||
|
|
@ -3046,7 +3047,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f08a8775800> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x75e94c293720> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 17,
|
"execution_count": 17,
|
||||||
|
|
@ -3757,7 +3758,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f08a876e310> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x75e94c290600> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 18,
|
"execution_count": 18,
|
||||||
|
|
@ -4015,7 +4016,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f08a876e310> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x75e94c290600> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 19,
|
"execution_count": 19,
|
||||||
|
|
@ -4298,7 +4299,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f08a8776850> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x75e94c290f90> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
|
|
@ -6066,7 +6067,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f08a9ff1350> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x75e94c2901b0> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 20,
|
"execution_count": 20,
|
||||||
|
|
@ -6101,7 +6102,7 @@
|
||||||
"\n",
|
"\n",
|
||||||
"display(aut)\n",
|
"display(aut)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"aut = spot.split_2step(aut, x, False)\n",
|
"aut = spot.split_2step(aut, x, False, spot.synthesis_info.splittype_EXPL)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"display(aut.show_storage())\n",
|
"display(aut.show_storage())\n",
|
||||||
"aut"
|
"aut"
|
||||||
|
|
@ -6975,7 +6976,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f08a9ff1350> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x75e94c2901b0> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 21,
|
"execution_count": 21,
|
||||||
|
|
@ -7219,7 +7220,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f08a8776970> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x75e94c290ea0> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
|
|
@ -8107,7 +8108,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f08a8775620> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x75e94c291b60> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 22,
|
"execution_count": 22,
|
||||||
|
|
@ -8141,7 +8142,7 @@
|
||||||
"\n",
|
"\n",
|
||||||
"display(aut)\n",
|
"display(aut)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"aut = spot.split_2step(aut, x, False)\n",
|
"aut = spot.split_2step(aut, x, False, spot.synthesis_info.splittype_EXPL)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"display(aut.show_storage())\n",
|
"display(aut.show_storage())\n",
|
||||||
"aut"
|
"aut"
|
||||||
|
|
@ -8529,7 +8530,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f08a8775620> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x75e94c291b60> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 23,
|
"execution_count": 23,
|
||||||
|
|
@ -8679,7 +8680,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f08a876e100> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x75e94c291ad0> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
|
|
@ -8858,7 +8859,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f08a876e100> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x75e94c291ad0> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
|
|
@ -9062,7 +9063,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f08a876f570> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x75e94c27bde0> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 25,
|
"execution_count": 25,
|
||||||
|
|
@ -9072,6 +9073,7 @@
|
||||||
],
|
],
|
||||||
"source": [
|
"source": [
|
||||||
"si = spot.synthesis_info()\n",
|
"si = spot.synthesis_info()\n",
|
||||||
|
"si.sp = spot.synthesis_info.splittype_EXPL\n",
|
||||||
"\n",
|
"\n",
|
||||||
"aut = spot.ltl_to_game(\"(a|b|c|d)->x\", [\"x\"], si)\n",
|
"aut = spot.ltl_to_game(\"(a|b|c|d)->x\", [\"x\"], si)\n",
|
||||||
"aut"
|
"aut"
|
||||||
|
|
@ -9268,7 +9270,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f08a876fae0> >"
|
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x75e94c290210> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 27,
|
"execution_count": 27,
|
||||||
|
|
@ -9582,7 +9584,7 @@
|
||||||
"</svg>\n"
|
"</svg>\n"
|
||||||
],
|
],
|
||||||
"text/plain": [
|
"text/plain": [
|
||||||
"<spot.aig; proxy of <Swig Object of type 'std::shared_ptr< spot::aig > *' at 0x7f08a876f2a0> >"
|
"<spot.aig; proxy of <Swig Object of type 'std::shared_ptr< spot::aig > *' at 0x75e94c292b80> >"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"execution_count": 28,
|
"execution_count": 28,
|
||||||
|
|
@ -9594,14 +9596,6 @@
|
||||||
"aig = spot.mealy_machine_to_aig(ctrl, \"ite\")\n",
|
"aig = spot.mealy_machine_to_aig(ctrl, \"ite\")\n",
|
||||||
"aig"
|
"aig"
|
||||||
]
|
]
|
||||||
},
|
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"id": "eb81b7d3",
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": []
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"metadata": {
|
"metadata": {
|
||||||
|
|
@ -9620,7 +9614,7 @@
|
||||||
"name": "python",
|
"name": "python",
|
||||||
"nbconvert_exporter": "python",
|
"nbconvert_exporter": "python",
|
||||||
"pygments_lexer": "ipython3",
|
"pygments_lexer": "ipython3",
|
||||||
"version": "3.11.7"
|
"version": "3.11.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nbformat": 4,
|
"nbformat": 4,
|
||||||
|
|
|
||||||
|
|
@ -282,7 +282,7 @@ spot.change_parity_here(gdpa, spot.parity_kind_max, spot.parity_style_odd)
|
||||||
gsdpa = spot.split_2step(gdpa, b, True)
|
gsdpa = spot.split_2step(gdpa, b, True)
|
||||||
spot.colorize_parity_here(gsdpa, True)
|
spot.colorize_parity_here(gsdpa, True)
|
||||||
tc.assertTrue(spot.solve_parity_game(gsdpa))
|
tc.assertTrue(spot.solve_parity_game(gsdpa))
|
||||||
tc.assertEqual(spot.highlight_strategy(gsdpa).to_str("HOA", "1.1"),
|
gsdpa_solved_ref = spot.automaton(
|
||||||
"""HOA: v1.1
|
"""HOA: v1.1
|
||||||
States: 18
|
States: 18
|
||||||
Start: 0
|
Start: 0
|
||||||
|
|
@ -350,6 +350,23 @@ State: 17
|
||||||
[t] 4 {4}
|
[t] 4 {4}
|
||||||
--END--"""
|
--END--"""
|
||||||
)
|
)
|
||||||
|
tc.assertTrue(spot.solve_parity_game(gsdpa_solved_ref))
|
||||||
|
|
||||||
|
# Check for the same language
|
||||||
|
tc.assertTrue(spot.are_equivalent(gsdpa, gsdpa_solved_ref))
|
||||||
|
# Check if the winning regions are the same for env states
|
||||||
|
# Env states should by construction have the same number as before
|
||||||
|
players_new = spot.get_state_players(gsdpa)
|
||||||
|
players_ref = spot.get_state_players(gsdpa_solved_ref)
|
||||||
|
# States maybe renumbered, but remain in the same "class"
|
||||||
|
tc.assertEqual(players_new, players_ref)
|
||||||
|
# Check that env states have the same winner
|
||||||
|
winners_new = spot.get_state_winners(gsdpa)
|
||||||
|
winners_ref = spot.get_state_winners(gsdpa_solved_ref)
|
||||||
|
|
||||||
|
tc.assertTrue(all([wn == wr for (wn, wr, p) in
|
||||||
|
zip(winners_new, winners_ref, players_ref)
|
||||||
|
if not p]))
|
||||||
|
|
||||||
# Test the different parity conditions
|
# Test the different parity conditions
|
||||||
gdpa = spot.tgba_determinize(spot.degeneralize_tba(g),
|
gdpa = spot.tgba_determinize(spot.degeneralize_tba(g),
|
||||||
|
|
|
||||||
|
|
@ -135,3 +135,169 @@ aut, s = do_split('((G (((! g_0) || (! g_1)) && ((r_0 && (X r_1)) -> (F (g_0 \
|
||||||
&& g_1))))) && (G (r_0 -> F g_0))) && (G (r_1 -> F g_1))',
|
&& g_1))))) && (G (r_0 -> F g_0))) && (G (r_1 -> F g_1))',
|
||||||
['g_0', 'g_1'])
|
['g_0', 'g_1'])
|
||||||
tc.assertTrue(equiv(aut, spot.unsplit_2step(s)))
|
tc.assertTrue(equiv(aut, spot.unsplit_2step(s)))
|
||||||
|
|
||||||
|
|
||||||
|
# check equivalence of split automata
|
||||||
|
# for the different methods for certain cases
|
||||||
|
autstr = """HOA: v1
|
||||||
|
name: "r2b_ack0 | F((!b2r_req0 & Xr2b_ack0) | (b2r_req0 & XG!r2b_ack0)) \
|
||||||
|
| (!b2r_req0 & G(!r2b_ack0 | ((!b2r_req0 | !b2r_req1) & X!b2r_req0 \
|
||||||
|
& (!(s2b_req0 | s2b_req1) | XF(b2r_req0 | b2r_req1)) & (!b2r_req0 \
|
||||||
|
| X(b2r_req0 | (b2r_req1 M !b2r_req0))) & (!b2r_req0 | r2b_ack0 \
|
||||||
|
| Xb2r_req0))))"
|
||||||
|
States: 12
|
||||||
|
Start: 7
|
||||||
|
AP: 5 "r2b_ack0" "b2r_req0" "b2r_req1" "s2b_req0" "s2b_req1"
|
||||||
|
controllable-AP: 2 1
|
||||||
|
acc-name: parity max even 4
|
||||||
|
Acceptance: 4 Fin(3) & (Inf(2) | (Fin(1) & Inf(0)))
|
||||||
|
properties: trans-labels explicit-labels trans-acc colored complete
|
||||||
|
properties: deterministic
|
||||||
|
--BODY--
|
||||||
|
State: 0
|
||||||
|
[!0&!1] 0 {2}
|
||||||
|
[0] 1 {1}
|
||||||
|
[!0&1] 3 {2}
|
||||||
|
State: 1
|
||||||
|
[t] 1 {2}
|
||||||
|
State: 2
|
||||||
|
[!0&1] 2 {2}
|
||||||
|
[0&1] 2 {3}
|
||||||
|
[!0&!1] 4 {2}
|
||||||
|
[0&!1] 5 {3}
|
||||||
|
State: 3
|
||||||
|
[!0&!1] 0 {2}
|
||||||
|
[0&1&2] 2 {1}
|
||||||
|
[!0&1] 3 {2}
|
||||||
|
[0&!1&3 | 0&!1&4] 6 {2}
|
||||||
|
[0&!1&!3&!4] 7 {2}
|
||||||
|
[0&1&!2] 8 {2}
|
||||||
|
State: 4
|
||||||
|
[0] 1 {1}
|
||||||
|
[!0&1] 2 {2}
|
||||||
|
[!0&!1] 4 {2}
|
||||||
|
State: 5
|
||||||
|
[0] 1 {1}
|
||||||
|
[!0&1] 2 {1}
|
||||||
|
[!0&!1] 5 {1}
|
||||||
|
State: 6
|
||||||
|
[!0&!1&2] 0 {2}
|
||||||
|
[0] 1 {1}
|
||||||
|
[!0&1] 2 {1}
|
||||||
|
[!0&!1&!2] 9 {1}
|
||||||
|
State: 7
|
||||||
|
[!0&!1] 0 {2}
|
||||||
|
[0] 1 {1}
|
||||||
|
[!0&1] 2 {1}
|
||||||
|
State: 8
|
||||||
|
[!0&!1&2] 0 {2}
|
||||||
|
[1] 2 {1}
|
||||||
|
[0&!1&2&3 | 0&!1&2&4] 6 {2}
|
||||||
|
[0&!1&2&!3&!4] 7 {2}
|
||||||
|
[!0&!1&!2] 10 {1}
|
||||||
|
[0&!1&!2] 11 {1}
|
||||||
|
State: 9
|
||||||
|
[!0&!1&2] 0 {2}
|
||||||
|
[0] 1 {1}
|
||||||
|
[!0&1] 3 {2}
|
||||||
|
[!0&!1&!2] 9 {1}
|
||||||
|
State: 10
|
||||||
|
[!0&!1&2] 0 {2}
|
||||||
|
[0] 1 {1}
|
||||||
|
[!0&1] 2 {1}
|
||||||
|
[!0&!1&!2] 10 {2}
|
||||||
|
State: 11
|
||||||
|
[!0&!1&2] 0 {2}
|
||||||
|
[0] 1 {1}
|
||||||
|
[!0&1] 2 {1}
|
||||||
|
[!0&!1&!2] 11 {1}
|
||||||
|
--END--
|
||||||
|
HOA: v1
|
||||||
|
States: 2
|
||||||
|
Start: 0
|
||||||
|
AP: 15 "u0room29light0f1dturn2off1b" "u0room29light0f1dturn2on1b" \
|
||||||
|
"p0b0room29window29opened" "u0room29light0f1dtoggle1b" \
|
||||||
|
"p0b0room29window29closed" "p0p0all2windows2closed0room" \
|
||||||
|
"u0system29start2new2timer0f1dmin25231b" \
|
||||||
|
"u0system29start2new2timer0f1dhour241b" \
|
||||||
|
"u0room29warnlight29control0room29warnlight29control" \
|
||||||
|
"u0system29start2new2timer0system29start2new2timer" \
|
||||||
|
"u0room29warnlight29control0f1dturn2on1b" \
|
||||||
|
"u0room29warnlight29control0f1dturn2off1b" "u0room29light0room29light" \
|
||||||
|
"u0system29start2new2timer0f1dhour251b" "p0b0timeout"
|
||||||
|
acc-name: all
|
||||||
|
Acceptance: 0 t
|
||||||
|
properties: trans-labels explicit-labels state-acc deterministic
|
||||||
|
controllable-AP: 0 1 3 6 7 8 9 10 11 12 13
|
||||||
|
--BODY--
|
||||||
|
State: 0
|
||||||
|
[!0&!1&!3&!6&!7&!8&!9&!10&11&12&13 | !0&!1&!3&!6&!7&!8&!9&10&!11&12&13 \
|
||||||
|
| !0&!1&!3&!6&!7&!8&9&!10&11&12&!13 | !0&!1&!3&!6&!7&!8&9&10&!11&12&!13 \
|
||||||
|
| !0&!1&!3&!6&!7&8&!9&!10&!11&12&13 | !0&!1&!3&!6&!7&8&9&!10&!11&12&!13 \
|
||||||
|
| !0&!1&!3&!6&7&!8&!9&!10&11&12&!13 | !0&!1&!3&!6&7&!8&!9&10&!11&12&!13 \
|
||||||
|
| !0&!1&!3&!6&7&8&!9&!10&!11&12&!13 | !0&!1&!3&6&!7&!8&!9&!10&11&12&!13 \
|
||||||
|
| !0&!1&!3&6&!7&!8&!9&10&!11&12&!13 | !0&!1&!3&6&!7&8&!9&!10&!11&12&!13 \
|
||||||
|
| !0&!1&3&!6&!7&!8&!9&!10&11&!12&13 | !0&!1&3&!6&!7&!8&!9&10&!11&!12&13 \
|
||||||
|
| !0&!1&3&!6&!7&!8&9&!10&11&!12&!13 | !0&!1&3&!6&!7&!8&9&10&!11&!12&!13 \
|
||||||
|
| !0&!1&3&!6&!7&8&!9&!10&!11&!12&13 | !0&!1&3&!6&!7&8&9&!10&!11&!12&!13 \
|
||||||
|
| !0&!1&3&!6&7&!8&!9&!10&11&!12&!13 | !0&!1&3&!6&7&!8&!9&10&!11&!12&!13 \
|
||||||
|
| !0&!1&3&!6&7&8&!9&!10&!11&!12&!13 | !0&!1&3&6&!7&!8&!9&!10&11&!12&!13 \
|
||||||
|
| !0&!1&3&6&!7&!8&!9&10&!11&!12&!13 | !0&!1&3&6&!7&8&!9&!10&!11&!12&!13 \
|
||||||
|
| !0&1&!3&!6&!7&!8&!9&!10&11&!12&13 | !0&1&!3&!6&!7&!8&!9&10&!11&!12&13 \
|
||||||
|
| !0&1&!3&!6&!7&!8&9&!10&11&!12&!13 | !0&1&!3&!6&!7&!8&9&10&!11&!12&!13 \
|
||||||
|
| !0&1&!3&!6&!7&8&!9&!10&!11&!12&13 | !0&1&!3&!6&!7&8&9&!10&!11&!12&!13 \
|
||||||
|
| !0&1&!3&!6&7&!8&!9&!10&11&!12&!13 | !0&1&!3&!6&7&!8&!9&10&!11&!12&!13 \
|
||||||
|
| !0&1&!3&!6&7&8&!9&!10&!11&!12&!13 | !0&1&!3&6&!7&!8&!9&!10&11&!12&!13 \
|
||||||
|
| !0&1&!3&6&!7&!8&!9&10&!11&!12&!13 | !0&1&!3&6&!7&8&!9&!10&!11&!12&!13 \
|
||||||
|
| 0&!1&!3&!6&!7&!8&!9&!10&11&!12&13 | 0&!1&!3&!6&!7&!8&!9&10&!11&!12&13 \
|
||||||
|
| 0&!1&!3&!6&!7&!8&9&!10&11&!12&!13 | 0&!1&!3&!6&!7&!8&9&10&!11&!12&!13 \
|
||||||
|
| 0&!1&!3&!6&!7&8&!9&!10&!11&!12&13 | 0&!1&!3&!6&!7&8&9&!10&!11&!12&!13 \
|
||||||
|
| 0&!1&!3&!6&7&!8&!9&!10&11&!12&!13 | 0&!1&!3&!6&7&!8&!9&10&!11&!12&!13 \
|
||||||
|
| 0&!1&!3&!6&7&8&!9&!10&!11&!12&!13 | 0&!1&!3&6&!7&!8&!9&!10&11&!12&!13 \
|
||||||
|
| 0&!1&!3&6&!7&!8&!9&10&!11&!12&!13 | 0&!1&!3&6&!7&8&!9&!10&!11&!12&!13] 1
|
||||||
|
State: 1
|
||||||
|
[!0&!1&!3&!6&!7&!8&!9&!10&11&12&13 | !0&!1&!3&!6&!7&!8&!9&10&!11&12&13 \
|
||||||
|
| !0&!1&!3&!6&!7&!8&9&!10&11&12&!13 | !0&!1&!3&!6&!7&!8&9&10&!11&12&!13 \
|
||||||
|
| !0&!1&!3&!6&!7&8&!9&!10&!11&12&13 | !0&!1&!3&!6&!7&8&9&!10&!11&12&!13 \
|
||||||
|
| !0&!1&!3&!6&7&!8&!9&!10&11&12&!13 | !0&!1&!3&!6&7&!8&!9&10&!11&12&!13 \
|
||||||
|
| !0&!1&!3&!6&7&8&!9&!10&!11&12&!13 | !0&!1&!3&6&!7&!8&!9&!10&11&12&!13 \
|
||||||
|
| !0&!1&!3&6&!7&!8&!9&10&!11&12&!13 | !0&!1&!3&6&!7&8&!9&!10&!11&12&!13 \
|
||||||
|
| !0&!1&3&!6&!7&!8&!9&!10&11&!12&13 | !0&!1&3&!6&!7&!8&!9&10&!11&!12&13 \
|
||||||
|
| !0&!1&3&!6&!7&!8&9&!10&11&!12&!13 | !0&!1&3&!6&!7&!8&9&10&!11&!12&!13 \
|
||||||
|
| !0&!1&3&!6&!7&8&!9&!10&!11&!12&13 | !0&!1&3&!6&!7&8&9&!10&!11&!12&!13 \
|
||||||
|
| !0&!1&3&!6&7&!8&!9&!10&11&!12&!13 | !0&!1&3&!6&7&!8&!9&10&!11&!12&!13 \
|
||||||
|
| !0&!1&3&!6&7&8&!9&!10&!11&!12&!13 | !0&!1&3&6&!7&!8&!9&!10&11&!12&!13 \
|
||||||
|
| !0&!1&3&6&!7&!8&!9&10&!11&!12&!13 | !0&!1&3&6&!7&8&!9&!10&!11&!12&!13 \
|
||||||
|
| !0&1&!3&!6&!7&!8&!9&!10&11&!12&13 | !0&1&!3&!6&!7&!8&!9&10&!11&!12&13 \
|
||||||
|
| !0&1&!3&!6&!7&!8&9&!10&11&!12&!13 | !0&1&!3&!6&!7&!8&9&10&!11&!12&!13 \
|
||||||
|
| !0&1&!3&!6&!7&8&!9&!10&!11&!12&13 | !0&1&!3&!6&!7&8&9&!10&!11&!12&!13 \
|
||||||
|
| !0&1&!3&!6&7&!8&!9&!10&11&!12&!13 | !0&1&!3&!6&7&!8&!9&10&!11&!12&!13 \
|
||||||
|
| !0&1&!3&!6&7&8&!9&!10&!11&!12&!13 | !0&1&!3&6&!7&!8&!9&!10&11&!12&!13 \
|
||||||
|
| !0&1&!3&6&!7&!8&!9&10&!11&!12&!13 | !0&1&!3&6&!7&8&!9&!10&!11&!12&!13 \
|
||||||
|
| 0&!1&!3&!6&!7&!8&!9&!10&11&!12&13 | 0&!1&!3&!6&!7&!8&!9&10&!11&!12&13 \
|
||||||
|
| 0&!1&!3&!6&!7&!8&9&!10&11&!12&!13 | 0&!1&!3&!6&!7&!8&9&10&!11&!12&!13 \
|
||||||
|
| 0&!1&!3&!6&!7&8&!9&!10&!11&!12&13 | 0&!1&!3&!6&!7&8&9&!10&!11&!12&!13 \
|
||||||
|
| 0&!1&!3&!6&7&!8&!9&!10&11&!12&!13 | 0&!1&!3&!6&7&!8&!9&10&!11&!12&!13 \
|
||||||
|
| 0&!1&!3&!6&7&8&!9&!10&!11&!12&!13 | 0&!1&!3&6&!7&!8&!9&!10&11&!12&!13 \
|
||||||
|
| 0&!1&!3&6&!7&!8&!9&10&!11&!12&!13 | 0&!1&!3&6&!7&8&!9&!10&!11&!12&!13] 1
|
||||||
|
--END--
|
||||||
|
"""
|
||||||
|
|
||||||
|
for autus in spot.automata(autstr):
|
||||||
|
si = spot.synthesis_info()
|
||||||
|
all_split = []
|
||||||
|
for sp in [spot.synthesis_info.splittype_EXPL,
|
||||||
|
spot.synthesis_info.splittype_SEMISYM,
|
||||||
|
spot.synthesis_info.splittype_FULLYSYM,
|
||||||
|
spot.synthesis_info.splittype_AUTO
|
||||||
|
]:
|
||||||
|
all_split.append(spot.split_2step(autus, si))
|
||||||
|
for i in range(len(all_split)):
|
||||||
|
for j in range(i+1, len(all_split)):
|
||||||
|
tc.assertTrue(spot.are_equivalent(all_split[i], all_split[j]))
|
||||||
|
|
||||||
|
|
||||||
|
del autus
|
||||||
|
del si
|
||||||
|
del all_split
|
||||||
|
gcollect()
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,7 @@ for i in range(0, 2):
|
||||||
tc.assertFalse(spot.solve_game(game))
|
tc.assertFalse(spot.solve_game(game))
|
||||||
|
|
||||||
# A game can have only inputs
|
# A game can have only inputs
|
||||||
game = spot.ltl_to_game("GFa", [])
|
game_ref = spot.automaton("""HOA: v1
|
||||||
tc.assertEqual(game.to_str(), """HOA: v1
|
|
||||||
States: 3
|
States: 3
|
||||||
Start: 0
|
Start: 0
|
||||||
AP: 1 "a"
|
AP: 1 "a"
|
||||||
|
|
@ -49,3 +48,10 @@ State: 1
|
||||||
State: 2
|
State: 2
|
||||||
[t] 0 {0}
|
[t] 0 {0}
|
||||||
--END--""")
|
--END--""")
|
||||||
|
|
||||||
|
gi = spot.synthesis_info()
|
||||||
|
gi.dict = game_ref.get_dict()
|
||||||
|
|
||||||
|
game = spot.ltl_to_game("GFa", [], gi)
|
||||||
|
|
||||||
|
tc.assertTrue(spot.are_equivalent(game, game_ref))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue