fuzzy_dl_owl2.fuzzydl.concept.concrete.fuzzy_concrete_concept

An abstract base class defines the structure and behavior for fuzzy concepts operating within specific numerical intervals.

Description

Fuzzy logic concepts often rely on numerical ranges to determine partial truth values, and this class provides the foundational framework for such interval-based definitions. By enforcing a specific structure where a lower bound cannot exceed an upper bound, the implementation ensures that the mathematical domain remains valid for subsequent calculations. Subclasses are expected to provide the specific algorithm for determining membership degrees, allowing for various shapes of fuzzy sets, such as triangular or trapezoidal functions, to be built upon this consistent interval management. The class also integrates with the broader ontology system by identifying itself as a concrete type and handling standard operations like name retrieval and role management, although it does not support complex concept replacement or decomposition into atomic parts.

Classes

FuzzyConcreteConcept

This abstract base class represents a fuzzy concept defined over a specific numerical interval, characterized by a lower bound and an upper bound. It serves as a template for evaluating the degree of membership a specific numerical value has within the concept, requiring subclasses to implement the specific logic for this calculation. The class manages the interval parameters through properties, ensuring structural integrity by raising a ValueError if the upper bound is set lower than the lower bound. As a concrete concept type, it operates directly on numerical data rather than abstract relationships, providing a mechanism to quantify partial truth or satisfaction within a defined range.

Module Contents

UML Class Diagram for FuzzyConcreteConcept

UML Class Diagram for FuzzyConcreteConcept

class FuzzyConcreteConcept(name: str)

Bases: fuzzy_dl_owl2.fuzzydl.concept.concept.Concept, abc.ABC

This abstract base class represents a fuzzy concept defined over a specific numerical interval, characterized by a lower bound and an upper bound. It serves as a template for evaluating the degree of membership a specific numerical value has within the concept, requiring subclasses to implement the specific logic for this calculation. The class manages the interval parameters through properties, ensuring structural integrity by raising a ValueError if the upper bound is set lower than the lower bound. As a concrete concept type, it operates directly on numerical data rather than abstract relationships, providing a mechanism to quantify partial truth or satisfaction within a defined range.

Parameters:
  • name (str) – Identifier for the concept used for labeling and debugging.

  • _k1 (float) – The lower bound of the interval for which the concept is defined.

  • _k2 (float) – Upper bound of the interval defining the concept’s domain, used to calculate membership degrees.

Raises:

ValueError – Raised when the lower bound k1 is greater than the upper bound k2, which would define an invalid interval for the concept.

compute_atomic_concepts() set[Self]

Returns an empty set representing the atomic concepts associated with this instance. Because this is a concrete concept, it does not decompose into or reference other atomic concepts of the same type. The method performs no computation beyond returning the empty set and has no side effects.

Returns:

A set of atomic concepts represented as instances of the class.

Return type:

set[Self]

compute_name() str

Retrieves the name associated with the FuzzyConcreteConcept instance by returning the value of the name attribute. This method acts as a simple accessor and does not perform any computation or modification of the underlying data. It assumes that the name attribute is already set; otherwise, an AttributeError will be raised.

Returns:

The name associated with the object instance.

Return type:

str

abstractmethod get_membership_degree(value: float) float

Calculates the degree to which a specific numerical value belongs to this fuzzy concept, representing the core evaluation logic of fuzzy set theory. The method accepts a floating-point number and returns a membership coefficient, typically constrained to the range [0.0, 1.0], where 0.0 signifies complete exclusion and 1.0 signifies full inclusion. As an abstract method, it requires implementation by subclasses to define the specific shape and parameters of the membership function, such as triangular, trapezoidal, or Gaussian distributions. This operation is expected to be stateless with respect to the input value, meaning repeated calls with the same argument should yield the same result unless the concept’s internal parameters change.

Parameters:

value (float) – The input value for which to calculate the degree of membership.

Returns:

A float representing the degree of membership of the input value, typically ranging from 0.0 (no membership) to 1.0 (full membership).

Return type:

float

get_roles() set[str]

Retrieves the set of roles associated with this fuzzy concrete concept. This implementation returns an empty set, indicating that no roles are defined or applicable to this specific entity. The method has no side effects and returns a new set instance on every call.

Returns:

A set of strings representing the roles associated with the object.

Return type:

set[str]

is_concrete() bool

Determines whether the concept is considered concrete, returning True unconditionally for all instances of this class. This method serves as a definitive marker to distinguish FuzzyConcreteConcept objects from abstract or non-concrete counterparts within the conceptual hierarchy. As the implementation is constant, there are no side effects or edge cases dependent on the object’s state.

Returns:

True if the class is concrete, False otherwise.

Return type:

bool

replace(
concept1: fuzzy_dl_owl2.fuzzydl.concept.concept.Concept,
concept2: fuzzy_dl_owl2.fuzzydl.concept.concept.Concept,
) fuzzy_dl_owl2.fuzzydl.concept.concept.Concept

This method is designed to replace concept1 with concept2 within the context of the current concept, but the provided implementation currently acts as a placeholder that signals a failure. When called, it triggers an error message via Util.error and catches the resulting FuzzyOntologyException to allow execution to continue, ultimately returning None without modifying the object’s state. Consequently, this operation does not perform a functional replacement and indicates that the feature is either unimplemented or unsupported for this specific concept type.

Parameters:
  • concept1 (Concept) – The concept to be replaced.

  • concept2 (Concept) – The new concept that will replace the original concept.

Returns:

None

Return type:

Concept

_k1: float = 0.0
_k2: float = 0.0
property k1: float

Returns the lower bound of the numerical interval [k1, k2] over which this concrete concept is defined. The value is held internally as a float and is read without modifying the instance.

Returns:

The lower bound k1 of the definition interval.

Return type:

float

property k2: float

Returns the upper bound of the numerical interval [k1, k2] over which this concrete concept is defined. The value is held internally as a float and is read without modifying the instance.

Returns:

The upper bound k2 of the definition interval.

Return type:

float

name: str