hoa: fix I/O of determinism

Fixes #212.

* spot/parseaut/parseaut.yy, spot/twaalgos/hoa.cc: Recognize
exist-branch, and adjust printer to the 1.1 semantics.
* tests/core/alternating.test, tests/core/complete.test,
tests/core/det.test, tests/core/explsum.test,
tests/core/parseaut.test, tests/core/readsave.test,
tests/core/sbacc.test, tests/core/tgbagraph.test,
tests/python/alternating.py, tests/python/dualize.py: Adjust test
cases.
* NEWS: Mention the change.
This commit is contained in:
Alexandre Duret-Lutz 2017-07-31 21:03:49 +02:00
parent 0cf250d839
commit d3607a7ce3
13 changed files with 291 additions and 106 deletions

9
NEWS
View file

@ -172,6 +172,15 @@ New in spot 2.3.5.dev (not yet released)
process automata from different streams at the same time (i.e., process automata from different streams at the same time (i.e.,
using multiple spot::automaton_stream_parser instances at once). using multiple spot::automaton_stream_parser instances at once).
- The print_hoa() and parse_automaton() functions have been updated
to recognize the "exist-branch" property of the non-released HOA
v1.1, as well as the new meaning of property "deterministic". (In
HOA v1 "properties: deterministic" means that the automaton has no
existential branching; in HOA v1.1 it disallows universal
branching as well.) The meaning of "deterministic" in Spot has
been adjusted to these new semantics, see "Backward-incompatible
changes" below.
Python: Python:
- The 'spot.gen' package exports the functions from libspotgen. - The 'spot.gen' package exports the functions from libspotgen.

View file

