rewrite explicit Kripke structures and their parser

Fixes #4 and fixes #5.

* NEWS: Mention the change.
* src/kripkeparse/: Delete.
* README, src/Makefile.am, configure.ac: Adjust.
* src/kripke/kripkeexplicit.cc, src/kripke/kripkeexplicit.hh,
src/kripke/kripkeprint.cc, src/kripke/kripkeprint.hh: Delete.
* src/kripke/kripkegraph.hh: New file.
* src/kripke/Makefile.am: Adjust.
* src/parseaut/parseaut.yy, src/parseaut/public.hh: Add
an option to read kripke structures.
* src/tests/bad_parsing.test: Delete.
* src/tests/Makefile.am: Adjust.
* src/tests/kripke.test, src/tests/parse_print_test.cc: Rewrite.
* src/tests/ikwiad.cc, src/tests/parseaut.test,
iface/ltsmin/modelcheck.cc, wrap/python/spot_impl.i: Adjust.
This commit is contained in:
Alexandre Duret-Lutz 2015-11-28 02:15:36 +01:00
parent 073d154540
commit afbaa54d92
27 changed files with 670 additions and 1472 deletions

View file

@ -18,8 +18,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "kripkeparse/public.hh"
#include "kripke/kripkeprint.hh"
#include "parseaut/public.hh"
#include "twaalgos/hoa.hh"
using namespace spot;
@ -28,20 +28,23 @@ int main(int argc, char** argv)
(void) argc;
assert(argc == 2);
int return_value = 0;
kripke_parse_error_list pel;
{
auto k = kripke_parse(argv[1], pel, make_bdd_dict());
if (!pel.empty())
{
format_kripke_parse_errors(std::cerr, argv[1], pel);
return_value = 1;
}
spot::automaton_parser_options opts;
opts.want_kripke = true;
spot::automaton_stream_parser parser(argv[1], opts);
if (!return_value)
kripke_save_reachable(std::cout, k);
}
assert(spot::fnode::instances_check());
while (auto paut = parser.parse(make_bdd_dict(),
default_environment::instance()))
{
if (paut->format_errors(std::cerr))
{
return_value = 1;
if (paut->ks)
continue;
}
if (!paut->ks)
break;
print_hoa(std::cout, paut->ks, "k");
}
return return_value;
}