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

Edit detail for #428 Equation Domain coerce to OutputForm and Boolean revision 3 of 4

1 2 3 4
Editor: Bill Page
Time: 2008/06/17 14:56:39 GMT-7
Note: 'Domain' in 'SetCategory'?

added:

From BillPage Tue Jun 17 14:56:33 -0700 2008
From: Bill Page
Date: Tue, 17 Jun 2008 14:56:33 -0700
Subject: 'Domain' in 'SetCategory'?
Message-ID: <20080617145633-0700@axiom-wiki.newsynthesis.org>

Putting 'Domain' in 'SetCategory' is one possible solution to this problem:
\begin{spad}
)abbrev domain DOMAIN Domain
++ Author: Gabriel Dos Reis
++ Date Create: October 18, 2007.
++ Modified: Bill Page
++ Date Last Updated: June 17, 2008.
++ Basic Operations: coerce, reify
++ Related Constructors: Type, Syntax, OutputForm
++ Also See: Type, ConstructorCall
Domain(): Public == Private where
  Public ==> SetCategory with
    reify: % -> ConstructorCall
      ++ reify(d) returns the abstract syntax for the domain `x'.

    reflect: ConstructorCall -> %
      ++ reflect cc returns the domain object designated by the
      ++ ConstructorCall syntax `cc'.  The constructor implied
      ++ by `cc' must be known to the system since it is instantiated.

    showSummary: % -> Void
      ++ showSummary(d) prints out implementation detail information
      ++ of domain `d'.

  Private ==> add
    coerce x ==
      outputDomainConstructor(x)$Lisp

    x = y ==
      x0 := reify(x)
      y0 := reify(y)
      constructorName(x0)=constructorName(y0) and arguments(x0)=arguments(y0)

    reify x ==
      devaluate(x)$Lisp @ ConstructorCall

    reflect cc ==
      evalDomain(cc)$Lisp @ %

    showSummary x ==
      showSummary(x)$Lisp

\end{spad}

\begin{axiom}
(V1=V2)@Boolean
(Complex Integer = Complex Float)@Boolean
\end{axiom}

\begin{axiom}
V1=V2
%::Boolean
\end{axiom}

Submitted by : Bill Page at: 2008-06-17T14:34:21-07:00 (16 years ago)
Name :
Axiom Version :
Category : Severity : Status :
Optional subject :  
Optional comment :

OpenAxiom? displays Equation(Domain) as:

 (3) -> V1=V2

  LISP output:
 (UNPRINTABLE . UNPRINTABLE)
                            Type: Equation Domain
 (4) -> %::Boolean
   Internal Error
   The function = with signature (%,%) -> Boolean is missing from
      domain Domain

and is missing equality.

axiom
V1:=DirectProduct(3+4,Integer)
LatexWiki Image(1)
Type: Domain
axiom
V2:=DirectProduct(7,Integer)
LatexWiki Image(2)
Type: Domain
axiom
V1=V2 LISP output: (UNPRINTABLE . UNPRINTABLE)
Type: Equation Domain
axiom
%::Boolean Internal Error The function = with signature (%,%) -> Boolean is missing from domain Domain

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

Domain in SetCategory? --Bill Page, Tue, 17 Jun 2008 14:56:33 -0700 reply
Putting Domain in SetCategory is one possible solution to this problem:
spad
)abbrev domain DOMAIN Domain ++ Author: Gabriel Dos Reis ++ Date Create: October 18, 2007. ++ Modified: Bill Page ++ Date Last Updated: June 17, 2008. ++ Basic Operations: coerce, reify ++ Related Constructors: Type, Syntax, OutputForm ++ Also See: Type, ConstructorCall Domain(): Public == Private where Public ==> SetCategory with reify: % -> ConstructorCall ++ reify(d) returns the abstract syntax for the domain `x'. reflect: ConstructorCall -> % ++ reflect cc returns the domain object designated by the ++ ConstructorCall syntax `cc'. The constructor implied ++ by `cc' must be known to the system since it is instantiated. showSummary: % -> Void ++ showSummary(d) prints out implementation detail information ++ of domain `d'. Private ==> add coerce x == outputDomainConstructor(x)$Lisp x = y == x0 := reify(x) y0 := reify(y) constructorName(x0)=constructorName(y0) and arguments(x0)=arguments(y0) reify x == devaluate(x)$Lisp @ ConstructorCall reflect cc == evalDomain(cc)$Lisp @ % showSummary x == showSummary(x)$Lisp
spad
   Compiling OpenAxiom source code from file 
      /var/zope2/var/LatexWiki/6570934237940921533-25px002.spad using 
      Spad compiler.
   DOMAIN abbreviates domain Domain 
   processing macro definition Public ==> -- the constructor category 
   processing macro definition Private ==> -- the constructor capsule 
------------------------------------------------------------------------
   initializing NRLIB DOMAIN for Domain 
   compiling into NRLIB DOMAIN 
   Adding $ modemaps
   Adding OutputForm modemaps
   compiling exported coerce : % -> OutputForm
      DOMAIN;coerce;$Of;1 is replaced by outputDomainConstructor 
;;;     ***       |DOMAIN;coerce;$Of;1| REDEFINED
Time: 0.01 SEC.
   Adding Boolean modemaps
   compiling exported = : (%,%) -> Boolean
   Adding ConstructorCall modemaps
   Adding Symbol modemaps
   Adding Syntax modemaps
   Adding List Syntax modemaps
Time: 0.02 SEC.
   Adding ConstructorCall modemaps
   compiling exported reify : % -> ConstructorCall
      DOMAIN;reify;$Cc;3 is replaced by devaluate 
Time: 0 SEC.
   Adding ConstructorCall modemaps
   compiling exported reflect : ConstructorCall -> %
      DOMAIN;reflect;Cc$;4 is replaced by evalDomain 
Time: 0 SEC.
   Adding Void modemaps
   compiling exported showSummary : % -> Void
      DOMAIN;showSummary;$V;5 is replaced by showSummary 
Time: 0 SEC.
(time taken in buildFunctor:  0)
;;;     ***       |Domain| REDEFINED
;;;     ***       |Domain| REDEFINED
Time: 0 SEC.
   Cumulative Statistics for Constructor Domain
      Time: 0.03 seconds
   finalizing NRLIB DOMAIN 
   Processing Domain for Browser database:
     -- reify : % -> ConstructorCall
     -- reflect : ConstructorCall -> %
     -- showSummary : % -> Void
     -- constructor
------------------------------------------------------------------------
   Domain is now explicitly exposed in frame initial 
   Domain will be automatically loaded when needed from 
      /var/zope2/var/LatexWiki/DOMAIN.NRLIB/code.o

axiom
(V1=V2)@Boolean
LatexWiki Image(3)
Type: Boolean
axiom
(Complex Integer = Complex Float)@Boolean
LatexWiki Image(4)
Type: Boolean

axiom
V1=V2
LatexWiki Image(5)
Type: Equation Domain
axiom
%::Boolean
LatexWiki Image(6)
Type: Boolean