@ -146,7 +146,8 @@ extern "C" int strverscmp(const char *s1, const char *s2);
bool accept_all_seen = false; bool accept_all_seen = false;
bool aliased_states = false; bool aliased_states = false;
spot::trival deterministic = spot::trival::maybe(); spot::trival universal = spot::trival::maybe();
spot::trival existential = spot::trival::maybe();
spot::trival complete = spot::trival::maybe(); spot::trival complete = spot::trival::maybe();
bool trans_acc_seen = false; bool trans_acc_seen = false;
@ -346,6 +347,7 @@ BOOLEAN: 't' | 'f'
header: format-version header-items header: format-version header-items
{ {
bool v1plus = strverscmp("v1", res.format_version.c_str()) < 0;
// Preallocate the states if we know their number. // Preallocate the states if we know their number.
if (res.states >= 0) if (res.states >= 0)
{ {
@ -457,14 +459,15 @@ header: format-version header-items
res.acc_style = State_Acc; res.acc_style = State_Acc;
} }
auto univ_branch = res.prop_is_true("univ-branch"); if (auto univ_branch = res.prop_is_true("univ-branch"))
if (res.opts.want_kripke && univ_branch) if (res.opts.want_kripke)
error(univ_branch.loc, error(univ_branch.loc,
"Kripke structures may not use 'properties: univ-branch'"); "Kripke structures may not use 'properties: univ-branch'");
} }
{ {
unsigned ss = res.start.size(); unsigned ss = res.start.size();
auto det = res.prop_is_true("deterministic"); auto det = res.prop_is_true("deterministic");
auto no_exist = res.prop_is_false("exist-branch");
if (ss > 1) if (ss > 1)
{ {
if (det) if (det)
@ -472,7 +475,14 @@ header: format-version header-items
error(det.loc, error(det.loc,
"deterministic automata should have at most " "deterministic automata should have at most "
"one initial state"); "one initial state");
res.deterministic = spot::trival::maybe(); res.universal = spot::trival::maybe();
}
else if (no_exist)
{
error(no_exist.loc,
"universal automata should have at most "
"one initial state");
res.universal = spot::trival::maybe();
} }
} }
else else
@ -480,7 +490,30 @@ header: format-version header-items
// Assume the automaton is deterministic until proven // Assume the automaton is deterministic until proven
// wrong, or unless we are building a Kripke structure. // wrong, or unless we are building a Kripke structure.
if (!res.opts.want_kripke) if (!res.opts.want_kripke)
res.deterministic = true; {
res.universal = true;
res.existential = true;
}
}
for (auto& ss: res.start)
{
if (ss.second.size() > 1)
{
if (auto no_univ = res.prop_is_false("univ-branch"))
{
error(ss.first,
"conjunct initial state despite...");
error(no_univ.loc, "... property: !univ-branch");
}
else if (v1plus)
if (auto det = res.prop_is_true("deterministic"))
{
error(ss.first,
"conjunct initial state despite...");
error(det.loc, "... property: deterministic");
}
res.existential = false;
}
} }
auto complete = res.prop_is_true("complete"); auto complete = res.prop_is_true("complete");
if (ss < 1) if (ss < 1)
@ -1069,14 +1102,29 @@ body: states
error(@1, "automaton is complete..."); error(@1, "automaton is complete...");
error(p.loc, "... despite 'properties: !complete'"); error(p.loc, "... despite 'properties: !complete'");
} }
if (res.deterministic) bool det_warned = false;
if (res.universal && res.existential)
if (auto p = res.prop_is_false("deterministic")) if (auto p = res.prop_is_false("deterministic"))
{ {
error(@1, "automaton is deterministic..."); error(@1, "automaton is deterministic...");
error(p.loc, "... despite 'properties: !deterministic'"); error(p.loc, "... despite 'properties: !deterministic'");
det_warned = true;
}
if (res.universal.is_true() && !det_warned)
if (auto p = res.prop_is_true("exist-branch"))
{
error(@1, "automaton has no existential branching...");
error(p.loc, "... despite 'properties: exist-branch'");
det_warned = true;
}
if (res.existential.is_true() && !det_warned)
if (auto p = res.prop_is_true("univ-branch"))
{
error(@1, "automaton is has no universal branching...");
error(p.loc, "... despite 'properties: univ-branch'");
det_warned = true;
} }
} }
state-num: INT state-num: INT
{ {
if (((int) $1) < 0) if (((int) $1) < 0)
@ -1132,7 +1180,7 @@ checked-state-num: state-num
states: | states state states: | states state
{ {
if ((res.deterministic.is_true() || res.complete.is_true())) if ((res.universal.is_true() || res.complete.is_true()))
{ {
bdd available = bddtrue; bdd available = bddtrue;
bool det = true; bool det = true;
@ -1142,15 +1190,21 @@ states: | states state
det = false; det = false;
available -= t.cond; available -= t.cond;
} }
if (res.deterministic.is_true() && !det) if (res.universal.is_true() && !det)
{ {
res.deterministic = false; res.universal = false;
if (auto p = res.prop_is_true("deterministic")) if (auto p = res.prop_is_true("deterministic"))
{ {
error(@2, "automaton is not deterministic..."); error(@2, "automaton is not deterministic...");
error(p.loc, error(p.loc,
"... despite 'properties: deterministic'"); "... despite 'properties: deterministic'");
} }
else if (auto p = res.prop_is_false("exist-branch"))
{
error(@2, "automaton has existential branching...");
error(p.loc,
"... despite 'properties: !exist-branch'");
}
} }
if (res.complete.is_true() && available != bddfalse) if (res.complete.is_true() && available != bddfalse)
{ {
@ -1192,7 +1246,8 @@ state: state-name labeled-edges
{ {
// Assume the worse. This skips the tests about determinism // Assume the worse. This skips the tests about determinism
// we might perform on the state. // we might perform on the state.
res.deterministic = spot::trival::maybe(); res.universal = spot::trival::maybe();
res.existential = spot::trival::maybe();
res.complete = spot::trival::maybe(); res.complete = spot::trival::maybe();
} }
@ -1402,6 +1457,7 @@ state-conj-checked: state-conj-2
" previous declaration..."); " previous declaration...");
error(ub.loc, "... here"); error(ub.loc, "... here");
} }
res.existential = false;
} }
/* Block of unlabeled edge, with occasional (incorrect) labeled /* Block of unlabeled edge, with occasional (incorrect) labeled
@ -1531,7 +1587,8 @@ dstar_header: dstar_sizes
res.info_states.resize(res.states); res.info_states.resize(res.states);
} }
res.acc_style = State_Acc; res.acc_style = State_Acc;
res.deterministic = true; res.universal = true;
res.existential = true;
res.complete = true; res.complete = true;
fill_guards(res); fill_guards(res);
res.cur_guard = res.guards.end(); res.cur_guard = res.guards.end();
@ -2339,9 +2396,7 @@ static void fix_initial_state(result_& r)
static void fix_properties(result_& r) static void fix_properties(result_& r)
{ {
r.aut_or_ks->prop_universal(r.deterministic); r.aut_or_ks->prop_universal(r.universal);
// std::cerr << "fix det: " << r.deterministic << '\n';
// std::cerr << "fix complete: " << r.complete << '\n';
r.aut_or_ks->prop_complete(r.complete); r.aut_or_ks->prop_complete(r.complete);
if (r.acc_style == State_Acc || if (r.acc_style == State_Acc ||
(r.acc_style == Mixed_Acc && !r.trans_acc_seen)) (r.acc_style == Mixed_Acc && !r.trans_acc_seen))
@ -2373,7 +2428,7 @@ static void check_version(const result_& r)
std::ostringstream s; std::ostringstream s;
s << "we can read HOA v" << supported s << "we can read HOA v" << supported
<< " but this file uses " << v << "; this might " << " but this file uses " << v << "; this might "
<< "cause the following errors"; "cause the following errors";
r.h->errors.emplace_front(r.format_version_loc, s.str()); r.h->errors.emplace_front(r.format_version_loc, s.str());
return; return;
} }

View file

@ -50,7 +50,7 @@ namespace spot
std::vector<bool> common_acc; std::vector<bool> common_acc;
bool has_state_acc; bool has_state_acc;
bool is_complete; bool is_complete;
bool is_deterministic; bool is_universal;
bool is_colored; bool is_colored;
bool use_implicit_labels; bool use_implicit_labels;
bool use_state_labels = true; bool use_state_labels = true;
@ -65,7 +65,7 @@ namespace spot
bool state_labels) bool state_labels)
{ {
check_det_and_comp(aut); check_det_and_comp(aut);
use_implicit_labels = implicit && is_deterministic && is_complete; use_implicit_labels = implicit && is_universal && is_complete;
use_state_labels &= state_labels; use_state_labels &= state_labels;
number_all_ap(aut); number_all_ap(aut);
} }
@ -95,7 +95,7 @@ namespace spot
std::string empty; std::string empty;
unsigned ns = aut->num_states(); unsigned ns = aut->num_states();
bool deterministic = true; bool universal = true;
bool complete = true; bool complete = true;
bool state_acc = true; bool state_acc = true;
bool nodeadend = true; bool nodeadend = true;
@ -117,10 +117,10 @@ namespace spot
lastcond = t.cond; lastcond = t.cond;
if (complete) if (complete)
sum |= t.cond; sum |= t.cond;
if (deterministic) if (universal)
{ {
if (!bdd_implies(t.cond, available)) if (!bdd_implies(t.cond, available))
deterministic = false; universal = false;
else else
available -= t.cond; available -= t.cond;
} }
@ -151,7 +151,7 @@ namespace spot
common_acc.push_back(st_acc); common_acc.push_back(st_acc);
state_acc &= st_acc; state_acc &= st_acc;
} }
is_deterministic = deterministic; is_universal = universal;
is_complete = complete; is_complete = complete;
has_state_acc = state_acc; has_state_acc = state_acc;
// If the automaton has state-based acceptance and contain // If the automaton has state-based acceptance and contain
@ -160,10 +160,10 @@ namespace spot
is_colored = colored && (!has_state_acc || nodeadend); is_colored = colored && (!has_state_acc || nodeadend);
// If the automaton declares that it is universal or // If the automaton declares that it is universal or
// state-based, make sure that it really is. // state-based, make sure that it really is.
if (aut->prop_universal().is_true() && !deterministic) if (aut->prop_universal().is_true() && !universal)
throw std::runtime_error("print_hoa(): automaton is not universal" throw std::runtime_error("print_hoa(): automaton is not universal"
" but prop_universal()==true"); " but prop_universal()==true");
if (aut->prop_universal().is_false() && deterministic) if (aut->prop_universal().is_false() && universal)
throw std::runtime_error("print_hoa(): automaton is universal" throw std::runtime_error("print_hoa(): automaton is universal"
" despite prop_universal()==false"); " despite prop_universal()==false");
if (aut->prop_complete().is_true() && !complete) if (aut->prop_complete().is_true() && !complete)
@ -455,21 +455,6 @@ namespace spot
} }
os << str; os << str;
}; };
// It's probable that nobody cares about the "no-univ-branch"
// property. The "univ-branch" property seems more important to
// announce that the automaton might not be parsable by tools that
// do not support alternating automata.
if (!aut->is_existential())
{
prop(" univ-branch");
}
else if (verbose)
{
if (v1_1)
prop(" !univ-branch");
else
prop(" no-univ-branch");
}
implicit_labels = md.use_implicit_labels; implicit_labels = md.use_implicit_labels;
state_labels = md.use_state_labels; state_labels = md.use_state_labels;
if (implicit_labels) if (implicit_labels)
@ -490,20 +475,60 @@ namespace spot
prop(" complete"); prop(" complete");
else if (v1_1) else if (v1_1)
prop(" !complete"); prop(" !complete");
if (md.is_deterministic) // The definition of "deterministic" was changed between HOA v1
// (were it meant "universal") and HOA v1.1 were it means
// ("universal" and "existential").
if (!v1_1)
{
if (md.is_universal)
prop(" deterministic"); prop(" deterministic");
else if (v1_1) // It's probable that nobody cares about the "no-univ-branch"
// property. The "univ-branch" property seems more important to
// announce that the automaton might not be parsable by tools that
// do not support alternating automata.
if (!aut->is_existential())
{
prop(" univ-branch");
}
else if (verbose)
{
if (v1_1)
prop(" !univ-branch");
else
prop(" no-univ-branch");
}
}
else
{
if (md.is_universal && aut->is_existential())
{
prop(" deterministic");
if (verbose)
prop(" !univ-branch !exist-branch");
}
else
{
prop(" !deterministic"); prop(" !deterministic");
if (!aut->is_existential())
prop(" univ-branch");
else if (verbose)
prop(" !univ-branch");
if (!md.is_universal)
prop(" exist-branch");
else if (verbose)
prop(" !exist-branch");
}
}
// Deterministic automata are also unambiguous, so writing both // Deterministic automata are also unambiguous, so writing both
// properties seems redundant. People working on unambiguous // properties seems redundant. People working on unambiguous
// automata are usually concerned about non-deterministic // automata are usually concerned about non-deterministic
// unambiguous automata. So do not mention "unambiguous" // unambiguous automata. So do not mention "unambiguous"
// in the case of deterministic automata. // in the case of deterministic automata.
if (aut->prop_unambiguous() && (verbose || !md.is_deterministic)) if (aut->prop_unambiguous() && (verbose || !md.is_universal))
prop(" unambiguous"); prop(" unambiguous");
else if (v1_1 && !aut->prop_unambiguous()) else if (v1_1 && !aut->prop_unambiguous())
prop(" !unambiguous"); prop(" !unambiguous");
if (aut->prop_semi_deterministic() && (verbose || !md.is_deterministic)) if (aut->prop_semi_deterministic() && (verbose || !md.is_universal))
prop(" semi-deterministic"); prop(" semi-deterministic");
else if (v1_1 && !aut->prop_semi_deterministic()) else if (v1_1 && !aut->prop_semi_deterministic())
prop(" !semi-deterministic"); prop(" !semi-deterministic");

View file

@ -129,7 +129,7 @@ diff expect.dot alt.dot
autfilt --trust=no --check=strength alt.hoa | grep properties: >output autfilt --trust=no --check=strength alt.hoa | grep properties: >output
cat >expected <<EOF cat >expected <<EOF
properties: univ-branch trans-labels explicit-labels state-acc properties: trans-labels explicit-labels state-acc univ-branch
properties: very-weak properties: very-weak
EOF EOF
diff output expected diff output expected
@ -168,7 +168,7 @@ Start: 0
AP: 1 "a" AP: 1 "a"
acc-name: Buchi acc-name: Buchi
Acceptance: 1 Inf(0) Acceptance: 1 Inf(0)
properties: univ-branch trans-labels explicit-labels state-acc complete properties: trans-labels explicit-labels state-acc complete univ-branch
properties: very-weak properties: very-weak
--BODY-- --BODY--
State: 0 {0} State: 0 {0}
@ -211,8 +211,8 @@ Start: 0
AP: 1 "a" AP: 1 "a"
acc-name: co-Buchi acc-name: co-Buchi
Acceptance: 1 Fin(0) Acceptance: 1 Fin(0)
properties: univ-branch trans-labels explicit-labels trans-acc complete properties: trans-labels explicit-labels trans-acc complete
properties: deterministic properties: deterministic univ-branch
--BODY-- --BODY--
State: 0 State: 0
[0] 0 [0] 0
@ -232,8 +232,8 @@ Start: 0&1
AP: 1 "a" AP: 1 "a"
acc-name: co-Buchi acc-name: co-Buchi
Acceptance: 1 Fin(0) Acceptance: 1 Fin(0)
properties: univ-branch trans-labels explicit-labels trans-acc complete properties: trans-labels explicit-labels trans-acc complete
properties: deterministic properties: deterministic univ-branch
--BODY-- --BODY--
State: 0 State: 0
[0] 0 [0] 0
@ -253,8 +253,8 @@ Start: 0
AP: 1 "a" AP: 1 "a"
acc-name: co-Buchi acc-name: co-Buchi
Acceptance: 1 Fin(0) Acceptance: 1 Fin(0)
properties: univ-branch trans-labels explicit-labels trans-acc complete properties: trans-labels explicit-labels trans-acc complete
properties: deterministic properties: deterministic univ-branch
--BODY-- --BODY--
State: 0 State: 0
[0] 1 [0] 1
@ -280,8 +280,8 @@ Start: 0&2
AP: 1 "a" AP: 1 "a"
acc-name: co-Buchi acc-name: co-Buchi
Acceptance: 1 Fin(0) Acceptance: 1 Fin(0)
properties: univ-branch trans-labels explicit-labels trans-acc properties: trans-labels explicit-labels trans-acc deterministic
properties: deterministic properties: univ-branch
--BODY-- --BODY--
State: 0 State: 0
[0] 0 [0] 0
@ -301,8 +301,8 @@ Start: 0&2&4
AP: 1 "a" AP: 1 "a"
acc-name: co-Buchi acc-name: co-Buchi
Acceptance: 1 Fin(0) Acceptance: 1 Fin(0)
properties: univ-branch trans-labels explicit-labels trans-acc properties: trans-labels explicit-labels trans-acc deterministic
properties: deterministic properties: univ-branch
--BODY-- --BODY--
State: 0 State: 0
[0] 0 [0] 0
@ -325,8 +325,8 @@ Start: 0&1
AP: 1 "a" AP: 1 "a"
acc-name: co-Buchi acc-name: co-Buchi
Acceptance: 1 Fin(0) Acceptance: 1 Fin(0)
properties: univ-branch trans-labels explicit-labels trans-acc complete properties: trans-labels explicit-labels trans-acc complete
properties: deterministic properties: deterministic univ-branch
--BODY-- --BODY--
State: 0 State: 0
[0] 0 [0] 0
@ -343,8 +343,8 @@ Start: 0&1&3
AP: 1 "a" AP: 1 "a"
acc-name: co-Buchi acc-name: co-Buchi
Acceptance: 1 Fin(0) Acceptance: 1 Fin(0)
properties: univ-branch trans-labels explicit-labels trans-acc properties: trans-labels explicit-labels trans-acc deterministic
properties: deterministic properties: univ-branch
--BODY-- --BODY--
State: 0 State: 0
[0] 0 [0] 0
@ -365,8 +365,8 @@ Start: 0&1
AP: 1 "a" AP: 1 "a"
acc-name: co-Buchi acc-name: co-Buchi
Acceptance: 1 Fin(0) Acceptance: 1 Fin(0)
properties: univ-branch trans-labels explicit-labels trans-acc complete properties: trans-labels explicit-labels trans-acc complete
properties: deterministic properties: deterministic univ-branch
--BODY-- --BODY--
State: 0 State: 0
[0] 0 [0] 0
@ -896,8 +896,8 @@ Start: 0&1
AP: 1 "p1" AP: 1 "p1"
acc-name: co-Buchi acc-name: co-Buchi
Acceptance: 1 Fin(0) Acceptance: 1 Fin(0)
properties: univ-branch trans-labels explicit-labels trans-acc properties: trans-labels explicit-labels trans-acc deterministic
properties: deterministic properties: univ-branch
--BODY-- --BODY--
State: 0 "p1" State: 0 "p1"
[0] 2 [0] 2

View file

@ -195,8 +195,8 @@ Start: 0
AP: 2 "a" "b" AP: 2 "a" "b"
acc-name: co-Buchi acc-name: co-Buchi
Acceptance: 1 Fin(0) Acceptance: 1 Fin(0)
properties: univ-branch trans-labels explicit-labels state-acc complete properties: trans-labels explicit-labels state-acc complete
properties: deterministic very-weak properties: deterministic univ-branch very-weak
--BODY-- --BODY--
State: 0 State: 0
[!0 | 1] 0 [!0 | 1] 0
@ -210,8 +210,8 @@ Start: 0&1
AP: 0 AP: 0
acc-name: co-Buchi acc-name: co-Buchi
Acceptance: 1 Fin(0) Acceptance: 1 Fin(0)
properties: univ-branch trans-labels explicit-labels state-acc complete properties: trans-labels explicit-labels state-acc complete
properties: deterministic properties: deterministic univ-branch
--BODY-- --BODY--
State: 0 State: 0
[t] 0 [t] 0
@ -233,8 +233,8 @@ Start: 0
AP: 2 "a" "b" AP: 2 "a" "b"
acc-name: co-Buchi acc-name: co-Buchi
Acceptance: 1 Fin(0) Acceptance: 1 Fin(0)
properties: univ-branch trans-labels explicit-labels state-acc properties: trans-labels explicit-labels state-acc deterministic
properties: deterministic very-weak properties: univ-branch very-weak
--BODY-- --BODY--
State: 0 State: 0
[!0 | 1] 0 [!0 | 1] 0
@ -248,8 +248,8 @@ Start: 0&1
AP: 0 AP: 0
acc-name: co-Buchi acc-name: co-Buchi
Acceptance: 1 Fin(0) Acceptance: 1 Fin(0)
properties: univ-branch trans-labels explicit-labels state-acc properties: trans-labels explicit-labels state-acc deterministic
properties: deterministic properties: univ-branch
--BODY-- --BODY--
State: 0 State: 0
State: 1 State: 1

View file

@ -153,7 +153,7 @@ AP: 1 "a"
acc-name: Buchi acc-name: Buchi
Acceptance: 1 Inf(0) Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels state-acc !complete properties: trans-labels explicit-labels state-acc !complete
properties: !deterministic properties: !deterministic exist-branch
spot.highlight.states: 0 1 spot.highlight.states: 0 1
spot.highlight.edges: 1 2 2 2 spot.highlight.edges: 1 2 2 2
--BODY-- --BODY--
@ -178,7 +178,7 @@ AP: 1 "a"
acc-name: Buchi acc-name: Buchi
Acceptance: 1 Inf(0) Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels state-acc !complete properties: trans-labels explicit-labels state-acc !complete
properties: !deterministic properties: !deterministic exist-branch
spot.highlight.states: 1 1 spot.highlight.states: 1 1
--BODY-- --BODY--
State: 0 {0} State: 0 {0}
@ -202,7 +202,7 @@ AP: 1 "a"
acc-name: Buchi acc-name: Buchi
Acceptance: 1 Inf(0) Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels state-acc !complete properties: trans-labels explicit-labels state-acc !complete
properties: !deterministic properties: !deterministic exist-branch
spot.highlight.states: 1 5 spot.highlight.states: 1 5
spot.highlight.edges: 2 5 3 5 spot.highlight.edges: 2 5 3 5
--BODY-- --BODY--
@ -263,7 +263,7 @@ AP: 1 "a"
acc-name: Buchi acc-name: Buchi
Acceptance: 1 Inf(0) Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels state-acc !complete properties: trans-labels explicit-labels state-acc !complete
properties: !deterministic properties: !deterministic exist-branch
spot.highlight.states: 0 2 1 5 spot.highlight.states: 0 2 1 5
spot.highlight.edges: 1 3 2 5 3 5 spot.highlight.edges: 1 3 2 5 3 5
--BODY-- --BODY--

View file

@ -170,7 +170,7 @@ States: 6
Start: 5 Start: 5
AP: 3 "a" "b" "c" AP: 3 "a" "b" "c"
Acceptance: 2 Inf(0) | Inf(1) Acceptance: 2 Inf(0) | Inf(1)
properties: univ-branch trans-labels explicit-labels trans-acc properties: trans-labels explicit-labels trans-acc univ-branch
--BODY-- --BODY--
State: 0 State: 0
[0] 0&1 [0] 0&1
@ -222,7 +222,7 @@ States: 7
Start: 0&2&5 Start: 0&2&5
AP: 3 "b" "a" "c" AP: 3 "b" "a" "c"
Acceptance: 4 Fin(0) | Inf(1) | (Inf(2)&Inf(3)) Acceptance: 4 Fin(0) | Inf(1) | (Inf(2)&Inf(3))
properties: univ-branch trans-labels explicit-labels trans-acc properties: trans-labels explicit-labels trans-acc univ-branch
--BODY-- --BODY--
State: 0 State: 0
[1] 0 {0} [1] 0 {0}
@ -254,7 +254,7 @@ States: 8
Start: 7 Start: 7
AP: 3 "b" "a" "c" AP: 3 "b" "a" "c"
Acceptance: 4 Fin(0) | Inf(1) | (Inf(2)&Inf(3)) Acceptance: 4 Fin(0) | Inf(1) | (Inf(2)&Inf(3))
properties: univ-branch trans-labels explicit-labels trans-acc properties: trans-labels explicit-labels trans-acc univ-branch
--BODY-- --BODY--
State: 0 State: 0
[1] 0 {0} [1] 0 {0}

View file

@ -690,12 +690,108 @@ State: 1
[!0] 1 [!0] 1
[!0] 0 [!0] 0
--END-- --END--
HOA: v1
States: 2
Start: 0
Start: 1
AP: 2 "a" "\"b\""
Acceptance: 1 Inf(0)
properties: !exist-branch univ-branch
--BODY--
State: 0 {0}
[1] 1
[!1] 0
State: 1
[!0] 1
[!0] 0
--END--
HOA: v1
States: 2
Start: 0
AP: 2 "a" "\"b\""
Acceptance: 1 Inf(0)
properties: !exist-branch univ-branch
--BODY--
State: 0 {0}
[1] 1
[!1] 0
State: 1
[!0] 1
[!0] 0
--END--
HOA: v1
States: 2
Start: 0&1
AP: 2 "a" "\"b\""
Acceptance: 1 Inf(0)
properties: exist-branch !univ-branch
--BODY--
State: 0 {0}
[1] 1
[!1] 0
State: 1
[!0] 1
[!0] 0
--END--
HOA: v1
States: 2
Start: 0
AP: 2 "a" "\"b\""
Acceptance: 1 Inf(0)
properties: exist-branch !univ-branch
--BODY--
State: 0 {0}
[1] 1
[!1] 0
State: 1
[!0] 1&0
--END--
HOA: v1
States: 2
Start: 0&1 /* This is ok in the v1 format */
AP: 2 "a" "b"
Acceptance: 1 Inf(0)
properties: deterministic
--BODY--
State: 0 {0}
[1] 1
[!1] 0
State: 1
[!0] 0
--END--
HOA: v1.1
States: 2
Start: 0&1 /* This is NOT ok since v1.1 */
AP: 2 "a" "b"
Acceptance: 1 Inf(0)
properties: deterministic
--BODY--
State: 0 {0}
[1] 1
[!1] 0
State: 1
[!0] 0
--END--
EOF EOF
expecterr input <<EOF expecterr input <<EOF
input:7.13-25: deterministic automata should have at most one initial state input:7.13-25: deterministic automata should have at most one initial state
input:20.13-20: complete automata should have at least one initial state input:20.13-20: complete automata should have at least one initial state
input:33.1-35.6: automaton is not deterministic... input:33.1-35.6: automaton is not deterministic...
input:28.13-25: ... despite 'properties: deterministic' input:28.13-25: ... despite 'properties: deterministic'
input:43.13-25: universal automata should have at most one initial state
input:62.1-64.6: automaton has existential branching...
input:57.13-25: ... despite 'properties: !exist-branch'
input:58.9-64.6: automaton is has no universal branching...
input:57.27-37: ... despite 'properties: univ-branch'
input:68.1-10: conjunct initial state despite...
input:71.26-37: ... property: !univ-branch
input:91.6-8: universal branch used despite previous declaration...
input:85.26-37: ... here
input:86.9-91.8: automaton has no existential branching...
input:85.13-24: ... despite 'properties: exist-branch'
input:106.6-9: we can read HOA v1 but this file uses v1.1; $t
input:108.1-10: conjunct initial state despite...
input:111.13-25: ... property: deterministic
EOF EOF
# Mix HOA with neverclaims and LBTT automata # Mix HOA with neverclaims and LBTT automata
@ -1960,7 +2056,7 @@ Start: 12
AP: 4 "p2" "c1" "p1" "c2" AP: 4 "p2" "c1" "p1" "c2"
acc-name: co-Buchi acc-name: co-Buchi
Acceptance: 1 Fin(0) Acceptance: 1 Fin(0)
properties: univ-branch trans-labels explicit-labels state-acc properties: trans-labels explicit-labels state-acc univ-branch
properties: very-weak properties: very-weak
--BODY-- --BODY--
State: 0 "X (G(c2))" State: 0 "X (G(c2))"
@ -2435,7 +2531,7 @@ Start: 0
AP: 2 "b" "a" AP: 2 "b" "a"
acc-name: co-Buchi acc-name: co-Buchi
Acceptance: 1 Fin(0) Acceptance: 1 Fin(0)
properties: univ-branch trans-labels explicit-labels state-acc properties: trans-labels explicit-labels state-acc univ-branch
properties: very-weak properties: very-weak
--BODY-- --BODY--
State: 0 "((((a) U (b)) && GF(b)) && FG(a))" State: 0 "((((a) U (b)) && GF(b)) && FG(a))"
@ -2464,8 +2560,8 @@ Start: 0
AP: 2 "a" "b" AP: 2 "a" "b"
acc-name: co-Buchi acc-name: co-Buchi
Acceptance: 1 Fin(0) Acceptance: 1 Fin(0)
properties: univ-branch trans-labels explicit-labels state-acc complete properties: trans-labels explicit-labels state-acc complete
properties: deterministic properties: deterministic univ-branch
--BODY-- --BODY--
State: 0 State: 0
[!0&!1] 0&1 [!0&!1] 0&1
@ -2641,7 +2737,7 @@ Start: 0
AP: 2 "b" "a" AP: 2 "b" "a"
acc-name: Buchi acc-name: Buchi
Acceptance: 1 Inf(0) Acceptance: 1 Inf(0)
properties: univ-branch trans-labels explicit-labels state-acc properties: trans-labels explicit-labels state-acc univ-branch
properties: very-weak properties: very-weak
--BODY-- --BODY--
State: 0 "((((a) U (b)) && GF(b)) && FG(a))" State: 0 "((((a) U (b)) && GF(b)) && FG(a))"
@ -2670,8 +2766,8 @@ Start: 0
AP: 2 "a" "b" AP: 2 "a" "b"
acc-name: Buchi acc-name: Buchi
Acceptance: 1 Inf(0) Acceptance: 1 Inf(0)
properties: univ-branch trans-labels explicit-labels state-acc complete properties: trans-labels explicit-labels state-acc complete
properties: deterministic properties: deterministic univ-branch
--BODY-- --BODY--
State: 0 State: 0
[!0&!1] 0&1 [!0&!1] 0&1

