Commit bf3c3aec authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

tostring: quote U, W, M, R when used as atomic propositions

* src/ltltest/tostring.test, src/ltltest/parse.test: More tests.
* src/ltlvisit/tostring.cc (is_bare_word): Quote U, W, M, R.
* NEWS: Mention it.
parent 5086e241
......@@ -9,6 +9,10 @@ New in spot 1.0a (not released):
- "P0.init" is parsed as an atomic even without the double quotes,
but it was always output with double quotes. This version will
not quote this atomic proposition anymore.
- "U", "W", "M", "R" were correctly parsed as atomic propositions
(instead of binary operators) when placed in double quotes, but
on output they were output without quotes, making the result
unparsable.
- tgba_product::transition_annotation() would segfault when
called in a product against a Kripke structure.
* Minor improvements:
......
#! /bin/sh
# Copyright (C) 2009, 2010, 2011, 2012 Laboratoire de Recherche et Developpement
# de l'Epita (LRDE).
# -*- coding: utf-8 -*-
# Copyright (C) 2009, 2010, 2011, 2012, 2013 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.
......@@ -61,6 +62,13 @@ for f in \
'<>b' \
'X b' \
'()b' \
'X"X"' \
'X"F"' \
'X"G"' \
'X"U"' \
'X"W"' \
'X"R"' \
'X"M"' \
'long_atomic_proposition_1 U long_atomic_proposition_2' \
' ab & ac | ad ^ af' \
'((b & a) + a) & d' \
......@@ -81,7 +89,7 @@ do
if ../ltl2text "$f"; then
:
else
echo "ltl2dot failed to parse '$f'"
echo "ltl2text failed to parse '$f'"
exit 1
fi
......
#! /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, 2013 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
# département Systèmes Répartis Coopératifs (SRC), Université Pierre
# et Marie Curie.
#
# This file is part of Spot, a model checking library.
......@@ -54,6 +55,10 @@ run 0 ../tostring 'p=0UFXp=1'
run 0 ../tostring 'GF"\GF"'
run 0 ../tostring 'GF"foo bar"'
run 0 ../tostring 'FFG__GFF'
run 0 ../tostring 'X"U"'
run 0 ../tostring 'X"W"'
run 0 ../tostring 'X"M"'
run 0 ../tostring 'X"R"'
run 0 ../tostring '{a;b;{c && d*};**}|=>G{a*:b*}'
run 0 ../tostring 'GF!{{a || c} && b}'
......
// -*- coding: utf-8 -*-
// Copyright (C) 2008, 2010, 2012 Laboratoire de Recherche et
// Copyright (C) 2008, 2010, 2012, 2013 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
......@@ -191,14 +191,16 @@ namespace spot
static bool
is_bare_word(const char* str)
{
// Bare words cannot be empty, start with the letter of a unary
// operator, or be the name of an existing constant. Also they
// should start with an letter.
// Bare words cannot be empty, start with the letter of a
// unary operator, or be the name of an existing constant or
// operator. Also they should start with an letter.
if (!*str
|| *str == 'F'
|| *str == 'G'
|| *str == 'X'
|| !(isalpha(*str) || *str == '_' || *str == '.')
|| ((*str == 'U' || *str == 'W' || *str == 'M' || *str == 'R')
&& str[1] == 0)
|| !strcasecmp(str, "true")
|| !strcasecmp(str, "false"))
return false;
......
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