Namespace conexp.base
Namespace conexp.fca.contexts
Namespace conexp.fca.many-valued-contexts
Namespace conexp.fca.implications
Namespace conexp.fca.exploration
Namespace conexp.fca.lattices
Namespace conexp.fca.more
Namespace conexp.io.latex
Namespace conexp.io.contexts
Namespace conexp.io.lattices
Namespace conexp.io.layouts
Namespace conexp.io.many-valued-contexts
Namespace conexp.layouts
Basic definitions for conexp-clj.
<=>
=>
abs
all-closed-sets
all-closed-sets-in-family
ask
ceil
clojure-coll
clojure-fn
clojure-map
clojure-seq
clojure-set
clojure-type
clojure-vec
compare-order
conexp-version
conexp-version-map
covers?
cross-product
def-
defalias
defmacro-
die-with-error
difference
disjoint-union
distinct-by-key
dopar
ensure-length
ensure-seq
exact-integer-sqrt
exists
expand-bindings
expt
first-non-nil
first-position-if
floor
forall
gcd
generic-equals
graph-of-function?
has-version?
hash-combine-hash
illegal-argument
illegal-state
immigrate
improve-basic-order
index
inits
integer-length
internal-version-string
intersection
intersection-set?
join
lcm
lectic-<
lectic-<_i
map-by-fn
map-invert
memo-fn
minimal-generating-subsets
minimal-hypergraph-transversals
minimum-set-covers
next-closed-set
next-closed-set-in-family
not-yet-implemented
now
order-by
parallel-closures
partial-max
partial-min
prod
project
proper-subset?
proper-superset?
quit
reduce!
redundant?
reflexive-transitive-closure
rename
rename-keys
round
select
set-of
set-of-range
singleton?
sort-by-first
sort-by-second
split-at-first
split-at-last
sqrt
subset?
subsets
sum
superset?
tails
to-set
topological-sort
transitive-closure
transitive-reduction
union
unsupported-operation
warn
when-available
with-altered-vars
with-memoized-fns
with-printed-result
with-str-out
with-testing-data
with-var-bindings
yes-or-no?
zip
<=>
Argument List: ([a b])
Documentation:
Implements equivalence.
=>
Argument List: ([a b])
Documentation:
Implements implication.
abs
Argument List: ([n])
Documentation:
(abs n) is the absolute value of n
all-closed-sets
Argument List: ([base clop] [base clop initial])
Documentation:
Computes all closed sets of a given closure operator on a given set. Uses initial as first closed set if supplied.
all-closed-sets-in-family
Argument List: ([predicate base clop] [predicate base clop initial])
Documentation:
Computes all closed sets of a given closure operator on a given set base contained in the family described by predicate. See documentation of next-closed-set-in-family for more details. Uses initial as first closed set if supplied.
ask
Argument List: ([prompt read & preds-and-fail-messages])
Documentation:
Performs simple quering. prompt is printed first and then the user is asked for an answer (via read). The other arguments are predicates with corresponding error messages. If a given answer does not satisfy some predicate pred, it's associated error message is printed (if it is a string) or it is assumed to be a function of one argument, whereupon it is called with the invalid answer and the result is printed. In any case, the user is asked again, until the given answer fulfills all given predicates.
ceil
Argument List: ([n])
Documentation:
(ceil n) returns the least integer greater than or equal to n. If n is an exact number, ceil returns an integer, otherwise a double.
clojure-type
Argument List: ([thing])
Documentation:
Dispatch function for multimethods.
compare-order
Argument List: ([x y])
Documentation:
Orders things for proper output of formal contexts.
conexp-version
Argument List: ([])
Documentation:
Returns the version of conexp as a string.
covers?
Argument List: ([sets base-set])
Documentation:
Technical Helper. Tests wheterh all elements in base-set are contained at least one set in sets.
cross-product
Argument List: ([& sets])
Documentation:
Returns cross product of set-1 and set-2.
def-
Argument List: ([name & decls])
Documentation:
Same as def, but yields a private definition
defalias
Argument List: ([name orig] [name orig doc])
Documentation:
Defines an alias for a var: a new var with the same root binding (if any) and similar metadata. The metadata of the alias is its initial metadata (as provided by def) merged into the metadata of the original.
defmacro-
Argument List: ([name & decls])
Documentation:
Same as defmacro but yields a private definition
die-with-error
Argument List: ([error strings])
Documentation:
Stops program by raising the given error with strings as message.
difference
Argument List: ([s1] [s1 s2] [s1 s2 & sets])
Documentation:
Return a set that is the first set without elements of the remaining sets
disjoint-union
Argument List: ([& sets])
Documentation:
Computes the disjoint union of sets by joining the cross-products of the sets with natural numbers.
distinct-by-key
Argument List: ([sequence key])
Documentation:
Returns a sequence of all elements of the given sequence with distinct key values, where key is a function from the elements of the given sequence. If two elements correspond to the same key, the one is chosen which appeared earlier in the sequence.
This function is copied from clojure.core/distinct and adapted for using a key function.
dopar
Argument List: ([[k v] & body])
Documentation:
Executes body binding k to each value in v. Execution is done in parallel. Code adapted from http://www.acooke.org/cute/Clojuremac0.html
ensure-length
Argument List: ([string length] [string length padding])
Documentation:
Fills given string with padding to have at least the given length.
ensure-seq
Argument List: ([x])
Documentation:
Given anything that can be made a sequence from, returns that sequence. If given a number x, returns (range x).
exact-integer-sqrt
Argument List: ([n])
Documentation:
(exact-integer-sqrt n) expects a non-negative integer n, and returns [s r] where n = s^2+r and n < (s+1)^2. In other words, it returns the floor of the square root and the 'remainder'. For example, (exact-integer-sqrt 15) is [3 6] because 15 = 3^2+6.
exists
Argument List: ([bindings condition])
Documentation:
Implements logical exists quantor. Bindings is of the form [var-1 seq-1 var-2 seq-2 ...]. Returns boolean value.
expand-bindings
Argument List: ([bindings body])
Documentation:
Expands bindings used by forall and exists.
expt
Argument List: ([a b])
Documentation:
Exponentiation of arguments. Is exact if given arguments are exact and returns double otherwise.
first-non-nil
Argument List: ([seq])
Documentation:
Returns first non-nil element in seq, or nil if there is none.
first-position-if
Argument List: ([predicate sequence])
Documentation:
Return the index of the first element in sequence for which predicate returns true.
floor
Argument List: ([n])
Documentation:
(floor n) returns the greatest integer less than or equal to n. If n is an exact number, floor returns an integer, otherwise a double.
forall
Argument List: ([bindings condition])
Documentation:
Implements logical forall quantor. Bindings is of the form [var-1 seq-1 var-2 seq-2 ...]. Returns boolean value.
gcd
Argument List: ([a b])
Documentation:
(gcd a b) returns the greatest common divisor of a and b
generic-equals
Argument List: ([[this other] class fields])
Documentation:
Implements a generic equals for class on fields.
graph-of-function?
Argument List: ([relation source target])
Documentation:
Returns true iff relation is the graph of a function from source to target.
has-version?
Argument List: ([{my-major :major, my-minor :minor, my-patch :patch}])
Documentation:
Compares given version of conexp and returns true if and only if the current version of conexp is higher or equal than the given one
hash-combine-hash
Argument List: ([& args])
Documentation:
Combines the hashes of all things given.
illegal-argument
Argument List: ([& strings])
Documentation:
Throws IllegalArgumentException with given strings as message.
illegal-state
Argument List: ([& strings])
Documentation:
Throws IllegalStateException with given strings as message.
immigrate
Argument List: ([& ns-names])
Documentation:
Create a public var in this namespace for each public var in the namespaces named by ns-names. The created vars have the same name, root binding, and metadata as the original except that their :ns metadata value is this namespace.
This function is literally copied from the clojure.contrib.ns-utils library.
improve-basic-order
Argument List: ([base clop])
Documentation:
Improves basic order on the sequence base, where the closure operator clop operates on.
index
Argument List: ([xrel ks])
Documentation:
Returns a map of the distinct values of ks in the xrel mapped to a set of the maps in xrel with the corresponding values of ks.
inits
Argument List: ([sqn])
Documentation:
Returns a lazy sequence of the beginnings of sqn.
integer-length
Argument List: ([n])
Documentation:
Length of integer in binary
intersection
Argument List: ([s1] [s1 s2] [s1 s2 & sets])
Documentation:
Return a set that is the intersection of the input sets
intersection-set?
Argument List: ([set sets])
Documentation:
Tests whether set has non-empty intersection with every set in sets.
join
Argument List: ([xrel yrel] [xrel yrel km])
Documentation:
When passed 2 rels, returns the rel corresponding to the natural join. When passed an additional keymap, joins on the corresponding keys.
lcm
Argument List: ([a b])
Documentation:
(lcm a b) returns the least common multiple of a and b
lectic-<
Argument List: ([base A B])
Documentation:
Implements lectic ordering. The basic order is given by the ordering of base which is interpreted as increasing order.
lectic-<_i
Argument List: ([base i A B])
Documentation:
Implements lectic < at position i. The basic order is given by the ordering of base which is interpreted as increasing order.
A and B have to be sets.
map-by-fn
Argument List: ([function keys])
Documentation:
Returns a hash map with the values of keys as keys and their values under function as values.
map-invert
Argument List: ([m])
Documentation:
Returns the map with the vals mapped to the keys.
memo-fn
Argument List: ([name args & body])
Documentation:
Defines memoized, anonymous function.
minimal-generating-subsets
Argument List: ([clop A])
Documentation:
Given a set A and a closure operator clop returns all subsets B of A such that (= (clop A) (clop B)).
minimal-hypergraph-transversals
Argument List: ([vertices edges])
Documentation:
Returns all minimal hypergraph transversals of the hypergraph defined by «edges» on the vertex sets «vertices».
minimum-set-covers
Argument List: ([base-set sets])
Documentation:
For a given set base-set and a collection of sets returns all subcollections of sets such that the union of the contained sets cover base-set and that are minimal with that property.
next-closed-set
Argument List: ([base clop A])
Documentation:
Computes next closed set of the closure operator clop after A with the Next Closure algorithm. The order of elements in base, interpreted as increasing, is taken to be the basic order of the elements.
next-closed-set-in-family
Argument List: ([predicate base clop A])
Documentation:
Computes next closed set as with next-closed-set, which is in the family F of all closed sets satisfing predicate. predicate has to satisfy the condition
A in F and i in base ==> clop(A union {1, ..., i-1}) in F.
not-yet-implemented
Argument List: ([])
Documentation:
Throws UnsupportedOperationException with "Not yet implemented" message.
now
Argument List: ([])
Documentation:
Returns the current time in a human readable format.
order-by
Argument List: ([sequence])
Documentation:
Returns a function on two arguments a and b that returns true if and only if b occurs not after a in the given sequence (ascending order.)
parallel-closures
Argument List: ([base clop])
Documentation:
Returns the set of all closures of the closure operator on the given base set. Computes the closures in parallel, to the extent possible.
partial-max
Argument List: ([<= xs])
Documentation:
For a given partial order <= and given elements returns the maximal among them.
partial-min
Argument List: ([<= xs])
Documentation:
For a given partial order <= and given elements returns the minimal among them.
prod
Argument List: ([index start end & expr])
Documentation:
Computes the product of expr for indices from start to end, named as index.
project
Argument List: ([xrel ks])
Documentation:
Returns a rel of the elements of xrel with only the keys in ks
proper-subset?
Argument List: ([set-1 set-2])
Documentation:
Returns true iff set-1 is a proper subset of set-2.
proper-superset?
Argument List: ([set-1 set-2])
Documentation:
Returns true iff set-1 is a proper superset of set-2.
quit
Argument List: ([])
Documentation:
Quits conexp-clj.
reduce!
Argument List: ([fn initial-value coll])
Documentation:
Does the same as reduce, but calls transient on the initial value and persistent! on the result.
redundant?
Argument List: ([base-set cover count])
Documentation:
Technical Helper. For a given set base-set, a collection cover of sets and a map mapping elements from base-set to the number of times they occur in sets in cover, tests whether the cover is redundant or not, i.e. if a proper subcollection of cover is already a cover or not.
reflexive-transitive-closure
Argument List: ([base-set pairs])
Documentation:
Computes the reflexive, transitive closure of a given set of pairs on base-set.
rename
Argument List: ([xrel kmap])
Documentation:
Returns a rel of the maps in xrel with the keys in kmap renamed to the vals in kmap
rename-keys
Argument List: ([map kmap])
Documentation:
Returns the map with the keys in kmap renamed to the vals in kmap
round
Argument List: ([n])
Documentation:
(round n) rounds to the nearest integer. round always returns an integer. Rounds up for values exactly in between two integers.
select
Argument List: ([pred xset])
Documentation:
Returns a set of the elements for which pred is true
set-of
Argument List: ([thing & condition])
Documentation:
Macro for writing sets as mathematicians do (at least similar to it.) The following syntax constructions are supported:
(set-of x [x [1 2 3]]) for the set of all x with x in [1 2 3] (set-of x | x [1 2 3]) for the same set (set-of [x y] [x [1 2 3], y [4 5 6] :when (= 1 (gcd x y))]) for the set of all pairs [x y] with x in [1 2 3], y in [4 5 6] and x and y are coprime.
In general, the condition vector (or the sequence after |) must be suitable for doseq.
set-of-range
Argument List: ([end] [start end] [start end step])
Documentation:
Returns a set of all numbers from start upto (but not including) end, by step if provided.
singleton?
Argument List: ([x])
Documentation:
Returns true iff given thing is a singleton sequence or set.
sort-by-first
Argument List: ([x y])
Documentation:
Ensures that pairs are ordered by first entry first.
sort-by-second
Argument List: ([x y])
Documentation:
Ensures that pairs are ordered by second entry first. This gives better output for context sums, products, ...
split-at-first
Argument List: ([predicate sequence])
Documentation:
Splits given sequence at first element satisfing predicate. The first element satisfing predicate will be in the second sequence.
split-at-last
Argument List: ([predicate sequence])
Documentation:
Splits given sequence at last element satisfing predicate. The last element satisfing predicate will be in the first sequence.
sqrt
Argument List: ([n])
Documentation:
Square root, but returns exact number if possible.
subset?
Argument List: ([set1 set2])
Documentation:
Is set1 a subset of set2?
subsets
Argument List: ([base-set])
Documentation:
Returns all subsets of the given base-set.
sum
Argument List: ([index start end & expr])
Documentation:
Computes the sum of expr for indices from start to end, named as index.
superset?
Argument List: ([set1 set2])
Documentation:
Is set1 a superset of set2?
tails
Argument List: ([sqn])
Documentation:
Returns a lazy sequence of the tails of sqn.
to-set
Argument List: ([thing])
Documentation:
Converts given argument «thing» to a set. If it is a number, returns the set {0, ..., thing-1}. If it is a collection, returns (set thing). Otherwise raises an error.
topological-sort
Argument List: ([comp coll])
Documentation:
Returns a linear extension of the given collection coll and the supplied comparator comp.
transitive-closure
Argument List: ([pairs])
Documentation:
Computes transitive closure of a given set of pairs.
transitive-reduction
Argument List: ([pairs] [base pred])
Documentation:
Returns for a set of pairs its transitive reduction. Alternatively, the relation can be given as a base set and a predicate p which returns true in (p x y) iff [x y] is in the relation in question.
Note that if the relation given is not acyclic, the transitive closure of the reduction may not yield the transitive closure of the original relation anymore, since the reduction itself can be empty.
union
Argument List: ([] [s1] [s1 s2] [s1 s2 & sets])
Documentation:
Return a set that is the union of the input sets
unsupported-operation
Argument List: ([& strings])
Documentation:
Throws UnsupportedOperationException with given strings as message.
warn
Argument List: ([message])
Documentation:
Emits a warning message on out.
with-altered-vars
Argument List: ([bindings & body])
Documentation:
Executes the code given in a dynamic environment where the var roots of the given names are altered according to the given bindings. The bindings have the form [name_1 f_1 name_2 f_2 ...] where f_i is applied to the original value of the var associated with name_i to give the new value which will be in place during execution of body. The old value will be restored after execution has been finished.
with-memoized-fns
Argument List: ([functions & body])
Documentation:
Runs code in body with all given functions memoized.
with-printed-result
Argument List: ([string & body])
Documentation:
Prints string followed by result, returning it.
with-str-out
Argument List: ([& body])
Documentation:
Returns string of all output being made in (flatten body).
with-testing-data
Argument List: ([bindings & body])
Documentation:
Expects for all bindings the body to be evaluated to true. bindings must be those of doseq.
with-var-bindings
Argument List: ([bindings & body])
Documentation:
Executes body with the vars in bindings set to the corresponding values.
yes-or-no?
Argument List: ([question])
Documentation:
Asks string, expecting 'yes' or 'no'. Returns true when answered 'yes' and false otherwise.
zip
Argument List: ([seq-1 seq-2])
Documentation:
Returns sequence of pairs [x,y] where x runs through seq-1 and y runs through seq-2 simultaneously. This is the same as (map #(vector %1 %2) seq-1 seq-2).
Provides the implementation of formal contexts and functions on them.
->Formal-Context
adiag-context
adprime
aprime
attribute-clarified?
attribute-concept
attribute-derivation
attribute-reduced?
attributes
cbo-test
clarify-attributes
clarify-context
clarify-objects
compatible-subcontext?
compatible-subcontexts
concept?
concepts
context-apposition
context-attribute-closure
context-clarified?
context-composition
context-disjoint-union
context-intersection
context-object-closure
context-product
context-reduced?
context-semiproduct
context-size
context-subposition
context-sum
context-to-string
context-transitive-closure
context-union
context-xia-product
context?
diag-context
direct-lower-concepts
direct-upper-concepts
down-arrows
dual-context
extent?
extents
incidence
incidence-relation
incident?
intent?
intents
invert-context
make-context
make-context-from-matrix
make-context-nc
null-context
object-clarified?
object-concept
object-derivation
object-reduced?
objects
odprime
one-context
oprime
print-context
rand-context
random-context
random-contexts
reduce-attributes
reduce-context
reduce-objects
rename-attributes
rename-objects
restrict-concept
subconcept?
subconceptneq?
subcontext?
up-arrows
up-down-arrows
->Formal-Context
Argument List: ([objects attributes incidence])
Documentation:
Positional factory function for class conexp.fca.contexts.Formal-Context.
adiag-context
Argument List: ([base-set])
Documentation:
Returns not= on base-set as context.
adprime
Argument List: ([ctx set-of-attributes])
Documentation:
Computes double prime in context ctx for the given set-of-attributes.
aprime
Argument List: ([ctx attributes])
Documentation:
Computes set of objects common to all attributes in context.
attribute-clarified?
Argument List: ([ctx])
Documentation:
Tests whether given context ctx is attribute clarified.
attribute-concept
Argument List: ([ctx m])
Documentation:
Returns the attribute concept of the given attribute m in context ctx.
attribute-derivation
Argument List: ([ctx attributes])
Documentation:
Computes set of objects common to all attributes in context.
attribute-reduced?
Argument List: ([ctx])
Documentation:
Tests whether given context ctx is attribute-reduced or not.
attributes
Argument List: ([ctx])
Documentation:
Returns the attributes of a context.
cbo-test
Argument List: ([attribute j B D])
Documentation:
Simple implementation of the test used by the «Close by One» algorithm.
clarify-attributes
Argument List: ([ctx])
Documentation:
Clarifies attributes in context ctx.
clarify-context
Argument List: ([ctx])
Documentation:
Clarifies context ctx.
clarify-objects
Argument List: ([ctx])
Documentation:
Clarifies objects in context ctx.
compatible-subcontext?
Argument List: ([ctx-1 ctx-2])
Documentation:
Tests whether ctx-1 is a compatible subcontext of ctx-2.
compatible-subcontexts
Argument List: ([ctx])
Documentation:
Returns all compatible subcontexts of ctx. ctx has to be reduced.
concept?
Argument List: ([ctx [set-of-obj set-of-att]])
Documentation:
Tests whether given pair is a concept in context ctx.
concepts
Argument List: ([ctx])
Documentation:
Returns a sequence of all concepts of ctx.
context-apposition
Argument List: ([ctx-1 ctx-2])
Documentation:
Returns context apposition of ctx-1 and ctx-2, that is
(G_1,M_1,I_1) | (G_1,M_2,I_2) := (G_1,M_1 dunion M_2,I_1 dunion I_2).
context-attribute-closure
Argument List: ([ctx set-of-attributes])
Documentation:
Computes double prime in context ctx for the given set-of-attributes.
context-clarified?
Argument List: ([ctx])
Documentation:
Tests whether given context ctx is clarified.
context-composition
Argument List: ([ctx-1 ctx-2])
Documentation:
Returns context composition of ctx-1 and ctx-2, that is
(G_1,M_1,I_1) o (G_2,M_2,I_2) := (G_1,M_2,I_1 o I_2).
context-disjoint-union
Argument List: ([ctx-1 ctx-2])
Documentation:
Returns the disjoint union of ctx-1 and ctx-2.
context-intersection
Argument List: ([ctx1 ctx2])
Documentation:
Returns context intersection of ctx1 and ctx2.
context-object-closure
Argument List: ([ctx set-of-objects])
Documentation:
Computes double prime in context ctx for the given set-of-objects.
context-product
Argument List: ([ctx-1 ctx-2])
Documentation:
Computes the context product of ctx-1 and ctx-2, that is
(G_1,M_1,I_1) x (G_2,M_2,I_2) := (G_1 x G_2, M_1 x M_2, nabla)
where
(g_1,g_2) nabla (m_1,m_2) <=> g_1I_1m_1 or g_2I_2m_2.
context-reduced?
Argument List: ([ctx])
Documentation:
Tests whether given context ctx is reduced or not.
context-semiproduct
Argument List: ([ctx-1 ctx-2])
Documentation:
Computes the context semiproduct of ctx-1 and ctx-2, where for contexts (G_1,M_1,I_1) and (G_2,M_2,I_2) their semidirect product is defined as
(G_1 x G_2, M_1 dunion M_2, nabla)
where
(g_1,g_2) nabla (j,m) <=> g_jI_jm for j in {1,2}.
context-size
Argument List: ([ctx])
Documentation:
Returns tuple of number of objects, number of attributes, and fill rate.
context-subposition
Argument List: ([ctx-1 ctx-2])
Documentation:
Returns context subposition of ctx-1 and ctx-2, that is
(G_1,M_1,I_1) --------------- := (G_1 dunion G_2, M_1, I_1 union I_2). (G_2,M_1,I_2)
context-sum
Argument List: ([ctx-1 ctx-2])
Documentation:
Computes the context sum of ctx-1 and ctx-2, that is
(G_1,M_1,I_1) + (G_2,M_2,I_2) := (G_1 dunion G_2, M_1 dunion M_2, I_1 dunion I_2 dunion (G_1 x M_2) dunion (G_2 x M_1))
where all set unions are disjoint set unions.
context-to-string
Argument List: ([ctx] [ctx order-on-objects order-on-attributes])
Documentation:
Prints contexts in a human readable form. Orderings can be given as sequences or as functions. If given as sequence, the corresponding elements will be ordered that way, with all remaining elements at the end. If given as function, sort the corresponding elements with that function. If no ordering is given for objects and attributes, sort-by-second is used.
context-transitive-closure
Argument List: ([ctx])
Documentation:
Transitively closes incidence relation of ctx and returns corresponding context.
context-union
Argument List: ([ctx-1 ctx-2])
Documentation:
Returns the union of ctx-1 and ctx-2. Note that this union is inclusive; use context-disjoint-union if this is not what you want.
context-xia-product
Argument List: ([ctx-1 ctx-2])
Documentation:
Computes Xia's product of ctx-1 and ctx-2, where for two contexts (G_1,M_1,I_1) and (G_2,M_2,I_2) their Xia product is defined as
(G_1 x G_2, M_1 x M_2, ~)
where
(g_1,g_2) ~ (m_1,m_2) <=> (g_1I_1m_1 <=> g_2I_2m_2).
context?
Argument List: ([thing])
Documentation:
Returns true iff thing is a formal context.
diag-context
Argument List: ([base-set])
Documentation:
Returns = on base-set as context.
direct-lower-concepts
Argument List: ([ctx [A B]])
Documentation:
Computes the set of direct upper neighbours of the concept [A B] in the concept lattice of ctx. Uses Lindig's Algorithm for that.
direct-upper-concepts
Argument List: ([ctx [A B]])
Documentation:
Computes the set of direct upper neighbours of the concept [A B] in the concept lattice of ctx. Uses Lindig's Algorithm for that.
down-arrows
Argument List: ([ctx])
Documentation:
Computes the down arrow relation of ctx.
dual-context
Argument List: ([ctx])
Documentation:
Dualizes context ctx, that is (G,M,I) gets (M,G,I^{-1}).
extent?
Argument List: ([ctx thing])
Documentation:
Test whether
thing' is an extent of the formal context
ctx.'
extents
Argument List: ([ctx] [ctx pred])
Documentation:
Computes a sequence of all extents of «ctx», in a lectic order. Optionally, one can specify a predicate function «pred» that acts as a filter on all extents of «ctx». «pred» should specify the same conditions as the predicate function to «next-closed-set-in-family».
incidence
Argument List: ([ctx])
Documentation:
Returns a function that, given a pair [a b], returns true if and only if a and b are incident in the context ctx.
incidence-relation
Argument List: ([ctx])
Documentation:
Returns the incidence-relation of the given context, as a set of pairs of objects and attributes.
incident?
Argument List: ([ctx g m])
Documentation:
Returns true if and only if in context ctx, the object g is incident with the attribute m.
intent?
Argument List: ([ctx thing])
Documentation:
Test whether
thing' is an intent of the formal context
ctx.'
intents
Argument List: ([ctx] [ctx pred])
Documentation:
Computes a sequence of all intents of «ctx», in a lectic order. Optionally, one can specify a predicate function «pred» that acts as a filter on all intents of «ctx». «pred» should specify the same conditions as the predicate function to «next-closed-set-in-family».
invert-context
Argument List: ([ctx])
Documentation:
Inverts context ctx, that is (G,M,I) gets (G,M,(G x M) \ I).
make-context
Argument List: ([objects attributes incidence])
Documentation:
Standard constructor for contexts. Takes a sequence of objects, a sequence of attributes and either a set of pairs or function of two arguments being true iff its arguments are incident. Note that the object and attribute sequences are converted to sets and therefore have to not contain any duplicate elements. If the incidence relation is given as a sequence, it is automatically restricted to the cartesian product of the object an the attribute set.
make-context-from-matrix
Argument List: ([G M bits])
Documentation:
Given objects G and attribute M and an incidence matrix constructs the corresponding context. G and M may also be numbers where they represent (range G) and (range M) respectively.
make-context-nc
Argument List: ([objects attributes incidence])
Documentation:
Context constructor similar to make-context, but does not do any safety checking and is therefore faster. Use with care.
This function is useful if you want to construct new contexts from old ones. In particular, if you want to use the incidence relation if a given context as the incidence relation for a new one, you can just pass it to this function without any modifications.
null-context
Argument List: ([base-set])
Documentation:
Returns context with no crosses.
object-clarified?
Argument List: ([ctx])
Documentation:
Tests whether given context ctx is object clarified.
object-concept
Argument List: ([ctx g])
Documentation:
Returns the object concept of the given object g in context ctx.
object-derivation
Argument List: ([ctx objects])
Documentation:
Computes set of attributes common to all objects in context.
object-reduced?
Argument List: ([ctx])
Documentation:
Tests whether given context ctx is object-reduced or not.
objects
Argument List: ([ctx])
Documentation:
Returns the objects of a context.
odprime
Argument List: ([ctx set-of-objects])
Documentation:
Computes double prime in context ctx for the given set-of-objects.
one-context
Argument List: ([base-set])
Documentation:
Returns context full of crosses.
oprime
Argument List: ([ctx objects])
Documentation:
Computes set of attributes common to all objects in context.
print-context
Argument List: ([ctx & args])
Documentation:
Prints the result of applying context-to-string to the given arguments.
rand-context
Argument List: ([base-set fill-rate] [objects attributes fill-rate])
Documentation:
Randomly fills context on base-set (or on objects and attributes) with crosses and propability fill-rate. If given numbers instead of collections uses (range base-set) (and likewise for objects and attributes) instead.
random-context
Argument List: ([base-set fill-rate] [objects attributes fill-rate])
Documentation:
Randomly fills context on base-set (or on objects and attributes) with crosses and propability fill-rate. If given numbers instead of collections uses (range base-set) (and likewise for objects and attributes) instead.
random-contexts
Argument List: ([number upper-limit])
Documentation:
Returns a sequence of number contexts, with random fill rate and random size between 0 and upper-limit.
reduce-attributes
Argument List: ([ctx])
Documentation:
Attribute reduction for ctx.
reduce-context
Argument List: ([ctx])
Documentation:
Reduces context ctx.
reduce-objects
Argument List: ([ctx])
Documentation:
Object reduction for ctx.
rename-attributes
Argument List: ([ctx old-to-new])
Documentation:
Rename attributes in ctx by given function old-to-new.
rename-objects
Argument List: ([ctx old-to-new])
Documentation:
Rename objects in ctx by given function old-to-new.
restrict-concept
Argument List: ([concept subcontext])
Documentation:
Restricts the given concept to the given subcontext.
subconcept?
Argument List: ([a b])
Documentation:
Tests if 'a is a subset of 'b, but not equal.
subconceptneq?
Argument List: ([a b])
Documentation:
Tests if 'a is a subset of 'b, but not equal.
subcontext?
Argument List: ([ctx-1 ctx-2])
Documentation:
Tests whether ctx-1 is a subcontext ctx-2 or not.
up-arrows
Argument List: ([ctx])
Documentation:
Computes the up arrow relation of ctx.
up-down-arrows
Argument List: ([ctx])
Documentation:
Returns up-down-arrow relation of ctx.
Many-Valued-Contexts and some functions for scaling.
->Many-Valued-Context
biordinal-scale
dichotomic-scale
incidences-of-object
interordinal-scale
interval-scale
make-mv-context
make-mv-context-from-matrix
make-mv-context-nc
make-mv-subcontext
mv-context-to-string
nominal-scale
object-by-incidence
ordinal-scale
scale-mv-context
scale-mv-context-with
values-of-attribute
values-of-object
->Many-Valued-Context
Argument List: ([objects attributes incidence])
Documentation:
Positional factory function for class conexp.fca.many_valued_contexts.Many-Valued-Context.
biordinal-scale
Argument List: ([values n] [values others n <= >=])
Documentation:
Returns the biordinal scale on the sequence values, optionally given two order relations <= and >=. Note that values (and others) must be ordered (e.g. vector or list), because otherwise the result will be arbitrary.
dichotomic-scale
Argument List: ([values])
Documentation:
Returns the dichotimic scale on the set values. Note that base must have exactly two arguments.
incidences-of-object
Argument List: ([mv-ctx g])
Documentation:
For a given many-valued context mv-ctx and a given object g, returns the set of all values of g in mv-ctx.
interordinal-scale
Argument List: ([values] [values <= >=] [values others <= >=])
Documentation:
Returns the interordinal scale on the set base, optionally given two order relations <= and >=.
interval-scale
Argument List: ([values] [values others] [values others < >=])
Documentation:
Returns the interval scale on the set values. Note that values must be ordered (e.g. vector or list), because otherwise the result will be arbitrary. Also note that the intervales will be left-open.
make-mv-context
Argument List: ([objects attributes incidence])
Documentation:
Constructs a many-valued context from a set of objects, a set of attributes and an incidence relation, given as set of triples [g m w] or as a function from two arguments g and m to values w.
make-mv-context-from-matrix
Argument List: ([objects attributes values])
Documentation:
Creates a many-valued context from a given matrix of values. objects and attributes may either be given as numbers representing the corresponding number of objects and attributes respectively, or as collections. The number of entries in values must match the number of objects times the number of attributes.
make-mv-context-nc
Argument List: ([objects attributes incidence])
Documentation:
Just creates a many-valued context from a set of objects, a set of attributes and a hashmap from pairs of objects and attributes to values. Does no checking, use with care.
make-mv-subcontext
Argument List: ([mv-ctx objs attrs])
Documentation:
For a given many-valued context, returns the induced subcontext given by the object and attribute set.
mv-context-to-string
Argument List: ([mv-ctx] [mv-ctx order-on-objects order-on-attributes])
Documentation:
Returns a string representing the given many-valued context mv-ctx as a value-table.
nominal-scale
Argument List: ([values] [values others])
Documentation:
Returns the nominal scale on the set base.
object-by-incidence
Argument List: ([mv-ctx values])
Documentation:
For a given many-valued context mv-ctx and an attribute-value map, returns all objects having these values.
ordinal-scale
Argument List: ([values] [values <=] [values others <=])
Documentation:
Returns the ordinal scale on the set values, optionally given an order relation <=.
scale-mv-context
Argument List: ([mv-ctx scales] [mv-ctx scales default])
Documentation:
Scales given many-valued context mv-ctx with given scales. scales must be a map from attributes m to contexts K, where all possible values of m in mv-ctx are among the objects in K. If a scale for an attribute is given, the default scale is used, where default should be a function returning a scale for the supplied attribute. If no default scale is given, an error is thrown if an attribute is missing.
scale-mv-context-with
Argument List: ([ctx & scales])
Documentation:
Scales the given many-valued context ctx with the given scales. These are of the form
[att_1 att_2 ...] scale,
where att_i is an attribute of the given context and scale determines a call to a known scale. The variable «values» will be bound to the corresponding values of each attribute and may be used when constructing the scale. For example, you may use this macro with
(scale-mv-context-with ctx [a b c] (nominal-scale values) [d] (ordinal-scale values <=) (nominal-scale values))
where the last entry (without any associated attribute) is the default scale. Note that attributes of ctx always have to be given in a sequence, even if there is only one.
values-of-attribute
Argument List: ([mv-ctx m])
Documentation:
For a given many-valued context mv-ctx and a given attribute m, returns the set of all values of m in mv-ctx.
values-of-object
Argument List: ([mv-ctx g])
Documentation:
For a given many-valued context mv-ctx and a given object g, returns the set of all values of g in mv-ctx.
Implications for Formal Concept Analysis.
->Implication
add-immediate-elements
approx-canonical-base
association-rules
canonical-base
canonical-base-from-base
canonical-base-from-clop
clop-by-implications
close-under-implications
close-with-downing-gallier
complete-implication-set?
conclusion
confidence
cover
equivalence-oracle-by-implications
equivalent-implications?
follows-semantically?
follows?
frequent-closed-itemsets
frequent-itemsets
holds?
horn1-reduce-implication
horn1-refine-implication
impl
implication-graph
implication?
intersect-implicational-theories
irredundant-subset
learn-implications-by-queries
luxenburger-base
luxenburger-basis
make-implication
membership-oracle-by-implications
minimal-implication-set?
parallel-canonical-base
parallel-canonical-base-from-clop
premise
proper-conclusion
proper-premise-implications
proper-premise?
proper-premises
proper-premises-by-hypertrans
proper-premises-for-attribute
pseudo-clop-by-implications
pseudo-close-under-implications
pseudo-intents
respects?
ryssel-base
sound-implication-set?
stem-base
stem-base-from-base
support
tautology?
->Implication
Argument List: ([premise conclusion])
Documentation:
Positional factory function for class conexp.fca.implications.Implication.
add-immediate-elements
Argument List: ([implications initial-set subset-test])
Documentation:
Iterating through the sequence of implications, tries to apply as many implications as possible. Uses subset-test to determine whether a given implication can be used to extend a given set, i.e. an implication impl can be used to extend a set s if and only if
(subset-test (premise impl) s)
is true. Note that if (conclusion impl) is already a subset of s, then s is effectively not extended.
approx-canonical-base
Argument List: ([ctx ε δ])
Documentation:
Compute a set L of implications that is an approximation to the canonical base of the formal context `ctx'. More precisely, if H is the canonical base of ctx, then
|Mod(L) Δ Mod(H)|/2^{|M|} ≤ ε
with probability at least 1-δ. The computation is done in polynomial time with respect to |M|, |L|, 1/ε, and 1/δ.
association-rules
Argument List: ([context minsupp minconf])
Documentation:
Returns all association rules of context with the parameters minsupp as minimal support and minconf as minimal confidence. The result returned is a lazy sequence.
canonical-base
Argument List: ([ctx] [ctx background-knowledge] [ctx background-knowledge predicate])
Documentation:
Returns the canonical base of given context, as a lazy sequence. Uses «background-knowledge» as starting set of implications, which will not appear in the result. If «predicate» is given (a function), computes only those implications from the canonical base whose premise satisfy this predicate, i.e. «predicate» returns true on these premises. Note that «predicate» has to satisfy the same conditions as the predicate to «next-closed-set-in-family».
canonical-base-from-base
Argument List: ([implications])
Documentation:
For a given set of implications returns its stem-base.
canonical-base-from-clop
Argument List: ([clop base] [clop base background-knowledge] [clop base background-knowledge predicate])
Documentation:
Given a closure operator «clop» on the set «base», computes its canonical base, optionally using the set «background-knowledge» of implications on «base-set» as background knowledge. The result will be a lazy sequence. If «predicate» is given as third argument, computes only those implications whose premise satisfy this predicate. Note that «predicate» has to satisfy the same conditions as the one of «next-closed-set-in-family».
clop-by-implications
Argument List: ([implications])
Documentation:
Returns closure operator given by implications.
close-under-implications
Argument List: ([implications input-set])
Documentation:
Computes smallest superset of set being closed under given implications.
close-with-downing-gallier
Argument List: ([[implications in-premise numargs] input-set])
Documentation:
Downing-Gallier
complete-implication-set?
Argument List: ([ctx impl-set])
Documentation:
Checks wheter given set of implications is complete in context ctx. This is a very costly computation.
conclusion
Argument List: ([thing])
Documentation:
Returns conclusion of given object.
confidence
Argument List: ([implication context])
Documentation:
Computes the confidence of the given implication in the given context.
equivalence-oracle-by-implications
Argument List: ([background-implications])
Documentation:
Return a function that can serve as an equivalence oracle for query learning.
The returned oracle will return true if a given set S of implications is equivalent to background-implications. Otherwise, it will return a counterexample, i.e., model of S that is not a model ov background-implications or vice versa.
equivalent-implications?
Argument List: ([impls-1 impls-2])
Documentation:
Returns true iff the two seqs of implications are equivalent.
follows-semantically?
Argument List: ([implication implications])
Documentation:
Returns true iff implication follows semantically from given implications.
follows?
Argument List: ([implication implications])
Documentation:
Returns true iff implication follows semantically from given implications.
frequent-closed-itemsets
Argument List: ([context minsupp])
Documentation:
Computes for context a lazy sequence of all frequent and closed itemsets, given minsupp as minimal support.
frequent-itemsets
Argument List: ([context minsupp])
Documentation:
Returns all frequent itemsets of context, given minsupp as minimal support.
holds?
Argument List: ([impl ctx])
Documentation:
Returns true iff impl holds in given context ctx.
impl
Argument List: ([& elements])
Documentation:
Convenience interface for creating implications. Write implications just as
user=> (impl 1 2 3 ==> 4 5 6) (#{1 2 3} ==> #{4 5 6})
implication-graph
Argument List: ([implications])
Documentation:
Compute setup for Downing-Gallier
implication?
Argument List: ([thing])
Documentation:
Returns true iff thing is an implication.
intersect-implicational-theories
Argument List: ([base-set & implication-sets])
Documentation:
Given a set «base-set» and collections «implication-sets» of implications, returns the canonical base of the intersection of the corresponding closure theories.
irredundant-subset
Argument List: ([impls])
Documentation:
Given a set impls of implications, returns an irredundant subset of impls. Note that this set does not need to be of minimal cardinality.
learn-implications-by-queries
Argument List: ([base-set member? equivalent?])
Documentation:
Learn an implicational theory on base-set with access to membership oracle
member?' and equivalence oracle
equivalent?'.The membership oracle has to decide for a given set S whether S is a model of the background theory to be learned. The equivalence oracle has to decide whether a given set of implications is equivalent to the background theory. For this it needs to return true if the theories are equivalent, and a counterexample otherwise, i.e., a subset of base-set that is a model of the current hypothesis and not a model of the background theory, or vice versa.
This function implements the HORN1 algorithm of Angluin, Frazier, and Pitt: “Learning Conjunctions of Horn Clauses”, 1992.
luxenburger-base
Argument List: ([context minsupp-or-predicate minconf])
Documentation:
Computes the luxenburger-base of a given context «context», returning the result as a lazy sequence. Uses «minconf» as minimal confidence. If «minsupp-or-predicate» is a number, uses that as a minimal support threshold. In this case, «minsupp» ∈ [0,1] must hold. If «minsupp-or-predicate» is a function, uses this as a predicate to filter all candidate itemsets. In this case, the predicate should be valid predicate value for «intents».
luxenburger-basis
Argument List: ([context minsupp-or-predicate minconf])
Documentation:
Computes the luxenburger-base of a given context «context», returning the result as a lazy sequence. Uses «minconf» as minimal confidence. If «minsupp-or-predicate» is a number, uses that as a minimal support threshold. In this case, «minsupp» ∈ [0,1] must hold. If «minsupp-or-predicate» is a function, uses this as a predicate to filter all candidate itemsets. In this case, the predicate should be valid predicate value for «intents».
make-implication
Argument List: ([premise conclusion])
Documentation:
Creates an implication (premise => conclusion \ premise).
membership-oracle-by-implications
Argument List: ([implications])
Documentation:
Return a function that can serve as a membership oracle for query learning.
The returned oracle will return true if a given set S of elements is a model of implications, and false otherwise.
minimal-implication-set?
Argument List: ([impl-set])
Documentation:
Checks whether given set of implications is minimal, i.e. no implication in this set follows from the others.
parallel-canonical-base
Argument List: ([ctx] [ctx background-knowledge])
Documentation:
Computes the canonical base of the given formal context. Background knowledge can be provided as a set of implications on the attribute set of the given context. Computation is eager and is done in parallel.
parallel-canonical-base-from-clop
Argument List: ([clop base] [clop base background-knowledge])
Documentation:
Computes the canonical base of the given closure operator in parallel. Accepts the same parameters as «canonical-base-from-clop», except for the predicate.
premise
Argument List: ([thing])
Documentation:
Returns premise of given object.
proper-conclusion
Argument List: ([ctx A])
Documentation:
Returns all elements which are implied in context ctx by A but are neither contained in A or follow from a strict subsets of A.
proper-premise-implications
Argument List: ([ctx])
Documentation:
Returns all implications based on the proper premises of the context ctx.
proper-premise?
Argument List: ([ctx A])
Documentation:
Returns true iff set A is a subset of the attributes of context ctx and is a proper premise in ctx.
proper-premises
Argument List: ([ctx])
Documentation:
Returns the proper premises of the given context ctx as a lazy sequence.
proper-premises-by-hypertrans
Argument List: ([ctx m objs])
Documentation:
Returns all proper premises for the attribute «m» in the formal context «ctx». The set «objs» should contain all objects from ctx which are in down-arrow relation to m.
proper-premises-for-attribute
Argument List: ([ctx m])
Documentation:
Returns all proper premises for the attribute «m» in the formal context «ctx».
pseudo-clop-by-implications
Argument List: ([implications])
Documentation:
Returns for a given set of implications the corresponding closure operator whose closures are all closed and pseudo-closed sets.
pseudo-close-under-implications
Argument List: ([implications set])
Documentation:
Computes smallest superset of set being pseudo-closed under given implications.
pseudo-intents
Argument List: ([ctx])
Documentation:
Returns the pseudo intents of the given context ctx.
respects?
Argument List: ([set impl])
Documentation:
Returns true iff set respects given implication impl.
ryssel-base
Argument List: ([ctx])
Documentation:
Returns the implications computed by Ryssels Algorithm, as a lazy sequence.
sound-implication-set?
Argument List: ([ctx impl-set])
Documentation:
Checks whether given set of implications is sound, i.e. every implication holds in the given context.
stem-base
Argument List: ([ctx] [ctx background-knowledge] [ctx background-knowledge predicate])
Documentation:
Returns the canonical base of given context, as a lazy sequence. Uses «background-knowledge» as starting set of implications, which will not appear in the result. If «predicate» is given (a function), computes only those implications from the canonical base whose premise satisfy this predicate, i.e. «predicate» returns true on these premises. Note that «predicate» has to satisfy the same conditions as the predicate to «next-closed-set-in-family».
stem-base-from-base
Argument List: ([implications])
Documentation:
For a given set of implications returns its stem-base.
support
Argument List: ([thing ctx])
Documentation:
Computes the support of the set of attributes B in context ctx. If an implications is given, returns the support of this implication in the given context.
tautology?
Argument List: ([impl])
Documentation:
Returns true iff impl has empty conclusion.
Provides function for exploration and computing proper premises.
abortion-sentinal
counterexample-from-expert
counterexamples-via-repl
default-handler-for-complete-counterexamples
default-handler-for-incomplete-counterexamples
define-repl-fn
eval-command
examples-by-automorphisms
expert-interaction
explore-attributes
explore-attributes-with-complete-counterexamples
explore-attributes-with-incomplete-counterexamples
falsifies-implication?
help-repl-command
incomplete-counterexamples-via-repl
make-handler
print-when-there
run-repl-command
saturate-partial-example
suitable-repl-commands
valid-counterexample?
counterexamples-via-repl
Argument List: ([ctx knowledge impl])
Documentation:
Starts a repl for counterexamples, which must be specified completely.
default-handler-for-complete-counterexamples
Argument List: ([ctx known impl])
Documentation:
Default handler for attribute exploration. Does it's interaction on the console.
default-handler-for-incomplete-counterexamples
Argument List: ([possible-ctx certain-ctx known impl])
Documentation:
Default handler for attribute exploration with incomplete counterexamples. Does it's interaction on the console.
eval-command
Argument List: ([query state])
Documentation:
Runs the given REPL command query with state, in the case the query uniquely determines a command. If not, an error message is printed and state is returned.
examples-by-automorphisms
Argument List: ([ctx [g atts] auts])
Documentation:
Generates for the given context ctx and a given example row [g atts] a sequence of new examples (as rows of the same form) by applying the context automorphism in auts. The context automorphisms are applied to the attributes in atts only, the corresponding object will be a newly generated.
explore-attributes
Argument List: ([& {:keys [possible-context certain-context context background-knowledge handler incomplete-counterexamples]}])
Documentation:
Performs attribute exploration on the given context(s). Returns a hashmap of implications computed and the final context, stored with keys :implications and :context (in the case of complete counterexamples) or :possible-context/:certain-context (in the case of incomplete counterexamples), respectively.
Arguments are passed as keyword arguments like so
(explore-attributes :context ctx-1 :handler my-handler) (explore-attributes :incomplete-counterexamples true :possible-context ctx-1 :certain-context ctx-2 :handler my-other-handler :background-knowledge #{})
Either a value for :context or values for :possible-context and :certain-context must be given, but not both. The second option is only possible if :incomplete-counterexamples is set to «true».
Optional keyword arguments are:
:handler «fn»
Interaction is accomplished via the given handler fn. Depending on whether incomplete counterexamples are allowed or not, this handler is called with different arguments and is supposed to return different things:
if incomplete counterexamples are not allowed, «fn» is called (in this order) with the current working context, the set of known implications and the current implication to be asked to the expert. It is supposed to return either «nil» (in which case the implication is accepted), or a sequence of counterexamples which are supposed to be of the form
[g attributes]
where «g» is the name of a new object and «attributes» is the set of attributes the new object should possess.
if incomplete counterexamples are allowed, «fn» is called with the context of possible incidences, the context of certain incidence, the set of known implications and the current implication to be asked to the expert. It is supposed to return either «nil» (in which case the implication is accepted), or a sequence of counterexamples of the form
[g positive-attributes negative-attributes],
where «g» is a new object, «positive-attributes» is a sequence of attributes the new object has, and «negative-attributes» is a sequence of attributes the new object does not have. Note that «positive-attributes» and «negative-attributes» must be disjoint.
Note that it is the responsibility of the handler to ensure that the counterexample is correct. If this is not the case, the exploration algorithm will just ask the same question in the next iteration again.
It is possible to abort the exploration from within a handler. For this, the handler just has to return :abort. In this case, the current working context as well as the currently known implications are returned as if the exploration would have been finished in that iteration.
:background-knowledge «set of implications»
background-knowledge denotes a set of implications used as background knowledge, which will be subtracted from the computed result.
:incomplete-counterexamples «true or false»
Specifies whether incomplete counterexamples are allowed or not. Default is false. Mandatory to be set to true if context is given via :possible-context and :certain-context.
If you want to use automorphisms of the underlying context, you have to construct a special handler using the «make-handler» function. See the corresponding documentation of «make-handler».
explore-attributes-with-complete-counterexamples
Argument List: ([ctx background-knowledge handler])
Documentation:
Performs attribute exploration with complete background knowledge
explore-attributes-with-incomplete-counterexamples
Argument List: ([possible-ctx certain-ctx background-knowledge handler])
Documentation:
Performs attribute exploration allowing for incomplete counterexamples
falsifies-implication?
Argument List: ([new-atts impl])
Documentation:
Returns true iff set of new attributes does not respect implication impl.
help-repl-command
Argument List:
Documentation:
Returns the help string of the given command.
incomplete-counterexamples-via-repl
Argument List: ([possible-ctx certain-ctx knowledge impl])
Documentation:
Starts a repl for counterexamples, which may be incomplete.
make-handler
Argument List: ([& {:keys [automorphisms incomplete-counterexamples?], :or {automorphisms #{}, incomplete-counterexamples? false}}])
Documentation:
Creates a handler for attribute exploration. Valid keys are
automorphisms: A sequence of automorphisms of the overall context, used to construct more examples from a given one.
Currently, this has only an effect if the counterexamples are complete.
incomplete-counterexamples?: If true, allows for incomplete counterexamples. In contrast to the case of complete counterexamples, the function returned takes four arguments (instead of 3), namely the context of the possible incidence, the context of the certain incidence, the known implications as well as the current implication to be asked to the expert.
run-repl-command
Argument List:
Documentation:
Runs a command for the counterexample REPL.
saturate-partial-example
Argument List: ([impls positives negatives unknown])
Documentation:
Saturates the partial example given by positives, negatives and unknown. Uses the set impls of implications for saturation.
suitable-repl-commands
Argument List: ([query])
Documentation:
Returns all known repl commands for query, which can be a symbol or a string.
valid-counterexample?
Argument List: ([state attributes impl])
Documentation:
Checks the given example for being valid.
Basis datastructure and definitions for abstract lattices.
->Lattice
base-set
concept-lattice
directly-neighboured?
distributive?
dual-lattice
has-lattice-order?
inf
lattice-atoms
lattice-coatoms
lattice-doubly-irreducibles
lattice-inf-irreducibles
lattice-lower-neighbours
lattice-one
lattice-sup-irreducibles
lattice-upper-neighbours
lattice-zero
make-lattice
make-lattice-nc
modular?
order
standard-context
sup
->Lattice
Argument List: ([base-set order-function inf sup])
Documentation:
Positional factory function for class conexp.fca.lattices.Lattice.
base-set
Argument List: ([lattice])
Documentation:
Returns the base set of lattice.
concept-lattice
Argument List: ([ctx])
Documentation:
Returns for a given context ctx its concept lattice.
directly-neighboured?
Argument List: ([lat x y])
Documentation:
Checks whether x is direct lower neighbour of y in lattice lat.
distributive?
Argument List: ([lat])
Documentation:
Checks (primitively) whether given lattice lat is distributive or not.
dual-lattice
Argument List: ([lat])
Documentation:
Dualizes given lattice lat.
has-lattice-order?
Argument List: ([lat])
Documentation:
Given a lattice checks if its order is indeed a lattice order.
inf
Argument List: ([lattice])
Documentation:
Returns a function computing the infimum in lattice.
lattice-atoms
Argument List: ([lat])
Documentation:
Returns the lattice atoms of lat.
lattice-coatoms
Argument List: ([lat])
Documentation:
Returns the lattice coatoms of lat.
lattice-doubly-irreducibles
Argument List: ([lat])
Documentation:
Returns all (i.e. sup and inf) irreducible elements of lattice lat.
lattice-inf-irreducibles
Argument List: ([lat])
Documentation:
Returns the inf-irreducible elements of lattice lat.
lattice-lower-neighbours
Argument List: ([lat y])
Documentation:
Returns all direct lower neighbours of y in lattice lat.
lattice-one
Argument List: ([lat])
Documentation:
Returns the one element of lattice lat.
lattice-sup-irreducibles
Argument List: ([lat])
Documentation:
Returns the sup-irreducible elements of lattice lat.
lattice-upper-neighbours
Argument List: ([lat x])
Documentation:
Returns all direct upper neighbours of x in lattice lat.
lattice-zero
Argument List: ([lat])
Documentation:
Returns the zero element of lattice lat.
make-lattice
Argument List: ([& args])
Documentation:
Standard constructor for makeing lattice. Call with two arguments [base-set order] to construct the lattice by its order relation (given as a set of pairs or as a function of two arguments). Call with three arguments [base-set inf sup] to construct the lattice by its algebraic operations.
Note: This function will test the resulting lattice for being one, which may take some time. If you don't want this, use make-lattice-nc.
make-lattice-nc
Argument List: ([base-set order-function] [base-set inf sup] [base-set order-function inf sup])
Documentation:
Creates a new lattice from the given arguments, without any checks. Use with care.
modular?
Argument List: ([lat])
Documentation:
Checks (primitively) whether given lattice lat is modular or not.
order
Argument List: ([lattice])
Documentation:
Returns a function of one or two arguments representing the order relation. If called with one argument it is assumed that this argument is a pair of elements.
standard-context
Argument List: ([lat])
Documentation:
Returns the standard context of lattice lat.
sup
Argument List: ([lattice])
Documentation:
Returns a function computing the supremum in lattice.
More on FCA.
*fast-computation*
all-bonds
all-bonds-by-shared-intents
all-shared-intents
average-concept-robustness
bond?
concept-probability
concept-robustness
concept-robustness-add-next-entry
concept-robustness-polynomial
concept-stability
context-from-clop
implication-context
jaccard-index
maximal-counterexample
next-shared-intent
smallest-bond
sorensen-coefficient
weighted-concept-similarity
*fast-computation*
Argument List:
Documentation:
Enable computation of concept probability with floating point arithmetic instead of rationals
all-bonds
Argument List: ([ctx-1 ctx-2])
Documentation:
Returns all bonds between ctx-1 and ctx-2.
all-bonds-by-shared-intents
Argument List: ([ctx-1 ctx-2])
Documentation:
All bonds between ctx-1 and ctx-2, computed using shared intents.
all-shared-intents
Argument List: ([ctx-1 ctx-2])
Documentation:
All intents shared between contexts ctx-1 and ctx-2. ctx-1 and ctx-2 must have the same attribute set.
average-concept-robustness
Argument List: ([concepts alpha])
Documentation:
Takes the seq
concepts' consisting of all concepts of a context and computes the average concept robustness with parmater
alpha'.
bond?
Argument List: ([ctx-1 ctx-2 ctx])
Documentation:
Checks whether context ctx is a bond between ctx-1 and ctx-2.
concept-probability
Argument List: ([context concept])
Documentation:
Compute the probability of a
concept' in
context' 𝕂 in the following manner. Let pₘ be the relative frequence of attribute m in context. The probability of a subset B ⊆ M in 𝕂 is the product of all pₘ for m ∈ B. Then the probability of a concept is defined by pr(A,B) := pr(B=B'') which is ∑_{k=0}^n {n choose k}·p_Bᵏ·(1-p_B)ⁿ⁻ᵏ·∏_{m ∈ M ∖ B}(1-p_mᵏ).
concept-robustness
Argument List: ([concept concepts alpha sorted?] [concept concepts alpha])
Documentation:
Computes the robustness of a
concept' in a context with parameter
alpha' by using the seqconcepts' consisting of all concepts of the context. The optional boolean parameter
sorted?' allows to declare the seq of concepts as beeing already sorted by increasing size of the attribute set. This function uses the function concept-robustness-polynomial.
concept-robustness-add-next-entry
Argument List: ([concept cache])
Documentation:
Helper-function for `concept-robustness-polynomial'.
This function computes the value e(Y,
concept'), based on the already computed values e(Z,
concept'), which are given in the second parametercache' in the form [Z, e(Z,
concept')].This function is needed in the algorithm on page 19 in "Finding Robust Itemsets under Subsampling" from Tatti, Moerchen, and Calders.
concept-robustness-polynomial
Argument List: ([concept concepts sorted?] [concept concepts])
Documentation:
Return the coefficients of the robustness polynomial of `concept'.
For the given
concept' of a context, the coefficients of the polynomial p corresponding to the robustness is computed by using the seq
concepts' of all concepts of the context. The optional boolean parameter `sorted?' allows to declare the seq of concepts as being already sorted by increasing attribute-set. Thus if v is the result of (robustness-polynomial concept concepts), then (eval-polynomial v (- 1 alpha)) computes the robustness with parameter alpha.For details see "Finding Robust Itemsets under Subsampling" from Tatti, Moerchen, and Calders, pages 17–19.
concept-stability
Argument List: ([context concept])
Documentation:
Compute the concept stability of
concept' in
context'.
context-from-clop
Argument List: ([base-set clop])
Documentation:
Returns a context whose intents are exactly the closed sets of the given closure operator on the given base-set.
implication-context
Argument List: ([n])
Documentation:
Returns a context for a non-negative number n which has as it's extents the closure systems on the set {0 .. (n-1)} and as it's intents the corresponding implicational theory.
jaccard-index
Argument List: ([x y])
Documentation:
Computes the Jaccard index of two sets. This is |x ∩ y| / |x ∪ y|. Returns 1 if both sets are empty.
maximal-counterexample
Argument List: ([c base-set B C])
Documentation:
For a given closure operator c on a set base-set, maximizes the set C (i.e. returns a superset of C) that is not a superset of B (i.e. there exists an element m in B without C that is also not in the result.
next-shared-intent
Argument List: ([ctx-1 ctx-2 b])
Documentation:
The smallest shared intent of contexts ctx-1 and ctx-2 containing b.
smallest-bond
Argument List: ([ctx-1 ctx-2 rel])
Documentation:
Returns the smallest bond between ctx-1 and ctx-2 that has the elements of rel as crosses.
sorensen-coefficient
Argument List: ([x y])
Documentation:
Computes the Sorensen coefficient of two sets. This is 2 * |x ∩ y| / (|x| + |y|). Returns 1 if both sets are empty.
weighted-concept-similarity
Argument List: ([sim [c1 c2]] [sim [c1 c2] w])
Documentation:
Computes a weighted concept similarity for a given similatity measure
sim', two concepts [
c1'c2'] and an optional weight
w' (default is 1/2).That is the weighted average of the similarity of the extents/object sets (weight
w') and the intents/attribute sets (weight 1-
w').This is from Alqadah, F. & Bhatnagar, R. (2011), 'Similarity measures in formal concept analysis.', Ann. Math. Artif. Intell. 61 (3), 249, https://doi.org/10.1007/s10472-011-9257-7
Provides functionality to represent conexp-clj datastructures as latex code.
latex
Argument List: ([this] [this choice])
Documentation:
Returns a string representation of this.
tex-escape
Argument List: ([string])
Documentation:
Escapes all significant characters used by LaTeX.
add-context-input-format
ctx->xml-vector
define-context-input-format
define-context-output-format
find-context-input-format
find-tag
find-tags
get-default-context-format
get-known-context-input-formats
hash-from-pairs
list-context-formats
list-context-input-formats
list-context-output-formats
read-context
set-default-context-format!
trim
write-context
define-context-input-format
Argument List: ([input-format [file] & body])
Documentation:
Defines input format for contexts.
define-context-output-format
Argument List: ([input-format [thing file] & body])
Documentation:
Defines output format for contexts.
find-context-input-format
Argument List: ([file__7379__auto__] [file__7379__auto__ format__7380__auto__])
Documentation:
Tries to determine the format used in file.
get-default-context-format
Argument List: ([])
Documentation:
Returns default write format for contexts.
list-context-formats
Argument List: ([])
Documentation:
Returns a list of known context IO formats, i.e. formats for which reading and writing is defined.
list-context-input-formats
Argument List: ([])
Documentation:
Returns a list of known context input formats
list-context-output-formats
Argument List: ([])
Documentation:
Returns a list of known context input formats
read-context
Argument List: ([file] [file explicit-format])
Documentation:
Reads context from file, automatically determining the format used.
set-default-context-format!
Argument List: ([format__7380__auto__])
Documentation:
Sets default write format for contexts to format.
write-context
Argument List: ([format context file] [context file])
Documentation:
Writes context to file using format.
add-lattice-input-format
define-lattice-input-format
define-lattice-output-format
find-lattice-input-format
get-default-lattice-format
get-known-lattice-input-formats
list-lattice-formats
list-lattice-input-formats
list-lattice-output-formats
read-lattice
set-default-lattice-format!
write-lattice
define-lattice-input-format
Argument List: ([input-format [file] & body])
Documentation:
Defines input format for lattices.
define-lattice-output-format
Argument List: ([input-format [thing file] & body])
Documentation:
Defines output format for lattices.
find-lattice-input-format
Argument List: ([file__7379__auto__] [file__7379__auto__ format__7380__auto__])
Documentation:
Tries to determine the format used in file.
get-default-lattice-format
Argument List: ([])
Documentation:
Returns default write format for lattices.
list-lattice-formats
Argument List: ([])
Documentation:
Returns a list of known lattice IO formats, i.e. formats for which reading and writing is defined.
list-lattice-input-formats
Argument List: ([])
Documentation:
Returns a list of known lattice input formats
list-lattice-output-formats
Argument List: ([])
Documentation:
Returns a list of known lattice input formats
read-lattice
Argument List: ([file] [file explicit-format])
Documentation:
Reads lattice from file, automatically determining the format used.
set-default-lattice-format!
Argument List: ([format__7380__auto__])
Documentation:
Sets default write format for lattices to format.
write-lattice
Argument List: ([format lattice file] [lattice file])
Documentation:
Writes lattice to file using format.
Implements IO for layouts.
add-layout-input-format
define-layout-input-format
define-layout-output-format
find-layout-input-format
get-arguments
get-default-layout-format
get-known-layout-input-formats
list-layout-formats
list-layout-input-formats
list-layout-output-formats
read-layout
seq-positions
set-default-layout-format!
write-layout
define-layout-input-format
Argument List: ([input-format [file] & body])
Documentation:
Defines input format for layouts.
define-layout-output-format
Argument List: ([input-format [thing file] & body])
Documentation:
Defines output format for layouts.
find-layout-input-format
Argument List: ([file__7379__auto__] [file__7379__auto__ format__7380__auto__])
Documentation:
Tries to determine the format used in file.
get-default-layout-format
Argument List: ([])
Documentation:
Returns default write format for layouts.
list-layout-formats
Argument List: ([])
Documentation:
Returns a list of known layout IO formats, i.e. formats for which reading and writing is defined.
list-layout-input-formats
Argument List: ([])
Documentation:
Returns a list of known layout input formats
list-layout-output-formats
Argument List: ([])
Documentation:
Returns a list of known layout input formats
read-layout
Argument List: ([file] [file explicit-format])
Documentation:
Reads layout from file, automatically determining the format used.
seq-positions
Argument List: ([seq])
Documentation:
Returns a map from elements of seq to their positions.
set-default-layout-format!
Argument List: ([format__7380__auto__])
Documentation:
Sets default write format for layouts to format.
write-layout
Argument List: ([format layout file] [layout file])
Documentation:
Writes layout to file using format.
Implements IO for Many-Valued Contexts.
add-mv-context-input-format
define-mv-context-input-format
define-mv-context-output-format
find-mv-context-input-format
get-default-mv-context-format
get-known-mv-context-input-formats
list-mv-context-formats
list-mv-context-input-formats
list-mv-context-output-formats
read-many-valued-context
read-mv-context
set-default-mv-context-format!
write-many-valued-context
write-mv-context
define-mv-context-input-format
Argument List: ([input-format [file] & body])
Documentation:
Defines input format for mv-contexts.
define-mv-context-output-format
Argument List: ([input-format [thing file] & body])
Documentation:
Defines output format for mv-contexts.
find-mv-context-input-format
Argument List: ([file__7379__auto__] [file__7379__auto__ format__7380__auto__])
Documentation:
Tries to determine the format used in file.
get-default-mv-context-format
Argument List: ([])
Documentation:
Returns default write format for mv-contexts.
list-mv-context-formats
Argument List: ([])
Documentation:
Returns a list of known mv-context IO formats, i.e. formats for which reading and writing is defined.
list-mv-context-input-formats
Argument List: ([])
Documentation:
Returns a list of known mv-context input formats
list-mv-context-output-formats
Argument List: ([])
Documentation:
Returns a list of known mv-context input formats
read-many-valued-context
Argument List: ([file] [file explicit-format])
Documentation:
Reads mv-context from file, automatically determining the format used.
read-mv-context
Argument List: ([file] [file explicit-format])
Documentation:
Reads mv-context from file, automatically determining the format used.
set-default-mv-context-format!
Argument List: ([format__7380__auto__])
Documentation:
Sets default write format for mv-contexts to format.
write-many-valued-context
Argument List: ([format mv-context file] [mv-context file])
Documentation:
Writes mv-context to file using format.
write-mv-context
Argument List: ([format mv-context file] [mv-context file])
Documentation:
Writes mv-context to file using format.
inf-additive-layout
Argument List: ([lattice])
Documentation:
Returns an infimum additive layout for lattice.
standard-layout
Argument List:
Documentation:
Standard layout function. Call on a lattice to get a layout.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close