|
|
last edited 10 years ago by test1 |
1 2 | ||
Editor: test1
Time: 2014/04/23 19:02:34 GMT+0 |
||
Note: |
changed: -)trace outputForm )trace OutputForm
Trace may affect correct output of 1::EXPR INT
. This page should be read in conjunction with IssueTracker #283.
To suppress the infinite loop being displayed till overflow, add )math
to the package traced (does not always work). I think the coercion 2/3::FRAC INT
is where the main bug lies, but since it is affected by )trace
, it may not be easy to find.
We first establish that without )trace
, the following works as intended.
(1) -> 2/3::FRAC INT
(1) |
1::EXPR INT
(2) |
What led me to suspect that FRAC
is involved in the )trace
bug is the following trace obtained in a Windows session (but unfortunately, I no longer know the exact set up to reproduce this):
(7) -> 1::EXPR INT 1<enter SparseMultivariatePolynomial.zero?,17 : arg1= 1 1>exit SparseMultivariatePolynomial.zero?,17 : false 1<enter Fraction.*,60 : 1\((0 . 1) 0 . 1) 1<enter SparseMultivariatePolynomial.coerce,77 : arg1= 1 1>exit SparseMultivariatePolynomial.coerce,77 : 1 1<enter SparseMultivariatePolynomial.=,97 : arg1= 1 arg2= 1 1>exit SparseMultivariatePolynomial.=,97 : true 1<enter SparseMultivariatePolynomial.*,65 : arg1= 1 arg2= 1 1<enter SparseMultivariatePolynomial.*,90 : arg1= 1 arg2= 1 1>exit SparseMultivariatePolynomial.*,90 : 1 1>exit SparseMultivariatePolynomial.*,65 : 1 1<enter SparseMultivariatePolynomial.zero?,17 : arg1= 1 1>exit SparseMultivariatePolynomial.zero?,17 : false 1<enter SparseMultivariatePolynomial.=,97 : arg1= 1 arg2= 1 1>exit SparseMultivariatePolynomial.=,97 : true 1>exit Fraction.*,60 : ((0 . 1) 0 . 1) 1<enter Fraction.denom,73 : ((0 . 1) 0 . 1) 2<enter Fraction.denom,73 : ((0 . 1) 0 . 1) 3<enter Fraction.denom,73 : ((0 . 1) 0 . 1) ...
The following, surprisingly also works (trying to recreate the above trace, but failed).
)trace FRAC
Parameterized constructors traced: FRAC
)trace SMP )math
Parameterized constructors traced: FRAC,SMP 1::EXPR INT
(3) |
Here are trace examples that produced Bind Stack Overflow.
)trace INT
Parameterized constructors traced: FRAC,SMP, INT
)trace FRAC
Parameterized constructors traced: SMP,INT, FRAC
)trace EXPR INT )math
Packages traced: Integer,Expression(Integer) Parameterized constructors traced: SMP, INT, FRAC
)trace KERNEL EXPR INT
Packages traced: Integer,Expression(Integer), Kernel(Expression(Integer)) Parameterized constructors traced: SMP, INT, FRAC
)trace SMP(INT,KERNEL EXPR INT)
Packages traced: Integer,Expression(Integer), Kernel(Expression(Integer)), SparseMultivariatePolynomial(Integer, Kernel( Expression(Integer))) Parameterized constructors traced: SMP, INT, FRAC
)trace OutputForm
Packages traced: Integer,Expression(Integer), Kernel(Expression(Integer)), SparseMultivariatePolynomial(Integer, Kernel( Expression(Integer))) Parameterized constructors traced: SMP, INT, FRAC, OUTFORM 1::EXPR INT
1<enter Expression.coerce,61 : arg1 = 1 1>exit Expression.coerce, 61 : 1
1<enter Expression.denom,101 : arg1 = 1 1>exit Expression.denom, 101 : 1 1<enter Expression.numer, 99 : arg1 = 1 1>exit Expression.numer, 99 : 1
(4) |
2/3::FRAC INT
1<enter Fraction./,127 : (2 . 1)\(3 . 1) 1<enter Fraction.zero?, 13 : (3 . 1) 1<enter Integer.zero?, 18 : 3 1>exit Integer.zero?, 18 : NIL 1>exit Fraction.zero?, 13 : NIL 1<enter Fraction.recip, 54 : (3 . 1) 1<enter Integer.zero?, 18 : 3 1>exit Integer.zero?, 18 : NIL 1<enter Integer.zero?, 18 : 1 1>exit Integer.zero?, 18 : NIL 1<enter Integer.=, 58 : 3\1 1>exit Integer.=, 58 : NIL 1<enter Integer.unitNormal, 90 : 3 1>exit Integer.unitNormal, 90 : #(1 3 1) 1<enter Integer.zero?, 18 : 3 1>exit Integer.zero?, 18 : NIL 1<enter Integer.*, 67 : 1\1 1<enter Integer.*, 66 : 1\1 1>exit Integer.*, 66 : 1 1>exit Integer.*, 67 : 1 1>exit Fraction.recip, 54 : (0 1 . 3) 1<enter Fraction.*, 61 : (2 . 1)\(1 . 3) 1<enter Fraction.zero?, 13 : (2 . 1) 1<enter Integer.zero?, 18 : 2 1>exit Integer.zero?, 18 : NIL 1>exit Fraction.zero?, 13 : NIL 1<enter Fraction.zero?, 13 : (1 . 3) 1<enter Integer.zero?, 18 : 1 1>exit Integer.zero?, 18 : NIL 1>exit Fraction.zero?, 13 : NIL 1<enter Fraction.=, 21 : (2 . 1)\(1 . 1) 1<enter Integer.=, 58 : 2\1 1>exit Integer.=, 58 : NIL 1>exit Fraction.=, 21 : NIL 1<enter Fraction.=, 21 : (1 . 3)\(1 . 1) 1<enter Integer.=, 58 : 1\1 1>exit Integer.=, 58 : T 1<enter Integer.=, 58 : 3\1 1>exit Integer.=, 58 : NIL 1>exit Fraction.=, 21 : NIL 1<enter Integer.=, 58 : 3\1 1>exit Integer.=, 58 : NIL 1<enter Integer.gcd, 88 : 2\3 1>exit Integer.gcd, 88 : 1 1<enter Integer.one?, 19 : 1 1>exit Integer.one?, 19 : T 1<enter Integer.=, 58 : 1\1 1>exit Integer.=, 58 : T 1<enter Integer.*, 67 : 2\1 1<enter Integer.*, 66 : 2\1 1>exit Integer.*, 66 : 2 1>exit Integer.*, 67 : 2 1<enter Integer.*, 67 : 3\1 1<enter Integer.*, 66 : 3\1 1>exit Integer.*, 66 : 3 1>exit Integer.*, 67 : 3 1<enter Integer.zero?, 18 : 2 1>exit Integer.zero?, 18 : NIL 1<enter Integer.=, 58 : 3\1 1>exit Integer.=, 58 : NIL 1<enter Integer.unitNormal, 90 : 3 1>exit Integer.unitNormal, 90 : #(1 3 1) 1<enter Integer.zero?, 18 : 3 1>exit Integer.zero?, 18 : NIL 1<enter Integer.*, 67 : 2\1 1<enter Integer.*, 66 : 2\1 1>exit Integer.*, 66 : 2 1>exit Integer.*, 67 : 2 1>exit Fraction.*, 61 : (2 . 3) 1>exit Fraction./, 127 : (2 . 3)
(5) |
For a preliminary analysis, see SandBox Trace Analysed.