axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] bad errormessage: There are no library operations


From: William Sit
Subject: Re: [Axiom-developer] bad errormessage: There are no library operations named ADEF
Date: Sat, 25 Jul 2009 00:22:52 -0400

Dear Michael:

The following works, but we shouldn't have to use such "unnatural" transformation, since (1,2) is a Tuple object (or, is it, always? see below). I also agree the error message is bad, but that is neither news nor where the problem seems to lie.

((x : (Tuple INT)):INT +-> select(x,0)) ((1,2)::Tuple INT)

or simpler:

((x : (Tuple INT)):INT +-> select(x,0)) [1,2]

Axiom transcript:

(6) -> ((x:(TUPLE INT)):INT+->select(x,0)) [1,2]

  (6) 1
Type: PositiveInteger
(7) -> ((x:(TUPLE INT)):INT+->select(x,0)) (1,2)

  There are no library operations named ADEF
     Use HyperDoc Browse or issue
                               )what op ADEF
to learn if there is any operation containing " ADEF " in its
     name.

Cannot find a definition or applicable library operation named ADEF
     with argument type(s)
                              PositiveInteger
                              PositiveInteger

Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need.
(7) -> (1,2)

  (7) [1,2]
Type: Tuple PositiveInteger

(8) -> [1,2]

  (8) [1,2]
Type: List PositiveInteger

Note that the outputform of a tuple uses square brackets.

An examination of the code for Tuple.spad shows that a tuple can be input only from a "PrimitiveArray S" which inherits from "OneDimensionalArrayAggregate(S)". However, the way the Interpreter accepts tuples as input is inconsistent:

select((1,2),0) succeeds, but select([1,2],0) fails.

Further investigation shows that the problem has nothing to do with anonymous functions. It appears that the Interpreter treats (...) differently for unary from binary or higher arity functions. For unary function, the parenthesis is ignored, while for binary or higher arity functions, it is treated as delimiters for a tuple. The [1,2] construction forces the Interpreter to view this more favorably as a single argument.

This problem survives from Nag Axiom 2.3. If the observations above are correct, to fix it, it would would require the Interpreter to search by interpreting (...) first as a tuple, and failing that, as a single argument; or in the reverse order.


(1) -> f==((x:(TUPLE INT)):INT+->select(x,0))
Function declaration f : Tuple Integer -> Integer has been added to
     workspace.
Type: Void
(2) -> )set mess bot on
(2) -> f (1,2,3) -- treated as 3 arguments, same as f(1,2,3)

Function Selection for f
     Arguments: (PI,PI,PI)
  -> no function f found for arguments (PI,PI,PI)
  There are no library operations named f
     Use HyperDoc Browse or issue
                                )what op f
to learn if there is any operation containing " f " in its name.

Cannot find a definition or applicable library operation named f
     with argument type(s)
                              PositiveInteger
                              PositiveInteger
                              PositiveInteger

Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. (2) -> f ((1,2,3)) --treated as 3 arguments, same as f(1,2,3)

Function Selection for f
     Arguments: (PI,PI,PI)
  -> no function f found for arguments (PI,PI,PI)
  There are no library operations named f
     Use HyperDoc Browse or issue
                                )what op f
to learn if there is any operation containing " f " in its name.

Cannot find a definition or applicable library operation named f
     with argument type(s)
                              PositiveInteger
                              PositiveInteger
                              PositiveInteger

Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. (2) -> f (1,2,3)::Tuple INT -- wrong association, still treated as f(1,2,3)

Function Selection for f
     Arguments: (PI,PI,PI)
  -> no function f found for arguments (PI,PI,PI)
  There are no library operations named f
     Use HyperDoc Browse or issue
                                )what op f
to learn if there is any operation containing " f " in its name.

Cannot find a definition or applicable library operation named f
     with argument type(s)
                              PositiveInteger
                              PositiveInteger
                              PositiveInteger

Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. (2) -> f ((1,2,3)::Tuple INT) -- forces (1,2,3) as a single argument

Function Selection for f
     Arguments: TUPLE INT