View file

@ -809,8 +809,8 @@ Start: 1
AP: 2 "a" "b" AP: 2 "a" "b"
acc-name: Buchi acc-name: Buchi
Acceptance: 1 Inf(0) Acceptance: 1 Inf(0)
properties: no-univ-branch trans-labels explicit-labels state-acc properties: trans-labels explicit-labels state-acc deterministic
properties: deterministic unambiguous semi-deterministic weak properties: no-univ-branch unambiguous semi-deterministic weak
properties: inherently-weak properties: inherently-weak
--BODY-- --BODY--
State: 0 State: 0

View file

@ -249,7 +249,7 @@ Start: 0
AP: 1 "a" AP: 1 "a"
acc-name: generalized-Buchi 2 acc-name: generalized-Buchi 2
Acceptance: 2 Inf(0)&Inf(1) Acceptance: 2 Inf(0)&Inf(1)
properties: univ-branch trans-labels explicit-labels state-acc properties: trans-labels explicit-labels state-acc univ-branch
--BODY-- --BODY--
State: 0 {0} State: 0 {0}
[0] 3 [0] 3

View file

@ -260,8 +260,8 @@ Start: 2&0
AP: 0 AP: 0
acc-name: all acc-name: all
Acceptance: 0 t Acceptance: 0 t
properties: univ-branch trans-labels explicit-labels state-acc complete properties: trans-labels explicit-labels state-acc complete
properties: deterministic properties: !deterministic univ-branch
--BODY-- --BODY--
State: 0 State: 0
[t] 0 [t] 0

