Add text I/O for Kripke structures.

* src/kripke/kripkeexplicit.cc, src/kripke/kripkeexplicit.hh,
src/kripke/kripkeprint.cc, src/kripke/kripkeprint.hh: New files.
* src/kripke/Makefile.am: Add them.
* src/kripkeparse/fmterror.cc, src/kripkeparse/kripkeparse.yy,
src/kripkeparse/kripkescan.ll, src/kripkeparse/parsedecl.hh,
src/kripkeparse/public.hh, src/kripkeparse/scankripke.ll: New
files.
* src/kripkeparse/Makefile.am: Add them.
* src/kripketest/bad_parsing.test, src/kripketest/defs.in,
src/kripketest/kripke.test, src/kripketest/origin,
src/kripketest/parse_print_test.cc: New files.
* src/kripketest/Makefile.am: Add them.
* src/Makefile.am (SUBDIRS): Add kripkeparse and kripketest.
* README: Document src/kripketest/ and src/kripkeparse/.
* configure.ac: Generate src/kripkeparse/Makefile,
src/kripketest/Makefile, src/kripketest/defs.
* iface/dve2/defs.in (run2): New function.
* iface/dve2/dve2check.cc (syntax, main): Add option -gK.
* iface/dve2/kripke.test: New file.
* iface/dve2/Makefile.am (TESTS): Add kripke.test.
This commit is contained in:
Thomas Badie 2011-11-24 22:47:41 +01:00 committed by Alexandre Duret-Lutz
parent 71d1a4fe25
commit bb5949f6de
28 changed files with 1824 additions and 7 deletions

View file

@ -33,6 +33,8 @@
#include "misc/timer.hh"
#include "misc/memusage.hh"
#include <cstring>
#include "kripke/kripkeexplicit.hh"
#include "kripke/kripkeprint.hh"
static void
syntax(char* prog)
@ -58,6 +60,8 @@ syntax(char* prog)
<< std::endl
<< " -gm output the model state-space in dot format"
<< std::endl
<< " -gK output the model state-space in Kripke format"
<< std::endl
<< " -gp output the product state-space in dot format"
<< std::endl
<< " -T time the different phases of the execution"
@ -80,7 +84,7 @@ main(int argc, char **argv)
bool use_timer = false;
enum { DotFormula, DotModel, DotProduct, EmptinessCheck }
enum { DotFormula, DotModel, DotProduct, EmptinessCheck, Kripke }
output = EmptinessCheck;
bool accepting_run = false;
bool expect_counter_example = false;
@ -128,6 +132,9 @@ main(int argc, char **argv)
case 'f':
output = DotFormula;
break;
case 'K':
output = Kripke;
break;
default:
goto error;
}
@ -242,6 +249,14 @@ main(int argc, char **argv)
tm.stop("dotty output");
goto safe_exit;
}
if (output == Kripke)
{
tm.start("kripke output");
spot::KripkePrinter p (model, std::cout);
p.run();
tm.stop("kripke output");
goto safe_exit;
}
}