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

Edit detail for SandBox NNI revision 2 of 3

1 2 3
Editor: Bill Page
Time: 2008/05/21 20:35:32 GMT-7
Note: pretty

changed:
-)lisp (system "pretty < /var/zope/var/LatexWiki/NNI.NRLIB/NNI.lsp | tee /tmp/NNI.lsp")
)lisp (system "cat < /var/zope2/var/LatexWiki/NNI.NRLIB/NNI.lsp | tee /tmp/NNI.lsp")

changed:
-)lisp (system "pretty < /var/zope/var/LatexWiki/NNI2.NRLIB/NNI2.lsp | diff -au /tmp/NNI.lsp -")
-\end{axiom}
)lisp (system "cat < /var/zope2/var/LatexWiki/NNI2.NRLIB/NNI2.lsp | diff -au /tmp/NNI.lsp -")
\end{axiom}

This is an experiment to see what the differences are between defining NonNegativeInteger? (NNI) as a SubDomain? of Integer, versus defining it simply based on Integer itself.

The surprizing conclusion is that the latter definition of NNI produces nearly identical code as the first definition except for the now required definitions of coerce:%->Integer and convert:Integer->%, but without the extra CategoryFrame datastructure. This would seem to confirm that the SubDomain? construct does not have any great advantages over the more direct definition.

First, NNI the usual way: Axiom output parse error!

Axiom output parse error!

Now write NNI without using SubDomain?: Axiom output parse error!

The behaviour is identical to NNI Axiom output parse error!

The generated lisp code for NNI is: Axiom output parse error!

Compared NNI (-) to NNI2 (+): Axiom output parse error!

SubDomain? written in Aldor: Axiom output parse error!

Axiom output parse error!

Test the new subdomain. Axiom output parse error!

Now define NNI the using the new SubSetDom?:

For some unknown reason this fails: Axiom output parse error!

But this works: Axiom output parse error!

Axiom output parse error!

Axiom output parse error!

Axiom output parse error!

Axiom output parse error!