View file

@ -59,7 +59,7 @@ Start: 0
AP: 2 "p1" "p2" AP: 2 "p1" "p2"
acc-name: Buchi acc-name: Buchi
Acceptance: 1 Inf(0) Acceptance: 1 Inf(0)
properties: univ-branch trans-labels explicit-labels trans-acc properties: trans-labels explicit-labels trans-acc univ-branch
--BODY-- --BODY--
State: 0 State: 0
[0] 1&2 {0} [0] 1&2 {0}
@ -89,7 +89,7 @@ Start: 0&1
AP: 2 "p1" "p2" AP: 2 "p1" "p2"
acc-name: Buchi acc-name: Buchi
Acceptance: 1 Inf(0) Acceptance: 1 Inf(0)
properties: univ-branch trans-labels explicit-labels trans-acc properties: trans-labels explicit-labels trans-acc univ-branch
--BODY-- --BODY--
State: 0 State: 0
[0] 1&2 {0} [0] 1&2 {0}
@ -120,7 +120,7 @@ Start: 0
AP: 2 "p1" "p2" AP: 2 "p1" "p2"
acc-name: Buchi acc-name: Buchi
Acceptance: 1 Inf(0) Acceptance: 1 Inf(0)
properties: univ-branch trans-labels explicit-labels trans-acc properties: trans-labels explicit-labels trans-acc univ-branch
--BODY-- --BODY--
State: 0 State: 0
[0] 1&2 {0} [0] 1&2 {0}
@ -146,7 +146,7 @@ Start: 0
AP: 2 "p1" "p2" AP: 2 "p1" "p2"
acc-name: Buchi acc-name: Buchi
Acceptance: 1 Inf(0) Acceptance: 1 Inf(0)
properties: univ-branch trans-labels explicit-labels trans-acc properties: trans-labels explicit-labels trans-acc univ-branch
--BODY-- --BODY--
State: 0 State: 0
[0&!1] 1&2 {0} [0&!1] 1&2 {0}

