Commit 1e84bb1e authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

autfilt: add a --quiet option

* src/bin/autfilt.cc: Add option.
* src/tgbatest/det.test: Test it.
parent 541ce543
......@@ -89,6 +89,7 @@ static const argp_option options[] =
{ "lbtt", OPT_LBTT, "t", OPTION_ARG_OPTIONAL,
"LBTT's format (add =t to force transition-based acceptance even"
" on Büchi automata)", 0 },
{ "quiet", 'q', 0, 0, "suppress all normal output", 0 },
{ "spin", 's', 0, 0, "Spin neverclaim (implies --ba)", 0 },
{ "spot", OPT_SPOT, 0, 0, "SPOT's format", 0 },
{ "utf8", '8', 0, 0, "enable UTF-8 characters in output "
......@@ -151,7 +152,7 @@ static const struct argp_child children[] =
{ 0, 0, 0, 0 }
};
static enum output_format { Dot, Lbtt, Lbtt_t, Spin, Spot, Stats, Hoa }
static enum output_format { Dot, Lbtt, Lbtt_t, Spin, Spot, Stats, Hoa, Quiet }
format = Dot;
static bool one_match = false;
static const char* stats = "";
......@@ -197,6 +198,9 @@ parse_opt(int key, char* arg, struct argp_state*)
case 'M':
type = spot::postprocessor::Monitor;
break;
case 'q':
format = Quiet;
break;
case 's':
format = Spin;
if (type != spot::postprocessor::Monitor)
......@@ -443,6 +447,9 @@ namespace
case Hoa:
spot::hoa_reachable(std::cout, aut, hoa_opt) << '\n';
break;
case Quiet:
// Do not output anything.
break;
case Spot:
spot::tgba_save_reachable(std::cout, aut);
break;
......
......@@ -59,39 +59,61 @@ EOF
$ltl2tgba -x tba-det --det --stats '%d,%s,%f' -F formulas/3 > out
diff formulas out
cat >in.tgba <<'EOF'
acc = "1";
"1", "2", "a", "1";
"1", "1", "!a",;
"2", "3", "a", "1";
"2", "1", "!a",;
"3", "3", "a",;
"3", "1", "!a",;
cat >in.hoa <<'EOF'
HOA: v1
States: 3
Start: 0
AP: 1 "a"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels trans-acc complete deterministic
--BODY--
State: 0
[!0] 0
[0] 1 {0}
State: 1
[!0] 0
[0] 2 {0}
State: 2
[!0] 0
[0] 2
--END--
EOF
# FIXME: we should improve this output
cat >ex.tgba <<'EOF'
acc = "0";
"0", "0", "!a",;
"0", "1", "a",;
"0", "3", "!a",;
"1", "0", "!a",;
"1", "2", "a",;
"1", "3", "!a",;
"3", "3", "!a", "0";
"2", "0", "!a",;
"2", "2", "a",;
"2", "3", "!a",;
"2", "5", "a",;
"5", "3", "!a", "0";
"5", "5", "a", "0";
cat >ex.hoa <<'EOF'
HOA: v1
States: 5
Start: 0
AP: 1 "a"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels state-acc
--BODY--
State: 0
[!0] 0
[0] 1
[!0] 2
State: 1
[!0] 0
[0] 3
[!0] 2
State: 2 {0}
[!0] 2
State: 3
[!0] 0
[0] 3
[!0] 2
[0] 4
State: 4 {0}
[!0] 2
[0] 4
--END--
EOF
run 0 ../ltl2tgba -b -DC -X in.tgba > out.tgba
# FIXME: use are-isomorphic once it is available
diff out.tgba ex.tgba
run 0 ../ltl2tgba -H -DC -XH in.hoa > out.hoa
run 1 ../../bin/autfilt -q --are-isomorph in.hoa out.hoa
run 0 ../../bin/autfilt -q --are-isomorph ex.hoa out.hoa
run 0 ../ltl2tgba -x -DC 'GFa & XGFb' > out.tgba
cat >ex.tgba <<EOF
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment