Package COM.INFORMATIMAGO.COMMON-LISP.CESARUM.BRELATION


This package implements a relation abstract data type based on an
array of bset.  It can represent only relations between two positive
and bounded integers.

(Inspired by Modula-2 cocktail-9309/reuse/src/Relations.md).

See also: COM.INFORMATIMAGO.COMMON-LISP.CESARUM.BSET

License:

    AGPL3

    Copyright Pascal J. Bourguignon 2004 - 2015

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.
    If not, see <http://www.gnu.org/licenses/>

ASSIGN

ASSIGN-ELEMENT

ASSIGN-EMPTY

brelation
structure
The Binary Relation Class.

CARDINAL

CLOSURE

COMPLEMENT

DIFFERENCE

EMPTYP

EXCLUDE

EXISTS

EXISTS-1

EXTRACT

FOR-ALL

FOR-ALL-DO

GET-CYCLICS

HAS-REFLEXIVE

INCLUDE

INTERSECTION

IS-CYCLIC

IS-ELEMENT

IS-EQUAL

IS-EQUIVALENCE

IS-NOT-EQUAL

IS-REFLEXIVE

IS-REFLEXIVE-1

IS-RELATED

IS-STRICT-SUBSET

IS-SUBSET

IS-SYMMETRIC

IS-TRANSITIVE

IS-TRANSITIVE-1

(make-brelation size-1 size-2)
function
RETURN: A new BRELATION between sets of sizes SIZE-1 and SIZE-2.

PROJECT-1

PROJECT-2

(read-brelation stream rel)
function
DO:     Read a relation from the STREAM.
POST:   REL is the relation read.
RETURN: REL.
NOTE:   The serialization format is that of a list of adjacency lists.
        ((1 (2 3)) (2 (3)) (4)) = ({1 2 3 4} {(1 2) (1 3) (2 3)})

SELECT

SYM-DIFF

UNION

(write-brelation stream rel)
function
DO:     Write the relation REL to the STREAM.
RETURN: REL.