Aleksej Saushev | 5 Feb 2010 21:09
Picon

[open-axiom-devel] "iter" definition bug

  Hello!

The following code brings FriCAS into Lisp debugger.

)abbrev package BUG Bug
Bug(D: Type): Exports == Implementation where
  Exports == with
    dummy: D -> D
  Implementation == add
    iter: (D -> D, D, PositiveInteger) -> D
    iter(f, p, 0) == p
    iter(f, p, n) == f(iter(f, p, n-1))

The output follows:

   BUG abbreviates package Bug 
------------------------------------------------------------------------
   initializing NRLIB BUG for Bug 
   compiling into NRLIB BUG 
   compiling local iter : (D -> D,D,PositiveInteger) -> D
      BUG;iter is replaced by p 

Break
Available restarts:

1. (CONTINUE) Return from BREAK.

Broken at SI:BYTECODES. [Evaluation of: (PROGN (DEFPARAMETER *YEARWEEK* "Wednesday February 3, 2010 at
04:29:45 ") (DEFPARAMETER *BUILD-VERSION* "FriCAS 2010-01-08") (DEFPARAMETER TIMESTAMP
"/tmp/wip/fricas/work/fricas/target/i486--netbsdelf/timestamp") (DEFPARAMETER
(Continue reading)

Gabriel Dos Reis | 5 Feb 2010 22:03
Picon
Favicon

Re: [open-axiom-devel] "iter" definition bug

Aleksej Saushev <asau@...> writes:

|   Hello!
| 
| The following code brings FriCAS into Lisp debugger.
| 
| )abbrev package BUG Bug
| Bug(D: Type): Exports == Implementation where
|   Exports == with
|     dummy: D -> D
|   Implementation == add
|     iter: (D -> D, D, PositiveInteger) -> D
|     iter(f, p, 0) == p
|     iter(f, p, n) == f(iter(f, p, n-1))

[...]

| OpenAxiom's response is that this is "apparent user error":
| 
|    BUG abbreviates package Bug 
| ------------------------------------------------------------------------
|    initializing NRLIB BUG for Bug 
|    compiling into NRLIB BUG 
|    Adding $ modemaps
|    Adding D modemaps
|    Adding Integer modemaps
|    Adding NonNegativeInteger modemaps
|    Adding PositiveInteger modemaps
|    compiling local iter : (D -> D,D,PositiveInteger) -> D
|       BUG;iter is replaced by p 
(Continue reading)

Gabriel Dos Reis | 6 Feb 2010 14:15
Picon
Favicon

Re: [open-axiom-devel] Re: "iter" definition bug

Aleksej Saushev <asau@...> writes:

| Aleksej Saushev <asau@...> writes:
| 
| > I seek for enlightement.
| 
| Even with all your corrections it still doesn't work,
| both this:
| 
| )abbrev package BUG Bug
| Bug(D: Type): Exports == Implementation where
|   Exports == with
|     dummy: D -> D
|   Implementation == add
|     iterte: (D -> D, D, NonNegativeInteger) -> D
|     iterte(f, p, n) ==
|       n = 0 => p
|       f(iterte(f, p, subtractIfCan(n, 1)))
                       ^^^^^^^^^^^^^^^^^^^

subtractIfCan does not return a NonNegativeInteger.  Rather, its
return type is  Union(NonNegativeInteger, "failed").
(In general, the xxxIfCan functions return a Union(D, "failed") where
D is some domain.)
Consequently, you need an explicit coercion to retrieve the
NonNegativeInteger value.  The following code compiles with OpenAxiom

)abbrev package BUG Bug
Bug(D: Type): Exports == Implementation where
  Exports == with
(Continue reading)

Aleksej Saushev | 6 Feb 2010 13:44
Picon

Re: [open-axiom-devel] "iter" definition bug

Aleksej Saushev <asau@...> writes:

> I seek for enlightement.

Even with all your corrections it still doesn't work,
both this:

)abbrev package BUG Bug
Bug(D: Type): Exports == Implementation where
  Exports == with
    dummy: D -> D
  Implementation == add
    iterte: (D -> D, D, NonNegativeInteger) -> D
    iterte(f, p, n) ==
      n = 0 => p
      f(iterte(f, p, subtractIfCan(n, 1)))

and this:

)abbrev package BUG Bug
Bug(D: Type): Exports == Implementation where
  Exports == with
    dummy: D -> D
  Implementation == add
    iterte: (D -> D, D, NonNegativeInteger) -> D
    iterte(f, p, n) == if n = 0 then p else f(iterte(f, p, subtractIfCan(n, 1)))

result in

   BUG abbreviates package Bug 
(Continue reading)

Gabriel Dos Reis | 14 Feb 2010 02:24
Picon
Favicon

[open-axiom-devel] ar-sandbox merge from trunk


Hi Arthur,

  I merged all changes that happened to trunk into the ar-sandbox.

-- Gaby

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
Gabriel Dos Reis | 14 Feb 2010 02:32
Picon
Favicon

[open-axiom-devel] jap-sandbox merged from trunk


Hi Alfredo,

  trunk is merged into jap-sandbox.

-- Gaby

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev

Gmane