![]() |
Formalized Common Knowledge |
printable version
The OpenCyc SubL Application Programming Interface
|
Methods for directly manipulating KB datastructures
Also, if it exists but has a null id, install EXTERNAL-ID on the constant. @note If you know the assertion is a gaf, consider using gaf-formula instead, if you do not explicitly need a CNF. If assertion is a meta-assertion, recurse down sub-assertions. By convention, negated gafs do not necessarily mention the term #$not. :backward :forward or :code. :true :false or :unknown. :neg or :pos. SENSE must be either :pos or :neg. SENSE must be either :pos or :neg. TRUTH only gets looked at for ground, single pos lit cnfs in which case TRUTH gives the truth of the gaf.
Methods for querying the structures used to index assertions from constants.
Methods for mapping over the KB datastructures. The WITH- macros also provide relevant mts for most functions in which
the microtheory is an optional argument.
Miscellaneous methods useful for interacting with the KB
Methods that support the EL
function INDEXED-TERM-P : (object)
Returns T iff OBJECT is an indexed CycL term, i.e. a fort or an assertion.
Single value returned satisfies BOOLEANP.
function REMOVE-TERM-INDICES : (term)
Remove all assertions about TERM from the KB. Return the TERM.
Single value returned satisfies INDEXED-TERM-P.
function KEY-EXCEPTION-RULE-INDEX : (rule &optional mt)
Return a list of the keys to the next index level below RULE MT.
Single value returned satisfies LISTP.
function KEY-FUNCTION-RULE-INDEX : (func &optional mt)
Return a list of the keys to the next index level below FUNC MT.
Single value returned satisfies LISTP.
function KEY-GAF-ARG-INDEX : (term &optional argnum pred)
Return a list of the keys to the next index level below TERM ARGNUM PRED.
Single value returned satisfies LISTP.
function KEY-GENL-MT-RULE-INDEX : (col &optional sense mt)
Return a list of the keys to the next index level below COL SENSE MT.
Single value returned satisfies LISTP.
function KEY-GENLS-RULE-INDEX : (col &optional sense mt)
Return a list of the keys to the next index level below COL SENSE MT.
Single value returned satisfies LISTP.
function KEY-ISA-RULE-INDEX : (col &optional sense mt)
Return a list of the keys to the next index level below COL SENSE MT.
Single value returned satisfies LISTP.
function KEY-NART-ARG-INDEX : (term &optional argnum func)
Return a list of the keys to the next index level below TERM ARGNUM FUNC.
Single value returned satisfies LISTP.
function KEY-PREDICATE-EXTENT-INDEX : (pred)
Return a list of the keys to the next predicate-extent index level below PRED.
Single value returned satisfies LISTP.
function KEY-PREDICATE-RULE-INDEX : (pred &optional sense mt)
Return a list of the keys to the next index level below PRED SENSE MT.
Single value returned satisfies LISTP.
function NUM-EXCEPTION-RULE-INDEX : (rule &optional mt direction)
Return the raw assertion count at RULE MT DIRECTION.
Single value returned satisfies INTEGERP.
function NUM-FUNCTION-EXTENT-INDEX : (func)
Return the function extent of FUNC.
Single value returned satisfies INTEGERP.
function NUM-FUNCTION-RULE-INDEX : (func &optional mt direction)
Return the raw assertion count at FUNC MT DIRECTION.
Single value returned satisfies INTEGERP.
function NUM-GAF-ARG-INDEX : (term &optional argnum pred mt)
Return the number of gafs indexed off of TERM ARGNUM PRED MT.
Single value returned satisfies INTEGERP.
function NUM-GENL-MT-RULE-INDEX : (col &optional sense mt direction)
Return the raw assertion count at COL SENSE MT DIRECTION.
Single value returned satisfies INTEGERP.
function NUM-GENLS-RULE-INDEX : (col &optional sense mt direction)
Return the raw assertion count at COL SENSE MT DIRECTION.
Single value returned satisfies INTEGERP.
function NUM-INDEX : (term)
The total number of assertions indexed from TERM.
Single value returned satisfies INTEGERP.
function NUM-ISA-RULE-INDEX : (col &optional sense mt direction)
Return the raw assertion count at COL SENSE MT DIRECTION.
Single value returned satisfies INTEGERP.
function NUM-MT-INDEX : (term)
Return the number of assertions at the mt index for TERM.
Single value returned satisfies INTEGERP.
function NUM-NART-ARG-INDEX : (term &optional argnum func)
Return the number of #$termOfUnit gafs indexed off of TERM ARGNUM FUNC.
Single value returned satisfies INTEGERP.
function NUM-OTHER-INDEX : (term)
Return the number of assertions at the other index for TERM.
Single value returned satisfies INTEGERP.
function NUM-PREDICATE-EXTENT-INDEX : (pred &optional mt)
Return the assertion count at PRED MT.
Single value returned satisfies INTEGERP.
function NUM-PREDICATE-RULE-INDEX : (pred &optional sense mt direction)
Return the raw assertion count at PRED SENSE MT DIRECTION.
Single value returned satisfies INTEGERP.
function RELEVANT-NUM-FUNCTION-EXTENT-INDEX : (func)
Compute the function extent at relevant mts under FUNC.
This will be the entire function extent if #$BaseKB is relevant,
and zero otherwise.
Single value returned satisfies INTEGERP.
function RELEVANT-NUM-GAF-ARG-INDEX : (term &optional argnum pred)
Return the assertion count at relevant mts under TERM ARGNUM PRED.
Single value returned satisfies INTEGERP.
function RELEVANT-NUM-NART-ARG-INDEX : (term &optional argnum func)
Compute the assertion count at relevant mts under TERM ARGNUM FUNC.
This will be the entire count extent if #$BaseKB is relevant,
and zero otherwise.
Single value returned satisfies INTEGERP.
function RELEVANT-NUM-PREDICATE-EXTENT-INDEX : (pred)
Compute the assertion count at relevant mts under PRED.
Single value returned satisfies INTEGERP.2.3 KB Mapping
macro WITH-MT : (mt &body body)
MT and all its genl mts are relevant within BODY.
macro WITH-ALL-MTS : (&body body)
All mts are relevant within BODY.
macro WITH-JUST-MT : (mt &body body)
Only MT is relevant within BODY (no genl mts).
macro WITH-MT-LIST : (mt-list &body body)
Each mt in the list MT-LIST is relevant within BODY (no genl mts).
macro WITH-ANY-MT : (&body body)
Any mt can be used for relevance for a particular inference within &BODY.
macro WITH-GENL-MTS : (mt &body body)
MT and all its genl mts are relevant within BODY.
macro MAP-MTS : ((var) &body body)
Iterate over all microtheories, binding VAR to an mt and executing BODY.
function MAP-TERM : (function term)
Apply FUNCTION to each assertion indexed from TERM.
FUNCTION must satisfy FUNCTION-SPEC-P.
Single value returned satisfies NULL.
function MAP-TERM-SELECTIVE : (function term test &optional truth)
Apply FUNCTION to each assertion indexed from TERM with TRUTH that passes TEST.
If TRUTH is nil, all assertions are mapped.
FUNCTION must satisfy FUNCTION-SPEC-P.
TEST must satisfy FUNCTION-SPEC-P.
Single value returned satisfies NULL.
function MAP-TERM-GAFS : (function term &optional truth)
Apply FUNCTION to every gaf indexed from TERM.
If TRUTH is nil, all assertions are mapped.
FUNCTION must satisfy FUNCTION-SPEC-P.
Single value returned satisfies NULL.
function MAP-MT-CONTENTS : (function term &optional truth gafs-only)
Apply FUNCTION to each assertion with TRUTH in MT TERM.
If TRUTH is nil, all assertions are mapped.
If GAFS-ONLY, then only gafs are mapped.
FUNCTION must satisfy FUNCTION-SPEC-P.
Single value returned satisfies NULL.
function MAP-MT-INDEX : (function mt &optional truth gafs-only)
Apply FUNCTION to each assertion with TRUTH at mt index MT.
If TRUTH is nil, all assertions are mapped.
If GAFS-ONLY, then only gafs are mapped.
FUNCTION must satisfy FUNCTION-SPEC-P.
Single value returned satisfies NULL.
function MAP-OTHER-INDEX : (function term &optional truth gafs-only)
Apply FUNCTION to each assertion with TRUTH at other index TERM.
If TRUTH is nil, all assertions are mapped.
If GAFS-ONLY, then only gafs are mapped.
FUNCTION must satisfy FUNCTION-SPEC-P.
Single value returned satisfies NULL.
function GATHER-INDEX : (term &optional remove-duplicates?)
Return a list of all mt-relevant assertions indexed via TERM.
If REMOVE-DUPLICATES? is non-nil, assertions are guaranteed to only be listed once.
Single value returned is a list of elements satisfying ASSERTION-P.
function GATHER-INDEX-IN-ANY-MT : (term &optional remove-duplicates?)
Return a list of all assertions indexed via TERM.
If REMOVE-DUPLICATES? is non-nil, assertions are guaranteed to only be listed once.
Single value returned is a list of elements satisfying ASSERTION-P.
function GATHER-EXCEPTION-RULE-INDEX : (rule &optional mt direction)
Return a list of all non-gaf assertions (rules) such that:
a) it has a positive literal of the form (abnormal <whatever> RULE)
b) if MT is non-nil, then MT must be its microtheory
c) if DIRECTION is non-nil, then DIRECTION must be its direction.
Single value returned is a list of elements satisfying ASSERTION-P.
function GATHER-FUNCTION-EXTENT-INDEX : (func)
Return a list of all #$termOfUnit assertions such that:
FUNC is the functor of the naut arg2.
Single value returned is a list of elements satisfying ASSERTION-P.
function GATHER-FUNCTION-RULE-INDEX : (func &optional mt direction)
Return a list of all non-gaf assertions (rules) such that:
a) it has a negative literal of the form (termOfUnit <whatever> (FUNC . <whatever>))
b) if MT is non-nil, then MT must be its microtheory
c) if DIRECTION is non-nil, then DIRECTION must be its direction.
Single value returned is a list of elements satisfying ASSERTION-P.
function GATHER-GAF-ARG-INDEX : (term argnum &optional pred mt truth)
Return a list of all gaf assertions such that:
a) TERM is its ARGNUMth argument
b) if TRUTH is non-nil, then TRUTH is its truth value
c) if PRED is non-nil, then PRED must be its predicate
d) if MT is non-nil, then MT must be its microtheory (and PRED must be non-nil).
ARGNUM must satisfy POSITIVE-INTEGER-P.
Single value returned is a list of elements satisfying ASSERTION-P.
function GATHER-GENL-MT-RULE-INDEX : (genl-mt sense &optional rule-mt direction)
Return a list of all non-gaf assertions (rules) such that:
a) if SENSE is :pos, it has a positive literal of the form (genlMt <whatever> GENL-MT)
b) if SENSE is :neg, it has a negative literal of the form (genlMt <whatever> GENL-MT)
c) if RULE-MT is non-nil, then RULE-MT must be its microtheory
d) if DIRECTION is non-nil, then DIRECTION must be its direction.
SENSE must satisfy SENSE-P.
Single value returned is a list of elements satisfying ASSERTION-P.
function GATHER-GENLS-RULE-INDEX : (collection sense &optional mt direction)
Return a list of all non-gaf assertions (rules) such that:
a) if SENSE is :pos, it has a positive literal of the form (genls <whatever> COLLECTION)
b) if SENSE is :neg, it has a negative literal of the form (genls <whatever> COLLECTION)
c) if MT is non-nil, then MT must be its microtheory
d) if DIRECTION is non-nil, then DIRECTION must be its direction.
SENSE must satisfy SENSE-P.
Single value returned is a list of elements satisfying ASSERTION-P.
function GATHER-ISA-RULE-INDEX : (collection sense &optional mt direction)
Return a list of all non-gaf assertions (rules) such that:
a) if SENSE is :pos, it has a positive literal of the form (isa <whatever> COLLECTION)
b) if SENSE is :neg, it has a negative literal of the form (isa <whatever> COLLECTION)
c) if MT is non-nil, then MT must be its microtheory
d) if DIRECTION is non-nil, then DIRECTION must be its direction.
SENSE must satisfy SENSE-P.
Single value returned is a list of elements satisfying ASSERTION-P.
function GATHER-MT-INDEX : (term)
Return a list of all assertions such that TERM is its microtheory.
Single value returned is a list of elements satisfying ASSERTION-P.
function GATHER-NART-ARG-INDEX : (term argnum &optional func)
Return a list of all #$termOfUnit assertions with a naut arg2 such that:
a) TERM is its ARGNUMth argument
b) if FUNC is non-nil, then FUNC must be its functor
ARGNUM must satisfy POSITIVE-INTEGER-P.
Single value returned is a list of elements satisfying ASSERTION-P.
function GATHER-OTHER-INDEX : (term)
Return a list of other assertions mentioning TERM but not indexed in any other more useful manner.
Single value returned is a list of elements satisfying ASSERTION-P.
function GATHER-PREDICATE-EXTENT-INDEX : (pred &optional mt truth)
Return a list of all gaf assertions such that:
a) PRED is its predicate
b) if TRUTH is non-nil, then TRUTH is its truth value
c) if MT is non-nil, then MT must be its microtheory.
Single value returned is a list of elements satisfying ASSERTION-P.
function GATHER-PREDICATE-RULE-INDEX : (pred sense &optional mt direction)
Return a list of all non-gaf assertions (rules) such that:
a) if SENSE is :pos, it has PRED as a predicate in a positive literal
b) if SENSE is :neg, it has PRED as a predicate in a negative literal
c) if MT is non-nil, then MT must be its microtheory
d) if DIRECTION is non-nil, then DIRECTION must be its direction.
SENSE must satisfy SENSE-P.
Single value returned is a list of elements satisfying ASSERTION-P.
function GATHER-TERM-ASSERTIONS : (term &optional mt)
Return a list of all mt-relevant assertions of TERM.
Single value returned is a list of elements satisfying ASSERTION-P.
function FPRED-VALUE : (term pred &optional index-arg gather-arg truth)
Find the first gaf assertion such that:
(a) the assertion is in a relevant microtheory (relevance is established outside)
(b) if TRUTH is non-nil, the assertion has TRUTH as its truth value
(c) PRED is the predicate used.
(d) TERM is the term in the INDEX-ARG position.
Return the term in the GATHER-ARG position if such an assertion exists.
Otherwise, return NIL.
TERM must satisfy INDEXED-TERM-P.
PRED must satisfy FORT-P.
INDEX-ARG must satisfy INTEGERP.
GATHER-ARG must satisfy INTEGERP.
TRUTH must satisfy TRUTH-P.
Single value returned satisfies HL-TERM-P or is NIL.
function FPRED-VALUE-IN-MT : (term pred mt &optional index-arg gather-arg truth)
Find the first gaf assertion such that:
(a) the assertion is in microtheory MT
(b) if TRUTH is non-nil, the assertion has TRUTH as its truth value
(c) PRED is the predicate used.
(d) TERM is the term in the INDEX-ARG position.
Return the term in the GATHER-ARG position if such an assertion exists.
Otherwise, return NIL.
TERM must satisfy INDEXED-TERM-P.
PRED must satisfy FORT-P.
MT must satisfy HLMT-P.
INDEX-ARG must satisfy INTEGERP.
GATHER-ARG must satisfy INTEGERP.
TRUTH must satisfy TRUTH-P.
Single value returned satisfies HL-TERM-P or is NIL.
function FPRED-VALUE-IN-MTS : (term pred mts &optional index-arg gather-arg truth)
Find the first gaf assertion such that:
(a) the assertion is in one of the microtheories in the list MTS
(b) if TRUTH is non-nil, the assertion has TRUTH as its truth value
(c) PRED is the predicate used.
(d) TERM is the term in the INDEX-ARG position.
Return the term in the GATHER-ARG position if such an assertion exists.
Otherwise, return NIL.
TERM must satisfy INDEXED-TERM-P.
PRED must satisfy FORT-P.
MTS must satisfy LISTP.
INDEX-ARG must satisfy INTEGERP.
GATHER-ARG must satisfy INTEGERP.
TRUTH must satisfy TRUTH-P.
Single value returned satisfies HL-TERM-P or is NIL.
function FPRED-VALUE-IN-ANY-MT : (term pred &optional index-arg gather-arg truth)
Find the first gaf assertion such that:
(a) the assertion is allowed to be in any microtheory
(b) if TRUTH is non-nil, the assertion has TRUTH as its truth value
(c) PRED is the predicate used.
(d) TERM is the term in the INDEX-ARG position.
Return the term in the GATHER-ARG position if such an assertion exists.
Otherwise, return NIL.
TERM must satisfy INDEXED-TERM-P.
PRED must satisfy FORT-P.
INDEX-ARG must satisfy INTEGERP.
GATHER-ARG must satisfy INTEGERP.
TRUTH must satisfy TRUTH-P.
Single value returned satisfies HL-TERM-P or is NIL.
function FPRED-VALUE-IN-RELEVANT-MTS : (term pred &optional mt index-arg gather-arg truth)
If MT is NIL, behaves like FPRED-VALUE. Otherwise, behaves like FPRED-VALUE-IN-MT.
TERM must satisfy INDEXED-TERM-P.
PRED must satisfy FORT-P.
INDEX-ARG must satisfy INTEGERP.
GATHER-ARG must satisfy INTEGERP.
TRUTH must satisfy TRUTH-P.
Single value returned satisfies HL-TERM-P or is NIL.
function PRED-VALUES : (term pred &optional index-arg gather-arg truth)
Find all gaf assertions such that:
(a) the assertion is in a relevant microtheory (relevance is established outside)
(b) if TRUTH is non-nil, the assertion has TRUTH as its truth value
(c) PRED is the predicate used.
(d) TERM is the term in the INDEX-ARG position.
Return a list of the terms in the GATHER-ARG position of all such assertions.
TERM must satisfy INDEXED-TERM-P.
PRED must satisfy FORT-P.
INDEX-ARG must satisfy INTEGERP.
GATHER-ARG must satisfy INTEGERP.
TRUTH must satisfy TRUTH-P.
Single value returned is a list of elements satisfying HL-TERM-P.
function PRED-VALUES-IN-MT : (term pred mt &optional index-arg gather-arg truth)
Find all gaf assertions such that:
(a) the assertion is in microtheory MT
(b) if TRUTH is non-nil, the assertion has TRUTH as its truth value
(c) PRED is the predicate used.
(d) TERM is the term in the INDEX-ARG position.
Return a list of the terms in the GATHER-ARG position of all such assertions.
TERM must satisfy INDEXED-TERM-P.
PRED must satisfy FORT-P.
MT must satisfy HLMT-P.
INDEX-ARG must satisfy INTEGERP.
GATHER-ARG must satisfy INTEGERP.
TRUTH must satisfy TRUTH-P.
Single value returned is a list of elements satisfying HL-TERM-P.
function PRED-VALUES-IN-MTS : (term pred mts &optional index-arg gather-arg truth)
Find all gaf assertions such that:
(a) the assertion is in one of the microtheories in the list MTS
(b) if TRUTH is non-nil, the assertion has TRUTH as its truth value
(c) PRED is the predicate used.
(d) TERM is the term in the INDEX-ARG position.
Return a list of the terms in the GATHER-ARG position of all such assertions.
TERM must satisfy INDEXED-TERM-P.
PRED must satisfy FORT-P.
MTS must satisfy LISTP.
INDEX-ARG must satisfy INTEGERP.
GATHER-ARG must satisfy INTEGERP.
TRUTH must satisfy TRUTH-P.
Single value returned is a list of elements satisfying HL-TERM-P.
function PRED-VALUES-IN-ANY-MT : (term pred &optional index-arg gather-arg truth)
Find all gaf assertions such that:
(a) the assertion is allowed to be in any microtheory
(b) if TRUTH is non-nil, the assertion has TRUTH as its truth value
(c) PRED is the predicate used.
(d) TERM is the term in the INDEX-ARG position.
Return a list of the terms in the GATHER-ARG position of all such assertions.
TERM must satisfy INDEXED-TERM-P.
PRED must satisfy FORT-P.
INDEX-ARG must satisfy INTEGERP.
GATHER-ARG must satisfy INTEGERP.
TRUTH must satisfy TRUTH-P.
Single value returned is a list of elements satisfying HL-TERM-P.
function PRED-VALUES-IN-RELEVANT-MTS : (term pred &optional mt index-arg gather-arg truth)
If MT is NIL, behaves like PRED-VALUES. Otherwise, behaves like PRED-VALUES-IN-MT
TERM must satisfy INDEXED-TERM-P.
PRED must satisfy FORT-P.
INDEX-ARG must satisfy INTEGERP.
GATHER-ARG must satisfy INTEGERP.
TRUTH must satisfy TRUTH-P.
Single value returned is a list of elements satisfying HL-TERM-P.
function PRED-REFS : (pred &optional gather-arg truth)
Find all gaf assertions such that:
(a) the assertion is in a relevant microtheory (relevance is established outside)
(b) if TRUTH is non-nil, the assertion has TRUTH as its truth value
(c) PRED is the predicate used.
Return a list of the terms in the GATHER-ARG position of all such assertions.
PRED must satisfy FORT-P.
GATHER-ARG must satisfy INTEGERP.
TRUTH must satisfy TRUTH-P.
Single value returned is a list of elements satisfying HL-TERM-P.
function PRED-REFS-IN-MT : (pred mt &optional gather-arg truth)
Find all gaf assertions such that:
(a) the assertion is in microtheory MT
(b) if TRUTH is non-nil, the assertion has TRUTH as its truth value
(c) PRED is the predicate used.
Return a list of the terms in the GATHER-ARG position of all such assertions.
PRED must satisfy FORT-P.
MT must satisfy HLMT-P.
GATHER-ARG must satisfy INTEGERP.
TRUTH must satisfy TRUTH-P.
Single value returned is a list of elements satisfying HL-TERM-P.
function PRED-REFS-IN-MTS : (pred mts &optional gather-arg truth)
Find all gaf assertions such that:
(a) the assertion is in one of the microtheories in the list MTS
(b) if TRUTH is non-nil, the assertion has TRUTH as its truth value
(c) PRED is the predicate used.
Return a list of the terms in the GATHER-ARG position of all such assertions.
PRED must satisfy FORT-P.
MTS must satisfy LISTP.
GATHER-ARG must satisfy INTEGERP.
TRUTH must satisfy TRUTH-P.
Single value returned is a list of elements satisfying HL-TERM-P.
function PRED-REFS-IN-ANY-MT : (pred &optional gather-arg truth)
Find all gaf assertions such that:
(a) the assertion is allowed to be in any microtheory
(b) if TRUTH is non-nil, the assertion has TRUTH as its truth value
(c) PRED is the predicate used.
Return a list of the terms in the GATHER-ARG position of all such assertions.
PRED must satisfy FORT-P.
GATHER-ARG must satisfy INTEGERP.
TRUTH must satisfy TRUTH-P.
Single value returned is a list of elements satisfying HL-TERM-P.
function PRED-REFS-IN-RELEVANT-MTS : (pred &optional mt gather-arg truth)
If MT is NIL, behaves like PRED-REFS. Otherwise, behaves like PRED-REFS-IN-MT
PRED must satisfy FORT-P.
GATHER-ARG must satisfy INTEGERP.
TRUTH must satisfy TRUTH-P.
Single value returned is a list of elements satisfying HL-TERM-P.
function SOME-PRED-VALUE : (term pred &optional index-arg truth)
Find the first gaf assertion such that:
(a) the assertion is in a relevant microtheory (relevance is established outside)
(b) if TRUTH is non-nil, the assertion has TRUTH as its truth value
(c) PRED is the predicate used.
(d) TERM is the term in the INDEX-ARG position.
Return T if such an assertion exists, otherwise return NIL.
TERM must satisfy INDEXED-TERM-P.
PRED must satisfy FORT-P.
INDEX-ARG must satisfy INTEGERP.
TRUTH must satisfy TRUTH-P.
Single value returned satisfies BOOLEANP.
function SOME-PRED-VALUE-IN-MT : (term pred mt &optional index-arg truth)
Find the first gaf assertion such that:
(a) the assertion is in microtheory MT
(b) if TRUTH is non-nil, the assertion has TRUTH as its truth value
(c) PRED is the predicate used.
(d) TERM is the term in the INDEX-ARG position.
Return T if such an assertion exists, otherwise return NIL.
TERM must satisfy INDEXED-TERM-P.
PRED must satisfy FORT-P.
MT must satisfy HLMT-P.
INDEX-ARG must satisfy INTEGERP.
TRUTH must satisfy TRUTH-P.
Single value returned satisfies BOOLEANP.
function SOME-PRED-VALUE-IN-MTS : (term pred mts &optional index-arg truth)
Find the first gaf assertion such that:
(a) the assertion is in one of the microtheories in the list MTS
(b) if TRUTH is non-nil, the assertion has TRUTH as its truth value
(c) PRED is the predicate used.
(d) TERM is the term in the INDEX-ARG position.
Return T if such an assertion exists, otherwise return NIL.
TERM must satisfy INDEXED-TERM-P.
PRED must satisfy FORT-P.
MTS must satisfy LISTP.
INDEX-ARG must satisfy INTEGERP.
TRUTH must satisfy TRUTH-P.
Single value returned satisfies BOOLEANP.
function SOME-PRED-VALUE-IN-ANY-MT : (term pred &optional index-arg truth)
Find the first gaf assertion such that:
(a) the assertion is allowed to be in any microtheory
(b) if TRUTH is non-nil, the assertion has TRUTH as its truth value
(c) PRED is the predicate used.
(d) TERM is the term in the INDEX-ARG position.
Return T if such an assertion exists, otherwise return NIL.
TERM must satisfy INDEXED-TERM-P.
PRED must satisfy FORT-P.
INDEX-ARG must satisfy INTEGERP.
TRUTH must satisfy TRUTH-P.
Single value returned satisfies BOOLEANP.
function SOME-PRED-VALUE-IN-RELEVANT-MTS : (term pred &optional mt index-arg truth)
If MT is NIL, behaves like SOME-PRED-VALUE. Otherwise, behaves like SOME-PRED-VALUE-IN-MT
TERM must satisfy INDEXED-TERM-P.
PRED must satisfy FORT-P.
INDEX-ARG must satisfy INTEGERP.
TRUTH must satisfy TRUTH-P.
Single value returned satisfies BOOLEANP.
function PRED-U-V-HOLDS : (pred u v &optional u-arg v-arg truth)
Find the first gaf assertion such that:
(a) the assertion is in a relevant microtheory (relevance is established outside)
(b) if TRUTH is non-nil, the assertion has TRUTH as its truth value
(c) PRED is the predicate used.
(d) U is the term in the U-ARG position.
(e) V is the term in the V-ARG position.
Return T if such an assertion exists, otherwise return NIL.
PRED must satisfy FORT-P.
U must satisfy INDEXED-TERM-P.
V must satisfy HL-TERM-P.
U-ARG must satisfy INTEGERP.
V-ARG must satisfy INTEGERP.
TRUTH must satisfy TRUTH-P.
Single value returned satisfies BOOLEANP.
function PRED-U-V-HOLDS-IN-MT : (pred u v mt &optional u-arg v-arg truth)
Find the first gaf assertion such that:
(a) the assertion is in microtheory MT
(b) if TRUTH is non-nil, the assertion has TRUTH as its truth value
(c) PRED is the predicate used.
(d) U is the term in the U-ARG position.
(e) V is the term in the V-ARG position.
Return T if such an assertion exists, otherwise return NIL.
PRED must satisfy FORT-P.
U must satisfy INDEXED-TERM-P.
V must satisfy HL-TERM-P.
MT must satisfy HLMT-P.
U-ARG must satisfy INTEGERP.
V-ARG must satisfy INTEGERP.
TRUTH must satisfy TRUTH-P.
Single value returned satisfies BOOLEANP.
function PRED-U-V-HOLDS-IN-MTS : (pred u v mts &optional u-arg v-arg truth)
Find the first gaf assertion such that:
(a) the assertion is in one of the microtheories in the list MTS
(b) if TRUTH is non-nil, the assertion has TRUTH as its truth value
(c) PRED is the predicate used.
(d) U is the term in the U-ARG position.
(e) V is the term in the V-ARG position.
Return T if such an assertion exists, otherwise return NIL.
PRED must satisfy FORT-P.
U must satisfy INDEXED-TERM-P.
V must satisfy HL-TERM-P.
MTS must satisfy LISTP.
U-ARG must satisfy INTEGERP.
V-ARG must satisfy INTEGERP.
TRUTH must satisfy TRUTH-P.
Single value returned satisfies BOOLEANP.
function PRED-U-V-HOLDS-IN-ANY-MT : (pred u v &optional u-arg v-arg truth)
Find the first gaf assertion such that:
(a) the assertion is allowed to be in any microtheory
(b) if TRUTH is non-nil, the assertion has TRUTH as its truth value
(c) PRED is the predicate used.
(d) U is the term in the U-ARG position.
(e) V is the term in the V-ARG position.
Return T if such an assertion exists, otherwise return NIL.
PRED must satisfy FORT-P.
U must satisfy INDEXED-TERM-P.
V must satisfy HL-TERM-P.
U-ARG must satisfy INTEGERP.
V-ARG must satisfy INTEGERP.
TRUTH must satisfy TRUTH-P.
Single value returned satisfies BOOLEANP.
function PRED-U-V-HOLDS-IN-RELEVANT-MTS : (pred u v &optional mt u-arg v-arg truth)
If MT is NIL, behaves like PRED-U-V-HOLDS. Otherwise, behaves like PRED-U-V-HOLDS-IN-MT
PRED must satisfy FORT-P.
U must satisfy INDEXED-TERM-P.
V must satisfy HL-TERM-P.
U-ARG must satisfy INTEGERP.
V-ARG must satisfy INTEGERP.
TRUTH must satisfy TRUTH-P.
Single value returned satisfies BOOLEANP.
function PRED-VALUE-TUPLES : (term pred index-arg gather-args &optional truth)
Find all gaf assertions such that:
(a) the assertion is in a relevant microtheory (relevance is established outside)
(b) if TRUTH is non-nil, the assertion has TRUTH as its truth value
(c) PRED is the predicate used.
(d) TERM is the term in the INDEX-ARG position.
Return a list of tuples formed from the GATHER-ARGS positions of all such assertions.
TERM must satisfy INDEXED-TERM-P.
PRED must satisfy FORT-P.
INDEX-ARG must satisfy INTEGERP.
GATHER-ARGS must satisfy LISTP.
TRUTH must satisfy TRUTH-P.
Single value returned is a list of elements satisfying LISTP.
function PRED-VALUE-TUPLES-IN-MT : (term pred index-arg gather-args mt &optional truth)
Find all gaf assertions such that:
(a) the assertion is microtheory MT
(b) if TRUTH is non-nil, the assertion has TRUTH as its truth value
(c) PRED is the predicate used.
(d) TERM is the term in the INDEX-ARG position.
Return a list of tuples formed from the GATHER-ARGS positions of all such assertions.
TERM must satisfy INDEXED-TERM-P.
PRED must satisfy FORT-P.
INDEX-ARG must satisfy INTEGERP.
GATHER-ARGS must satisfy LISTP.
MT must satisfy HLMT-P.
TRUTH must satisfy TRUTH-P.
Single value returned is a list of elements satisfying LISTP.
function PRED-VALUE-TUPLES-IN-MTS : (term pred index-arg gather-args mts &optional truth)
Find all gaf assertions such that:
(a) the assertion is in one of the microtheories in the list MTS
(b) if TRUTH is non-nil, the assertion has TRUTH as its truth value
(c) PRED is the predicate used.
(d) TERM is the term in the INDEX-ARG position.
Return a list of tuples formed from the GATHER-ARGS positions of all such assertions.
TERM must satisfy INDEXED-TERM-P.
PRED must satisfy FORT-P.
INDEX-ARG must satisfy INTEGERP.
GATHER-ARGS must satisfy LISTP.
MTS must satisfy LISTP.
TRUTH must satisfy TRUTH-P.
Single value returned is a list of elements satisfying LISTP.
function PRED-VALUE-TUPLES-IN-ANY-MT : (term pred index-arg gather-args &optional truth)
Find all gaf assertions such that:
(a) the assertion is allowed to be from any microtheory
(b) if TRUTH is non-nil, the assertion has TRUTH as its truth value
(c) PRED is the predicate used.
(d) TERM is the term in the INDEX-ARG position.
Return a list of tuples formed from the GATHER-ARGS positions of all such assertions.
TERM must satisfy INDEXED-TERM-P.
PRED must satisfy FORT-P.
INDEX-ARG must satisfy INTEGERP.
GATHER-ARGS must satisfy LISTP.
TRUTH must satisfy TRUTH-P.
Single value returned is a list of elements satisfying LISTP.
function PRED-VALUE-TUPLES-IN-RELEVANT-MTS : (term pred index-arg gather-args &optional mt truth)
If MT is NIL, behaves like PRED-VALUE-TUPLES. Otherwise, behaves like PRED-VALUE-TUPLES-IN-MT
TERM must satisfy INDEXED-TERM-P.
PRED must satisfy FORT-P.
INDEX-ARG must satisfy INTEGERP.
GATHER-ARGS must satisfy LISTP.
TRUTH must satisfy TRUTH-P.
Single value returned is a list of elements satisfying LISTP.2.4 KB Accessors
function REFLEXIVE-PREDICATE? : (predicate &optional mt)
Return T iff PREDICATE is a reflexive predicate.
Single value returned satisfies BOOLEANP.
function IRREFLEXIVE-PREDICATE? : (predicate &optional mt)
Return T iff PREDICATE is an irreflexive predicate.
Single value returned satisfies BOOLEANP.
function SYMMETRIC-PREDICATE? : (predicate &optional mt)
Return T iff PREDICATE is a symmetric predicate.
Single value returned satisfies BOOLEANP.
function ASYMMETRIC-PREDICATE? : (predicate &optional mt)
Return T iff PREDICATE is an asymmetric predicate.
Single value returned satisfies BOOLEANP.
function ANTI-SYMMETRIC-PREDICATE? : (predicate &optional mt)
Return T iff PREDICATE is an anti-symmetric predicate.
Single value returned satisfies BOOLEANP.
function TRANSITIVE-PREDICATE? : (predicate &optional mt)
Return T iff PREDICATE is a transitive predicate.
Single value returned satisfies BOOLEANP.
function RELATION? : (relation &optional mt)
Return T iff RELATION is a relationship.
Single value returned satisfies BOOLEANP.
function COMMUTATIVE-RELATION? : (relation &optional mt)
Return T iff RELATION is a commutative relation.
Single value returned satisfies BOOLEANP.
function COMMUTATIVE-FUNCTION? : (function &optional mt)
Return T iff FUNCTION is a commutative function.
Single value returned satisfies BOOLEANP.
function BINARY-PREDICATE? : (predicate &optional mt)
Return T iff PREDICATE is a predicate of arity 2.
Single value returned satisfies BOOLEANP.
function ARGN-ISA : (relation argnum &optional mt)
Returns a list of the local isa constraints applied to the ARGNUMth argument of
RELATION (#$argsIsa conjoins with #$arg1Isa et al).
ARGNUM must satisfy INTEGERP.
function MIN-ARGN-ISA : (relation n &optional mt)
Returns a list of the most specific local isa-constraints applicable
to argument N of RELATION.
RELATION must satisfy INDEXED-TERM-P.
N must satisfy INTEGERP.
Single value returned is a list of elements satisfying INDEXED-TERM-P.
function ARGN-ISA-OF : (collection argnum &optional mt)
Returns the relations for which COLLECTION is a
local isa constraint applied to argument ARGNUM.
ARGNUM must satisfy INTEGERP.
Single value returned is a list of elements satisfying INDEXED-TERM-P.
function ARGN-GENL : (relation argnum &optional mt)
Returns the local genl constraints applied to the ARGNUMth argument of RELATION.
ARGNUM must satisfy INTEGERP.
Single value returned is a list of elements satisfying INDEXED-TERM-P.
function MIN-ARGN-GENL : (relation n &optional mt)
Return a list of the most specific local genl constraints applicable
to the argument N of RELATION.
N must satisfy INTEGERP.
Single value returned is a list of elements satisfying FORT-P.
function ARGN-GENL-OF : (collection argnum &optional mt)
Returns a list of the predicates for which COLLECTION is a
local genl constraint applied to the Nth argument.
ARGNUM must satisfy INTEGERP.
Single value returned is a list of elements satisfying FORT-P.
function DEFINING-DEFNS : (col &optional mt)
Return a list of the local defining (necessary and sufficient definitions) of collection COL.
Single value returned is a list of elements satisfying FORT-P.
function NECESSARY-DEFNS : (col &optional mt)
Return a list of the local necessary definitions of collection COL.
Single value returned is a list of elements satisfying FORT-P.
function SUFFICIENT-DEFNS : (col &optional mt)
Return a list of the local sufficient definitions of collection COL.
Single value returned is a list of elements satisfying FORT-P.
function ALL-SUFFICIENT-DEFNS : (col &optional mt)
Return a list of all sufficient definitions of collection COL.
Single value returned is a list of elements satisfying FORT-P.
function ARITY : (relation &optional mt)
Return the arity for relation constant RELATION.
function RESULT-ISA : (functor &optional mt)
Return a list of the collections that include as instances
the results of non-predicate function constant FUNCTOR.
Single value returned is a list of elements satisfying FORT-P.
function CREATOR : (fort &optional mt)
Identify the cyclist who created FORT.
FORT must satisfy FORT-P.
MT must satisfy HLMT-P.
Single value returned satisfies FORT-P.
function CREATION-TIME : (fort &optional mt)
Identify when FORT was created.
FORT must satisfy FORT-P.
MT must satisfy HLMT-P.
Single value returned satisfies INTEGERP.
function COMMENT : (fort &optional mt)
Return the comment string for FORT.
FORT must satisfy FORT-P.
Single value returned satisfies STRINGP.
function ASSERTED-BY : (assertion)
Returns the cyclist who asserted ASSERTION.
ASSERTION must satisfy ASSERTION-P.
function ASSERTED-WHEN : (assertion)
Returns the date when ASSERTION was asserted.
ASSERTION must satisfy ASSERTION-P.
Single value returned satisfies INTEGERP.
function REVIEWER : (fort &optional mt)
Identify the cyclist who reviewed FORT.
FORT must satisfy FORT-P.
MT must satisfy HLMT-P.
Single value returned satisfies FORT-P.
function ALL-TERM-ASSERTIONS : (term &optional remove-duplicates?)
Return a list of all the assertions indexed via the indexed term TERM.
TERM must satisfy INDEXED-TERM-P.
Single value returned is a list of elements satisfying ASSERTION-P.
function ISA-RELEVANT-ASSERTIONS : (term &optional mt)
Return a list of all (e.g., inheritance) rules relevant to TERM
by virtue of the collections of which it is an instance.
Single value returned is a list of elements satisfying ASSERTION-P.
function ASSERTIONS-MENTIONING-TERMS : (term-list &optional include-meta-assertions?)
Return a list of assertions that mention every term in TERM-LIST.
Single value returned is a list of elements satisfying ASSERTION-P.
function PRIMITIVE-COLLECTION? : (fort &optional mt)
Return T iff FORT is a collection for which no classical (necessary and sufficient)
definition is known.
Single value returned satisfies BOOLEANP.
function PREDS-FOR-PAIR : (fort-1 fort-2 &optional mt mode)
Return a list of the predicates relevant to relating FORT-1 and FORT-2.
MODE may be :figurative (instances of collections),
:literal (constants), or
:mixed (referents).
FORT-1 must satisfy FORT-P.
FORT-2 must satisfy FORT-P.
Single value returned is a list of elements satisfying FORT-P.
function COLLECTIONS-COEXTENSIONAL? : (col-1 col-2 &optional mt)
Are COL-1 and COL-2 coextensional?
COL-1 must satisfy EL-FORT-P.
COL-2 must satisfy EL-FORT-P.
Single value returned satisfies BOOLEANP.
function COLLECTIONS-DISJOINT? : (col-1 col-2 &optional mt)
Are collections COL-1 and COL-2 disjoint?
(uses only sbhl graphs: their extensions are not searched
nor are their necessary conditions analyzed)
COL-1 must satisfy EL-FORT-P.
COL-2 must satisfy EL-FORT-P.
Single value returned satisfies BOOLEANP.
function COLLECTIONS-INTERSECT? : (col-1 col-2 &optional mt)
Do collections COL-1 and COL-2 intersect?
(uses only sbhl graphs: their extensions are not searched
nor are their sufficient conditions analyzed)
COL-1 must satisfy EL-FORT-P.
COL-2 must satisfy EL-FORT-P.
Single value returned satisfies BOOLEANP.
function COUNT-ALL-INSTANCES : (collection &optional mt tv)
Counts the number of instances in the collection and then returns the count.
COLLECTION must satisfy EL-FORT-P.
Single value returned is a list of elements satisfying FORT-P.2.5 Epistemological-Level Support
function EL-STRENGTH-P : (object)
Return T iff OBJECT is a valid CycL assertion strength
:default or :monotonic.
Single value returned satisfies BOOLEANP.
function EL-TO-HL : (formula &optional mt)
Translate el expression FORMULA into its equivalent canonical hl expressions
FORMULA must satisfy EL-FORMULA-P.
function EL-TO-HL-QUERY : (formula &optional mt)
Translate el query FORMULA into its equivalent hl expressions
FORMULA must satisfy EL-FORMULA-P.
function