* src/tgba/bddprint.cc (print_handler): Quote promises
when !want_prom. * src/tgbaparse/tgbaparse.yy (prop_list): Accept strings or identifiers. Discard empty strings. * src/tgbatest/mixprod.cc, src/tgbatest/mixprod.test: New file. * src/tgbatest/Makefile.am (check_PROGRAMS): Add mixprod. (mixprod_SOURCES): New variable. (TESTS): Add mixprod.test.
This commit is contained in:
parent
fd12c02345
commit
bacd5a0ac2
7 changed files with 112 additions and 10 deletions
11
ChangeLog
11
ChangeLog
|
|
@ -1,3 +1,14 @@
|
|||
2003-06-18 Alexandre Duret-Lutz <aduret@src.lip6.fr>
|
||||
|
||||
* src/tgba/bddprint.cc (print_handler): Quote promises
|
||||
when !want_prom.
|
||||
* src/tgbaparse/tgbaparse.yy (prop_list): Accept strings or
|
||||
identifiers. Discard empty strings.
|
||||
* src/tgbatest/mixprod.cc, src/tgbatest/mixprod.test: New file.
|
||||
* src/tgbatest/Makefile.am (check_PROGRAMS): Add mixprod.
|
||||
(mixprod_SOURCES): New variable.
|
||||
(TESTS): Add mixprod.test.
|
||||
|
||||
2003-06-17 Alexandre Duret-Lutz <aduret@src.lip6.fr>
|
||||
|
||||
* src/tgba/tgbaproduct.cc (state_bdd_product::state_bdd_product):
|
||||
|
|
|
|||
|
|
@ -25,10 +25,15 @@ namespace spot
|
|||
if (isi != dict->prom_formula_map.end())
|
||||
{
|
||||
if (want_prom)
|
||||
o << "Prom[";
|
||||
to_string(isi->second, o);
|
||||
if (want_prom)
|
||||
o << "]";
|
||||
{
|
||||
o << "Prom[";
|
||||
to_string(isi->second, o) << "]";
|
||||
}
|
||||
else
|
||||
{
|
||||
o << "\"";
|
||||
to_string(isi->second, o) << "\"";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -69,15 +69,17 @@ prop_list:
|
|||
{
|
||||
$$ = new std::list<pair>;
|
||||
}
|
||||
| prop_list IDENT
|
||||
| prop_list strident
|
||||
{
|
||||
$1->push_back(pair(false, parse_environment.require(*$2)));
|
||||
if (*$2 != "")
|
||||
$1->push_back(pair(false, parse_environment.require(*$2)));
|
||||
delete $2;
|
||||
$$ = $1;
|
||||
}
|
||||
| prop_list '!' IDENT
|
||||
| prop_list '!' strident
|
||||
{
|
||||
$1->push_back(pair(true, parse_environment.require(*$3)));
|
||||
if (*$3 != "")
|
||||
$1->push_back(pair(true, parse_environment.require(*$3)));
|
||||
delete $3;
|
||||
$$ = $1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,3 +13,4 @@ explprod
|
|||
*.ps
|
||||
*.dot
|
||||
tripprod
|
||||
mixprod
|
||||
|
|
|
|||
|
|
@ -11,18 +11,23 @@ check_PROGRAMS = \
|
|||
ltlprod \
|
||||
bddprod \
|
||||
explprod \
|
||||
tripprod
|
||||
tripprod \
|
||||
mixprod
|
||||
|
||||
# Keep this sorted alphabetically.
|
||||
bddprod_SOURCES = ltlprod.cc
|
||||
bddprod_CXXFLAGS = -DBDD_CONCRETE_PRODUCT
|
||||
explicit_SOURCES = explicit.cc
|
||||
explprod_SOURCES = explprod.cc
|
||||
ltl2tgba_SOURCES = ltl2tgba.cc
|
||||
ltlprod_SOURCES = ltlprod.cc
|
||||
mixprod_SOURCES = mixprod.cc
|
||||
readsave_SOURCES = readsave.cc
|
||||
tgbaread_SOURCES = tgbaread.cc
|
||||
tripprod_SOURCES = tripprod.cc
|
||||
|
||||
# Keep this sorted by STRENGTH. Test basic things first,
|
||||
# because such failures will be easier to diagnose and fix.
|
||||
TESTS = \
|
||||
explicit.test \
|
||||
tgbaread.test \
|
||||
|
|
@ -31,7 +36,8 @@ TESTS = \
|
|||
ltlprod.test \
|
||||
bddprod.test \
|
||||
explprod.test \
|
||||
tripprod.test
|
||||
tripprod.test \
|
||||
mixprod.test
|
||||
|
||||
EXTRA_DIST = $(TESTS)
|
||||
|
||||
|
|
|
|||
53
src/tgbatest/mixprod.cc
Normal file
53
src/tgbatest/mixprod.cc
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
#include <iostream>
|
||||
#include <cassert>
|
||||
#include "ltlvisit/destroy.hh"
|
||||
#include "ltlast/allnodes.hh"
|
||||
#include "ltlparse/public.hh"
|
||||
#include "tgba/ltl2tgba.hh"
|
||||
#include "tgba/tgbaproduct.hh"
|
||||
#include "tgba/tgbabddconcreteproduct.hh"
|
||||
#include "tgbaparse/public.hh"
|
||||
#include "tgbaalgos/save.hh"
|
||||
|
||||
void
|
||||
syntax(char* prog)
|
||||
{
|
||||
std::cerr << prog << " formula file" << std::endl;
|
||||
exit(2);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
int exit_code = 0;
|
||||
|
||||
if (argc != 3)
|
||||
syntax(argv[0]);
|
||||
|
||||
spot::ltl::environment& env(spot::ltl::default_environment::instance());
|
||||
|
||||
spot::ltl::parse_error_list pel1;
|
||||
spot::ltl::formula* f1 = spot::ltl::parse(argv[1], pel1, env);
|
||||
if (spot::ltl::format_parse_errors(std::cerr, argv[1], pel1))
|
||||
return 2;
|
||||
|
||||
spot::tgba_parse_error_list pel2;
|
||||
spot::tgba_explicit* a2 = spot::tgba_parse(argv[2], pel2, env);
|
||||
if (spot::format_tgba_parse_errors(std::cerr, pel2))
|
||||
return 2;
|
||||
|
||||
{
|
||||
spot::tgba_bdd_concrete a1 = spot::ltl_to_tgba(f1);
|
||||
spot::ltl::destroy(f1);
|
||||
spot::tgba_product p(a1, *a2);
|
||||
|
||||
spot::tgba_save_reachable(std::cout, p);
|
||||
}
|
||||
|
||||
assert(spot::ltl::unop::instance_count() == 0);
|
||||
assert(spot::ltl::binop::instance_count() == 0);
|
||||
assert(spot::ltl::multop::instance_count() == 0);
|
||||
delete a2;
|
||||
assert(spot::ltl::atomic_prop::instance_count() == 0);
|
||||
return exit_code;
|
||||
}
|
||||
24
src/tgbatest/mixprod.test
Executable file
24
src/tgbatest/mixprod.test
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/bin/sh
|
||||
|
||||
. ./defs
|
||||
|
||||
set -e
|
||||
|
||||
# We don't check the output, but just running this might be enough to
|
||||
# trigger assertions or I/O errors.
|
||||
|
||||
cat >input1 <<EOF
|
||||
s1, s3, a,;
|
||||
s1, s2, b, p1;
|
||||
s2, s1, !a,;
|
||||
s2, s3, c,;
|
||||
EOF
|
||||
|
||||
./mixprod 'F(a U b) & Xa' input1 >stdout
|
||||
cat stdout
|
||||
|
||||
# Make sure we can read the produced output
|
||||
|
||||
./mixprod 'G!a' stdout
|
||||
|
||||
rm input1 stdout
|
||||
Loading…
Add table
Add a link
Reference in a new issue