Commit fe340ae8 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz

ltlsynt: fix lar.old implementation

* bin/ltlsynt.cc: Make sure to_parity_old() receive a deterministic
automaton, for correctness.   Also call reduce_parity() afterward,
to match what was done in 2.8.7.
* tests/core/ltlsynt.test: Include lar.old in the comparison of all
results to make sure it give the same result as the other 3
algorithms.
parent a6da6ed9
Pipeline #18352 passed with stages
in 126 minutes and 23 seconds
// -*- coding: utf-8 -*-
// Copyright (C) 2017-2019 Laboratoire de Recherche et Développement
// Copyright (C) 2017-2020 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
......@@ -286,7 +286,7 @@ namespace
spot::process_timer timer;
timer.start();
if (opt_solver == LAR)
if (opt_solver == LAR || opt_solver == LAR_OLD)
{
trans_.set_type(spot::postprocessor::Generic);
trans_.set_pref(spot::postprocessor::Deterministic);
......@@ -361,10 +361,17 @@ namespace
std::cerr << "split inputs and outputs done\nautomaton has "
<< dpa->num_states() << " states\n";
if (opt_solver == LAR)
dpa = spot::to_parity(dpa);
{
dpa = spot::to_parity(dpa);
// reduce_parity is called by to_parity(),
// but with colorization turned off.
spot::colorize_parity_here(dpa, true);
}
else
dpa = spot::to_parity_old(dpa);
spot::colorize_parity_here(dpa, true);
{
dpa = spot::to_parity_old(dpa);
dpa = reduce_parity_here(dpa, true);
}
spot::change_parity_here(dpa, spot::parity_kind_max,
spot::parity_style_odd);
if (verbose)
......
#! /bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2017, 2019 Laboratoire de Recherche et Développement
# de l'Epita (LRDE).
# Copyright (C) 2017, 2019, 2020 Laboratoire de Recherche et
# Développement de l'Epita (LRDE).
#
# This file is part of Spot, a model checking library.
#
......@@ -199,7 +199,7 @@ for i in 2 3 4 5 6 10; do
ltl2tgba -f "!($F)" > negf_aut$i
# test ltlsynt
for algo in sd ds lar; do
for algo in sd ds lar lar.old; do
ltlsynt -f "$F" --ins="$IN" --outs="$OUT" --algo=$algo > out$i || true
REAL=`head -1 out$i`
test $REAL = $EXP
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment