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
Type: Type
axiom
q:Q
Type: Void
axiom
q:=quatern(1+%i*3,2-%i,3,4)
Type: Quaternion(Complex(Expression(Integer)))
axiom
q:=quatern(1+%i*3,2-%i,3+t,4+t+t^2)
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
Type: Type
axiom
qp:QP
Type: Void
axiom
qp:=quatern(1+%i*3,2-%i,3,4)
Type: Quaternion(Complex(Fraction(Polynomial(Integer))))
axiom
qp:=quatern(1+%i*3,2-%i,3+t,4+t+t^2)
Type: Quaternion(Complex(Fraction(Polynomial(Integer))))
axiom
qp:=quatern(1+%i*3,2-%i+t,3,4)
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
Type: Type
axiom
t:C
Type: Void
axiom
QC:=Quaternion C
Type: Type
axiom
qc:QC
Type: Void
axiom
qc:=quatern(1+%i*3,2-%i,3,4)
Type: Quaternion(Complex(Expression(Integer)))
axiom
qc:=quatern(1+%i*3,2-%i,3+t,4+t+t^2)
Type: Quaternion(Complex(Expression(Integer)))
axiom
qc:=quatern(1+%i*3,2-%i+t,3,4)
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?