login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

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.

fricas
2/3::FRAC INT

\label{eq1}2 \over 3(1)
Type: Fraction(Integer)
fricas
1::EXPR INT

\label{eq2}1(2)
Type: Expression(Integer)

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).

fricas
)trace FRAC
Parameterized constructors traced: FRAC
fricas
)trace SMP )math
Parameterized constructors traced: FRAC, SMP 1::EXPR INT

\label{eq3}1(3)
Type: Expression(Integer)

Here are trace examples that produced Bind Stack Overflow.

fricas
)trace INT
Parameterized constructors traced: FRAC, SMP, INT
fricas
)trace FRAC 
Parameterized constructors traced: SMP, INT, FRAC
fricas
)trace EXPR INT )math
Packages traced: Integer, Expression(Integer) Parameterized constructors traced: SMP, INT, FRAC
fricas
)trace KERNEL EXPR INT
Packages traced: Integer, Expression(Integer), Kernel(Expression(Integer)) Parameterized constructors traced: SMP, INT, FRAC
fricas
)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
fricas
)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

\label{eq4}1(4)
Type: Expression(Integer)

fricas
2/3::FRAC INT
1<enter Fraction./,124 : (2 . 1)\(3 . 1) 1<enter Fraction.zero?,13 : (3 . 1) 1<enter Integer.zero?,25 : 3 1>exit Integer.zero?,25 : NIL 1>exit Fraction.zero?,13 : NIL 1<enter Fraction.recip,50 : (3 . 1) 1<enter Integer.zero?,25 : 3 1>exit Integer.zero?,25 : NIL 1<enter Integer.zero?,25 : 1 1>exit Integer.zero?,25 : NIL 1<enter Integer.=,65 : 3\1 1>exit Integer.=,65 : NIL 1<enter Integer.unitNormal,90 : 3 1>exit Integer.unitNormal,90 : #(1 3 1) 1<enter Integer.zero?,25 : 3 1>exit Integer.zero?,25 : NIL 1<enter Integer.*,71 : 1\1 1<enter Integer.*,72 : 1\1 1>exit Integer.*,72 : 1 1>exit Integer.*,71 : 1 1>exit Fraction.recip,50 : (0 1 . 3) 1<enter Fraction.*,57 : (2 . 1)\(1 . 3) 1<enter Fraction.zero?,13 : (2 . 1) 1<enter Integer.zero?,25 : 2 1>exit Integer.zero?,25 : NIL 1>exit Fraction.zero?,13 : NIL 1<enter Fraction.zero?,13 : (1 . 3) 1<enter Integer.zero?,25 : 1 1>exit Integer.zero?,25 : NIL 1>exit Fraction.zero?,13 : NIL 1<enter Fraction.=,56 : (2 . 1)\(1 . 1) 1<enter Integer.=,65 : 2\1 1>exit Integer.=,65 : NIL 1>exit Fraction.=,56 : NIL 1<enter Fraction.=,56 : (1 . 3)\(1 . 1) 1<enter Integer.=,65 : 1\1 1>exit Integer.=,65 : T 1<enter Integer.=,65 : 3\1 1>exit Integer.=,65 : NIL 1>exit Fraction.=,56 : NIL 1<enter Integer.=,65 : 3\1 1>exit Integer.=,65 : NIL 1<enter Integer.gcd,88 : 2\3 1>exit Integer.gcd,88 : 1 1<enter Integer.exquo,86 : 2\1 1>exit Integer.exquo,86 : (0 . 2) 1<enter Integer.exquo,86 : 3\1 1>exit Integer.exquo,86 : (0 . 3) 1<enter Integer.=,65 : 1\1 1>exit Integer.=,65 : T 1<enter Integer.*,71 : 2\1 1<enter Integer.*,72 : 2\1 1>exit Integer.*,72 : 2 1>exit Integer.*,71 : 2 1<enter Integer.*,71 : 3\1 1<enter Integer.*,72 : 3\1 1>exit Integer.*,72 : 3 1>exit Integer.*,71 : 3 1<enter Integer.zero?,25 : 2 1>exit Integer.zero?,25 : NIL 1<enter Integer.=,65 : 3\1 1>exit Integer.=,65 : NIL 1<enter Integer.unitNormal,90 : 3 1>exit Integer.unitNormal,90 : #(1 3 1) 1<enter Integer.zero?,25 : 3 1>exit Integer.zero?,25 : NIL 1<enter Integer.*,71 : 2\1 1<enter Integer.*,72 : 2\1 1>exit Integer.*,72 : 2 1>exit Integer.*,71 : 2 1>exit Fraction.*,57 : (2 . 3) 1>exit Fraction./,124 : (2 . 3)

\label{eq5}2 \over 3(5)
Type: Fraction(Integer)

For a preliminary analysis, see SandBox Trace Analysed.




  Subject:   Be Bold !!
  ( 13 subscribers )  
Please rate this page: