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

 Submitted by : (unknown) at: 2007-11-17T22:33:32-08:00 (11 years ago) Name : Axiom Version : default friCAS-20090114 Axiom-20050901 OpenAxiom-20091012 OpenAxiom-20110220 OpenAxiom-Release-141 Category : Axiom Aldor Interface Axiom Compiler Axiom Library Axiom Interpreter Axiom Documentation Axiom User Interface building Axiom from source lisp system MathAction Doyen CD Reduce Axiom on Windows Axiom on Linux Severity : critical serious normal minor wishlist Status : open closed rejected not reproducible fix proposed fixed somewhere duplicate need more info 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:

fricas
Q:=Quaternion Complex Expression Integer
 (1)
Type: Type
fricas
q:Q
Type: Void
fricas
q:=quatern(1+%i*3,2-%i,3,4)
 (2)
Type: Quaternion(Complex(Expression(Integer)))
fricas
q:=quatern(1+%i*3,2-%i,3+t,4+t+t^2)
 (3)
Type: Quaternion(Complex(Expression(Integer)))
fricas
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.

Actually, problem is because Axiom/FriCAS chooses different type for expression which it can not coerce to Q

fricas
quatern(1+%i*3,2-%i+t,3,4)
 (4)
Type: Quaternion(Polynomial(Complex(Integer)))
fricas
quatern(1+%i*3,2-%i+t,3,4)::Q
Cannot convert the value from type Quaternion(Polynomial(Complex(
Integer))) to Quaternion(Complex(Expression(Integer))) .

Probably we should enhance coercions to handle this case...

Such a coercion exists in the follow similar case:

fricas
QP:=Quaternion Complex Fraction Polynomial Integer
 (5)
Type: Type
fricas
qp:QP
Type: Void
fricas
qp:=quatern(1+%i*3,2-%i,3,4)
 (6)
Type: Quaternion(Complex(Fraction(Polynomial(Integer))))
fricas
qp:=quatern(1+%i*3,2-%i,3+t,4+t+t^2)
 (7)
Type: Quaternion(Complex(Fraction(Polynomial(Integer))))
fricas
qp:=quatern(1+%i*3,2-%i+t,3,4)
 (8)
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:

fricas
C:=Complex Expression Integer
 (9)
Type: Type
fricas
t:C
Type: Void
fricas
QC:=Quaternion C
 (10)
Type: Type
fricas
qc:QC
Type: Void
fricas
qc:=quatern(1+%i*3,2-%i,3,4)
 (11)
Type: Quaternion(Complex(Expression(Integer)))
fricas
qc:=quatern(1+%i*3,2-%i,3+t,4+t+t^2)
 (12)
Type: Quaternion(Complex(Expression(Integer)))
fricas
qc:=quatern(1+%i*3,2-%i+t,3,4)
 (13)
Type: Quaternion(Complex(Expression(Integer)))

 Subject:   Be Bold !! ( 15 subscribers )