psl: add support for the [:*i..j] operator

This operator is to ':' what [*i..j] is to ';'.

Part of issue #51.

* doc/tl/tl.tex: Document syntax, semantic, and trivial
simplifications.
* doc/tl/spotltl.sty: Add macros for new operators.
* src/ltlast/bunop.cc, src/ltlast/bunop.hh: Implement it.
* src/ltlast/multop.cc: Add some trivial simplifications.
* src/ltlparse/ltlparse.yy, src/ltlparse/ltlscan.ll: Parse it.
* src/ltltest/equals.test, src/ltltest/latex.test,
src/tgbatest/ltl2tgba.test: Add more tests.
* src/ltlvisit/randomltl.cc: Output this operator in
random PSL formulas.
* src/ltltest/rand.test: Adjust.
* src/tgbaalgos/ltl2tgba_fm.cc: Add translation rules.
* src/ltlvisit/tostring.cc: Add pretty printing code.
* src/ltlvisit/simplify.cc, src/ltlvisit/snf.cc: Adjust
switches.
* NEWS: Mention the new operator.
This commit is contained in:
Alexandre Duret-Lutz 2015-01-15 18:50:32 +01:00
parent eebbcac281
commit a79db4eefe
17 changed files with 442 additions and 162 deletions

View file

@ -1,6 +1,6 @@
#! /bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2009, 2010, 2011, 2012, 2014 Laboratoire de Recherche et
# Copyright (C) 2009, 2010, 2011, 2012, 2014, 2015 Laboratoire de Recherche et
# Développement de l'Epita (LRDE).
# Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
# département Systèmes Répartis Coopératifs (SRC), Université Pierre
@ -181,6 +181,20 @@ G({1}<>->1), 1
{1[->10\,20];b}, {[*10..20];b}
{1[->..];b}, {[*1..];b}
{{a&!c}[->0];b}, b
{(a|c)[:*0..3];d}, {1;d}
{(a|c)[:*1..3];d}, {(a|c);d}
{0[:*0..3];d}, {1;d}
{0[:*1..3];d}, 0
{1[:*0..3];d}, {1;d}
{1[:*1..3];d}, {1;d}
{[*0][:*0..3];d}, {1;d}
{[*0][:*1..3];d}, 0
{(a*;b|c)[:*1to3][:*2:4]}, {(a*;b|c)[:*2..12]}
{(a*;b|c)[:*][:+]}, {(a*;b|c)[:*]}
{(a*;b|c)[:*0]}, 1
{(a*;b|c)[:*1]}, {(a*;b|c)}
{(a;b):(a;b):(a;b)[:*2]:(a;b):b*:b*:(c;d)[:*1]}, {(a;b)[:*5]:b*[:*2]:(c;d)}
EOF

View file

@ -1,6 +1,6 @@
#!/bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2013 Laboratoire de Recherche et Développement
# Copyright (C) 2013, 2015 Laboratoire de Recherche et Développement
# de l'Epita (LRDE).
#
# This file is part of Spot, a model checking library.
@ -35,6 +35,7 @@ a U b W c R (d & e) M f
{a;b[=2];((c:d*) && f*);e[*2..]}<>-> {((a | [*0])*;b[+]) & (c1[->2])}[]-> h
{a;b;c} []=> {d*;e} <>=> !f
!{a;b*;c}! -> d
{a*;(b;c)[:*3..4];(c;d)[:+];d}!
G(uglyname->Fuglierlongname42)
EOF

View file

@ -1,6 +1,6 @@
#!/bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Laboratoire de Recherche et Développement
# Copyright (C) 2014, 2015 Laboratoire de Recherche et Développement
# de l'Epita (LRDE).
#
# This file is part of Spot, a model checking library.
@ -34,6 +34,8 @@ eword 1
boolform 1
star 1
star_b 1
fstar 1
fstar_b 1
and 0
andNLM 0
or 1
@ -53,8 +55,11 @@ EOF
diff stdout expected
sere='eword=0,and=0,andNLM=0,fusion=0,star=0,star_b=0'
sere="$sere,or=0,concat=0,fstar=0,fstar_b=0"
run 0 $randltl -S -n 10000 a b c --tree-size=10..20 \
--sere-p=eword=0,and=0,andNLM=0,fusion=0,star=0,star_b=0,or=0,concat=0 \
--sere-p=$sere \
--boolean-p=equiv=0,implies=0,xor=0,and=0,not=0,false=0,true=0,or=0 \
--dump-pr > stdout
@ -64,6 +69,8 @@ eword 0
boolform 1
star 0
star_b 0
fstar 0
fstar_b 0
and 0
andNLM 0
or 0
@ -86,7 +93,7 @@ diff stdout expected
# Disabling all operators will prevent more formulas to be generated.
$randltl -S -n 10000 a b c --tree-size=10..20 \
--sere-p=eword=0,and=0,andNLM=0,fusion=0,star=0,star_b=0,or=0,concat=0 \
--sere-p=$sere \
--boolean-p=equiv=0,implies=0,xor=0,and=0,not=0,false=0,true=0,or=0 > out &&
exit 1
sort out > out2