sum [Relation]


Purpose

The sum relation is an aggregation operator that returns the sum of a set of numbers.

Syntax

sum setOfNumbers number

Domain

The setOfNumbers argument is a list of integer and/or real numbers.

Range

The number argument is the sum of setOfNumbers.

Examples

(ask (sum '(3 4 5) 12)) ==> T 
(tellm (:about Box3 (:filled-by contents Item1 Item2)) 
       (weight Item1 30) (weight Item2 40)) 
(retrieve ?x (sum (weight (contents Box3)) ?x)) ==> (70)

See Also

Last modified: Jun 1 1995