fuzzy_dl_owl2.fuzzydl.concept.quasi_sugeno_integral
Defines a specialized fuzzy logic aggregation operator known as the Quasi-Sugeno integral, which combines weighted concepts into a single composite concept.
Description
The implementation extends the base Sugeno integral functionality to handle the specific characteristics of the Quasi-Sugeno variant, ensuring that the number of provided weights matches the number of input concepts to maintain mathematical consistency. By inheriting from the parent Sugeno class, it leverages existing aggregation logic while introducing a distinct type identifier and a custom string serialization format that encapsulates the weights and constituent concepts. Logical operations such as negation, conjunction, and disjunction are supported through delegation to a central operator handler, allowing these composite concepts to participate seamlessly in broader fuzzy logic expressions. Furthermore, the design includes mechanisms for structural manipulation, such as cloning instances to preserve state and recursively replacing specific concepts within the aggregation hierarchy, which facilitates complex reasoning tasks within the fuzzy description logic framework.
Classes
This class encapsulates the logic for a Quasi-Sugeno integral, an aggregation operator that combines a collection of concepts with specific weights. It is initialized with a list of floating-point weights and a list of Concept objects, requiring that both lists have the same length to ensure valid aggregation. The class automatically generates a string representation of the integral in the format (qsugeno (weights...) (concepts...)) and supports standard logical operations such as negation, conjunction, and disjunction. Additionally, it provides functionality for cloning the instance and replacing specific concepts within the integral structure. |
Module Contents
UML Class Diagram for QsugenoIntegral
- class QsugenoIntegral(weights: list[float], concepts: list[fuzzy_dl_owl2.fuzzydl.concept.concept.Concept])
Bases:
fuzzy_dl_owl2.fuzzydl.concept.sugeno_integral.SugenoIntegral
This class encapsulates the logic for a Quasi-Sugeno integral, an aggregation operator that combines a collection of concepts with specific weights. It is initialized with a list of floating-point weights and a list of Concept objects, requiring that both lists have the same length to ensure valid aggregation. The class automatically generates a string representation of the integral in the format (qsugeno (weights…) (concepts…)) and supports standard logical operations such as negation, conjunction, and disjunction. Additionally, it provides functionality for cloning the instance and replacing specific concepts within the integral structure.
- Parameters:
type (Any) – The classification of the concept, identifying it as a Quasi-Sugeno integral.
name (Any) – Automatically generated string representation of the integral in the format (qsugeno (weights) (concepts)).
- __and__(value: Self) Self
Implements the bitwise AND operation (&) for the QsugenoIntegral class, enabling the combination or intersection of the current instance with another instance of the same type. This method delegates the specific logic to the OperatorConcept.and_ static method, ensuring consistent handling of the operation across the module. It returns a new QsugenoIntegral object representing the result, leaving the original operands unmodified. While the method expects a value of the same type, specific edge cases or type compatibility checks are handled by the delegated OperatorConcept implementation.
- Parameters:
value (Self) – The right-hand operand for the AND operation, which must be an instance of the same class.
- Returns:
The result of the AND operation between this instance and the provided value.
- Return type:
Self
- __hash__() int
Return a hash value for this object, computed from its string representation. This approach ensures that the hash value reflects the structural identity of the object without relying on cached values or additional methods. The hash is derived from the output of the __str__ method, which provides a consistent and unique representation of the concept’s structure. This implementation does not utilize any internal caching mechanism and directly computes the hash each time it is called.
- Returns:
An integer hash value representing the structural identity of this object.
- Return type:
int
- __neg__() fuzzy_dl_owl2.fuzzydl.concept.concept.Concept
Returns the logical negation of the current Sugeno integral instance by implementing the unary minus operator behavior. When the - operator is applied to an object of this class, this method delegates the computation to OperatorConcept.not_, passing the instance itself as the argument. The operation produces and returns a new Concept object representing the complement of the original integral, without modifying the state of the current instance.
- Returns:
Returns a new Concept representing the logical negation of this instance.
- Return type:
- __or__(value: Self) Self
Implements the bitwise OR operation (|) for the QsugenoIntegral object, enabling it to be combined with another instance of the same type. This method delegates the actual computation to the OperatorConcept.or_ static method, which applies the specific logical disjunction rules defined for the concept. It returns a new QsugenoIntegral instance representing the result of the operation, ensuring that the original objects remain unmodified.
- Parameters:
value (Self) – The right-hand operand to combine with the current instance using the OR operator.
- Returns:
The result of the OR operation between the current instance and the provided value.
- Return type:
Self
- clone() Self
Creates and returns an independent duplicate of the current instance. This method constructs a new object by creating shallow copies of the internal weights and concepts lists, ensuring that subsequent modifications to the structure of the new object do not affect the original. The returned instance is a separate entity that preserves the state of the source at the moment of the call.
- Returns:
A new instance of the class with copies of the current weights and concepts.
- Return type:
Self
- compute_name() str
Generates a formatted string representation of the Sugeno integral instance based on its current weights and concepts. The returned string follows a specific parenthesized syntax, starting with the ‘qsugeno’ identifier and including space-separated lists of the instance’s weights and concepts. This method provides a canonical name or serialization format for the integral configuration without modifying the object’s state.
- Returns:
A formatted string representing the Sugeno quantifier, including its weights and concepts.
- Return type:
str
- replace( ) fuzzy_dl_owl2.fuzzydl.concept.concept.Concept
Performs a substitution of concept a with concept c within the structure of the integral by recursively applying the replacement operation to all constituent concepts. The method constructs a new QsugenoIntegral instance using the original weights and the modified list of concepts, then returns the negation of this new instance. This operation does not modify the current object in place but rather generates a new conceptual entity reflecting the substitution and sign change.
- Parameters:
- Returns:
A new Concept representing the negation of the Sugeno Integral computed over the original weights and the list of concepts where every instance of a has been replaced by c.
- Return type:
- type