hoa: store the automaton name as a property
* src/hoaparse/hoaparse.yy: Store the automaton name. * src/tgbaalgos/hoa.cc: Output it if it exists. * src/tgbatest/hoaparse.test: Adjust tests.
This commit is contained in:
parent
f37ff8407c
commit
5a1e38d90f
3 changed files with 10 additions and 2 deletions
|
|
@ -359,7 +359,9 @@ header-item: "States:" INT
|
|||
}
|
||||
| "name:" STRING
|
||||
{
|
||||
delete $2;
|
||||
res.h->aut->set_named_prop("automaton-name", $2, [](void* name) {
|
||||
delete static_cast<std::string*>(name);
|
||||
});
|
||||
}
|
||||
| "properties:" properties
|
||||
| HEADERNAME header-spec
|
||||
|
|
|
|||
|
|
@ -250,7 +250,10 @@ namespace spot
|
|||
|
||||
const char nl = newline ? '\n' : ' ';
|
||||
os << "HOA: v1" << nl;
|
||||
if (f)
|
||||
auto* n = aut->get_named_prop("automaton-name");
|
||||
if (n)
|
||||
escape_str(os << "name: \"", *static_cast<std::string*>(n)) << '"' << nl;
|
||||
else if (f)
|
||||
escape_str(os << "name: \"", to_string(f)) << '"' << nl;
|
||||
os << "States: " << num_states << nl
|
||||
<< "Start: 0" << nl
|
||||
|
|
|
|||
|
|
@ -384,6 +384,7 @@ EOF
|
|||
|
||||
expectok input <<EOF
|
||||
HOA: v1
|
||||
name: "GFa & GF(b & c)"
|
||||
States: 1
|
||||
Start: 0
|
||||
AP: 3 "a" "b" "c"
|
||||
|
|
@ -431,6 +432,7 @@ AP: 1 "a"
|
|||
[!0--ABORT--
|
||||
HOA: v1
|
||||
States: 2
|
||||
name: "survivor"
|
||||
Start: 0
|
||||
Acceptance: 2 (Inf(0) & Inf(!0)) & Inf(!1)
|
||||
AP: 1 "a"
|
||||
|
|
@ -460,6 +462,7 @@ diff stderr input.exp
|
|||
|
||||
cat >expected <<EOF
|
||||
HOA: v1
|
||||
name: "survivor"
|
||||
States: 2
|
||||
Start: 0
|
||||
AP: 1 "a"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue