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

Edit detail for #278 'simplifyLog' cannot cope with 'sqrt' revision 7 of 7

1 2 3 4 5 6 7
Editor: japp
Time: 2008/10/16 11:30:59 GMT-7
Note:

removed:
-
-
-From japp Thu Oct 16 11:30:39 -0700 2008
-From: japp
-Date: Thu, 16 Oct 2008 11:30:39 -0700
-Subject: 
-Message-ID: <20081016113039-0700@axiom-wiki.newsynthesis.org>
-
-Status: fixed somewhere => fix proposed 
-

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

axiom
simplifyLog(2*sqrt(2)*log(2))

\label{eq1}{\log \left({4}\right)}\ {\sqrt{2}}(1)
Type: Expression(Integer)

It's perhaps the line for i in 1..#terms repeat in manip.spad file and simplifyLog1 function to change in for i in #term..1 by -1 repeat because there is a delete!(terms,i) in the loop.

It's perhaps necessary to add exprs := reverse! exprs at the end of the loop, if we want to remain the order of the terms.

FMy?.

Category: Axiom Interpreter => Axiom Library Status: open => fix proposed

Status: fix proposed => fixed somewhere

no patch available

From wh-sandbox:

</p>
<p>--- branches/wh-sandbox/src/algebra/manip.spad.pamphlet 2006/11/15 17:26:27     263
+++ branches/wh-sandbox/src/algebra/manip.spad.pamphlet 2006/12/12 03:05:14     397
@@ -623,10 +623,13 @@
         -- like to combine it with a log term.
         terms :List F := [simplifyLog(term) for term in termList::List(F)]<a class=? exprs :List F := [] - for i in 1..#terms repeat - if retractIfCan(terms.i)@Union(FPR,"failed") case FPR then - exprs := cons(terms.i,exprs) - terms := delete!(terms,i) + nterms :List F := [] + for term in terms repeat + if retractIfCan(term)@Union(FPR,"failed") case FPR then + exprs := cons(term, exprs) + else + nterms := cons(term, nterms) + terms := nterms if not empty? exprs then foundLog := false i : NonNegativeInteger? := 0 " title="

--- branches/wh-sandbox/src/algebra/manip.spad.pamphlet 2006/11/15 17:26:27 263 +++ branches/wh-sandbox/src/algebra/manip.spad.pamphlet 2006/12/12 03:05:14 397 @@ -623,10 +623,13 @@ -- like to combine it with a log term. terms :List F := [simplifyLog(term) for term in termList::List(F)]? exprs :List F := [] - for i in 1..#terms repeat - if retractIfCan(terms.i)@Union(FPR,"failed") case FPR then - exprs := cons(terms.i,exprs) - terms := delete!(terms,i) + nterms :List F := [] + for term in terms repeat + if retractIfCan(term)@Union(FPR,"failed") case FPR then + exprs := cons(term, exprs) + else + nterms := cons(term, nterms) + terms := nterms if not empty? exprs then foundLog := false i : NonNegativeInteger? := 0 " class="equation" src="images/7151032306766980608-16.0px.png" align="bottom" Style="vertical-align:text-bottom" width="576" height="383"/>