aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/syntax.spad.pamphlet
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2008-01-20 21:17:21 +0000
committerdos-reis <gdr@axiomatics.org>2008-01-20 21:17:21 +0000
commit92db1817aed73ac8a38e9d3070a021d7153ca1ba (patch)
tree1e59d7655578549ff3d3f45084d9f657cd730572 /src/algebra/syntax.spad.pamphlet
parent7fc5f46ef3c26ff7b1c5a5876736f9a1c27c3c13 (diff)
downloadopen-axiom-92db1817aed73ac8a38e9d3070a021d7153ca1ba.tar.gz
* algebra/syntax.spad.pamphlet (ElaboratedExpression): New.
* algebra/any.spad.pamphlet: Rename ObjectProperty to Property. * algebra/exposed.lsp.pamphlet: Likewise. * algebra/Makefile.pamphlet (axiom_algebra_layer_5): Include ELABEXPR.o * share/algebra: Update databases.
Diffstat (limited to 'src/algebra/syntax.spad.pamphlet')
-rw-r--r--src/algebra/syntax.spad.pamphlet64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/algebra/syntax.spad.pamphlet b/src/algebra/syntax.spad.pamphlet
index e7c2b50b..4b3ce07f 100644
--- a/src/algebra/syntax.spad.pamphlet
+++ b/src/algebra/syntax.spad.pamphlet
@@ -241,6 +241,69 @@ ConstructorCall(): Public == Private where
outputDomainConstructor(x)$Lisp
@
+\section{domain ElaboratedExpression}
+<<domain ELABEXPR ElaboratedExpression>>=
+)abbrev domain ELABEXPR ElaboratedExpression
+++ Author: Gabriel Dos Reis
+++ Date Created: January 19, 2008
+++ Date Last Updated: January 20, 2008
+++ Description: This domains an expresion as elaborated by the interpreter.
+++ See Also:
+ElaboratedExpression(): Public == Private where
+ Public ==> CoercibleTo OutputForm with
+ type: % -> ConstructorCall
+ ++ type(e) returns the type of the expression as computed by
+ ++ the interpreter.
+ constant?: % -> Boolean
+ ++ constant?(e) returns true if `e' is a constant.
+ getConstant: % -> Union(SExpression,"failed")
+ ++ getConstant(e) retrieves the constant value of `e'e.
+ variable?: % -> Boolean
+ ++ variable?(e) returns true if `e' is a variable.
+ getVariable: % -> Union(Symbol,"failed")
+ ++ getVariable(e) retrieves the name of the variable `e'.
+ callForm?: % -> Boolean
+ ++ callForm?(e) is true when `e' is a call expression.
+ getOperator: % -> Union(Symbol, "failed")
+ ++ getOperator(e) retrieves the operator being invoked in `e',
+ ++ when `e' is an expression.
+ getOperands: % -> Union(List %, "failed")
+ ++ getOperands(e) returns the of operands in `e'e, assuming it
+ ++ is a call form.
+
+ Private ==> add
+ immediateDataTag := INTERN("--immediateData--")$Lisp
+
+ isAtomic(x: %): Boolean ==
+ ATOM(x)$Lisp @ Boolean
+
+ type x ==
+ getMode(x)$Lisp @ ConstructorCall
+
+ callForm? x ==
+ CONSP(x)$Lisp @ Boolean
+
+ getOperator x ==
+ op: SExpression := getUnnameIfCan(x)$Lisp
+ null? op => "failed"
+ op pretend Symbol
+
+ constant? x ==
+ isAtomic x and
+ EQ(getUnnameIfCan(x)$Lisp, immediateDataTag)$Lisp : Boolean
+
+ getConstant x ==
+ constant? x => getValue(x)$Lisp @ SExpression
+ "failed"
+
+ variable? x ==
+ isAtomic x and not constant? x
+
+ getVariable x ==
+ variable? x => symbol (getUnname(x)$Lisp@SExpression)
+ "failed"
+@
+
\section{License}
<<license>>=
@@ -280,6 +343,7 @@ ConstructorCall(): Public == Private where
<<license>>
<<domain SYNTAX Syntax>>
<<domain CTORCALL ConstructorCall>>
+<<domain ELABEXPR ElaboratedExpression>>
@
\end{document}