View file

@ -125,8 +125,8 @@ Start: 0
AP: 2 "a" "b" AP: 2 "a" "b"
acc-name: co-Buchi acc-name: co-Buchi
Acceptance: 1 Fin(0) Acceptance: 1 Fin(0)
properties: univ-branch trans-labels explicit-labels state-acc complete properties: trans-labels explicit-labels state-acc complete
properties: deterministic properties: deterministic univ-branch
--BODY-- --BODY--
State: 0 State: 0
[!0] 3 [!0] 3
@ -289,8 +289,8 @@ Start: 0
AP: 2 "a" "b" AP: 2 "a" "b"
acc-name: Streett 1 acc-name: Streett 1
Acceptance: 2 Fin(0) | Inf(1) Acceptance: 2 Fin(0) | Inf(1)
properties: univ-branch trans-labels explicit-labels state-acc complete properties: trans-labels explicit-labels state-acc complete
properties: deterministic properties: deterministic univ-branch
--BODY-- --BODY--
State: 0 {0} State: 0 {0}
[0&!1] 1 [0&!1] 1
@ -523,8 +523,8 @@ Start: 0
AP: 1 "a" AP: 1 "a"
acc-name: parity min even 2 acc-name: parity min even 2
Acceptance: 2 Inf(0) | Fin(1) Acceptance: 2 Inf(0) | Fin(1)
properties: univ-branch trans-labels explicit-labels state-acc complete properties: trans-labels explicit-labels state-acc complete
properties: deterministic properties: deterministic univ-branch
--BODY-- --BODY--
State: 0 State: 0
[!0] 0 [!0] 0
@ -546,8 +546,8 @@ Start: 0
AP: 2 "a" "b" AP: 2 "a" "b"
acc-name: co-Buchi acc-name: co-Buchi
Acceptance: 1 Fin(0) Acceptance: 1 Fin(0)
properties: univ-branch trans-labels explicit-labels state-acc complete properties: trans-labels explicit-labels state-acc complete
properties: deterministic properties: deterministic univ-branch
--BODY-- --BODY--
State: 0 State: 0
[0] 1 [0] 1