maskacc: Add a tgba_digraph version

* src/tgbaalgos/mask.cc, src/tgbaalgos/mask.hh: New files.
* src/tgbaalgos/Makefile.am: Adjust.
* src/tgba/acc.hh (mark_t::set): New method.
* src/bin/autfilt.cc: Add option --mask-acc.
* src/tgbatest/maskacc.test: Rewrite.
* src/tgbatest/maskacc.cc: Delete.
* src/tgbatest/Makefile.am: Adjust.
This commit is contained in:
Alexandre Duret-Lutz 2015-01-31 20:28:47 +01:00
parent a0a035e0e1
commit d0f0be234d
8 changed files with 264 additions and 90 deletions

View file

@ -24,28 +24,94 @@
set -e
cat >input1 <<EOF
acc = A B;
s1, s2, "a", A;
s1, s3, "b", B;
s2, s3, "a",;
s3, s2, "b",;
s2, s4, "a", B;
s3, s4, "b", A;
s4, s4, "a", A B;
HOA: v1
States: 4
Start: 0
AP: 2 "a" "b"
acc-name: generalized-Buchi 2
Acceptance: 2 Inf(0)&Inf(1)
properties: trans-labels explicit-labels trans-acc
--BODY--
State: 0
[0] 1 {0}
[1] 2 {1}
State: 1
[0] 2
[0] 3 {1}
State: 2
[1] 1
[1] 3 {0}
State: 3
[0] 3 {0 1}
--END--
EOF
cat >expect1 <<EOF
acc = "0" "1";
"0", "2", "b", "1";
"2", "1", "b",;
"1", "2", "a",;
"1", "3", "a", "1";
acc = "0" "1";
"0", "1", "a", "0";
"1", "2", "a",;
"2", "1", "b",;
"2", "3", "b", "0";
HOA: v1
States: 4
Start: 0
AP: 2 "a" "b"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels trans-acc
--BODY--
State: 0
[1] 1 {0}
State: 1
[1] 2
State: 2
[0] 1
[0] 3 {0}
State: 3
--END--
EOF
run 0 ../maskacc input1 | tee stdout
diff stdout expect1
run 0 ../../bin/autfilt --mask-acc=0 input1 -H >output
diff output expect1
cat >expect2 <<EOF
HOA: v1
States: 4
Start: 0
AP: 2 "a" "b"
acc-name: Buchi
Acceptance: 1 Inf(0)
properties: trans-labels explicit-labels trans-acc
--BODY--
State: 0
[0] 1 {0}
State: 1
[0] 2
State: 2
[1] 1
[1] 3 {0}
State: 3
--END--
EOF
run 0 ../../bin/autfilt --mask-acc=1 input1 -H >output
diff output expect2
cat >expect3 <<EOF
HOA: v1
States: 1
Start: 0
AP: 0
acc-name: all
Acceptance: 0 t
properties: trans-labels explicit-labels state-acc deterministic
--BODY--
State: 0
--END--
EOF
run 0 ../../bin/autfilt --mask-acc=0,1,2 input1 -H >output
diff output expect3
run 0 ../../bin/autfilt --mask-acc=0 --mask-acc=1 input1 -H >output
diff output expect3
# Errors
run 2 ../../bin/autfilt --mask-acc=a3 input1
run 2 ../../bin/autfilt --mask-acc=3-2 input1
run 2 ../../bin/autfilt --mask-acc=0,9999,1 input1