ltltest: speedup more tests

This generalizes the previous patch.

* src/ltltest/equalsf.cc: Allow escaped '\,' and
negated result.
* src/ltltest/Makefile.am: Use equalsf.cc for
almost all tests that used equals.cc.
(nequals): New.
* src/ltltest/equals.test, src/ltltest/eventuniv.test,
src/ltltest/lunabbrev.test, src/ltltest/nenoform.test,
src/ltltest/parseerr.test, src/ltltest/tunabbrev.test,
src/ltltest/tunenoform.test: Adjust.
This commit is contained in:
Alexandre Duret-Lutz 2014-08-17 12:22:06 +02:00
parent 7b9f695265
commit 6a741189bc
10 changed files with 371 additions and 324 deletions

View file

@ -1,6 +1,7 @@
#! /bin/sh
# Copyright (C) 2009, 2010, 2011 Laboratoire de Recherche et Développement
# de l'Epita (LRDE).
# -*- coding: utf-8 -*-
# Copyright (C) 2009, 2010, 2011, 2014 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
# et Marie Curie.
@ -27,44 +28,46 @@
set -e
cat >nenoform.txt<<EOF
# A few things that do not change
run 0 ../nenoform 'a' 'a'
run 0 ../nenoform '1' '1'
run 0 ../nenoform '0' '0'
run 0 ../nenoform '!a' '!a'
run 0 ../nenoform 'a U b' 'a U b'
run 0 ../nenoform 'a & b' 'a & b'
run 0 ../nenoform 'a & b' 'b & a'
run 0 ../nenoform 'a & !b & c' 'c & a & !b'
run 0 ../nenoform 'a & b & c' 'b & c & a'
run 0 ../nenoform 'Xa & b & Xa' 'b & Xa & b'
run 0 ../nenoform 'a & b' 'b & a & b'
run 0 ../nenoform 'a & !b' '!b & a & a'
run 0 ../nenoform 'a & b & (Xc |(f U !g)| e)' \
'b & a & a & (Xc | e |(f U !g)| e | Xc) & b'
run 0 ../nenoform 'GFa => FGb' 'FG!a || FGb'
a, a
1, 1
0, 0
!a, !a
a U b, a U b
a & b, a & b
a & b, b & a
a & !b & c, c & a & !b
a & b & c, b & c & a
Xa & b & Xa, b & Xa & b
a & b, b & a & b
a & !b, !b & a & a
a & b & (Xc |(f U !g)| e), b & a & a & (Xc | e |(f U !g)| e | Xc) & b
GFa => FGb, FG!a || FGb
# Basic rewritings
run 0 ../nenoform '!!a' 'a'
run 0 ../nenoform '!!!!!a' '!a'
run 0 ../nenoform '!Xa' 'X!a'
run 0 ../nenoform '!Fa' 'G!a'
run 0 ../nenoform '!Ga' 'F!a'
run 0 ../nenoform '!(a ^ b)' '!a&!b | a&b'
run 0 ../nenoform '!(a <=> b)' '(!a&b) | a&!b'
run 0 ../nenoform '!(a => b)' 'a&!b'
run 0 ../nenoform '!(!a => !b)' '!a&b'
run 0 ../nenoform '!(a U b)' '!a R !b'
run 0 ../nenoform '!(a R b)' '!a U !b'
run 0 ../nenoform '!(!a R !b)' 'a U b'
run 0 ../nenoform '!(a & b & c & d & b)' '!a | !b | !c | !d'
run 0 ../nenoform '!(a | b | c | d)' '!a & !b & !c & !d'
!!a, a
!!!!!a, !a
!Xa, X!a
!Fa, G!a
!Ga, F!a
!(a ^ b), !a&!b | a&b
!(a <=> b), (!a&b) | a&!b
!(a => b), a&!b
!(!a => !b), !a&b
!(a U b), !a R !b
!(a R b), !a U !b
!(!a R !b), a U b
!(a & b & c & d & b), !a | !b | !c | !d
!(a | b | c | d), !a & !b & !c & !d
# Nested rewritings
run 0 ../nenoform '!(a U (!b U ((a & b & c) R d)))' \
'!a R (b R ((!a | !b | !c) U !d))'
run 0 ../nenoform '!(GF a => FG b)' 'GFa & GF!b'
!(a U (!b U ((a & b & c) R d))), !a R (b R ((!a | !b | !c) U !d))
!(GF a => FG b), GFa & GF!b
# Rational operators
run 0 ../nenoform '!X{a;b}<>->Fx' 'X{a;b}[]->G!x'
run 0 ../nenoform '!F({a*}<>->{b*}<>->c)' 'G({a*}[]->{b*}[]->!c)'
!X{a;b}<>->Fx, X{a;b}[]->G!x
!F({a*}<>->{b*}<>->c), G({a*}[]->{b*}[]->!c)
EOF
run 0 ../nenoform nenoform.txt