* 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>
|
2003-06-17 Alexandre Duret-Lutz <aduret@src.lip6.fr>
|
||||||
|
|
||||||
* src/tgba/tgbaproduct.cc (state_bdd_product::state_bdd_product):
|
* src/tgba/tgbaproduct.cc (state_bdd_product::state_bdd_product):
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,15 @@ namespace spot
|
||||||
if (isi != dict->prom_formula_map.end())
|
if (isi != dict->prom_formula_map.end())
|
||||||
{
|
{
|
||||||
if (want_prom)
|
if (want_prom)
|
||||||
o << "Prom[";
|
{
|
||||||
to_string(isi->second, o);
|
o << "Prom[";
|
||||||
if (want_prom)
|
to_string(isi->second, o) << "]";
|
||||||
o << "]";
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
o << "\"";
|
||||||
|
to_string(isi->second, o) << "\"";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -69,15 +69,17 @@ prop_list:
|
||||||
{
|
{
|
||||||
$$ = new std::list<pair>;
|
$$ = 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;
|
delete $2;
|
||||||
$$ = $1;
|
$$ = $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;
|
delete $3;
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,3 +13,4 @@ explprod
|
||||||
*.ps
|
*.ps
|
||||||
*.dot
|
*.dot
|
||||||
tripprod
|
tripprod
|
||||||
|
mixprod
|
||||||
|
|
|
||||||
|
|
@ -11,18 +11,23 @@ check_PROGRAMS = \
|
||||||
ltlprod \
|
ltlprod \
|
||||||
bddprod \
|
bddprod \
|
||||||
explprod \
|
explprod \
|
||||||
tripprod
|
tripprod \
|
||||||
|
mixprod
|
||||||
|
|
||||||
|
# Keep this sorted alphabetically.
|
||||||
bddprod_SOURCES = ltlprod.cc
|
bddprod_SOURCES = ltlprod.cc
|
||||||
bddprod_CXXFLAGS = -DBDD_CONCRETE_PRODUCT
|
bddprod_CXXFLAGS = -DBDD_CONCRETE_PRODUCT
|
||||||
explicit_SOURCES = explicit.cc
|
explicit_SOURCES = explicit.cc
|
||||||
explprod_SOURCES = explprod.cc
|
explprod_SOURCES = explprod.cc
|
||||||
ltl2tgba_SOURCES = ltl2tgba.cc
|
ltl2tgba_SOURCES = ltl2tgba.cc
|
||||||
ltlprod_SOURCES = ltlprod.cc
|
ltlprod_SOURCES = ltlprod.cc
|
||||||
|
mixprod_SOURCES = mixprod.cc
|
||||||
readsave_SOURCES = readsave.cc
|
readsave_SOURCES = readsave.cc
|
||||||
tgbaread_SOURCES = tgbaread.cc
|
tgbaread_SOURCES = tgbaread.cc
|
||||||
tripprod_SOURCES = tripprod.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 = \
|
TESTS = \
|
||||||
explicit.test \
|
explicit.test \
|
||||||
tgbaread.test \
|
tgbaread.test \
|
||||||
|
|
@ -31,7 +36,8 @@ TESTS = \
|
||||||
ltlprod.test \
|
ltlprod.test \
|
||||||
bddprod.test \
|
bddprod.test \
|
||||||
explprod.test \
|
explprod.test \
|
||||||
tripprod.test
|
tripprod.test \
|
||||||
|
mixprod.test
|
||||||
|
|
||||||
EXTRA_DIST = $(TESTS)
|
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