fuzzy_dl_owl2.fuzzydl.util.constants
A central configuration module that defines enumerations, type aliases, and global constants for a fuzzy description logic reasoning system.
Description
The software establishes a comprehensive schema of types and configurations required for fuzzy description logic reasoning, utilizing Python enumerations to enforce type safety across the application. It defines specific categories for mixed-integer linear programming solvers, feature data types, and complex logical operators, including various t-norms, t-conorms, and aggregation methods like Choquet and Sugeno integrals. A significant portion of the logic is dedicated to mapping the specific vocabulary of the FuzzyDL language to parsing objects, enabling the interpretation of domain-specific syntax through the pyparsing library. Additionally, the module initializes global environment settings such as result storage directories and numerical limits, ensuring consistent behavior for optimization tasks and file I/O operations throughout the system.
Attributes
Classes
This enumeration defines the specific strategies available for controlling the expansion of individuals within a reasoning process, specifically to ensure termination by preventing infinite model generation. It provides a range of options from disabling blocking entirely to applying various logical constraints—such as subset, set, or double blocking—that determine when a new individual is considered redundant or "blocked" by an existing one. These strategies are crucial for optimizing performance and correctness in automated reasoning tasks involving dynamic creation of entities. |
|
This enumeration categorizes the diverse structural forms that concepts can take within a fuzzy description logic reasoner. It encompasses standard logical constructs such as conjunctions, disjunctions, and existential or universal restrictions, alongside specialized fuzzy logic operators like Goedel and Lukasiewicz t-norms and t-conorms. Furthermore, it defines identifiers for rough set approximations (including tight and loose variants), aggregation methods like OWA and Sugeno integrals, and various weighted or thresholded concepts. By assigning a specific type to a concept, the reasoner can determine the appropriate semantic interpretation and computational algorithm to apply. |
|
This enumeration defines the set of primitive data types applicable to concrete features within the reasoning system. It categorizes features into distinct categories such as text, whole numbers, floating-point values, and binary states, enabling the reasoner to apply logic specific to each data format. Instances of this class provide a standardized way to represent feature types, and their string representation is simplified to the uppercase name of the specific type. |
|
This enumeration defines the specific blocking states applicable to individuals generated during the reasoning process. It categorizes individuals into three distinct statuses: explicitly blocked, permitted for processing, or pending evaluation. When represented as a string, the members return their symbolic names, facilitating clear logging and debugging within the reasoning module. |
|
Defines the specific categories of feature functions utilized by the reasoning engine, distinguishing between base values and arithmetic transformations. The available types include atomic and numeric values, alongside composite operations such as sum, subtraction, and product. This classification allows the system to apply specific logic or constraints depending on the nature of the feature calculation. When converted to a string, the members return their uppercase name rather than their integer value. |
|
This enumeration defines the comprehensive vocabulary of the FuzzyDL language, mapping specific reserved words and symbols to their corresponding parsing constructs. It encompasses a wide variety of language elements, including query commands (such as satisfiability and instance retrieval), concept and role definitions, logical operators (including specific fuzzy logic norms like Gödel and Łukasiewicz), and data type identifiers. Each member stores a pyparsing object—typically a CaselessKeyword or Literal—enabling direct integration into a grammar definition for parsing FuzzyDL syntax. The class supports flexible usage by providing methods to extract the underlying string name or parser token, and it implements custom equality logic to allow comparison against raw strings, parser objects, or other enum instances. |
|
This enumeration defines the specific mathematical frameworks or strategies for fuzzy logic operations supported by the reasoner. It provides options such as Classical, Zadeh, and Lukasiewicz logic, which dictate how truth values are combined and manipulated during inference. By inheriting from StrEnum, instances behave as strings in value while maintaining the type safety and distinct identity of an enumeration, allowing for easy serialization and comparison. |
|
This enumeration defines the standard comparison operators used to express logical relationships or constraints between values. It inherits from StrEnum, allowing its members to function as strings (such as ">") while providing the safety and structure of an enumeration. The class supports three primary operations: greater than, less than, and equal, making it suitable for defining conditions in rule engines, query builders, or mathematical contexts. When converted to a string, the enum yields its symbolic representation, whereas its representation provides the constant name. |
|
This enumeration defines a comprehensive set of inference rules and logical operators applicable within a knowledge base system, specifically catering to fuzzy logic and many-valued reasoning. It encompasses various t-norms and t-conorms (such as Gödel and Łukasiewicz variants for conjunction, disjunction, and implication), quantifiers, and advanced aggregation operators like OWA, Choquet integrals, and Sugeno integrals. Additionally, it includes specific property checks and their negations (e.g., CONCRETE, WEIGHTED) to determine the characteristics of data or rules. Users can reference these members to configure reasoning behavior or validate rule properties, noting that the string representation of each member automatically strips the "RULE_" prefix for readability. |
|
This enumeration defines the specific logic operator strategies available to the reasoning engine, corresponding to standard fuzzy logic systems. It includes variants such as Lukasiewicz, Gödel, Kleene-Dienes, and Zadeh, which determine how logical operations like conjunction and disjunction are evaluated within the system. When converted to a string or represented, the value returns its identifier name rather than its underlying integer code. |
|
This enumeration defines the available Mixed-Integer Linear Programming (MILP) solver backends supported by the reasoning system. It provides specific members for distinct solvers such as GUROBI and MIP, as well as configurations for the PULP library using different underlying engines like GLPK, HiGHS, or CPLEX. As a string-based enum, it facilitates configuration by allowing direct string comparisons, and it includes a static from_str method to safely parse case-insensitive string inputs into the corresponding enum member, raising an error for invalid values. |
|
This enumeration categorizes the specific types of representative individuals employed by the reasoning engine to define logical bounds or constraints. It distinguishes between two distinct options: GREATER_EQUAL, which typically represents a lower bound or minimum cardinality, and LESS_EQUAL, which represents an upper bound or maximum cardinality. By selecting one of these values, the reasoner can determine the specific inequality or approximation strategy to apply when processing a concept. |
|
This enumeration defines the specific categories of constraints that can be applied by the reasoning engine. It distinguishes between three primary modes of restriction: an upper bound limit (AT_MOST_VALUE), a lower bound limit (AT_LEAST_VALUE), and a precise equality requirement (EXACT_VALUE). By utilizing these members, developers can explicitly declare the nature of a restriction, allowing the reasoner to correctly interpret and enforce the intended logic on the associated values. |
|
This enumeration defines the permissible domains for variables, typically within the context of mathematical optimization or modeling. It categorizes variables into distinct types such as binary, continuous, integer, and semi-continuous, each imposing specific constraints on the values the variable can assume. As a string-based enumeration, members can be used directly in string comparisons or serialization, and the class is configured to return the member's name when represented as a string. |
Functions
|
Module Contents
UML Class Diagram for BlockingDynamicType
- class BlockingDynamicType(*args, **kwds)[source]
Bases:
enum.Enum
This enumeration defines the specific strategies available for controlling the expansion of individuals within a reasoning process, specifically to ensure termination by preventing infinite model generation. It provides a range of options from disabling blocking entirely to applying various logical constraints—such as subset, set, or double blocking—that determine when a new individual is considered redundant or “blocked” by an existing one. These strategies are crucial for optimizing performance and correctness in automated reasoning tasks involving dynamic creation of entities.
- Parameters:
NO_BLOCKING (Any) – Indicates that no blocking strategy is applied.
SUBSET_BLOCKING (Any) – A blocking strategy where a new individual is blocked if its set of predecessors is a subset of the predecessors of an existing blocked individual.
SET_BLOCKING (Any) – A blocking strategy based on set comparisons.
DOUBLE_BLOCKING (Any) – A blocking strategy where a node is blocked if it is blocked by an ancestor or if it is blocked by a node that is already blocked.
ANYWHERE_SUBSET_BLOCKING (Any) – A dynamic blocking strategy where an individual is blocked if its concept set is a subset of the concept set of any existing individual, regardless of the individual’s position in the model tree.
ANYWHERE_SET_BLOCKING (Any) – A blocking strategy that applies set blocking conditions to any ancestor node, not just the immediate predecessor.
ANYWHERE_DOUBLE_BLOCKING (Any) – A blocking strategy where a node is blocked if there exists any ancestor node that satisfies the double blocking condition.
- __repr__() str[source]
Returns the string representation of the BlockingDynamicType instance. This method provides a concise identifier for the object by returning the value of its name attribute directly. As a result, when the instance is printed or inspected in a REPL, it displays the assigned name rather than a standard memory address or constructor representation.
- Returns:
The string representation of the object, specifically its name.
- Return type:
str
- __str__() str[source]
Returns a human-readable string representation of the object by returning the value of the name attribute. This method is implicitly invoked by the str() built-in function, the print() function, and formatted string literals. Since the implementation simply accesses the attribute, it will raise an AttributeError if self.name has not been defined, and it relies on Python’s default string conversion if the attribute is not already a string. The operation is read-only and does not modify the state of the instance.
- Returns:
The string representation of the object, which is the value of the name attribute.
- Return type:
str
- ANYWHERE_DOUBLE_BLOCKING = 6
- ANYWHERE_SET_BLOCKING = 5
- ANYWHERE_SUBSET_BLOCKING = 4
- DOUBLE_BLOCKING = 3
- NO_BLOCKING = 0
- SET_BLOCKING = 2
- SUBSET_BLOCKING = 1
UML Class Diagram for ConceptType
- class ConceptType(*args, **kwds)[source]
Bases:
enum.Enum
This enumeration categorizes the diverse structural forms that concepts can take within a fuzzy description logic reasoner. It encompasses standard logical constructs such as conjunctions, disjunctions, and existential or universal restrictions, alongside specialized fuzzy logic operators like Goedel and Lukasiewicz t-norms and t-conorms. Furthermore, it defines identifiers for rough set approximations (including tight and loose variants), aggregation methods like OWA and Sugeno integrals, and various weighted or thresholded concepts. By assigning a specific type to a concept, the reasoner can determine the appropriate semantic interpretation and computational algorithm to apply.
- Parameters:
AND (Any) – Represents a logical conjunction concept.
GOEDEL_AND (Any) – Represents a conjunction operation using the Goedel t-norm (minimum).
LUKASIEWICZ_AND (Any) – Represents a conjunction operation based on the Lukasiewicz t-norm.
OR (Any) – Represents a standard logical disjunction concept.
GOEDEL_OR (Any) – Represents the Goedel disjunction concept, a specific type of logical disjunction used by the reasoner.
LUKASIEWICZ_OR (Any) – Represents a Lukasiewicz disjunction concept.
SOME (Any) – Represents an existential restriction, indicating the existence of at least one relationship to a specific concept.
ALL (Any) – Represents a universal restriction concept type.
UPPER_APPROX (Any) – Represents an upper approximation concept in fuzzy rough set theory, capturing elements that possibly belong to the target set.
LOWER_APPROX (Any) – Represents a lower fuzzy rough concept.
FUZZY_NUMBER_COMPLEMENT (Any) – Represents a negated fuzzy number concept.
TIGHT_UPPER_APPROX (Any) – Tight upper fuzzy rough concept.
TIGHT_LOWER_APPROX (Any) – Represents a tight lower approximation concept in fuzzy rough set theory, used to define elements that strictly belong to the set based on specific implication operators.
LOOSE_UPPER_APPROX (Any) – Represents a loose upper approximation of a fuzzy rough concept.
LOOSE_LOWER_APPROX (Any) – Represents a loose lower fuzzy rough concept.
GOEDEL_IMPLIES (Any) – Represents a concept based on the Goedel implication operator.
NOT_GOEDEL_IMPLIES (Any) – Represents the negation of a Gödel implication concept.
ATOMIC (Any) – Represents a basic, indivisible concept that serves as a fundamental building block for constructing more complex expressions within the reasoner.
COMPLEMENT (Any) – Represents the logical complement of a concept.
TOP (Any) – Represents the universal concept, encompassing all individuals within the domain of discourse.
BOTTOM (Any) – Represents the bottom concept, which denotes the empty set or a logical contradiction.
AT_MOST_VALUE (Any) – Represents a datatype restriction where the value must be less than or equal to a specified limit.
AT_LEAST_VALUE (Any) – Represents a datatype restriction requiring a value to be at least a specified threshold.
EXACT_VALUE (Any) – Represents an exact datatype restriction, requiring a data property to have a specific value.
NOT_AT_MOST_VALUE (Any) – Negation of an ‘at most’ datatype restriction.
NOT_AT_LEAST_VALUE (Any) – Negated ‘at least’ datatype restriction.
NOT_EXACT_VALUE (Any) – Represents the negation of an exact value restriction, indicating that a property does not equal a specific value.
WEIGHTED (Any) – Represents a weighted concept, where weights are applied to sub-concepts to determine their relative importance or contribution.
NOT_WEIGHTED (Any) – Represents the negation of a weighted concept.
W_SUM (Any) – Represents a weighted sum concept, used to aggregate degrees of membership by summing the products of weights and component values.
NOT_W_SUM (Any) – Negated weighted sum concept.
POS_THRESHOLD (Any) – Represents a positive threshold concept.
NOT_POS_THRESHOLD (Any) – Negated positive threshold concept.
NEG_THRESHOLD (Any) – Represents a negative threshold concept used by the reasoner.
NOT_NEG_THRESHOLD (Any) – Represents the negated version of a negative threshold concept.
EXT_POS_THRESHOLD (Any) – Represents an extended positive threshold concept.
NOT_EXT_POS_THRESHOLD (Any) – Negated extended positive threshold concept.
EXT_NEG_THRESHOLD (Any) – Represents an extended negative threshold concept.
NOT_EXT_NEG_THRESHOLD (Any) – Represents the logical negation of the extended negative threshold concept.
CONCRETE (Any) – Represents a concept defined over a concrete domain, such as integers or strings, rather than abstract individuals.
CONCRETE_COMPLEMENT (Any) – Represents a negated concrete concept.
MODIFIED (Any) – Represents a concept to which a modifier has been applied.
MODIFIED_COMPLEMENT (Any) – Represents the negation of a modified concept.
SELF (Any) – Represents a self-reflexivity concept.
FUZZY_NUMBER (Any) – Represents a fuzzy number concept.
OWA (Any) – Represents a concept defined using the Ordered Weighted Averaging (OWA) aggregation operator.
QUANTIFIED_OWA (Any) – Represents a concept defined by a quantified-guided Ordered Weighted Averaging (OWA) aggregation.
NOT_OWA (Any) – Represents a negated OWA concept.
NOT_QUANTIFIED_OWA (Any) – Represents the negation of a quantified-guided Ordered Weighted Averaging (OWA) concept.
CHOQUET_INTEGRAL (Any) – Represents a concept defined by the Choquet integral aggregation operator.
SUGENO_INTEGRAL (Any) – Represents a concept defined by the Sugeno integral.
QUASI_SUGENO_INTEGRAL (Any) – Represents a concept based on the Quasi-Sugeno integral, a fuzzy aggregation operator that generalizes the standard Sugeno integral.
NOT_CHOQUET_INTEGRAL (Any) – Represents the negation of a Choquet integral concept.
NOT_SUGENO_INTEGRAL (Any) – Represents the negation of a Sugeno integral concept.
NOT_QUASI_SUGENO_INTEGRAL (Any) – Negated Quasi-Sugeno integral concept.
W_MAX (Any) – Represents a weighted maximum concept.
NOT_W_MAX (Any) – Represents the logical negation of a weighted maximum concept.
W_MIN (Any) – Weighted minimum concept.
NOT_W_MIN (Any) – Negated weighted minimum concept.
W_SUM_ZERO (Any) – Represents a weighted sum-zero concept.
NOT_W_SUM_ZERO (Any) – Negated weighted sum-zero concept.
NOT_SELF (Any) – Represents the negation of the self-reflexive concept.
HAS_VALUE (Any) – Represents a has-value restriction concept, indicating that a property must relate to a specific individual or value.
NOT_HAS_VALUE (Any) – Negated has value restriction concept.
ZADEH_IMPLIES (Any) – Represents Zadeh’s set inclusion implication, specifically utilized for min-subs queries.
NOT_ZADEH_IMPLIES (Any) – Negated Zadeh’s set inclusion implication.
SIGMA_CONCEPT (Any) – Represents a concept defined by the sigma-count (cardinality) of a fuzzy set.
NOT_SIGMA_CONCEPT (Any) – Represents the negation of a sigma-count concept.
- __repr__() str[source]
Returns the official string representation of the instance by delegating directly to the name attribute. This implementation provides a concise and human-readable identifier for the object, which is particularly useful for debugging and logging, instead of the default Python object representation. The method assumes that the name attribute is a string and does not modify the object’s state.
- Returns:
Returns the string representation of the object, which is its name.
- Return type:
str
- __str__() str[source]
Returns a human-readable string representation of the ConceptType instance, typically used for display or logging purposes. This method is implicitly called by the built-in str() function and print() statements, returning the value of the instance’s name attribute. The operation has no side effects, though it will raise an AttributeError if the name attribute is not defined on the object.
- Returns:
The string representation of the object, which is its name.
- Return type:
str
- ALL = 7
- AND = 0
- ATOMIC = 17
- AT_LEAST_VALUE = 22
- AT_MOST_VALUE = 21
- BOTTOM = 20
- CHOQUET_INTEGRAL = 49
- COMPLEMENT = 18
- CONCRETE = 39
- CONCRETE_COMPLEMENT = 40
- EXACT_VALUE = 23
- EXT_NEG_THRESHOLD = 37
- EXT_POS_THRESHOLD = 35
- FUZZY_NUMBER = 44
- FUZZY_NUMBER_COMPLEMENT = 10
- GOEDEL_AND = 1
- GOEDEL_IMPLIES = 15
- GOEDEL_OR = 4
- HAS_VALUE = 62
- LOOSE_LOWER_APPROX = 14
- LOOSE_UPPER_APPROX = 13
- LOWER_APPROX = 9
- LUKASIEWICZ_AND = 2
- LUKASIEWICZ_OR = 5
- MODIFIED = 41
- MODIFIED_COMPLEMENT = 42
- NEG_THRESHOLD = 33
- NOT_AT_LEAST_VALUE = 25
- NOT_AT_MOST_VALUE = 24
- NOT_CHOQUET_INTEGRAL = 52
- NOT_EXACT_VALUE = 26
- NOT_EXT_NEG_THRESHOLD = 38
- NOT_EXT_POS_THRESHOLD = 36
- NOT_GOEDEL_IMPLIES = 16
- NOT_HAS_VALUE = 63
- NOT_NEG_THRESHOLD = 34
- NOT_OWA = 47
- NOT_POS_THRESHOLD = 32
- NOT_QUANTIFIED_OWA = 48
- NOT_QUASI_SUGENO_INTEGRAL = 54
- NOT_SELF = 61
- NOT_SIGMA_CONCEPT = 67
- NOT_SUGENO_INTEGRAL = 53
- NOT_WEIGHTED = 28
- NOT_W_MAX = 56
- NOT_W_MIN = 58
- NOT_W_SUM = 30
- NOT_W_SUM_ZERO = 60
- NOT_ZADEH_IMPLIES = 65
- OR = 3
- OWA = 45
- POS_THRESHOLD = 31
- QUANTIFIED_OWA = 46
- QUASI_SUGENO_INTEGRAL = 51
- SELF = 43
- SIGMA_CONCEPT = 66
- SOME = 6
- SUGENO_INTEGRAL = 50
- TIGHT_LOWER_APPROX = 12
- TIGHT_UPPER_APPROX = 11
- TOP = 19
- UPPER_APPROX = 8
- WEIGHTED = 27
- W_MAX = 55
- W_MIN = 57
- W_SUM = 29
- W_SUM_ZERO = 59
- ZADEH_IMPLIES = 64
UML Class Diagram for ConcreteFeatureType
- class ConcreteFeatureType(*args, **kwds)[source]
Bases:
enum.Enum
This enumeration defines the set of primitive data types applicable to concrete features within the reasoning system. It categorizes features into distinct categories such as text, whole numbers, floating-point values, and binary states, enabling the reasoner to apply logic specific to each data format. Instances of this class provide a standardized way to represent feature types, and their string representation is simplified to the uppercase name of the specific type.
- Parameters:
STRING (Any) – Represents a textual feature type, indicating that the feature data is a string.
INTEGER (Any) – Represents a concrete feature type for integer values.
REAL (Any) – Indicates a feature with a floating-point or continuous numerical value.
BOOLEAN (Any) – Represents a concrete feature of boolean type.
- __repr__() str[source]
Returns the canonical string representation of the ConcreteFeatureType instance. This method is invoked by the repr() built-in function and is primarily used for debugging and logging. Instead of returning a detailed constructor-style representation, the implementation simply returns the value of the instance’s name attribute, providing a direct and concise identifier for the feature type.
- Returns:
The string representation of the object, corresponding to its name.
- Return type:
str
- __str__() str[source]
Returns a human-readable string representation of the ConcreteFeatureType instance by returning the value of its name attribute. This method is invoked implicitly by the str() built-in function and during string formatting operations, providing a concise identifier for the feature type. It has no side effects, though it will raise an AttributeError if the name attribute has not been set on the instance.
- Returns:
The object’s name.
- Return type:
str
- BOOLEAN = 3
- INTEGER = 1
- REAL = 2
- STRING = 0
UML Class Diagram for CreatedIndividualBlockingType
- class CreatedIndividualBlockingType(*args, **kwds)[source]
Bases:
enum.Enum
This enumeration defines the specific blocking states applicable to individuals generated during the reasoning process. It categorizes individuals into three distinct statuses: explicitly blocked, permitted for processing, or pending evaluation. When represented as a string, the members return their symbolic names, facilitating clear logging and debugging within the reasoning module.
- Parameters:
BLOCKED (Any) – Indicates that the created individual is blocked.
NOT_BLOCKED (Any) – Indicates that the created individual is not blocked.
UNCHECKED (Any) – Indicates that the blocking status for the created individual has not been checked.
- __repr__() str[source]
Returns the string representation of the instance, which is defined as the value of the object’s name attribute. This method is primarily used for debugging and logging, providing a concise and readable identifier for the blocking type. It performs a direct attribute lookup without modifying the object’s state or causing side effects.
- Returns:
The name of the object.
- Return type:
str
- __str__() str[source]
Returns the informal string representation of the object, which is invoked by the str() built-in function and print operations. This implementation simply returns the value of the instance’s name attribute, providing a human-readable identifier for the object. The method performs no modification of state and has no side effects, although it will raise an AttributeError if the name attribute is missing from the instance.
- Returns:
The string representation of the object, which is the value of its name attribute.
- Return type:
str
- BLOCKED = 0
- NOT_BLOCKED = 1
- UNCHECKED = 2
UML Class Diagram for FeatureFunctionType
- class FeatureFunctionType(*args, **kwds)[source]
Bases:
enum.Enum
Defines the specific categories of feature functions utilized by the reasoning engine, distinguishing between base values and arithmetic transformations. The available types include atomic and numeric values, alongside composite operations such as sum, subtraction, and product. This classification allows the system to apply specific logic or constraints depending on the nature of the feature calculation. When converted to a string, the members return their uppercase name rather than their integer value.
- Parameters:
ATOMIC (Any) – Represents a fundamental, indivisible feature that is not derived from other features or operations.
NUMBER (Any) – Represents a feature that is a numeric value.
SUM (Any) – Represents a feature function that performs a summation operation.
SUBTRACTION (Any) – Represents a feature function that performs subtraction.
PRODUCT (Any) – Represents the product of a number and a feature.
- __repr__() str[source]
Returns the official string representation of the instance by directly accessing its name attribute. This method is intended to provide a concise and readable identifier for the object, typically used during debugging or logging, instead of the default memory address representation.
- Returns:
The name of the object.
- Return type:
str
- __str__() str[source]
Returns the informal string representation of the feature function type instance. This method is invoked by the built-in str() function and print() statements to provide a human-readable identifier. It simply returns the value of the instance’s name attribute, ensuring that the textual output corresponds directly to the specific type’s defined name. The operation has no side effects and relies on the name attribute being properly initialized.
- Returns:
The name of the object.
- Return type:
str
- ATOMIC = 0
- NUMBER = 1
- PRODUCT = 5
- SUBTRACTION = 3
- SUM = 2
UML Class Diagram for FuzzyDLKeyword
- class FuzzyDLKeyword(*args, **kwds)[source]
Bases:
enum.Enum
This enumeration defines the comprehensive vocabulary of the FuzzyDL language, mapping specific reserved words and symbols to their corresponding parsing constructs. It encompasses a wide variety of language elements, including query commands (such as satisfiability and instance retrieval), concept and role definitions, logical operators (including specific fuzzy logic norms like Gödel and Łukasiewicz), and data type identifiers. Each member stores a pyparsing object—typically a CaselessKeyword or Literal—enabling direct integration into a grammar definition for parsing FuzzyDL syntax. The class supports flexible usage by providing methods to extract the underlying string name or parser token, and it implements custom equality logic to allow comparison against raw strings, parser objects, or other enum instances.
- Parameters:
MAX_INSTANCE_QUERY (Any) – Keyword representing the maximum instance query, used to find the instance with the highest degree of membership.
MIN_INSTANCE_QUERY (Any) – Keyword used to query for the instance with the minimum degree of membership.
ALL_INSTANCES_QUERY (Any) – Keyword representing a query to retrieve all instances of a concept.
MAX_RELATED_QUERY (Any) – Keyword for the query that retrieves the individual with the maximum degree of relatedness to a specified individual.
MIN_RELATED_QUERY (Any) – Keyword for the ‘min-related?’ query, used to retrieve the minimum degree of relatedness.
MAX_SUBS_QUERY (Any) – Case-insensitive keyword token for the ‘max-subs?’ query operation.
MAX_G_SUBS_QUERY (Any) – Keyword for querying the maximum degree of subsumption using Gödel logic.
MAX_L_SUBS_QUERY (Any) – Keyword representing the query for the maximum degree of subsumption using Łukasiewicz logic.
MAX_KD_SUBS_QUERY (Any) – Represents the keyword for the maximum subsumption query using Kleene-Dienes implication logic.
MIN_SUBS_QUERY (Any) – Parser keyword for the minimum subsumption query, used to determine the minimum degree of subsumption between concepts.
MIN_G_SUBS_QUERY (Any) – Represents the query keyword for finding the minimum subsumption degree using Gödel logic.
MIN_L_SUBS_QUERY (Any) – Represents the keyword used to query the minimum degree of subsumption under Lukasiewicz logic.
MIN_KD_SUBS_QUERY (Any) – Represents the keyword for the minimum subsumption query using Kleene-Dienes logic.
MAX_SAT_QUERY (Any) – Keyword used to query the maximum degree of satisfiability for a concept.
MIN_SAT_QUERY (Any) – Represents the ‘min-sat?’ keyword used to query for the minimum satisfiability degree.
MAX_VAR_QUERY (Any) – Represents the “max-var?” keyword used to query for the maximum variable value.
MIN_VAR_QUERY (Any) – Keyword representing the query for the minimum value of a variable.
SAT_QUERY (Any) – Keyword representing the satisfiability query, used to determine if a concept is consistent.
DEFUZZIFY_LOM_QUERY (Any) – Keyword for the defuzzification query using the Largest of Maximum (LOM) method.
DEFUZZIFY_SOM_QUERY (Any) – Keyword for the defuzzification query that uses the Smallest of Maximums (SOM) method.
DEFUZZIFY_MOM_QUERY (Any) – Represents the ‘defuzzify-mom?’ keyword, used to execute a defuzzification query based on the Mean of Maxima method.
BNP_QUERY (Any) – Represents the ‘bnp?’ keyword used to perform a best necessary property query.
INSTANCE (Any) – Keyword used to assert that an individual is an instance of a concept.
DEFINE_TRUTH_CONSTANT (Any) – Keyword used to define a truth constant in the Fuzzy DL language.
DEFINE_CONCEPT (Any) – Keyword used to define a named concept in the Fuzzy DL language.
DEFINE_PRIMITIVE_CONCEPT (Any) – Keyword used to define a primitive concept in the Fuzzy DL language.
EQUIVALENT_CONCEPTS (Any) – Keyword used to declare that two concepts are equivalent in the FuzzyDL language.
DEFINE_FUZZY_CONCEPT (Any) – Keyword used to define a fuzzy concept in the Fuzzy DL language.
DEFINE_FUZZY_NUMBER (Any) – Keyword used to define a fuzzy number in the Fuzzy DL language.
DEFINE_FUZZY_NUMBER_RANGE (Any) – Keyword used to define a range of fuzzy numbers.
DEFINE_FUZZY_SIMILARITY (Any) – Keyword for defining a fuzzy similarity relation in the Fuzzy DL language.
DEFINE_FUZZY_EQUIVALENCE (Any) – Keyword used to define a fuzzy equivalence relation in the Fuzzy DL language.
RELATED (Any) – Keyword used to assert that two individuals are related by a specific role.
DEFINE_MODIFIER (Any) – Keyword used to define a fuzzy modifier.
FUNCTIONAL (Any) – Keyword used to define a functional role, indicating that an individual is associated with at most one other individual via this role.
TRANSITIVE (Any) – Keyword used to specify that a role is transitive.
REFLEXIVE (Any) – Keyword used to declare a role as reflexive, meaning every individual is related to itself.
SYMMETRIC (Any) – Keyword representing the symmetric property for a role in the Fuzzy DL language.
IMPLIES_ROLE (Any) – Keyword representing the implication or inclusion relationship between roles.
INVERSE (Any) – Keyword used to define or specify the inverse of a role in the Fuzzy DL language.
INVERSE_FUNCTIONAL (Any) – Keyword used to declare a role as inverse-functional, meaning that the inverse of the role relates to at most one individual.
DISJOINT (Any) – Keyword used to specify that two concepts are disjoint, meaning they share no common instances.
DISJOINT_UNION (Any) – Keyword used to define a disjoint union of concepts.
RANGE (Any) – Keyword used to specify the range restriction for a role, defining the valid types of objects or values it can relate to.
DOMAIN (Any) – Keyword used to specify the domain restriction of a role in the FuzzyDL language.
CONSTRAINTS (Any) – Represents the ‘constraints’ keyword in the Fuzzy DL language syntax.
DEFINE_FUZZY_LOGIC (Any) – Keyword used to define the specific fuzzy logic system (e.g., Zadeh, Lukasiewicz) used for reasoning.
CRISP_CONCEPT (Any) – Represents the ‘crisp-concept’ keyword, used to denote concepts with binary membership values rather than fuzzy degrees.
CRISP_ROLE (Any) – Keyword representing a crisp (non-fuzzy) role in the Fuzzy DL language.
AND (Any) – Keyword representing the logical conjunction (intersection) of concepts or roles.
GOEDEL_AND (Any) – Keyword representing the Gödel t-norm logical conjunction operator.
LUKASIEWICZ_AND (Any) – Represents the Lukasiewicz conjunction operator keyword used in fuzzy logic expressions.
IMPLIES (Any) – Represents the logical implication operator keyword used in Fuzzy DL expressions.
GOEDEL_IMPLIES (Any) – Keyword representing the Gödel implication operator in fuzzy logic.
KLEENE_DIENES_IMPLIES (Any) – Represents the Kleene-Dienes fuzzy implication operator keyword.
LUKASIEWICZ_IMPLIES (Any) – Represents the Lukasiewicz implication operator used in fuzzy logic expressions.
ZADEH_IMPLIES (Any) – Represents the Zadeh implication operator used in fuzzy logic expressions.
OR (Any) – Represents the logical disjunction operator ‘or’ used for combining concepts or axioms.
GOEDEL_OR (Any) – Represents the logical OR operation based on Gödel fuzzy logic.
LUKASIEWICZ_OR (Any) – Keyword representing the Lukasiewicz OR (disjunction) operator in fuzzy logic expressions.
NOT (Any) – Represents the logical negation operator used in Fuzzy DL expressions.
SOME (Any) – Represents the existential quantification keyword used to define concept restrictions where at least one filler of a role belongs to a specific concept.
HAS_VALUE (Any) – Represents the “b-some” keyword, used to express existential restrictions or value assertions where a role is associated with a specific individual or value.
ALL (Any) – Keyword representing the universal quantifier used to define restrictions on roles.
TOP (Any) – Represents the universal concept (Top) in the Fuzzy DL language, denoting the set of all individuals.
BOTTOM (Any) – Represents the bottom concept (the empty concept or logical false) in the Fuzzy DL language.
W_SUM (Any) – Represents the weighted sum operator in the FuzzyDL language.
W_SUM_ZERO (Any) – Represents the weighted sum zero operator.
W_MAX (Any) – Represents the weighted maximum operator keyword used in FuzzyDL expressions.
W_MIN (Any) – Represents the weighted minimum keyword in the FuzzyDL language.
SELF (Any) – Represents the ‘self’ keyword used to denote self-reference in concept expressions.
UPPER_APPROXIMATION (Any) – Keyword representing the ‘ua’ operator used to define the upper approximation of a concept.
LOWER_APPROXIMATION (Any) – Represents the lower approximation operator in the Fuzzy DL language, corresponding to the keyword ‘la’.
OWA (Any) – Represents the Ordered Weighted Averaging (OWA) aggregation operator.
Q_OWA (Any) – Keyword representing the Quasi Ordered Weighted Averaging (Q-OWA) operator.
CHOQUET (Any) – Keyword representing the Choquet integral aggregation operator.
SUGENO (Any) – Represents the Sugeno integral aggregation operator keyword used in fuzzy logic expressions.
QUASI_SUGENO (Any) – Represents the Quasi-Sugeno operator keyword used for fuzzy aggregation or integration.
TIGHT_UPPER_APPROXIMATION (Any) – Represents the “tua” keyword for the tight upper approximation operator in the Fuzzy DL language.
TIGHT_LOWER_APPROXIMATION (Any) – Keyword representing the tight lower approximation operator in the Fuzzy DL language.
LOOSE_UPPER_APPROXIMATION (Any) – Keyword representing the loose upper approximation operator.
LOOSE_LOWER_APPROXIMATION (Any) – Represents the loose lower approximation operator, denoted by ‘lla’, used for defining relaxed lower bounds in fuzzy concepts.
FEATURE_SUM (Any) – Represents the feature sum operator in the FuzzyDL language.
FEATURE_SUB (Any) – Represents the subtraction operator for feature terms in the FuzzyDL language.
FEATURE_MUL (Any) – Represents the feature multiplication operator (‘f*’) used in Fuzzy DL expressions.
FEATURE_DIV (Any) – Represents the FuzzyDL keyword for the division operation on features.
SIGMA_COUNT (Any) – Represents the ‘sigma-count’ keyword used to calculate the cardinality of a fuzzy set.
CRISP (Any) – Represents the “crisp” keyword used to define a crisp (non-fuzzy) type or shape for numbers or concepts in the FuzzyDL language.
LEFT_SHOULDER (Any) – Represents a left-shoulder membership function shape used in fuzzy logic definitions.
RIGHT_SHOULDER (Any) – Represents a right-shoulder membership function shape used in fuzzy logic definitions.
TRIANGULAR (Any) – Represents the keyword for a triangular membership function or fuzzy number shape.
TRAPEZOIDAL (Any) – Keyword used to specify a trapezoidal shape for fuzzy numbers or membership functions.
LINEAR (Any) – Represents the “linear” keyword used to define linear membership functions or shapes.
MODIFIED (Any) – Represents the “modified” keyword in the FuzzyDL language, used for defining modified fuzzy concepts or modifiers.
LINEAR_MODIFIER (Any) – Represents the ‘linear-modifier’ keyword in the FuzzyDL language, used to specify a linear modification operation on fuzzy concepts.
TRIANGULAR_MODIFIER (Any) – Keyword used to specify a triangular shape for a modifier definition.
SHOW_VARIABLES (Any) – Keyword used to display the variables defined in the current context.
SHOW_ABSTRACT_FILLERS (Any) – Represents the keyword used to display abstract fillers.
SHOW_ABSTRACT_FILLERS_FOR (Any) – Represents the command to display abstract fillers for a specific individual or entity.
SHOW_CONCRETE_FILLERS (Any) – Keyword representing the command to display concrete fillers (data values) associated with a role or instance.
SHOW_CONCRETE_FILLERS_FOR (Any) – Keyword used to display concrete fillers for a specific entity.
SHOW_CONCRETE_INSTANCE_FOR (Any) – Keyword used to display a concrete instance for a specific concept or identifier.
SHOW_INSTANCES (Any) – Keyword used to display the instances defined in the Fuzzy DL knowledge base.
SHOW_CONCEPTS (Any) – Represents the keyword used to display the defined concepts.
SHOW_LANGUAGE (Any) – Keyword representing the command to display the language syntax or configuration.
FREE (Any) – Keyword representing the free logic type.
BINARY (Any) – Represents the “binary” keyword in the FuzzyDL language.
LUKASIEWICZ (Any) – Keyword representing the Lukasiewicz fuzzy logic type.
ZADEH (Any) – Keyword representing the Zadeh fuzzy logic type.
CLASSICAL (Any) – Represents the “classical” keyword, used to specify standard Boolean logic or crisp operations within the Fuzzy DL language.
SUM (Any) – Represents the addition operator symbol “+” in the Fuzzy DL language.
SUB (Any) – Represents the subtraction operator (“-”) in the Fuzzy DL language.
MUL (Any) – Represents the arithmetic multiplication operator.
LESS_THAN_OR_EQUAL_TO (Any) – Represents the “less than or equal to” comparison operator used in Fuzzy DL expressions.
GREATER_THAN_OR_EQUAL_TO (Any) – Represents the “greater than or equal to” comparison operator (“>=”).
EQUALS (Any) – Represents the equality operator used for comparisons within the Fuzzy DL language.
STRING (Any) – Keyword representing the string data type in the Fuzzy DL language.
BOOLEAN (Any) – Case-insensitive keyword representing the boolean data type in the Fuzzy DL language.
INTEGER (Any) – Keyword representing the integer data type within the Fuzzy DL language.
REAL (Any) – Represents the primitive data type for real numbers within the FuzzyDL language syntax.
- Raises:
NotImplementedError – Raised when comparing the keyword to an object of an unsupported type. Equality is only implemented for strings, pyparsing elements, and other FuzzyDLKeyword instances.
- __eq__(value: object) bool[source]
Determines equality by comparing the keyword’s name against the provided value, supporting strings, pyparsing objects, and other FuzzyDLKeyword instances. The comparison is case-insensitive when the input is a string, a pyparsing CaselessKeyword, or a pyparsing Literal. If the input is another FuzzyDLKeyword instance, the method compares the results of their respective get_name methods. If the provided value is not one of these supported types, the method raises a NotImplementedError.
- Parameters:
value (object) – The object to compare against. Supported types include strings (case-insensitive), pp.CaselessKeyword, pp.Literal, and FuzzyDLKeyword.
- Raises:
NotImplementedError – Raised when the provided value is not a supported type for comparison (str, CaselessKeyword, Literal, or FuzzyDLKeyword).
- Returns:
True if the object’s name matches the name of the provided value (string, CaselessKeyword, Literal, or FuzzyDLKeyword) in a case-insensitive manner; otherwise, False.
- Return type:
bool
- __repr__() str[source]
Returns the string representation of the FuzzyDLKeyword instance. This implementation returns the value of the name attribute directly, providing a concise and readable identifier rather than a full constructor representation. Consequently, when the object is inspected or printed, it displays its underlying name.
- Returns:
The string representation of the object, which is the value of its name attribute.
- Return type:
str
- __str__() str[source]
Returns the string representation of the FuzzyDLKeyword instance, which is derived directly from its name attribute. This method is invoked implicitly by Python whenever the object is converted to a string, for example, when using the print() function or string formatting. The operation has no side effects on the object’s state, though it will raise an AttributeError if the name attribute is missing.
- Returns:
The string representation of the object, specifically the value of its name attribute.
- Return type:
str
- get_name() str[source]
Retrieves and normalizes the name associated with the underlying value object. The method converts the name to lowercase and strips all occurrences of single and double quotes using a regular expression substitution. This processing ensures a consistent string representation suitable for comparison or fuzzy matching, and it does not modify the state of the object itself. Note that this method assumes self.value and self.value.name are accessible and valid strings; if these attributes are missing or lack the expected methods, an AttributeError will be raised.
- Returns:
The lowercased name with all single and double quotes removed.
- Return type:
str
- get_value() pyparsing.CaselessKeyword | pyparsing.Literal[source]
Returns the underlying pyparsing element stored within the instance. This method provides access to the specific parsing token, which can be either a CaselessKeyword for case-insensitive matching or a Literal for exact string matching. It serves as a simple getter with no side effects, allowing the retrieval of the configured parser component.
- Returns:
Returns the internal value, which is either a CaselessKeyword or a Literal.
- Return type:
Union[pp.CaselessKeyword, pp.Literal]
- ALL
- ALL_INSTANCES_QUERY
- AND
- BINARY
- BNP_QUERY
- BOOLEAN
- BOTTOM
- CHOQUET
- CLASSICAL
- CONSTRAINTS
- CRISP
- CRISP_CONCEPT
- CRISP_ROLE
- DEFINE_CONCEPT
- DEFINE_FUZZY_CONCEPT
- DEFINE_FUZZY_EQUIVALENCE
- DEFINE_FUZZY_LOGIC
- DEFINE_FUZZY_NUMBER
- DEFINE_FUZZY_NUMBER_RANGE
- DEFINE_FUZZY_SIMILARITY
- DEFINE_MODIFIER
- DEFINE_PRIMITIVE_CONCEPT
- DEFINE_TRUTH_CONSTANT
- DEFUZZIFY_LOM_QUERY
- DEFUZZIFY_MOM_QUERY
- DEFUZZIFY_SOM_QUERY
- DISJOINT
- DISJOINT_UNION
- DOMAIN
- EQUALS
- EQUIVALENT_CONCEPTS
- FEATURE_DIV
- FEATURE_MUL
- FEATURE_SUB
- FEATURE_SUM
- FREE
- FUNCTIONAL
- GOEDEL_AND
- GOEDEL_IMPLIES
- GOEDEL_OR
- GREATER_THAN_OR_EQUAL_TO
- HAS_VALUE
- IMPLIES
- IMPLIES_ROLE
- INSTANCE
- INTEGER
- INVERSE
- INVERSE_FUNCTIONAL
- KLEENE_DIENES_IMPLIES
- LEFT_SHOULDER
- LESS_THAN_OR_EQUAL_TO
- LINEAR
- LINEAR_MODIFIER
- LOOSE_LOWER_APPROXIMATION
- LOOSE_UPPER_APPROXIMATION
- LOWER_APPROXIMATION
- LUKASIEWICZ
- LUKASIEWICZ_AND
- LUKASIEWICZ_IMPLIES
- LUKASIEWICZ_OR
- MAX_G_SUBS_QUERY
- MAX_INSTANCE_QUERY
- MAX_KD_SUBS_QUERY
- MAX_L_SUBS_QUERY
- MAX_RELATED_QUERY
- MAX_SAT_QUERY
- MAX_SUBS_QUERY
- MAX_VAR_QUERY
- MIN_G_SUBS_QUERY
- MIN_INSTANCE_QUERY
- MIN_KD_SUBS_QUERY
- MIN_L_SUBS_QUERY
- MIN_RELATED_QUERY
- MIN_SAT_QUERY
- MIN_SUBS_QUERY
- MIN_VAR_QUERY
- MODIFIED
- MUL
- NOT
- OR
- OWA
- QUASI_SUGENO
- Q_OWA
- RANGE
- REAL
- REFLEXIVE
- RELATED
- RIGHT_SHOULDER
- SAT_QUERY
- SELF
- SHOW_ABSTRACT_FILLERS
- SHOW_ABSTRACT_FILLERS_FOR
- SHOW_CONCEPTS
- SHOW_CONCRETE_FILLERS
- SHOW_CONCRETE_FILLERS_FOR
- SHOW_CONCRETE_INSTANCE_FOR
- SHOW_INSTANCES
- SHOW_LANGUAGE
- SHOW_VARIABLES
- SIGMA_COUNT
- SOME
- STRING
- SUB
- SUGENO
- SUM
- SYMMETRIC
- TIGHT_LOWER_APPROXIMATION
- TIGHT_UPPER_APPROXIMATION
- TOP
- TRANSITIVE
- TRAPEZOIDAL
- TRIANGULAR
- TRIANGULAR_MODIFIER
- UPPER_APPROXIMATION
- W_MAX
- W_MIN
- W_SUM
- W_SUM_ZERO
- ZADEH
- ZADEH_IMPLIES
UML Class Diagram for FuzzyLogic
- class FuzzyLogic[source]
Bases:
enum.StrEnum
This enumeration defines the specific mathematical frameworks or strategies for fuzzy logic operations supported by the reasoner. It provides options such as Classical, Zadeh, and Lukasiewicz logic, which dictate how truth values are combined and manipulated during inference. By inheriting from StrEnum, instances behave as strings in value while maintaining the type safety and distinct identity of an enumeration, allowing for easy serialization and comparison.
- Parameters:
CLASSICAL (Any) – Selects the classical fuzzy logic inference method for the reasoner.
ZADEH (Any) – Indicates the use of standard Zadeh operators for fuzzy logic operations.
LUKASIEWICZ (Any) – Specifies the Łukasiewicz variant of fuzzy logic for reasoning operations.
- __repr__() str[source]
Returns the official string representation of the FuzzyLogic instance. Instead of providing a detailed constructor-style representation, this method returns the value of the instance’s name attribute directly. This behavior allows the object to be identified succinctly by its name when displayed in the interactive console or during debugging sessions.
- Returns:
The string representation of the object, which is the value of the name attribute.
- Return type:
str
- __str__() str[source]
Returns the informal string representation of the FuzzyLogic instance, which is invoked by the built-in str() function and print() calls. The implementation simply returns the object’s internal value attribute, delegating the actual formatting logic to whatever type that attribute holds. Consequently, the output depends entirely on the string conversion behavior of the underlying value, and the method itself does not modify the object’s state or produce side effects.
- Returns:
The string representation of the object, corresponding to the value attribute.
- Return type:
str
- CLASSICAL = 'classical'
- LUKASIEWICZ = 'lukasiewicz'
- ZADEH = 'zadeh'
UML Class Diagram for InequalityType
- class InequalityType[source]
Bases:
enum.StrEnum
This enumeration defines the standard comparison operators used to express logical relationships or constraints between values. It inherits from StrEnum, allowing its members to function as strings (such as “>”) while providing the safety and structure of an enumeration. The class supports three primary operations: greater than, less than, and equal, making it suitable for defining conditions in rule engines, query builders, or mathematical contexts. When converted to a string, the enum yields its symbolic representation, whereas its representation provides the constant name.
- Parameters:
GREATER_THAN (Any) – Represents the greater-than inequality operator.
LESS_THAN (Any) – Represents the “less than” comparison operator.
EQUAL (Any) – Represents an equality relationship.
- __repr__() str[source]
Returns the official string representation of the instance, designed to be unambiguous and useful for debugging. The implementation delegates directly to the name attribute of the object, returning its value as the representation string. This method is invoked by the built-in repr() function and has no side effects, though it assumes that the name attribute is defined on the instance.
- Returns:
The string representation of the object, which is the value of its name attribute.
- Return type:
str
- __str__() str[source]
Returns the string representation of the inequality type instance. This method is invoked when the object is converted to a string, such as during string formatting or printing operations. It simply returns the underlying value associated with the instance, ensuring that the textual output corresponds directly to the specific inequality type defined.
- Returns:
The string representation of the object, which is the value attribute.
- Return type:
str
- EQUAL = '='
- GREATER_THAN = '>'
- LESS_THAN = '<'
UML Class Diagram for KnowledgeBaseRules
- class KnowledgeBaseRules(*args, **kwds)[source]
Bases:
enum.Enum
This enumeration defines a comprehensive set of inference rules and logical operators applicable within a knowledge base system, specifically catering to fuzzy logic and many-valued reasoning. It encompasses various t-norms and t-conorms (such as Gödel and Łukasiewicz variants for conjunction, disjunction, and implication), quantifiers, and advanced aggregation operators like OWA, Choquet integrals, and Sugeno integrals. Additionally, it includes specific property checks and their negations (e.g., CONCRETE, WEIGHTED) to determine the characteristics of data or rules. Users can reference these members to configure reasoning behavior or validate rule properties, noting that the string representation of each member automatically strips the “RULE_” prefix for readability.
- Parameters:
RULE_ATOMIC (Any) – Represents a basic, indivisible fact or condition that serves as a fundamental building block within the knowledge base.
RULE_COMPLEMENT (Any) – Represents the rule for applying the complement operation (logical negation).
RULE_GOEDEL_AND (Any) – Specifies the Gödel t-norm (minimum) for the logical AND operation.
RULE_LUKASIEWICZ_AND (Any) – Represents the Łukasiewicz t-norm for the logical AND operation.
RULE_GOEDEL_OR (Any) – Represents the Gödel t-conorm (logical OR) rule, which calculates the maximum of the input values.
RULE_LUKASIEWICZ_OR (Any) – Represents the logical OR operation based on Łukasiewicz logic.
RULE_GOEDEL_SOME (Any) – Represents the existential quantifier rule (‘some’) based on Gödel logic.
RULE_LUKASIEWICZ_SOME (Any) – Represents the existential quantifier rule based on Łukasiewicz logic.
RULE_GOEDEL_ALL (Any) – Represents the Gödel logic rule for universal quantification, corresponding to the minimum of a set of values.
RULE_LUKASIEWICZ_ALL (Any) – Represents the Łukasiewicz logic rule for the universal quantifier.
RULE_TOP (Any) – Represents the top element (tautology) in the logic system, corresponding to the maximum truth value.
RULE_BOTTOM (Any) – Represents the logical bottom element (minimal truth value), typically corresponding to false or zero.
RULE_GOEDEL_IMPLIES (Any) – Represents the Gödel implication rule, a specific fuzzy logic implication operator used for inference.
RULE_NOT_GOEDEL_IMPLIES (Any) – Represents the negation of the Gödel implication rule.
RULE_CONCRETE (Any) – Represents the rule for concrete elements or properties.
RULE_NOT_CONCRETE (Any) – Represents a rule or condition that is not concrete, distinguishing abstract or fuzzy elements from specific instances.
RULE_MODIFIED (Any) – Represents a rule or condition that checks for or indicates the modified state of an entity.
RULE_NOT_MODIFIED (Any) – Indicates that the rule or element has not been modified.
RULE_DATATYPE (Any) – Represents a rule that checks for or applies to data types.
RULE_NOT_DATATYPE (Any) – Represents a rule indicating that the element is not a datatype.
RULE_FUZZY_NUMBER (Any) – Indicates a rule or property related to fuzzy numbers.
RULE_NOT_FUZZY_NUMBER (Any) – Represents a rule condition indicating that the target element is not a fuzzy number.
RULE_WEIGHTED (Any) – Represents a rule that utilizes weighted aggregation or applies weights to its components.
RULE_NOT_WEIGHTED (Any) – Indicates that the rule or condition is not weighted.
RULE_THRESHOLD (Any) – Identifies a rule that applies a threshold condition.
RULE_NOT_THRESHOLD (Any) – Represents the negation of a threshold rule or condition.
RULE_OWA (Any) – Represents the Ordered Weighted Averaging (OWA) aggregation rule.
RULE_NOT_OWA (Any) – Represents the negation of the Ordered Weighted Averaging (OWA) aggregation rule.
RULE_W_SUM (Any) – Represents a rule that utilizes a weighted sum aggregation operator.
RULE_NOT_W_SUM (Any) – Indicates that the rule is not a weighted sum.
RULE_CHOQUET_INTEGRAL (Any) – Represents the Choquet integral rule, used for aggregating information while accounting for interactions between criteria.
RULE_NOT_CHOQUET_INTEGRAL (Any) – Represents a rule or condition indicating that the element is not a Choquet integral.
RULE_SUGENO_INTEGRAL (Any) – Represents the Sugeno integral rule.
RULE_NOT_SUGENO_INTEGRAL (Any) – Represents the negation of the Sugeno integral rule, identifying elements or conditions that are not Sugeno integrals.
RULE_QUASI_SUGENO_INTEGRAL (Any) – Represents a rule or aggregation method utilizing the Quasi-Sugeno integral.
RULE_NOT_QUASI_SUGENO_INTEGRAL (Any) – Represents a rule that is not a Quasi-Sugeno Integral.
RULE_SELF (Any) – Represents a rule that applies to the entity itself or is self-referential.
RULE_NOT_SELF (Any) – Represents the rule indicating that a relationship or property is not self-referential.
RULE_W_MIN (Any) – Represents the weighted minimum rule.
RULE_NOT_W_MIN (Any) – Represents the negation of the weighted minimum (W-Min) rule.
RULE_W_MAX (Any) – Represents the weighted maximum rule used for aggregating values or criteria.
RULE_NOT_W_MAX (Any) – Represents the negation of the Weighted Maximum rule.
RULE_W_SUM_ZERO (Any) – Represents a rule or property concerning a weighted sum that is zero.
RULE_NOT_W_SUM_ZERO (Any) – Represents the rule where the weighted sum is not zero.
RULE_HAS_VALUE (Any) – Represents a rule that verifies whether a specific attribute or entity possesses an assigned value.
RULE_NOT_HAS_VALUE (Any) – Represents a rule condition checking that a specific element or property lacks an assigned value.
RULE_ZADEH_IMPLIES (Any) – Represents the Zadeh implication rule, a specific fuzzy logic implication operator.
RULE_NOT_ZADEH_IMPLIES (Any) – Represents the rule for the negation of Zadeh implication.
RULE_SIGMA_COUNT (Any) – Represents a rule or condition involving the sigma count (fuzzy cardinality) operation.
RULE_NOT_SIGMA_COUNT (Any) – Represents the negation of the sigma count rule.
- __repr__() str[source]
Returns a string representation of the KnowledgeBaseRules instance by delegating to the __str__ method. This ensures that the official representation used by the interpreter and debugging tools matches the informal string output. The method does not modify the object’s state.
- Returns:
The string representation of the object, obtained by calling str() on the instance.
- Return type:
str
- __str__() str[source]
Returns a human-readable string representation of the KnowledgeBaseRules instance by processing the object’s name attribute. This method strips the ‘RULE_’ substring from the name to provide a simplified identifier, leaving the rest of the string intact if the prefix is not present. It is automatically invoked when the instance is converted to a string or printed.
- Returns:
The object’s name with the ‘RULE_’ prefix removed.
- Return type:
str
- RULE_ATOMIC = 0
- RULE_BOTTOM = 11
- RULE_CHOQUET_INTEGRAL = 30
- RULE_COMPLEMENT = 1
- RULE_CONCRETE = 14
- RULE_DATATYPE = 18
- RULE_FUZZY_NUMBER = 20
- RULE_GOEDEL_ALL = 8
- RULE_GOEDEL_AND = 2
- RULE_GOEDEL_IMPLIES = 12
- RULE_GOEDEL_OR = 4
- RULE_GOEDEL_SOME = 6
- RULE_HAS_VALUE = 44
- RULE_LUKASIEWICZ_ALL = 9
- RULE_LUKASIEWICZ_AND = 3
- RULE_LUKASIEWICZ_OR = 5
- RULE_LUKASIEWICZ_SOME = 7
- RULE_MODIFIED = 16
- RULE_NOT_CHOQUET_INTEGRAL = 31
- RULE_NOT_CONCRETE = 15
- RULE_NOT_DATATYPE = 19
- RULE_NOT_FUZZY_NUMBER = 21
- RULE_NOT_GOEDEL_IMPLIES = 13
- RULE_NOT_HAS_VALUE = 45
- RULE_NOT_MODIFIED = 17
- RULE_NOT_OWA = 27
- RULE_NOT_QUASI_SUGENO_INTEGRAL = 35
- RULE_NOT_SELF = 37
- RULE_NOT_SIGMA_COUNT = 49
- RULE_NOT_SUGENO_INTEGRAL = 33
- RULE_NOT_THRESHOLD = 25
- RULE_NOT_WEIGHTED = 23
- RULE_NOT_W_MAX = 41
- RULE_NOT_W_MIN = 39
- RULE_NOT_W_SUM = 29
- RULE_NOT_W_SUM_ZERO = 43
- RULE_NOT_ZADEH_IMPLIES = 47
- RULE_OWA = 26
- RULE_QUASI_SUGENO_INTEGRAL = 34
- RULE_SELF = 36
- RULE_SIGMA_COUNT = 48
- RULE_SUGENO_INTEGRAL = 32
- RULE_THRESHOLD = 24
- RULE_TOP = 10
- RULE_WEIGHTED = 22
- RULE_W_MAX = 40
- RULE_W_MIN = 38
- RULE_W_SUM = 28
- RULE_W_SUM_ZERO = 42
- RULE_ZADEH_IMPLIES = 46
UML Class Diagram for LogicOperatorType
- class LogicOperatorType(*args, **kwds)[source]
Bases:
enum.Enum
This enumeration defines the specific logic operator strategies available to the reasoning engine, corresponding to standard fuzzy logic systems. It includes variants such as Lukasiewicz, Gödel, Kleene-Dienes, and Zadeh, which determine how logical operations like conjunction and disjunction are evaluated within the system. When converted to a string or represented, the value returns its identifier name rather than its underlying integer code.
- Parameters:
LUKASIEWICZ (Any) – Represents the Łukasiewicz logic operator, commonly used in many-valued logic reasoning.
GOEDEL (Any) – Represents the Gödel logic operator type used by the reasoner.
KLEENE_DIENES (Any) – Represents the Kleene-Dienes logic operator, a specific operator type used by the reasoner.
ZADEH (Any) – Represents the standard fuzzy logic operators defined by Lotfi Zadeh, utilizing minimum for conjunction and maximum for disjunction.
- __repr__() str[source]
Returns the name of the logic operator type as its official string representation. This method overrides the default behavior to provide a concise and readable identifier, which is particularly useful for debugging and logging. It simply returns the value of the name attribute associated with the instance.
- Returns:
The name of the object.
- Return type:
str
- __str__() str[source]
Returns the string representation of the logic operator type by accessing its internal name attribute. This method is invoked implicitly when the object is converted to a string, such as during printing or string formatting operations. It ensures that the textual output corresponds directly to the identifier defined for the specific operator.
- Returns:
Returns the string representation of the object, which is its name.
- Return type:
str
- GOEDEL = 1
- KLEENE_DIENES = 2
- LUKASIEWICZ = 0
- ZADEH = 3
UML Class Diagram for MILPProvider
- class MILPProvider[source]
Bases:
enum.StrEnum
This enumeration defines the available Mixed-Integer Linear Programming (MILP) solver backends supported by the reasoning system. It provides specific members for distinct solvers such as GUROBI and MIP, as well as configurations for the PULP library using different underlying engines like GLPK, HiGHS, or CPLEX. As a string-based enum, it facilitates configuration by allowing direct string comparisons, and it includes a static from_str method to safely parse case-insensitive string inputs into the corresponding enum member, raising an error for invalid values.
- Parameters:
GUROBI (Any) – Selects the Gurobi solver for MILP optimization.
MIP (Any) – Selects the Python-MIP solver backend.
PULP (Any) – Represents the default solver backend provided by the PuLP library.
PULP_GLPK (Any) – Uses the GLPK solver via the PuLP interface.
PULP_HIGHS (Any) – Specifies the HiGHS solver, accessed via the PuLP library.
PULP_CPLEX (Any) – Uses the CPLEX solver via the PuLP interface.
- Raises:
ValueError – Raised when the string provided to from_str does not match any of the available MILP provider options.
- static from_str(value: str) Self[source]
This static method parses a string representation of a provider name and returns the corresponding MILPProvider enumeration member. The matching process is case-insensitive, as the input string is converted to lowercase before lookup. If the provided value does not correspond to any defined provider, a ValueError is raised with a message listing the valid available options.
- Parameters:
value (str) – The name of the MILP provider to convert.
- Raises:
ValueError – If the provided string does not correspond to a valid MILPProvider member.
- Returns:
The MILPProvider enum member corresponding to the input string, matched case-insensitively.
- Return type:
Self
- GUROBI
- MIP
- PULP
- PULP_CPLEX
- PULP_GLPK
- PULP_HIGHS
UML Class Diagram for RepresentativeIndividualType
- class RepresentativeIndividualType(*args, **kwds)[source]
Bases:
enum.Enum
This enumeration categorizes the specific types of representative individuals employed by the reasoning engine to define logical bounds or constraints. It distinguishes between two distinct options: GREATER_EQUAL, which typically represents a lower bound or minimum cardinality, and LESS_EQUAL, which represents an upper bound or maximum cardinality. By selecting one of these values, the reasoner can determine the specific inequality or approximation strategy to apply when processing a concept.
- Parameters:
GREATER_EQUAL (Any) – Represents a representative individual satisfying a greater-than-or-equal-to condition.
LESS_EQUAL (Any) – Indicates that the representative individual is used for less-than-or-equal-to comparisons.
- __repr__() str[source]
Returns the string representation of the object, which is defined as the value of the name attribute. This implementation provides a direct and concise identifier for the instance rather than a formal representation including the class name. It is primarily used for debugging and logging contexts where the specific name of the individual type is the most relevant information.
- Returns:
A string representation of the object, specifically the value of its name attribute.
- Return type:
str
- __str__() str[source]
Returns a human-readable string representation of the RepresentativeIndividualType instance by delegating to the object’s name attribute. This method is automatically invoked when the instance is converted to a string using the built-in str() function or formatted for output, such as in print statements. The implementation has no side effects, though it assumes that the name attribute is defined and contains a value that serves as a valid string representation.
- Returns:
The informal string representation of the object, which is its name.
- Return type:
str
- GREATER_EQUAL = 0
- LESS_EQUAL = 1
UML Class Diagram for RestrictionType
- class RestrictionType(*args, **kwds)[source]
Bases:
enum.Enum
This enumeration defines the specific categories of constraints that can be applied by the reasoning engine. It distinguishes between three primary modes of restriction: an upper bound limit (AT_MOST_VALUE), a lower bound limit (AT_LEAST_VALUE), and a precise equality requirement (EXACT_VALUE). By utilizing these members, developers can explicitly declare the nature of a restriction, allowing the reasoner to correctly interpret and enforce the intended logic on the associated values.
- Parameters:
AT_MOST_VALUE (Any) – Specifies that the value must be less than or equal to a defined maximum.
AT_LEAST_VALUE (Any) – Represents a restriction requiring the value to be greater than or equal to a specified threshold.
EXACT_VALUE (Any) – Indicates that the restricted property or quantity must match the specified value exactly.
- __repr__() str[source]
Returns the official string representation of the restriction type instance by returning the value of its name attribute. This method is intended to provide a concise and unambiguous identifier for the object, typically used for debugging and logging. It performs no side effects and assumes the name attribute is populated with a string value.
- Returns:
The name of the object.
- Return type:
str
- __str__() str[source]
Returns a human-readable string representation of the restriction type instance. This method is invoked by the built-in str() function and string formatting operations, allowing the object to be displayed cleanly in logs or user interfaces. It simply returns the value of the name attribute, ensuring that the string output corresponds directly to the instance’s identifier. The method has no side effects and assumes that the name attribute is defined on the instance.
- Returns:
The string representation of the object, which is its name.
- Return type:
str
- AT_LEAST_VALUE = 1
- AT_MOST_VALUE = 0
- EXACT_VALUE = 2
UML Class Diagram for VariableType
- class VariableType[source]
Bases:
enum.StrEnum
This enumeration defines the permissible domains for variables, typically within the context of mathematical optimization or modeling. It categorizes variables into distinct types such as binary, continuous, integer, and semi-continuous, each imposing specific constraints on the values the variable can assume. As a string-based enumeration, members can be used directly in string comparisons or serialization, and the class is configured to return the member’s name when represented as a string.
- Parameters:
BINARY (Any) – Represents a variable restricted to two values, typically 0 and 1.
CONTINUOUS (Any) – Represents a variable that can take any real value within its bounds.
INTEGER (Any) – Represents a variable restricted to integer values.
SEMI_CONTINUOUS (Any) – Represents a variable that is either zero or takes a value within a specified continuous range.
- __repr__() str[source]
Returns the official string representation of the VariableType instance. The implementation delegates directly to the name attribute, returning its value as the representation. This method has no side effects and is primarily used for debugging and logging purposes.
- Returns:
Returns the string representation of the object, which is the value of its name attribute.
- Return type:
str
- __str__() str[source]
Provides a human-readable string representation of the VariableType instance by returning the value of its name attribute. This method is automatically invoked by the built-in str() function and during string formatting operations, such as when using print() or f-strings. The operation has no side effects and relies on the name attribute being present on the instance.
- Returns:
The name of the object.
- Return type:
str
- BINARY
- CONTINUOUS
- INTEGER
- SEMI_CONTINUOUS
- KNOWLEDGE_BASE_SEMANTICS: FuzzyLogic
- MAXVAL: float = 2147483647000
- MAXVAL2: float = 4294967294000
- NUMBER
- RESULTS_PATH: str
- SEPARATOR: str = '-------------------------'
- STAR_SEPARATOR: str = '*************************'