* src/ltltest/Makefile.am (AM_CXXFLAGS): New variable.
* tgba/bdddict.hh (bdd_dict::register_propositions, bdd_dict::register_accepting_variables): New methods. * src/bdddict.cc: Likewise. * tgba/tgbaexplicit.cc (tgba_explicit::add_conditions, tgba_explicit::add_accepting_conditions): New methods. (tgba_explicit::get_init_state): Add an "empty" initial state to empty automata. * tgba/tgbaexplicit.hh: (tgba_explicit::add_conditions, tgba_explicit::add_accepting_conditions): New methods. * tgbaalgos/Makefiles.am (tgbaalgos_HEADERS, libtgbaalgos_la_SOURCES): Add dupexp.hh and dupexp.cc. * tgbaalgos/dupexp.hh, tgbaalgos/dupexp.cc: New files. * tgbatest/Makefile.am (AM_CXXFLAGS): New variable. (check_SCRIPTS): Add dupexp.test. (CLEANFILES): Add output1 and output2. * tgbatest/dupexp.test: New file. * tgbatest/ltl2tgba.cc: Handle -s and -S. * tgbatest/tgbaread.cc: Remove unused variable exit_code.
This commit is contained in:
parent
51ff9f8dda
commit
982c5efc6c
13 changed files with 271 additions and 8 deletions
|
|
@ -1,4 +1,5 @@
|
|||
AM_CPPFLAGS = -I$(srcdir)/.. $(BUDDY_CPPFLAGS)
|
||||
AM_CXXFLAGS = $(WARNING_CXXFLAGS)
|
||||
LDADD = ../libspot.la
|
||||
|
||||
check_SCRIPTS = defs
|
||||
|
|
@ -40,10 +41,11 @@ TESTS = \
|
|||
explpro3.test \
|
||||
tripprod.test \
|
||||
mixprod.test \
|
||||
dupexp.test \
|
||||
emptchk.test \
|
||||
emptchke.test \
|
||||
spotlbtt.test
|
||||
|
||||
EXTRA_DIST = $(TESTS)
|
||||
|
||||
CLEANFILES = input input1 input2 input3 stdout expected config
|
||||
CLEANFILES = input input1 input2 input3 stdout expected config output1 output2
|
||||
|
|
|
|||
30
src/tgbatest/dupexp.test
Executable file
30
src/tgbatest/dupexp.test
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
#!/bin/sh
|
||||
|
||||
. ./defs
|
||||
|
||||
set -e
|
||||
|
||||
run()
|
||||
{
|
||||
./ltl2tgba -f -s "$1" >output1
|
||||
./ltl2tgba -f -S "$1" >output2
|
||||
test `wc -l <output1` = `wc -l <output2`
|
||||
|
||||
./ltl2tgba -s "$1" >output1
|
||||
./ltl2tgba -S "$1" >output2
|
||||
test `wc -l <output1` = `wc -l <output2`
|
||||
}
|
||||
|
||||
run 'a'
|
||||
run 'a U b'
|
||||
run 'X a'
|
||||
run 'a & b & c'
|
||||
run 'a | b | (c U (d & (g U (h ^ i))))'
|
||||
run 'Xa & (b U !a) & (b U !a)'
|
||||
run 'Fa & Xb & GFc & Gd'
|
||||
run 'Fa & Xa & GFc & Gc'
|
||||
run 'Fc & X(a | Xb) & GF(a | Xb) & Gc'
|
||||
run '!((FF a) <=> (F x))'
|
||||
run '!((FF a) <=> (F a))'
|
||||
run 'Xa && (!a U b) && !b && X!b'
|
||||
run '(a U !b) && Gb'
|
||||
|
|
@ -14,6 +14,7 @@
|
|||
#include "tgbaalgos/magic.hh"
|
||||
#include "tgbaalgos/emptinesscheck.hh"
|
||||
#include "tgbaparse/public.hh"
|
||||
#include "tgbaalgos/dupexp.hh"
|
||||
|
||||
void
|
||||
syntax(char* prog)
|
||||
|
|
@ -45,6 +46,10 @@ syntax(char* prog)
|
|||
<< " -r display the relation BDD, not the reachability graph"
|
||||
<< std::endl
|
||||
<< " -R same as -r, but as a set" << std::endl
|
||||
<< " -s convert to explicit automata, and number states "
|
||||
<< "in DFS order" << std::endl
|
||||
<< " -S convert to explicit automata, and number states "
|
||||
<< "in BFS order" << std::endl
|
||||
<< " -t display reachable states in LBTT's format" << std::endl
|
||||
<< " -v display the BDD variables used by the automaton"
|
||||
<< std::endl
|
||||
|
|
@ -65,6 +70,7 @@ main(int argc, char** argv)
|
|||
int output = 0;
|
||||
int formula_index = 0;
|
||||
enum { None, Couvreur, MagicSearch } echeck = None;
|
||||
enum { NoneDup, BFS, DFS } dupexp = NoneDup;
|
||||
bool magic_many = false;
|
||||
bool expect_counter_example = false;
|
||||
bool from_file = false;
|
||||
|
|
@ -142,6 +148,14 @@ main(int argc, char** argv)
|
|||
{
|
||||
output = 3;
|
||||
}
|
||||
else if (!strcmp(argv[formula_index], "-s"))
|
||||
{
|
||||
dupexp = DFS;
|
||||
}
|
||||
else if (!strcmp(argv[formula_index], "-S"))
|
||||
{
|
||||
dupexp = BFS;
|
||||
}
|
||||
else if (!strcmp(argv[formula_index], "-t"))
|
||||
{
|
||||
output = 6;
|
||||
|
|
@ -218,6 +232,19 @@ main(int argc, char** argv)
|
|||
if (degeneralize_opt)
|
||||
a = degeneralized = new spot::tgba_tba_proxy(a);
|
||||
|
||||
spot::tgba_explicit* expl = 0;
|
||||
switch (dupexp)
|
||||
{
|
||||
case NoneDup:
|
||||
break;
|
||||
case BFS:
|
||||
a = expl = tgba_dupexp_bfs(a);
|
||||
break;
|
||||
case DFS:
|
||||
a = expl = tgba_dupexp_dfs(a);
|
||||
break;
|
||||
}
|
||||
|
||||
switch (output)
|
||||
{
|
||||
case -1:
|
||||
|
|
@ -305,6 +332,8 @@ main(int argc, char** argv)
|
|||
break;
|
||||
}
|
||||
|
||||
if (expl)
|
||||
delete expl;
|
||||
if (degeneralize_opt)
|
||||
delete degeneralized;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,8 +15,6 @@ syntax(char* prog)
|
|||
int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
int exit_code = 0;
|
||||
|
||||
if (argc < 2)
|
||||
syntax(argv[0]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue