Formal concepts are partially ordered with regard to inclusion of their extents or (which is equivalent) inverse inclusion of their intent.
fca :: ConceptLattice :: defaultinit
fca :: ConceptLattice :: from_concepts
Buildself
from a set of formal concepts
.
fca :: ConceptLattice :: is_lower_neighbour
Issub
the greatest lower bound of sup
considering all concepts
?
fca $ ConceptLattice :: SELF
Type of this instance, automatically specialized in every classcore :: Collection :: CONCURRENT
Type of the concurrent variant of this collectionserialization :: Serializable :: accept_json_serializer
Refinable service to customize the serialization of this class to JSONserialization :: Serializable :: accept_msgpack_attribute_counter
Hook to customize the behavior of theAttributeCounter
serialization :: Serializable :: accept_msgpack_serializer
Hook to customize the serialization of this class to MessagePackserialization :: Serializable :: add_to_bundle
Called by[]=
to dynamically choose the appropriate method according
core :: Comparator :: bubble_sort
Bubble-sortarray
between from
and to
indices
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
core :: Collection :: combinations
Allr
-length combinations on self (in same order) without repeated elements.
core :: Collection :: combinations_with_replacement
Allr
-length combination on self (in same order) with repeated elements.
serialization :: Serializable :: core_serialize_to
Actual serialization ofself
to serializer
core :: Object :: defaultinit
core :: Cloneable :: defaultinit
core :: Comparator :: defaultinit
fca :: ConceptLattice :: defaultinit
core :: Collection :: defaultinit
poset :: POSet :: defaultinit
fca :: ConceptLattice :: from_concepts
Buildself
from a set of formal concepts
.
serialization :: Serializable :: from_deserializer
Create an instance of this class from thedeserializer
core :: Collection :: has_all
Does the collection contain at least each element ofother
?
core :: Collection :: has_any
Does the collection contain at least one element ofother
?
poset :: POSet :: has_direct_edge
Is there a direct edge fromf
to t
?
core :: Collection :: has_exactly
Does the collection contain exactly all the elements ofother
?
core :: Comparator :: insertion_sort
Insertion-sortarray
between from
and to
indices
fca :: ConceptLattice :: is_lower_neighbour
Issub
the greatest lower bound of sup
considering all concepts
?
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Comparator :: merge_sort
Merge-sortarray
between from
and to
indices
serialization :: Serializable :: msgpack_extra_array_items
Hook to request a larger than usual metadata arraycore :: Object :: output_class_name
Display class name on stdout (debug only).core :: Collection :: permutations
Allr
-length permutations on self (all possible ordering) without repeated elements.
core :: Collection :: product
Cartesian product, overr
times self
.
core :: Comparator :: quick_sort
Quick-sortarray
between from
and to
indices
poset :: POSet :: select_greatest
Filter elements to return only the greatest onesposet :: POSet :: select_smallest
Filter elements to return only the smallest onesserialization :: Serializable :: serialize_msgpack
Serializeself
to MessagePack bytes
serialization :: Serializable :: serialize_to
Serializeself
to serializer
serialization :: Serializable :: serialize_to_json
Serializeself
to JSON
core :: Collection :: to_concurrent
Wrapsself
in a thread-safe collection
core :: Collection :: to_counter
Create and fill up a counter with the elements of `self.core :: Collection :: to_curlslist
Convert Collection[String] to CURLSListserialization :: Serializable :: to_pretty_json
Serializeself
to plain pretty JSON
core :: Collection :: to_shuffle
Return a new array made of elements in a random order.
# Concept Lattice
#
# Formal concepts are partially ordered with regard to inclusion of their extents
# or (which is equivalent) inverse inclusion of their intent.
class ConceptLattice[O: Object, A: Object]
super POSet[FormalConcept[O, A]]
# Build `self` from a set of formal `concepts`.
init from_concepts(concepts: Set[FormalConcept[O, A]]) do
for c in concepts do
add_node c
end
for c1 in concepts do
for c2 in concepts do
if c1 == c2 then continue
if not is_lower_neighbour(c1, c2, concepts) then continue
add_edge(c2, c1)
end
end
end
# Is `sub` the greatest lower bound of `sup` considering all `concepts`?
fun is_lower_neighbour(sub, sup: FormalConcept[O, A], concepts: Set[FormalConcept[O, A]]): Bool
do
if sub == sup then return false
if not sub.is_subconcept(sup) then return false
for concept in concepts do
if sub == concept then continue
if sup == concept then continue
if not sub.is_subconcept(concept) then continue
if not concept.is_subconcept(sup) then continue
return false
end
return true
end
end
lib/fca/fca.nit:218,1--253,3