Commit 1689c08e authored by Maximilien Colange's avatar Maximilien Colange
Browse files

genltl: add a new family from SYNTCOMP'2017

* bin/genltl.cc, spot/gen/formulas.cc, spot/gen/formulas.hh: Implement
  it.
* tests/core/genltl.test: Test it.
* NEWS: Document it.
parent 96974f7c
......@@ -2,6 +2,10 @@ New in spot 2.4.0.dev (not yet released)
Tools:
- genltl learned to generate a new family of formulas, taken from
the SYNTCOMP competition on reactive synthesis:
--gf-equiv=RANGE (GFa{1} & GFa{2} & ... & GFa{n}) <-> GFz
- genltl learned to generate 4 new families of formulas, taken
from Müller & Sickert's GandALF'17 paper:
--ms-example=RANGE GF(a1&X(a2&X(a3&...)))&F(b1&F(b2&F(b3&...)))
......
......@@ -61,7 +61,7 @@ enum {
static const argp_option options[] =
{
/**************************************************/
// Keep this alphabetically sorted (expect for aliases).
// Keep this alphabetically sorted (except for aliases).
{ nullptr, 0, nullptr, 0, "Pattern selection:", 1},
// J. Geldenhuys and H. Hansen (Spin'06): Larger automata and less
// work for LTL model checking.
......@@ -86,6 +86,8 @@ static const argp_option options[] =
"(range should be included in 1..12)", 0 },
{ "fxg-or", gen::LTL_FXG_OR, "RANGE", 0,
"F(p0 | XG(p1 | XG(p2 | ... XG(pn))))", 0},
{ "gf-equiv", gen::LTL_GF_EQUIV, "RANGE", 0,
"(GFa1 & GFa2 & ... & GFan) <-> GFz", 0},
{ "gh-q", gen::LTL_GH_Q, "RANGE", 0,
"(F(p1)|G(p2))&(F(p2)|G(p3))&...&(F(pn)|G(p{n+1}))", 0 },
{ "gh-r", gen::LTL_GH_R, "RANGE", 0,
......
......@@ -41,6 +41,18 @@ namespace spot
{
namespace
{
static formula
LTL_GF_equiv(int n, const std::string& a, const std::string& z)
{
std::vector<formula> gfs;
for (int i = 0; i < n; ++i)
gfs.emplace_back(formula::G(formula::F(
formula::ap(a + std::to_string(i+1)))));
return formula::Equiv(formula::And(gfs),
formula::G(formula::F(formula::ap(z))));
}
static formula
ms_example(const char* a, const char* b, int n)
{
......@@ -1159,6 +1171,8 @@ namespace spot
return eh_pattern(n);
case LTL_FXG_OR:
return FXG_or_n("p", n);
case LTL_GF_EQUIV:
return LTL_GF_equiv(n, "a", "z");
case LTL_GH_Q:
return Q_n("p", n);
case LTL_GH_R:
......@@ -1239,6 +1253,7 @@ namespace spot
"dac-patterns",
"eh-patterns",
"fxg-or",
"gf-equiv",
"gh-q",
"gh-r",
"go-theta",
......@@ -1296,6 +1311,7 @@ namespace spot
case LTL_EH_PATTERNS:
return 12;
case LTL_FXG_OR:
case LTL_GF_EQUIV:
case LTL_GH_Q:
case LTL_GH_R:
case LTL_GO_THETA:
......
......@@ -190,6 +190,7 @@ namespace spot
LTL_DAC_PATTERNS,
LTL_EH_PATTERNS,
LTL_FXG_OR,
LTL_GF_EQUIV,
LTL_GH_Q,
LTL_GH_R,
LTL_GO_THETA,
......
......@@ -157,3 +157,15 @@ ms-phi-h=3,170
ms-phi-h=4,1816
EOF
diff out exp
genltl --gf-equiv=0..5 --format=%F=%L,%f |
ltl2tgba -G -D -F-/2 --stats='%<,%s' > out
cat >exp<<EOF
gf-equiv=0,1
gf-equiv=1,4
gf-equiv=2,8
gf-equiv=3,21
gf-equiv=4,81
gf-equiv=5,431
EOF
diff out exp
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment