Speedup reduccmp.test

This test used to take more than 10min because an instance of valgrind
was launched for each separate equivalence check.  The list of
equivalences to checks are not given in a file, and only two valgrind
instances are run.  The test takes less than 15sec.

* src/ltltest/equalsf.cc: New file.
* src/ltltest/Makefile.am (reduccmp, reductaustr): Build using
equalsf.cc.
* src/ltltest/reduccmp.test: Rewrite.
* src/ltltest/uwrm.test: Also rewrite, and use valgrind.
This commit is contained in:
Alexandre Duret-Lutz 2014-08-17 11:22:00 +02:00
parent b43f75e917
commit 7b9f695265
4 changed files with 597 additions and 354 deletions

View file

@ -1,5 +1,5 @@
#! /bin/sh
# Copyright (C) 2012 Laboratoire de Recherche et Developpement
# Copyright (C) 2012, 2014 Laboratoire de Recherche et Developpement
# de l'Epita (LRDE).
#
# This file is part of Spot, a model checking library.
@ -22,52 +22,39 @@
# These formulas comes from an appendix of tl/tl.tex
. ./defs || exit 1
set -e
equiv()
{
dst=$1
shift
for src in "$@"; do
../reduccmp "$src" "$dst"
done
}
cat >input.txt<<EOF
# Equivalences with U
equiv Ff '1 U f'
equiv Gf '!F!f' '!(1 U!f)'
equiv 'f W g' '(f U g) | (G f)' '(f U g) | !(1 U ! f)' \
'f U (g | G f)' 'f U (g | !(1 U ! f ))'
equiv 'f M g' 'g U (f & g)'
equiv 'f R g' 'g W (f & g)' '(g U (f & g)) | !(1 U ! g)' \
'g U ((f & g) | !(1 U ! g))'
1 U f, Ff
!F!f, !(1 U!f), Gf
(f U g)|(G f), (f U g) | !(1 U ! f), f U (g | G f), f U (g | !(1 U !f)), f W g
g U (f & g), f M g
g W (f & g), (g U (f & g)) | !(1 U ! g), g U ((f & g) | !(1 U ! g)), f R g
# Equivalences with W
equiv Ff '!G!f' '!((! f) W 0)'
equiv Gf '0 R f' 'f W 0'
equiv 'f U g' '(f W g) & (F g)' '(f W g) & !((! g) W 0)'
equiv 'f M g' '(g W (f & g)) & (F f)' '(g W (f & g)) & !((!f) W 0)'
equiv 'f R g' 'g W (f & g)'
!G!f, !((! f) W 0), Ff
0 R f, f W 0, Gf
(f W g) & (F g), (f W g) & !((! g) W 0), f U g
(g W (f & g)) & (F f), (g W (f & g)) & !((!f) W 0), f M g
g W (f & g), f R g
# Equivalences with R
!G!f, !(0 R !f), Ff
0 R f, Gf
# (((X g) R f) & F g) | g, (((X g) R f ) & (!(0 R ! g))) | g, f U g
((X g) R f) | g, g R (f | g), f W g
(f R g) & F f, (f R g) & !(0 R !f), f R (g & F f), f R (g & !(0 R !f)), f M g
equiv Ff '!G!f' '!(0 R !f)'
equiv Gf '0 R f'
#equiv 'f U g' '(((X g) R f) & F g) | g' '(((X g) R f ) & (!(0 R ! g))) | g'
equiv 'f W g' '((X g) R f) | g' 'g R (f | g)'
equiv 'f M g' '( f R g) & F f' '(f R g) & ! (0 R ! f)' \
'f R (g & F f)' 'f R (g & !(0 R !f))'
# Equivalences with M
equiv Ff 'f M 1'
equiv Gf '!F!f' '!((!f) M 1)'
equiv 'f U g' '((X g) M f) | g' 'g M (f | g)'
equiv 'f W g' '(f U g) | G f' '((X g) M f) | g | !((! f ) M 1)'
equiv 'f R g' '(f M g) | G g' '(f M g) | !((! g) M 1)'
f M 1, Ff
!F!f, !((!f) M 1), Gf
((X g) M f) | g, g M (f | g), f U g
(f U g) | G f, ((X g) M f) | g | !((! f ) M 1), f W g
(f M g) | G g, (f M g) | !((! g) M 1), f R g
# Example from tl.tex
#(((f U (Xg & f))|!(1 U !f))&(1 U Xg)) | g, f U g
EOF
# equiv 'f U g' '(((f U (Xg & f))|!(1 U !f))&(1 U Xg)) | g'
run 0 ../reduccmp input.txt