From c0ab2c253aed35314d7cab2d68165268840dcb83 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Mon, 2 Feb 2009 13:16:02 +0000 Subject: * algebra/domain.spad.pamphlet (FunctionDescriptor): New. (OverloadSet): Likewise. (operations$ConstructorCategory): Likewise. * share/algebra: Update databases. --- src/algebra/Makefile.in | 5 ++-- src/algebra/Makefile.pamphlet | 5 ++-- src/algebra/domain.spad.pamphlet | 63 +++++++++++++++++++++++++++++++++++++++- 3 files changed, 68 insertions(+), 5 deletions(-) (limited to 'src/algebra') diff --git a/src/algebra/Makefile.in b/src/algebra/Makefile.in index 3921b396..c6ec6cfb 100644 --- a/src/algebra/Makefile.in +++ b/src/algebra/Makefile.in @@ -557,7 +557,8 @@ axiom_algebra_layer_10 = \ STACK STTAYLOR TABLBUMP TABLEAU \ TOPSP TRANFUN TRANFUN- TUBE \ UDPO UNISEG VIEW VSPACE \ - VSPACE- XPOLYC XPR BTAGG BTAGG- + VSPACE- XPOLYC XPR BTAGG BTAGG- \ + FUNDESC axiom_algebra_layer_10_nrlibs = \ @@ -694,7 +695,7 @@ axiom_algebra_layer_15 = \ FRAMALG FRAMALG- MDAGG ODPOL \ PLOT RMCAT2 ROIRC SDPOL \ SMATCAT SMATCAT- TUBETOOL UPXSCCA \ - UPXSCCA- JAVACODE POLY BYTEBUF + UPXSCCA- JAVACODE POLY BYTEBUF OVERSET axiom_algebra_layer_15_nrlibs = \ $(addsuffix .NRLIB/code.$(FASLEXT),$(axiom_algebra_layer_15)) diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet index 207cee78..84d13dfd 100644 --- a/src/algebra/Makefile.pamphlet +++ b/src/algebra/Makefile.pamphlet @@ -510,7 +510,8 @@ axiom_algebra_layer_10 = \ STACK STTAYLOR TABLBUMP TABLEAU \ TOPSP TRANFUN TRANFUN- TUBE \ UDPO UNISEG VIEW VSPACE \ - VSPACE- XPOLYC XPR BTAGG BTAGG- + VSPACE- XPOLYC XPR BTAGG BTAGG- \ + FUNDESC axiom_algebra_layer_10_nrlibs = \ @@ -825,7 +826,7 @@ axiom_algebra_layer_15 = \ FRAMALG FRAMALG- MDAGG ODPOL \ PLOT RMCAT2 ROIRC SDPOL \ SMATCAT SMATCAT- TUBETOOL UPXSCCA \ - UPXSCCA- JAVACODE POLY BYTEBUF + UPXSCCA- JAVACODE POLY BYTEBUF OVERSET axiom_algebra_layer_15_nrlibs = \ $(addsuffix .NRLIB/code.$(FASLEXT),$(axiom_algebra_layer_15)) diff --git a/src/algebra/domain.spad.pamphlet b/src/algebra/domain.spad.pamphlet index 4d0cb784..47679554 100644 --- a/src/algebra/domain.spad.pamphlet +++ b/src/algebra/domain.spad.pamphlet @@ -34,6 +34,55 @@ ConstructorKind(): Public == Private where package == 'package : % k1 = k2 == EQ(k1,k2)$Lisp coerce(k: %): OutputForm == k : OutputForm + +@ + +<>= +)abbrev domain FUNDESC FunctionDescriptor +++ Author: Gabriel Dos Reis +++ Date Created: February 01, 2009 +++ Date Last Modified: +++ Description: +++ This is the datatype for exported function descriptor. +++ A function descriptor consists of: (1) a signature; +++ (2) a predicate; and (3) a slot into the scope object. +FunctionDescriptor(): Public == Private where + Public == SetCategory with + signature: % -> Signature + ++ \spad{signature(x)} returns the signature of function + ++ described by \spad{x}. + Private == add + signature x == CAR(x)$Lisp + x = y == EQUAL(x,y)$Lisp + coerce x == (x : Syntax)::OutputForm + +@ + + +<>= +)abbrev domain OVERSET OverloadSet +++ Author: Gabriel Dos Reis +++ Date Created: February 01, 2009 +++ Date Last Modified: +++ Description: +++ This domain represents set of overloaded operators (in fact +++ operator descriptors). +OverloadSet(): Public == Private where + Public == SetCategory with + name: % -> Identifier + ++ \spad{name(x)} returns the name of the overload set \spad{x}. + members: % -> List FunctionDescriptor + ++ \spad{members(x)} returns the list of operator descriptors, + ++ e.g. signature and implementation slots, of the + ++ overload set \spad{x}. + Private == add + Rep == Pair(Identifier, List FunctionDescriptor) + name x == first rep x + members x == second rep x + x = y == rep x = rep y + coerce x == + rarrow(name(x)::OutputForm, members(x)::OutputForm) + @ <>= @@ -54,10 +103,16 @@ ConstructorCategory(): Category == OperatorCategory Identifier with ++ l.(i+1) holds when the constructor takes a domain object ++ as the `i'th argument. Otherwise the argument ++ must be a non-domain object. + operations: % -> List OverloadSet + ++ \spad{operations(c)} returns the list of all operator + ++ exported by instantiations of constructor \spad{c}. + ++ The operators are partitioned into overload sets. add kind x == getConstructorKind(x)$Lisp arity x == getConstructorArity(x)$Lisp dualSignature x == getDualSignatureFromDB(x)$Lisp + operations x == getConstructorOperationsFromDB(x)$Lisp + @ @@ -83,6 +138,7 @@ Constructor(): ConstructorCategory with findConstructor s == isConstructorName(s)$Lisp => just per(s pretend Identifier) nothing + @ @@ -120,6 +176,7 @@ ConstructorCall(): Public == Private where coerce(x: %): OutputForm == outputDomainConstructor(x)$Lisp + @ @@ -188,6 +245,7 @@ Signature(): Public == Private where rarrow(printType first source x, printType target x) rarrow(paren [printType s for s in source x], printType target x)$OutputForm + @ \section{A domain for operator signatures} @@ -230,6 +288,7 @@ SystemPredicate(): Public == Private where NOT(x)$Lisp => '_false::OutputForm EQ(x,'T)$Lisp => '_true::OutputForm EQCAR(x,'NOT)$Lisp => not(CADR(x)$Lisp : % :: OutputForm) + @ @@ -330,7 +389,7 @@ Domain(): Public == Private where \section{License} <>= ---Copyright (C) 2007-2008, Gabriel Dos Reis. +--Copyright (C) 2007-2009, Gabriel Dos Reis. --All rights reserved. -- --Redistribution and use in source and binary forms, with or without @@ -367,6 +426,8 @@ Domain(): Public == Private where <> <> +<> +<> <> <> <> -- cgit v1.2.3