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

Submitted by : Bill Page at: 2008-05-28T17:06:58-07:00 (9 years ago)
Name :
Axiom Version :
Category : Severity : Status :
Optional subject :  
Optional comment :

In OpenAxiom one should be able to write a function that returns a 'Category':

ST(x:Integer):Category == (x=0 => SetCategory;Type)
ST(0)

but we get the error message:

   Internal Error
   Interpreter code generation failed for expression
      (IF (= |#1| 0) |SetCategory| |Type|)

This is ok for functions that return 'Domain': 
FI(x:Integer):Domain == (x=0 => Float;Integer)
FI(0)
FI(1)

Axiom Version: => /usr/local/lib/open-axiom/x86_64-unknown-linux/1.2.0-2008-05-25

category valued functions --gdr, Wed, 28 May 2008 17:52:23 -0700 reply
Because the function of categories is to oversee domains, it is much much harder to have category valued functions with the current compilation scheme.

However, in the interpreter we should probably try to accomodate for as much as we can because we can also do a small step semantics, e.g. interpret literally the codes.

Going back to your problem, an issue here is with what the type of Type should be. Currently, OpenAxiom says that Type has type Type, instead of Category: 
Type
typeOf Type

Another option might be to say that Type has type Category. That would make your function OK. Note that the following works fine


ST2(x: Integer): Category == (x=0 => SetCategory; Ring)</p>
<p>ST2 0
ST2 1
SetCategory; Ring)

ST2 0 ST2 1 " class="equation" src="images/5108590959715763747-16.0px.png" width="374" height="52"/>

Bill, your original example now works.

declarations require domains --Bill Page, Thu, 29 May 2008 14:36:02 -0700 reply
Something is still inconsistent here:
  (1) -> ST(x:Integer):Category == (x=0 => SetCategory;Type)
   Function declaration ST : Integer -> Category has been added to
      workspace.
                                            Type: Void
  (2) -> A:=ST(0)
   Compiling function ST with type Integer -> Category

  ;;;     ***       |*1;ST;1;frame1392| REDEFINED
  ; (DEFUN |*1;ST;1;frame1392| ...) is being compiled.
  ;; The variable |*1;ST;1;frame1392;MV| is undefined.
  ;; The compiler will assume this variable is a global.

   (2)  SetCategory
                                            Type: Category
  (3) -> B:=ST(1)

   (3)  Type
                                            Type: Category
  (4) -> C:Category

   Category is a category, not a domain, and declarations require
      domains.
  (4) -> C:Category:=Ring

   Category is a category, not a domain, and declarations require
      domains.

  (4) -> C:=Ring

   (4)  Ring
                                               Type: Category

  (5) -> )display type C

   Type of value of C: Category

  (5) -> X:Domain:=Ring   -- Ring is not a domain

   (5)  Ring
                                               Type: Category

-------

If the type of a category-valued variable can be implicitly made to be Category, it should also be possible to declare this to be so.

well, that is the original restriction I inherited :-)

Status: open => fixed somewhere

The code generation failure is fixed. So, I don't think is an issue any more.

Status: fixed somewhere => closed

This is OpenAxiom specific issue that is fixed.


Some or all expressions may not have rendered properly, because Axiom returned the following error:
Error: export AXIOM=/usr/local/lib/open-axiom/x86_64-unknown-linux/1.2.0-2008-05-25; export ALDORROOT=/usr/local/aldor/linux/1.1.0; export PATH=ALDORROOT/bin:PATH; export HOME=/var/zope2/var/LatexWiki; ulimit -t 240; $AXIOM/bin/AXIOMsys < /var/zope2/var/LatexWiki/2099996685253644054-25px.axm
/bin/sh: /usr/local/lib/open-axiom/x86_64-unknown-linux/1.2.0-2008-05-25/bin/AXIOMsys: not found




  Subject:   Be Bold !!
  ( 13 subscribers )  
Please rate this page: