genltl: add --gf-implies
* spot/gen/formulas.cc, spot/gen/formulas.hh: Implement LTL_GF_IMPLIES. * bin/genltl.cc: Add --gf-implies. * NEWS: Mention it. * tests/core/genltl.test: Use it.
This commit is contained in:
parent
f369db6cb1
commit
0b71df3fd3
5 changed files with 35 additions and 21 deletions
5
NEWS
5
NEWS
|
|
@ -10,9 +10,10 @@ New in spot 2.4.4.dev (net yet released)
|
||||||
|
|
||||||
Tools:
|
Tools:
|
||||||
|
|
||||||
- genltl learned to generate a new family of formulas, taken from
|
- genltl learned to generate two new family of formulas, taken from
|
||||||
the SYNTCOMP competition on reactive synthesis:
|
the SYNTCOMP competition on reactive synthesis:
|
||||||
--gf-equiv=RANGE (GFa{1} & GFa{2} & ... & GFa{n}) <-> GFz
|
--gf-equiv=RANGE (GFa1 & GFa2 & ... & GFan) <-> GFz
|
||||||
|
--gf-implies=RANGE (GFa1 & GFa2 & ... & GFan) -> GFz
|
||||||
|
|
||||||
- genltl learned to generate 4 new families of formulas, taken
|
- genltl learned to generate 4 new families of formulas, taken
|
||||||
from Müller & Sickert's GandALF'17 paper:
|
from Müller & Sickert's GandALF'17 paper:
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// -*- coding: utf-8 -*-
|
// -*- coding: utf-8 -*-
|
||||||
// Copyright (C) 2012, 2013, 2015-2017 Laboratoire de Recherche et
|
// Copyright (C) 2012, 2013, 2015-2018 Laboratoire de Recherche et
|
||||||
// Développement de l'Epita (LRDE).
|
// Développement de l'Epita (LRDE).
|
||||||
//
|
//
|
||||||
// This file is part of Spot, a model checking library.
|
// This file is part of Spot, a model checking library.
|
||||||
|
|
@ -88,6 +88,8 @@ static const argp_option options[] =
|
||||||
"F(p0 | XG(p1 | XG(p2 | ... XG(pn))))", 0},
|
"F(p0 | XG(p1 | XG(p2 | ... XG(pn))))", 0},
|
||||||
{ "gf-equiv", gen::LTL_GF_EQUIV, "RANGE", 0,
|
{ "gf-equiv", gen::LTL_GF_EQUIV, "RANGE", 0,
|
||||||
"(GFa1 & GFa2 & ... & GFan) <-> GFz", 0},
|
"(GFa1 & GFa2 & ... & GFan) <-> GFz", 0},
|
||||||
|
{ "gf-implies", gen::LTL_GF_IMPLIES, "RANGE", 0,
|
||||||
|
"(GFa1 & GFa2 & ... & GFan) -> GFz", 0},
|
||||||
{ "gh-q", gen::LTL_GH_Q, "RANGE", 0,
|
{ "gh-q", gen::LTL_GH_Q, "RANGE", 0,
|
||||||
"(F(p1)|G(p2))&(F(p2)|G(p3))&...&(F(pn)|G(p{n+1}))", 0 },
|
"(F(p1)|G(p2))&(F(p2)|G(p3))&...&(F(pn)|G(p{n+1}))", 0 },
|
||||||
{ "gh-r", gen::LTL_GH_R, "RANGE", 0,
|
{ "gh-r", gen::LTL_GH_R, "RANGE", 0,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// -*- coding: utf-8 -*-
|
// -*- coding: utf-8 -*-
|
||||||
// Copyright (C) 2012-2017 Laboratoire de Recherche et Developpement
|
// Copyright (C) 2012-2018 Laboratoire de Recherche et Developpement
|
||||||
// de l'EPITA (LRDE).
|
// de l'EPITA (LRDE).
|
||||||
//
|
//
|
||||||
// This file is part of Spot, a model checking library.
|
// This file is part of Spot, a model checking library.
|
||||||
|
|
@ -41,18 +41,6 @@ namespace spot
|
||||||
{
|
{
|
||||||
namespace
|
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
|
static formula
|
||||||
ms_example(const char* a, const char* b, int n)
|
ms_example(const char* a, const char* b, int n)
|
||||||
{
|
{
|
||||||
|
|
@ -272,6 +260,18 @@ namespace spot
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static formula
|
||||||
|
LTL_GF_equiv_implies(int n, const std::string& a, const std::string& z,
|
||||||
|
bool equiv)
|
||||||
|
{
|
||||||
|
formula left = GF_n(a, n);
|
||||||
|
formula right = formula::G(formula::F(formula::ap(z)));
|
||||||
|
if (equiv)
|
||||||
|
return formula::Equiv(left, right);
|
||||||
|
else
|
||||||
|
return formula::Implies(left, right);
|
||||||
|
}
|
||||||
|
|
||||||
// (((p1 OP p2) OP p3)...OP pn) if right_assoc == false
|
// (((p1 OP p2) OP p3)...OP pn) if right_assoc == false
|
||||||
// (p1 OP (p2 OP (p3 OP (... pn) if right_assoc == true
|
// (p1 OP (p2 OP (p3 OP (... pn) if right_assoc == true
|
||||||
static formula
|
static formula
|
||||||
|
|
@ -1172,7 +1172,9 @@ namespace spot
|
||||||
case LTL_FXG_OR:
|
case LTL_FXG_OR:
|
||||||
return FXG_or_n("p", n);
|
return FXG_or_n("p", n);
|
||||||
case LTL_GF_EQUIV:
|
case LTL_GF_EQUIV:
|
||||||
return LTL_GF_equiv(n, "a", "z");
|
return LTL_GF_equiv_implies(n, "a", "z", true);
|
||||||
|
case LTL_GF_IMPLIES:
|
||||||
|
return LTL_GF_equiv_implies(n, "a", "z", false);
|
||||||
case LTL_GH_Q:
|
case LTL_GH_Q:
|
||||||
return Q_n("p", n);
|
return Q_n("p", n);
|
||||||
case LTL_GH_R:
|
case LTL_GH_R:
|
||||||
|
|
@ -1254,6 +1256,7 @@ namespace spot
|
||||||
"eh-patterns",
|
"eh-patterns",
|
||||||
"fxg-or",
|
"fxg-or",
|
||||||
"gf-equiv",
|
"gf-equiv",
|
||||||
|
"gf-implies",
|
||||||
"gh-q",
|
"gh-q",
|
||||||
"gh-r",
|
"gh-r",
|
||||||
"go-theta",
|
"go-theta",
|
||||||
|
|
@ -1312,6 +1315,7 @@ namespace spot
|
||||||
return 12;
|
return 12;
|
||||||
case LTL_FXG_OR:
|
case LTL_FXG_OR:
|
||||||
case LTL_GF_EQUIV:
|
case LTL_GF_EQUIV:
|
||||||
|
case LTL_GF_IMPLIES:
|
||||||
case LTL_GH_Q:
|
case LTL_GH_Q:
|
||||||
case LTL_GH_R:
|
case LTL_GH_R:
|
||||||
case LTL_GO_THETA:
|
case LTL_GO_THETA:
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// -*- coding: utf-8 -*-
|
// -*- coding: utf-8 -*-
|
||||||
// Copyright (C) 2017 Laboratoire de Recherche et Developpement de
|
// Copyright (C) 2017, 2018 Laboratoire de Recherche et Developpement de
|
||||||
// l'EPITA (LRDE).
|
// l'EPITA (LRDE).
|
||||||
//
|
//
|
||||||
// This file is part of Spot, a model checking library.
|
// This file is part of Spot, a model checking library.
|
||||||
|
|
@ -191,6 +191,7 @@ namespace spot
|
||||||
LTL_EH_PATTERNS,
|
LTL_EH_PATTERNS,
|
||||||
LTL_FXG_OR,
|
LTL_FXG_OR,
|
||||||
LTL_GF_EQUIV,
|
LTL_GF_EQUIV,
|
||||||
|
LTL_GF_IMPLIES,
|
||||||
LTL_GH_Q,
|
LTL_GH_Q,
|
||||||
LTL_GH_R,
|
LTL_GH_R,
|
||||||
LTL_GO_THETA,
|
LTL_GO_THETA,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright (C) 2016, 2017 Laboratoire de Recherche et Développement
|
# Copyright (C) 2016-2018 Laboratoire de Recherche et Développement
|
||||||
# de l'Epita (LRDE).
|
# de l'Epita (LRDE).
|
||||||
#
|
#
|
||||||
# This file is part of Spot, a model checking library.
|
# This file is part of Spot, a model checking library.
|
||||||
|
|
@ -136,7 +136,7 @@ test $(genltl --kr-nlogn=4 | ltl2tgba --low --stats=%s) -ge 16
|
||||||
test $(genltl --kr-n=4 | ltl2tgba --low --stats=%s) -ge 16
|
test $(genltl --kr-n=4 | ltl2tgba --low --stats=%s) -ge 16
|
||||||
|
|
||||||
genltl --ms-example=0..4 --ms-phi-r=0..2 --ms-phi-s=0..2 --ms-phi-h=0..4 \
|
genltl --ms-example=0..4 --ms-phi-r=0..2 --ms-phi-s=0..2 --ms-phi-h=0..4 \
|
||||||
--gf-equiv=0..5 --format=%F=%L,%f |
|
--gf-equiv=0..5 --gf-implies=0..5 --format=%F=%L,%f |
|
||||||
ltl2tgba -G -D -F-/2 --stats='%<,%s' > out
|
ltl2tgba -G -D -F-/2 --stats='%<,%s' > out
|
||||||
cat >exp<<EOF
|
cat >exp<<EOF
|
||||||
ms-example=0,1
|
ms-example=0,1
|
||||||
|
|
@ -161,11 +161,17 @@ gf-equiv=2,8
|
||||||
gf-equiv=3,21
|
gf-equiv=3,21
|
||||||
gf-equiv=4,81
|
gf-equiv=4,81
|
||||||
gf-equiv=5,431
|
gf-equiv=5,431
|
||||||
|
gf-implies=0,1
|
||||||
|
gf-implies=1,5
|
||||||
|
gf-implies=2,12
|
||||||
|
gf-implies=3,41
|
||||||
|
gf-implies=4,186
|
||||||
|
gf-implies=5,1047
|
||||||
EOF
|
EOF
|
||||||
diff out exp
|
diff out exp
|
||||||
|
|
||||||
# Running ltl2tgba on one formula at a time should give the same results
|
# Running ltl2tgba on one formula at a time should give the same results
|
||||||
genltl --ms-example=0..4 --ms-phi-r=0..2 --ms-phi-s=0..2 --ms-phi-h=0..4 \
|
genltl --ms-example=0..4 --ms-phi-r=0..2 --ms-phi-s=0..2 --ms-phi-h=0..4 \
|
||||||
--gf-equiv=0..5 --format=%F=%L,%f |
|
--gf-equiv=0..5 --gf-implies=0..5 --format=%F=%L,%f |
|
||||||
ltldo -F-/2 'ltl2tgba -G -D' --stats='%<,%s' > out
|
ltldo -F-/2 'ltl2tgba -G -D' --stats='%<,%s' > out
|
||||||
diff out exp
|
diff out exp
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue