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

Rewrite {b}<>->f as (!b)|f instead of b->f.

* src/ltlast/binop.cc, src/ltlast/binop.hh: Here.
* doc/tl/tl.tex, src/ltltest/equals.test: Adjust.
parent 098e121a
......@@ -842,7 +842,7 @@ formula $b$, the following rewritings are systematically performed
& \ratgroup{\eword}\Esuffix f&\equiv \0
& \ratgroup{\eword} & \equiv \0
& \nratgroup{\eword} & \equiv \1 \\
\ratgroup{b}\Asuffix f&\equiv b\IMPLIES f
\ratgroup{b}\Asuffix f&\equiv (\NOT{b})\OR f
& \ratgroup{b}\Esuffix f&\equiv b\AND f
& \ratgroup{b} &\equiv b
& \nratgroup{b} &\equiv \NOT b\\
......
......@@ -520,7 +520,7 @@ namespace spot
// - 1 []-> Exp = Exp
// - [*0] []-> Exp = 1
// - Exp []-> 1 = 1
// - boolExp []-> Exp = boolExp -> Exp
// - boolExp []-> Exp = !boolExp | Exp
if (first == constant::true_instance())
return second;
if (first == constant::false_instance()
......@@ -535,7 +535,8 @@ namespace spot
return second;
}
if (first->is_boolean())
return binop::instance(binop::Implies, first, second);
return multop::instance(multop::Or,
unop::instance(unop::Not, first), second);
break;
}
......
......@@ -105,7 +105,7 @@ namespace spot
/// - 1 []-> Exp = Exp
/// - [*0] []-> Exp = 1
/// - Exp []-> 1 = 1
/// - boolExp <>-> Exp = boolExp -> Exp
/// - boolExp <>-> Exp = !boolExp | Exp
static formula* instance(type op, formula* first, formula* second);
virtual void accept(visitor& v);
......
......@@ -141,11 +141,11 @@ run 0 ../equals '{x;x}[]->FF(0)' '{x;x}[]->0'
run 0 ../equals '{x;x}[]->y' '{x;x}|->y'
run 0 ../equals '{x;x}[]->y' '{x;x}(y)'
run 0 ../equals '{a*}!' '{a*}<>->1'
run 0 ../equals '{a -> b} (c)' '(a->b)->c'
run 0 ../equals '{a -> b} (c)' '!(a->b)|c'
run 0 ../equals '{a & !b}!' 'a & !b'
run 0 ../equals '{a;[*0]}|->!Xb' 'a -> !Xb'
run 0 ../equals '{a;[*0]}|->!Xb' '!a | !Xb'
run 0 ../equals '{{a;b}:b:c:d*:e:f}!' '{{a;b}:{{b && c } & d[*]}:{e && f}}!'
run 0 ../equals '{a:b:c}|->!Xb' '(a&b&c) -> !Xb'
run 0 ../equals '{a:b:c}|->!Xb' '!(a&b&c) | !Xb'
run 0 ../equals '{a:b:c*}|->!Xb' '{(a&&b)&c*}|-> !Xb'
run 0 ../equals '{a[*0]}' '{[*0]}'
......
Supports Markdown
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