parsetl: speedup parsing of n-ary operators with many operands

Issue #500, reported by Yann Thierry-Mieg.

* spot/parsetl/parsetl.yy, spot/parsetl/scantl.ll: Use variant
to store a new pnode objects that delays the construction of n-ary
operators.
* spot/parsetl/Makefile.am: Do not distribute stack.hh anymore.
* spot/tl/formula.cc: Fix detection of overflow in Star and FStar.
* HACKING: Update Bison requirements to 3.3.
* tests/core/500.test: New test case.
* tests/Makefile.am: Add it.
* tests/core/ltl2tgba2.test, tests/core/ltlsynt.test,
tests/core/tostring.test: Adjust to new expected order.
* NEWS: Mention the change.
This commit is contained in:
Alexandre Duret-Lutz 2022-03-26 15:57:56 +01:00
parent 46f3f5aaf4
commit 9c6a09890e
11 changed files with 374 additions and 181 deletions

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2015-2019, 2021 Laboratoire de Recherche et
// Copyright (C) 2015-2019, 2021, 2022 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
@ -136,7 +136,7 @@ namespace spot
// - AndRat(Exps1...,Bool1,Exps2...,Bool2,Exps3...) =
// AndRat(And(Bool1,Bool2),Exps1...,Exps2...,Exps3...)
// - OrRat(Exps1...,Bool1,Exps2...,Bool2,Exps3...) =
// AndRat(Or(Bool1,Bool2),Exps1...,Exps2...,Exps3...)
// OrRat(Or(Bool1,Bool2),Exps1...,Exps2...,Exps3...)
if (!b.empty())
v.insert(v.begin(), fnode::multop(o, std::move(b)));
}
@ -588,9 +588,9 @@ namespace spot
}
else if (min != unbounded())
{
min += min2;
if (SPOT_UNLIKELY(min >= unbounded()))
if (SPOT_UNLIKELY(min + min2 >= unbounded()))
break;
min += min2;
}
if (max2 == unbounded())
{
@ -598,9 +598,9 @@ namespace spot
}
else if (max != unbounded())
{
max += max2;
if (SPOT_UNLIKELY(max >= unbounded()))
if (SPOT_UNLIKELY(max + max2 >= unbounded()))
break;
max += max2;
}
(*i)->destroy();
i = v.erase(i);