diff --git a/NEWS b/NEWS index 214682f11..aa55c12b1 100644 --- a/NEWS +++ b/NEWS @@ -181,6 +181,11 @@ New in spot 2.3.5.dev (not yet released) been adjusted to these new semantics, see "Backward-incompatible changes" below. + - The parser for HOA now recognize and verifies correct use of the + "univ-branch" property. This is known to be a problem with option + -H1 of ltl3ba 1.1.2 and ltl3dra 0.2.3, so the environment variable + SPOT_HOA_TOLERANT can be set to disable the diagnostic. + Python: - The 'spot.gen' package exports the functions from libspotgen. diff --git a/bin/man/spot-x.x b/bin/man/spot-x.x index cd76d8526..ef31b991c 100644 --- a/bin/man/spot-x.x +++ b/bin/man/spot-x.x @@ -91,6 +91,14 @@ The contents of this variable is added to any dot output, immediately before the first state is output. This makes it easy to override global attributes of the graph. +.TP +\fBSPOT_HOA_TOLERANT\fR +If this variable is set, a few sanity checks performed by the HOA +parser are skipped. The tests in questions correspond to issues +in third-party tools that output incorrect HOA (e.g., declaring +the automaton with property "univ-branch" when no universal branching +is actually used) + .TP \fBSPOT_SATLOG\fR If set to a filename, the SAT-based minimization routines will append diff --git a/spot/parseaut/parseaut.yy b/spot/parseaut/parseaut.yy index 613dcb0cb..9de0b54e3 100644 --- a/spot/parseaut/parseaut.yy +++ b/spot/parseaut/parseaut.yy @@ -1110,18 +1110,25 @@ body: states error(p.loc, "... despite 'properties: !deterministic'"); det_warned = true; } - if (res.universal.is_true() && !det_warned) + static bool tolerant = getenv("SPOT_HOA_TOLERANT"); + if (res.universal.is_true() && !det_warned && !tolerant) if (auto p = res.prop_is_true("exist-branch")) { error(@1, "automaton has no existential branching..."); - error(p.loc, "... despite 'properties: exist-branch'"); + error(p.loc, "... despite 'properties: exist-branch'\n" + "note: If this is an issue you cannot fix, you may disable " + "this diagnostic\n by defining the SPOT_HOA_TOLERANT " + "environment variable."); det_warned = true; } - if (res.existential.is_true() && !det_warned) + if (res.existential.is_true() && !det_warned && !tolerant) if (auto p = res.prop_is_true("univ-branch")) { error(@1, "automaton is has no universal branching..."); - error(p.loc, "... despite 'properties: univ-branch'"); + error(p.loc, "... despite 'properties: univ-branch'\n" + "note: If this is an issue you cannot fix, you may disable " + "this diagnostic\n by defining the SPOT_HOA_TOLERANT " + "environment variable."); det_warned = true; } } diff --git a/tests/core/ltl3ba.test b/tests/core/ltl3ba.test index 9692beaac..be875a14f 100755 --- a/tests/core/ltl3ba.test +++ b/tests/core/ltl3ba.test @@ -29,7 +29,11 @@ set -e (ltl3ba -v) || exit 77 # The -H1 option will output alternating automata, so this tests -# ltlcross's support in this area. +# ltlcross's support in this area. However ltl3ba 1.1.3 incorrectly +# output "univ-branch" for all automata produced by -H1, causing +# error messages from Spot's parser unless SPOT_HOA_TOLERANT is set. +SPOT_HOA_TOLERANT=1 +export SPOT_HOA_TOLERANT # Using '_x' as first formula makes sure that ltlcross automatically # relabels the input formula when the atomic propositions are not # compatible with Spin's syntax. diff --git a/tests/core/parseaut.test b/tests/core/parseaut.test index 21a4ac940..e552a30b9 100755 --- a/tests/core/parseaut.test +++ b/tests/core/parseaut.test @@ -783,12 +783,16 @@ 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' +note: If this is an issue you cannot fix, you may disable this diagnostic + by defining the SPOT_HOA_TOLERANT environment variable. 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' +note: If this is an issue you cannot fix, you may disable this diagnostic + by defining the SPOT_HOA_TOLERANT environment variable. 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