#!/bin/sh # -*- coding: utf-8 -*- # Copyright (C) by the Spot authors, see the AUTHORS file for details. # # This file is part of Spot, a model checking library. # # Spot is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Spot is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public # License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . . ./defs # If the size of automata produced by ltl2tgba on the formulas we # commonly use as benchmark change, we want to notice it. set -e genltl --dac --eh --sb --hkrss --p --and-fg=32 --format=%F,%L,%f >pos (cat pos; ltlfilt --negate pos/3 --format='!%<,%f') | ltlfilt -u -F-/3 >formulas ltl2tgba -Fformulas/3 --stats='%<,%f, %s,%t' | ltl2tgba -D -F-/3 --stats='%<,%f,%>, %s,%t' | ltl2tgba -b -F-/3 --stats='%<,%f,%>, %s,%t' | ltl2tgba -bD -F-/3 --stats='%<,%f,%>, %s,%t' | ltl2tgba -B -F-/3 --stats='%<,%f,%>, %s,%t' | ltl2tgba -BD -F-/3 --stats='%<,%>, %s,%t' > output fg42=2,4294967298 gf42=1,4294967296 cat >expected <formulas <. Issue #380. ltlfilt -Fformulas/1 --stats='%f,%f,%>' | ltl2tgba -F-/2 --stats='%<,%<, %s,%t' | ltl2tgba -D -F-/2 --stats='%<,%<,%>, %s,%t' | $PERL -p -e 's/$/\r/' | ltl2tgba -B -F-/2 --stats='%<,%<,%>, %s,%t' | ltl2tgba -BD -F-/2 --stats='%<,%<,%>, %s,%t' | ltl2tgba -GD -F-/2 --stats='%<,%>, %s,%t' > output diff formulas output # Issue #367. test 4 = `ltl2tgba 'GF(a<->XXa)' --stats=%s` test 9 = `ltl2tgba --low 'GF(a<->XXa)' --stats=%s` test 9 = `ltl2tgba -x gf-guarantee=0 'GF(a<->XXa)' --stats=%s` test 4 = `ltl2tgba --low -x gf-guarantee=1 'GF(a<->XXa)' --stats=%s` # Regression test for issue #357. The second formula used to # incorrectly produce 13 edges when translated after the first one # because the transition were explored in a different order. ltl2tgba -D 'a | Fb' 'GF(d & (!c | XXc))' --stats=%s,%e,%d >out cat >expected <in <out cat >expected < c) W d))' | grep '\[f\]' && exit 1 # Reported by Jens Kreber ltl2tgba '!b & e U (a & b & c)' | grep '\[f\]' && exit 1 ltl2tgba '!b & e U (a & b & c)' --stats=%w | grep 0 && exit 1 ltl2tgba 'X!c & X(b & c & d & a U e)' | grep '\[f\]' && exit 1 ltl2tgba 'X!c & X(b & c & d & a U e)' --stats=%w | grep 0 && exit 1 # This caused issue at some point, because simplify_acceptance would # leave some undeclared acceptance set in the automaton, which would # cause simulation-based reduction to produce garbage output, which # would in turn cause the HOA printer to choke. ltlcross -f 'G(F(Gb ^ Fa) & FG!a)' 'ltl2tgba -G -D' # Issue #402, reported by Juraj Major. f='(GFp0 | FGp1) & (GF!p1 | FGp2) & (GF!p2 | FG!p0)' test 1,8,3 = `ltl2tgba -G -D "$f" --stats=%s,%e,%a` test 1,3,2 = `ltl2tgba -G -D "(GFp0 | FGp1)" --stats=%s,%e,%a` # Handling of Xor and <-> by ltl-split and -D -G. res=`ltl2tgba -D -G 'X((Fa & Fb & Fc & Fd) <-> GFe)' --stats='%s %g'` test "$res" = "17 (Inf(0)&Inf(1)) | (Fin(0) & Fin(1))" res=`ltl2tgba -D -G 'X((Fa & Fb & Fc & Fd) ^ GFe)' --stats='%s %g'` test "$res" = "17 (Inf(0) & Fin(1)) | (Fin(0) & Inf(1))" ltlcross 'ltl2tgba -D -G' 'ltl2tgba -G' -f '(Fa & Fb & Fc & Fd) ^ GFe' f='G(p1 | G!p0) M Xp1' test "6,1" = `ltl2tgba "$f" --stats=%s,%d` test "6,0" = `ltl2tgba -x wdba-minimize=2 "$f" --stats=%s,%d` test "6,0" = `ltl2tgba -x wdba-minimize=0 "$f" --stats=%s,%d` test "6,0" = `ltl2tgba --med "$f" --stats=%s,%d` f='X((p1 & Xp1) M Fp1)' test "4,1" = `ltl2tgba -D "$f" --stats=%s,%d` test "4,1" = `ltl2tgba -D -x wdba-minimize=2 "$f" --stats=%s,%d` test "4,0" = `ltl2tgba -D -x wdba-minimize=0 "$f" --stats=%s,%d` test "4,1" = `ltl2tgba -D --med "$f" --stats=%s,%d` # Issue #418. f='(G!a | G!b | G!c) & (FG!a2 | GFb2 | GFc2) & (GFc2 | FG!b2 | GFa2)' test 28 = `ltl2tgba -D -G -S --stats=%s "$f"` # Issue #443. This used to be too long. f='(!(G({(a)} |=> {(b)[*32]})))' test 34,0 = `ltl2tgba -B --stats=%s,%d "$f"` # Issue #444. Because WDBA-minimization disables itself for large # automata, the output is only deterministic up to a certain point, # and the goal is to raise that point. f='(!(G({(a)} |=> {(b)[*12]})))' test 14,1 = `ltl2tgba -B --stats=%s,%d "$f"` f='(!(G({(a)} |=> {(b)[*13]})))' test 15,0 = `ltl2tgba -B --stats=%s,%d "$f"` # Related to Issue #298. The difference between the translation of # this formula with --med and --high is just a different ordering of # the states caused by the use of exprop. opts="-x scc-filter=0,tls-impl=0,gf-guarantee=0,wdba-minimize=0" f='G(p0 -> F(p1 & !p2 & X(!p2 U p3)))' ltl2tgba $opts --med "$f" >med.hoa ltl2tgba $opts,exprop=0 "$f" > high.hoa diff med.hoa high.hoa ltl2tgba $opts "$f" > high.hoa test $(wc -l < med.hoa) = $(wc -l < high.hoa) cmp med.hoa high.hoa && exit 1 autfilt --stats=%F:%s,%e med.hoa high.hoa >out cat >exp < (GFb & GFc & GFd & GFe & GFf & GFg & GFh)) part # as suspendable. f='G((a -> X((!a U b) | G!a)) & (a -> X(G!a | (!a U c))) & (a -> X(G!a | (!a U d))) & (a -> X(G!a | (!a U e))) & (a -> X(G!a | (!a U f))) & (a -> X(G!a | (!a U g))) & (a -> X(G!a | (!a U h)))) & (GFa <-> (GFb & GFc & GFd & GFe & GFf & GFg & GFh))' test 128 = `ltl2tgba -G -D "$f" --stats=%s` # This used to die from out of memory after 5 minutes. See issue #536. f='(TRUE & (G F ~v21)& (( G F v39 -> G F v23))) -> (TRUE & (G F (v1 -> (v41 & v29)))& (G F (v3 -> (v42 & v29)))& (G F (v5 -> (v43 & v29)))& (G F (v7 -> (v44 & v29)))& (G F (v9 -> (v45 & v29)))& (G F (v11 -> (v46 & v29)))& (G F (v13 -> (v47 & v29)))& (G F (v15 -> (v48 & v29)))& (G F (v17 -> (v49 & v29)))& (G F (v19 -> (v50 & v29)))& (G F (v41 | (v1 | (v3 | (v5 | (v7 | (v9 | (v11 | (v13 | (v15 | (v17 | v19))))))))))))' ltl2tgba -p'min even' -D -C "$f" --stats='%s %e'>out test '22 288' = "`cat out`" # Make sure relabel-overlap still reduce empty automata. Issue #551. f='(G(!(G(p16) U G(p5))))&&((p5&&!p3&&p4&&!p2)) && ((p16&&!p14&&p5&&p15)) && (p5) && (p16) && (X(p5)) && (X(!(p2&&!p3&&p4&&!p5))) && (X(!(p3&&p4&&!p5))) && (X(X(!(p3&&!p5)))) && (X(X(!(p2&&!p3&&!p5)))) && (X(X(p5))) && (X((!p14&&p5))) && (X(X((!p14&&p5)))) && (F(G(p5))) && (F(G(!p16))) && (G((!p2||p3||p5))) && (G((!p3||p5))) && (G((!p2||p3||!p4||p5))) && (G((!p3||!p4||p5)))' s8=`ltl2tgba -x relabel-overlap=8 -f "$f" --stats=%g,%s,%e` test "$s8" = "t,1,0" s7=`ltl2tgba -x relabel-overlap=7 -f "$f" --stats=%g,%s,%e` test "$s7" = "t,1,0"