The following code:
--
K:=SparseMultivariatePolynomial(Fraction Integer,Symbol)
E:=Expression K
a:=a::Symbol::K; b:=b::Symbol::K; c:=c::Symbol::K;
P:=P::Symbol::E; Q:=Q::Symbol::E; R:=R::Symbol::E;
idot:=display(operator('dot,2), (x:List OutputForm):OutputForm +->
hconcat([x.1,_{_\cdot_} ,x.2]));
dot(A:E,B:E):E == (smaller?(A,B)=>idot(A,B);idot(B,A))
dot(P, Q)=dot(Q,P)
ihat:=display(operator('hat,2), (x:List OutputForm):OutputForm +->
hconcat([x.1,_{_\wedge_} ,x.2]));
hat(A:E,B:E):E == (smaller?(A,B)=>ihat(A,B);-ihat(B,A))
hat(P, Q)=-hat(Q,P)
simplifyHat:=rule
dot(P, Q)^2-dot(P,P)*dot(Q,Q) == hat(P,Q)^2
-dot(P,Q)^2+dot(P,P)*dot(Q,Q) == -hat(P,Q)^2
dot(Q,R)*dot(P,R)-dot(R,R)*dot(P,Q) == dot(hat(R,Q),hat(R,P))
--
Triggers the bug:
>> Error detected within library code:
Unknown operator
Here is a patch to correct the problem. The operative part is this change:
- opquote := operator('applyQuote)$CommonOperators
+ opquote := operator('%quote)$CommonOperators
Later in the code it checks for '%quote, not 'applyQuote.
wsp...@debian:~/fricas-src/src/algebra$ svn diff fspace.spad.pamphlet
Index: fspace.spad.pamphlet
===================================================================
--- fspace.spad.pamphlet (revision 666)
+++ fspace.spad.pamphlet (working copy)
@@ -220,7 +220,7 @@
operator op ==
is?(op, PAREN) => oppren
is?(op, BOX) => opbox
- error "Unknown operator"
+ error concat("Unknown operator 1: ",string(name(op)))$String
mainKernel x ==
empty?(l := kernels x) => "failed"
@@ -250,14 +250,14 @@
s
kernel(op:OP, args:List %) ==
- not belong? op => error "Unknown operator"
+ not belong? op => error concat("Unknown operator 2:
",string(name(op)))$String
okkernel(op, args)
okkernel(op, l) ==
kernel(op, l, 1 + reduce("max", [height f for f in l], 0))$K :: %
elt(op:OP, args:List %) ==
- not belong? op => error "Unknown operator"
+ not belong? op => error concat("Unknown operator 3:
",string(name(op)))$String
((u := arity op) case N) and (#args ~= u::N)
=> error "Wrong number of arguments"
(v := evaluate(op,args)$BasicOperatorFunctions1(%)) case % => v::%
@@ -556,7 +556,7 @@
equaldiff : (K,K)->Boolean
debugA: (List % ,List %,Boolean) -> Boolean
opdiff := operator('%diff)$CommonOperators()
- opquote := operator('applyQuote)$CommonOperators
+ opquote := operator('%quote)$CommonOperators
ground? x == retractIfCan(x)@Union(R,"failed") case R
ground x == retract x
@@ -573,7 +573,7 @@
operator op ==
is?(op, '%diff) => opdiff
is?(op, '%quote) => opquote
- error "Unknown operator"
+ error concat("Unknown operator 4: ",string(name(op)))$String
if R has ConvertibleTo InputForm then
INP==>InputForm
wsp...@debian:~/fricas-src/src/algebra$ svn diff fspace.spad.pamphlet
> fspace-applyQuote.patch
If there are no objections, I will commit this change.
Regards,
Bill Page.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/fricas-devel?hl=en
-~----------~----~----~----~------~----~------~--~---
Index: fspace.spad.pamphlet
===================================================================
--- fspace.spad.pamphlet (revision 666)
+++ fspace.spad.pamphlet (working copy)
@@ -220,7 +220,7 @@
operator op ==
is?(op, PAREN) => oppren
is?(op, BOX) => opbox
- error "Unknown operator"
+ error concat("Unknown operator 1: ",string(name(op)))$String
mainKernel x ==
empty?(l := kernels x) => "failed"
@@ -250,14 +250,14 @@
s
kernel(op:OP, args:List %) ==
- not belong? op => error "Unknown operator"
+ not belong? op => error concat("Unknown operator 2: ",string(name(op)))$String
okkernel(op, args)
okkernel(op, l) ==
kernel(op, l, 1 + reduce("max", [height f for f in l], 0))$K :: %
elt(op:OP, args:List %) ==
- not belong? op => error "Unknown operator"
+ not belong? op => error concat("Unknown operator 3: ",string(name(op)))$String
((u := arity op) case N) and (#args ~= u::N)
=> error "Wrong number of arguments"
(v := evaluate(op,args)$BasicOperatorFunctions1(%)) case % => v::%
@@ -556,7 +556,7 @@
equaldiff : (K,K)->Boolean
debugA: (List % ,List %,Boolean) -> Boolean
opdiff := operator('%diff)$CommonOperators()
- opquote := operator('applyQuote)$CommonOperators
+ opquote := operator('%quote)$CommonOperators
ground? x == retractIfCan(x)@Union(R,"failed") case R
ground x == retract x
@@ -573,7 +573,7 @@
operator op ==
is?(op, '%diff) => opdiff
is?(op, '%quote) => opquote
- error "Unknown operator"
+ error concat("Unknown operator 4: ",string(name(op)))$String
if R has ConvertibleTo InputForm then
INP==>InputForm