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

Edit detail for #364 coerce is missing from domain Expression revision 1 of 3

1 2 3
Editor:
Time: 2007/11/17 22:33:32 GMT-8
Note:

changed:
-
The domain 'Expression(R:OrderedSet)' should always be able to coerce something of type R to an Expression, but this fails in some cases. For example:
\begin{axiom}
Q:=Quaternion Complex Expression Integer
q:Q
q:=quatern(1+%i*3,2-%i,3,4)
q:=quatern(1+%i*3,2-%i,3+t,4+t+t^2)
q:=quatern(1+%i*3,2-%i+t,3,4)
\end{axiom}

Such a coercion exists in the follow similar case:
\begin{axiom}
QP:=Quaternion Complex Fraction Polynomial Integer
qp:QP
qp:=quatern(1+%i*3,2-%i,3,4)
qp:=quatern(1+%i*3,2-%i,3+t,4+t+t^2)
qp:=quatern(1+%i*3,2-%i+t,3,4)
\end{axiom}

The error can also be avoided if more type information is provided since this changes the chain of inferences made by the Axiom intepreter:
\begin{axiom}
C:=Complex Expression Integer
t:C
QC:=Quaternion C
qc:QC
qc:=quatern(1+%i*3,2-%i,3,4)
qc:=quatern(1+%i*3,2-%i,3+t,4+t+t^2)
qc:=quatern(1+%i*3,2-%i+t,3,4)
\end{axiom}

The formatting of the error message::

  Function:  coerce : Quaternion Complex Integer -> % is missing from
  domain: Expression Quaternion Complex Integer
    Internal Error
    The function coerce with signature $(Quaternion (Complex (Integer))) is
       missing from domain Expression(Quaternion (Complex (Integer)))

also leaves a lot to be desired. Why is it said twice, the second time badly?


Submitted by : (unknown) at: 2007-11-17T22:33:32-08:00 (17 years ago)
Name :
Axiom Version :
Category : Severity : Status :
Optional subject :  
Optional comment :

The domain Expression(R:OrderedSet) should always be able to coerce something of type R to an Expression, but this fails in some cases. For example:

axiom
Q:=Quaternion Complex Expression Integer

\label{eq1}\hbox{\axiomType{Quaternion}\ } (\hbox{\axiomType{Complex}\ } (\hbox{\axiomType{Expression}\ } (\hbox{\axiomType{Integer}\ })))(1)
Type: Type
axiom
q:Q
Type: Void
axiom
q:=quatern(1+%i*3,2-%i,3,4)

\label{eq2}1 +{3 \  i}+{{\left(2 - i \right)}\  i}+{3 \  j}+{4 \  k}(2)
Type: Quaternion(Complex(Expression(Integer)))
axiom
q:=quatern(1+%i*3,2-%i,3+t,4+t+t^2)

\label{eq3}1 +{3 \  i}+{{\left(2 - i \right)}\  i}+{{\left(t + 3 \right)}\  j}+{{\left({t^2}+ t + 4 \right)}\  k}(3)
Type: Quaternion(Complex(Expression(Integer)))
axiom
q:=quatern(1+%i*3,2-%i+t,3,4)
Cannot convert right-hand side of assignment 1 + 3%i + (t + 2 - %i)i + 3j + 4k
to an object of the type Quaternion(Complex(Expression(Integer))) of the left-hand side.

Such a coercion exists in the follow similar case:

axiom
QP:=Quaternion Complex Fraction Polynomial Integer

\label{eq4}\hbox{\axiomType{Quaternion}\ } (\hbox{\axiomType{Complex}\ } (\hbox{\axiomType{Fraction}\ } (\hbox{\axiomType{Polynomial}\ } (\hbox{\axiomType{Integer}\ }))))(4)
Type: Type
axiom
qp:QP
Type: Void
axiom
qp:=quatern(1+%i*3,2-%i,3,4)

\label{eq5}1 +{3 \  i}+{{\left(2 - i \right)}\  i}+{3 \  j}+{4 \  k}(5)
Type: Quaternion(Complex(Fraction(Polynomial(Integer))))
axiom
qp:=quatern(1+%i*3,2-%i,3+t,4+t+t^2)

\label{eq6}1 +{3 \  i}+{{\left(2 - i \right)}\  i}+{{\left(t + 3 \right)}\  j}+{{\left({t^2}+ t + 4 \right)}\  k}(6)
Type: Quaternion(Complex(Fraction(Polynomial(Integer))))
axiom
qp:=quatern(1+%i*3,2-%i+t,3,4)

\label{eq7}1 +{3 \  i}+{{\left(t + 2 - i \right)}\  i}+{3 \  j}+{4 \  k}(7)
Type: Quaternion(Complex(Fraction(Polynomial(Integer))))

The error can also be avoided if more type information is provided since this changes the chain of inferences made by the Axiom intepreter:

axiom
C:=Complex Expression Integer

\label{eq8}\hbox{\axiomType{Complex}\ } (\hbox{\axiomType{Expression}\ } (\hbox{\axiomType{Integer}\ }))(8)
Type: Type
axiom
t:C
Type: Void
axiom
QC:=Quaternion C

\label{eq9}\hbox{\axiomType{Quaternion}\ } (\hbox{\axiomType{Complex}\ } (\hbox{\axiomType{Expression}\ } (\hbox{\axiomType{Integer}\ })))(9)
Type: Type
axiom
qc:QC
Type: Void
axiom
qc:=quatern(1+%i*3,2-%i,3,4)

\label{eq10}1 +{3 \  i}+{{\left(2 - i \right)}\  i}+{3 \  j}+{4 \  k}(10)
Type: Quaternion(Complex(Expression(Integer)))
axiom
qc:=quatern(1+%i*3,2-%i,3+t,4+t+t^2)

\label{eq11}1 +{3 \  i}+{{\left(2 - i \right)}\  i}+{{\left(t + 3 \right)}\  j}+{{\left({t^2}+ t + 4 \right)}\  k}(11)
Type: Quaternion(Complex(Expression(Integer)))
axiom
qc:=quatern(1+%i*3,2-%i+t,3,4)

\label{eq12}1 +{3 \  i}+{{\left(t + 2 - i \right)}\  i}+{3 \  j}+{4 \  k}(12)
Type: Quaternion(Complex(Expression(Integer)))

The formatting of the error message:

  Function:  coerce : Quaternion Complex Integer -> % is missing from
  domain: Expression Quaternion Complex Integer
    Internal Error
    The function coerce with signature $(Quaternion (Complex (Integer))) is
       missing from domain Expression(Quaternion (Complex (Integer)))

also leaves a lot to be desired. Why is it said twice, the second time badly?