Function Selection for select
     Arguments: (TUPLE INT,NNI)
     Target type: INT

[1] signature: (TUPLE INT,NNI) -> INT
implemented: slot (Integer)$(NonNegativeInteger) from TUPLE INT

  Compiling function f with type Tuple Integer -> Integer

[1] signature: TUPLE INT -> INT
     implemented: local function *1;f;1;initial


  (2) 1
Type: PositiveInteger (3) -> f [1,2,3] -- a simpler way to force as single argument

Function Selection for construct
     Arguments: (PI,PI,PI)
     Target type: TUPLE INT
  -> no function construct found for arguments (PI,PI,PI)

Function Selection for f
     Arguments: TUPLE INT

[1] signature: TUPLE INT -> INT
     implemented: local function *1;f;1;initial


  (3) 1
Type: PositiveInteger (4) -> select ((1,2,3),0) -- (1,2,3) treated as first of two arguments

Function Selection for select
     Arguments: (TUPLE PI,NNI)

[1] signature: (TUPLE PI,NNI) -> PI
implemented: slot (PositiveInteger)$(NonNegativeInteger) from TUPLE PI


  (4) 1
Type: PositiveInteger (5) -> select ([1,2,3],0) -- Interpreter does not coerce List to Tuple in higher arity

Function Selection for select
     Arguments: (LIST PI,NNI)
  -> no function select found for arguments (LIST PI,NNI)

Function Selection for select
     Arguments: (LIST NNI,INT)
-> no function select found for arguments (LIST NNI,INT)

Function Selection for select
     Arguments: (LIST INT,SINT)
-> no function select found for arguments (LIST INT,SINT)

Function Selection for select
     Arguments: (LIST SINT,SINT)
-> no function select found for arguments (LIST SINT,SINT) There are 4 exposed and 1 unexposed library operations named select having 2 argument(s) but none was determined to be applicable.
     Use HyperDoc Browse, or issue
                            )display op select
to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments
     will allow you to apply the operation.

Cannot find a definition or applicable library operation named
     select with argument type(s)
                           List PositiveInteger
                            NonNegativeInteger

Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need.



William

On Sat, 25 Jul 2009 01:43:22 +0200
 Michael Becker <address@hidden> wrote:


    Hi,


(1) -> (1,2)
(1) ->
   (1)  [1,2]
Type: Tuple PositiveInteger
(2) -> select ((1,2),0)
(2) ->
   (2)  1
Type: PositiveInteger
(3) -> (x +-> select(x,0)) ((1,2)::Tuple INT)
(3) ->
   (3)  1
Type: PositiveInteger
(4) -> ((x : (Tuple INT)):INT +-> select(x,0))  ((1,2))
   There are no library operations named ADEF
      Use HyperDoc Browse or issue
                                )what op ADEF
to learn if there is any operation containing " ADEF " in its
      name.

Cannot find a definition or applicable library operation named ADEF
      with argument type(s)
                               PositiveInteger
                               PositiveInteger

Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need.




    -- Michael



  ps:  same result in fricas or open-axiom.








------------------------------------------------------------------------------------ Diese Nachricht könnte vertrauliche und/oder rechtlich
geschützte Informationen enthalten. Wenn Sie nicht der
Adressat dieser Email sind oder nicht autorisiert sind, diese
für den Adressaten entgegenzunehmen, so ist es untersagt,
diese Nachricht oder in ihr enthaltene Informationen zu nutzen, zu kopieren, offen zu legen oder anderweitig weiterzuverarbeiten. Sollten Sie diese Nachricht fälschlicherweise erhalten haben, verständigen Sie den Absender bitte unverzüglich per Antwort auf
diese Mail und löschen sie diese anschließend.
Vielen Dank für Ihre Kooperation.
------------------------------------------------------------------------------------ This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your co-operation. ------------------------------------------------------------------------------------ We make your business move.



_______________________________________________
Axiom-developer mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/axiom-developer

William Sit, Professor Emeritus
Mathematics, City College of New York Office: R6/202C Tel: 212-650-5179
Home Page: http://scisun.sci.ccny.cuny.edu/~wyscc/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]