This class implements the data structure and methods for fuzzy concepts.

Methods


Method new()

Creator for objects of class Concept

Usage

Concept$new(extent, intent)

Arguments

extent

(Set) The extent of the concept.

intent

(Set) The intent of the concept.

Returns

An object of class Concept.


Method get_extent()

Internal Set for the extent

Usage

Concept$get_extent()

Returns

The Set representation of the extent.


Method get_intent()

Internal Set for the intent

Usage

Concept$get_intent()

Returns

The Set representation of the intent.


Method print()

Prints the concept to console

Usage

Concept$print()

Returns

A string with the elements of the set and their grades between brackets .


Method to_latex()

Write the concept in LaTeX format

Usage

Concept$to_latex(print = TRUE)

Arguments

print

(logical) Print to output?

Returns

The fuzzy concept in LaTeX.


Method clone()

The objects of this class are cloneable with this method.

Usage

Concept$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# Build a formal context and find its concepts
fc_planets <- FormalContext$new(planets)
#> Warning: unable to load shared object '/Library/Frameworks/R.framework/Resources/modules//R_X11.so':
#>   dlopen(/Library/Frameworks/R.framework/Resources/modules//R_X11.so, 0x0006): Library not loaded: '/opt/X11/lib/libSM.6.dylib'
#>   Referenced from: '/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/modules/R_X11.so'
#>   Reason: tried: '/opt/X11/lib/libSM.6.dylib' (no such file), '/Library/Frameworks/R.framework/Resources/lib/libSM.6.dylib' (no such file), '/Users/runner/hostedtoolcache/Java_Temurin-Hotspot_jdk/8.0.392-8/x64/Contents/Home//lib/server/libSM.6.dylib' (no such file)
fc_planets$find_concepts()

# Print the first three concepts
fc_planets$concepts[1:3]
#> A set of 3 concepts:
#> 1: ({Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto}, {})
#> 2: ({Earth, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto}, {moon})
#> 3: ({Jupiter, Saturn, Uranus, Neptune, Pluto}, {far, moon})

# Select the first concept:
C <- fc_planets$concepts$sub(1)

# Get its extent and intent
C$get_extent()
#> {Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto}
C$get_intent()
#> {}