#14951: tokenize() function in logic/logicparser.py infinite loop
------------------------------------------------+--------------------------
Reporter: pmscurek | Owner: Paul
Type: defect | Scurek
Priority: major | Status: new
Component: misc | Milestone: sage-5.11
Keywords: logic, propcalc, logicparser | Resolution:
Authors: Paul Scurek | Merged in:
Report Upstream: N/A | Reviewers:
Branch: | Work issues:
Stopgaps: | Dependencies:
------------------------------------------------+--------------------------
Description changed by pmscurek:
Old description:
> The tokenize() function in logic/logicparser.py is called when a new
> formula of propositional calculus is created using
> propcalc.formula(<formula_expression>). The tokenize() function enters
> an infinite loop if the characters '<', '>', or '-', are used in
> <formula_expression> incorrectly (i.e. not as a part of one of the
> operators '<->' or '->'). The following code would cause an infinitely
> loop because of the '-':
>
> {{{
> #!python
> sage: import sage.logic.propcalc as propcalc
>
> sage: f = propcalc.formula("a-b")
> }}}
>
> The BooleanFormula class located in logic/boolformula.py also needs a
> method that returns the full syntax parse tree of a boolean formula, so
> that each formula has a unique parse tree. The BooleanFormula tree()
> method does not serve this purpose.
New description:
The tokenize() function in logic/logicparser.py is called when a new
formula of propositional calculus is created using
propcalc.formula(<formula_expression>). The tokenize() function enters an
infinite loop if the characters '<', '>', or '-', are used in
<formula_expression> incorrectly (i.e. not as a part of one of the
operators '<->' or '->'). The following code would cause an infinite loop
because of the '-':
{{{
#!python
sage: import sage.logic.propcalc as propcalc
sage: f = propcalc.formula("a-b")
}}}
The BooleanFormula class located in logic/boolformula.py also needs a
method that returns the full syntax parse tree of a boolean formula, so
that each formula has a unique parse tree. The BooleanFormula tree()
method does not serve this purpose.
--
--
Ticket URL: <http://trac.sagemath.org/ticket/14951#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.