fuzzy-dl-owl2 1.0.6__tar.gz → 1.0.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/PKG-INFO +72 -4
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/README.md +70 -2
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/feature_function.py +9 -3
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/fuzzydl_to_owl2.py +3 -1
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/knowledge_base.py +13 -5
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/milp/expression.py +13 -2
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/milp/inequation.py +12 -0
- fuzzy_dl_owl2-1.0.7/fuzzy_dl_owl2/fuzzydl/milp/milp_helper.py +1428 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/milp/term.py +4 -1
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/util/config_reader.py +44 -2
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/util/constants.py +5 -6
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/fuzzyowl2.py +3 -1
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/pyproject.toml +2 -2
- fuzzy_dl_owl2-1.0.6/fuzzy_dl_owl2/fuzzydl/milp/milp_helper.py +0 -788
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/LICENSE +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/assertion/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/assertion/assertion.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/assertion/atomic_assertion.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/all_some_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/approximation_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/atomic_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/choquet_integral.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/concrete/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/concrete/crisp_concrete_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/concrete/fuzzy_concrete_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/concrete/fuzzy_number/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/concrete/fuzzy_number/triangular_fuzzy_number.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/concrete/left_concrete_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/concrete/linear_concrete_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/concrete/modified_concrete_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/concrete/right_concrete_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/concrete/trapezoidal_concrete_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/concrete/triangular_concrete_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/ext_threshold_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/has_value_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/implies_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/interface/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/interface/has_concept_interface.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/interface/has_concepts_interface.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/interface/has_role_concept_interface.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/interface/has_role_interface.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/interface/has_value_interface.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/interface/has_weighted_concepts_interface.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/modified/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/modified/linearly_modified_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/modified/modified_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/modified/triangularly_modified_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/negated_nominal.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/operator_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/owa_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/qowa_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/quasi_sugeno_integral.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/self_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/string_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/sugeno_integral.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/threshold_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/truth_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/value_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/weighted_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/weighted_max_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/weighted_min_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/weighted_sum_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/weighted_sum_zero_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept_equivalence.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concrete_feature.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/degree/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/degree/degree.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/degree/degree_expression.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/degree/degree_numeric.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/degree/degree_variable.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/domain_axiom.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/exception/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/exception/fuzzy_ontology_exception.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/exception/inconsistent_ontology_exception.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/general_concept_inclusion.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/individual/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/individual/created_individual.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/individual/individual.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/individual/representative_individual.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/label.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/milp/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/milp/show_variables_helper.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/milp/solution.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/milp/variable.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/modifier/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/modifier/linear_modifier.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/modifier/modifier.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/modifier/triangular_modifier.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/parser/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/parser/dl_parser.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/primitive_concept_definition.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/all_instances_query.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/bnp_query.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/defuzzify/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/defuzzify/defuzzify_query.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/defuzzify/lom_defuzzify_query.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/defuzzify/mom_defuzzify_query.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/defuzzify/som_defuzzify_query.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/instance_query.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/kb_satisfiable_query.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/max/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/max/max_instance_query.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/max/max_query.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/max/max_related_query.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/max/max_satisfiable_query.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/max/max_subsumes_query.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/min/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/min/min_instance_query.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/min/min_query.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/min/min_related_query.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/min/min_satisfiable_query.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/min/min_subsumes_query.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/query.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/related_query.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/satisfiable_query.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/subsumption_query.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/range_axiom.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/relation.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/restriction/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/restriction/has_value_restriction.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/restriction/restriction.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/role_parent_with_degree.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/util/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/util/util.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/util/utils.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/fuzzyowl2_to_fuzzydl.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/choquet_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/concept_definition.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/fuzzy_datatype.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/fuzzy_modifier.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/fuzzy_nominal_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/fuzzy_property.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/left_shoulder_function.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/linear_function.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/linear_modifier.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/modified_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/modified_function.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/modified_property.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/owa_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/property_definition.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/qowa_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/quasi_sugeno_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/right_shoulder_function.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/sugeno_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/trapezoidal_function.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/triangular_function.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/triangular_modifer.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_max_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_min_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_sum_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_sum_zero_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/parser/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/parser/owl2_parser.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/parser/owl2_xml_parser.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/util/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/util/constants.py +0 -0
- {fuzzy_dl_owl2-1.0.6 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/util/fuzzy_xml.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: fuzzy-dl-owl2
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.7
|
|
4
4
|
Summary: A python porting of the Fuzzy Description Language (see https://www.umbertostraccia.it/cs/software/fuzzyDL/fuzzyDL.html) and the Fuzzy OWL 2 framework (see https://www.umbertostraccia.it/cs/software/FuzzyOWL/index.html).
|
|
5
5
|
License: CC-BY-SA-4.0
|
|
6
6
|
Author: Giuseppe Filippone
|
|
@@ -11,12 +11,12 @@ Classifier: Programming Language :: Python :: 3
|
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.11
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.12
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
-
Requires-Dist: gurobipy (>=12.0.0,<13.0.0)
|
|
15
14
|
Requires-Dist: networkx (>=3.3,<4.0)
|
|
16
15
|
Requires-Dist: owlready2 (>=0.47,<0.48)
|
|
17
16
|
Requires-Dist: pyowl2 (>=1.0.2,<2.0.0)
|
|
18
17
|
Requires-Dist: pyparsing (>=3.2.3,<4.0.0)
|
|
19
18
|
Requires-Dist: rdflib (>=7.1.4,<8.0.0)
|
|
19
|
+
Requires-Dist: setuptools (>=80.8.0,<81.0.0)
|
|
20
20
|
Requires-Dist: sortedcontainers (>=2.4.0,<3.0.0)
|
|
21
21
|
Requires-Dist: trycast (>=1.2.0,<2.0.0)
|
|
22
22
|
Project-URL: Repository, https://github.com/giuseppefilippone/fuzzy_dl_owl2
|
|
@@ -78,17 +78,85 @@ The file `CONFIG.ini` is structured as follows:
|
|
|
78
78
|
```text
|
|
79
79
|
[DEFAULT]
|
|
80
80
|
debugPrint = False
|
|
81
|
-
relaxMilp = False
|
|
82
81
|
epsilon = 0.001
|
|
83
82
|
maxIndividuals = -1
|
|
83
|
+
owlAnnotationLabel = fuzzyLabel
|
|
84
|
+
milpProvider = mip
|
|
84
85
|
```
|
|
85
86
|
|
|
86
87
|
| Configuration Variable | Description |
|
|
87
88
|
|----------------------|-----------------------------------|
|
|
88
89
|
| debugPrint | Enable/disable debugging |
|
|
89
|
-
| relaxMilp | Enable/disable MILP constraint relaxation. Important: The solution may be wrong by enabling this flag |
|
|
90
90
|
| epsilon | Define the precision of the solution. For instance, epsilon = 0.001 means that the solution will be calculated with an accuracy to the third decimal place |
|
|
91
91
|
| maxIndividuals | Define the maximal number of individuals to handle. The value -1 indicate that there is no maximum |
|
|
92
|
+
| owlAnnotationLabel | Define the Annotation label used to build the Fuzzy OWL 2 RDF/XML ontology |
|
|
93
|
+
| milpProvider | Define the MILP provider used by the reasoner. The supported providers are listed below. |
|
|
94
|
+
|
|
95
|
+
Supported MILP Providers:
|
|
96
|
+
| Provider | milpProvider |
|
|
97
|
+
|--------------|----------------------|
|
|
98
|
+
| Gurobi | gurobi |
|
|
99
|
+
| CPLEX | pulp_cplex |
|
|
100
|
+
| CBC | pulp |
|
|
101
|
+
| GLPK | pulp_glpk |
|
|
102
|
+
| HiGHS | pulp_highs |
|
|
103
|
+
| MIP | mip |
|
|
104
|
+
|
|
105
|
+
⸻
|
|
106
|
+
|
|
107
|
+
# MILP Provider Usage and Configuration
|
|
108
|
+
|
|
109
|
+
## GUROBI
|
|
110
|
+
|
|
111
|
+
- Install [gurobipy](https://pypi.org/project/gurobipy/):
|
|
112
|
+
```python
|
|
113
|
+
pip install gurobipy==12.0.0
|
|
114
|
+
```
|
|
115
|
+
- Download the GUROBI license from their [website](https://www.gurobi.com/solutions/licensing/).
|
|
116
|
+
- Add Gurobi to the PATH
|
|
117
|
+
|
|
118
|
+
## MIP
|
|
119
|
+
|
|
120
|
+
- Install python [MIP](https://www.python-mip.com/):
|
|
121
|
+
```python
|
|
122
|
+
pip install mip==1.16rc0
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## GLPK
|
|
126
|
+
|
|
127
|
+
- Install [GLPK](https://www.gnu.org/software/glpk/) v5.0 and [GMP](https://gmplib.org/) v6.3.0
|
|
128
|
+
- Install python [pulp](https://github.com/coin-or/PuLP?tab=readme-ov-file):
|
|
129
|
+
```python
|
|
130
|
+
pip install pulp==3.2.1
|
|
131
|
+
```
|
|
132
|
+
- Add GLPK to the PATH
|
|
133
|
+
|
|
134
|
+
## CBC
|
|
135
|
+
|
|
136
|
+
- Install [CBC](https://github.com/coin-or/Cbc)
|
|
137
|
+
- Install python [pulp](https://github.com/coin-or/PuLP?tab=readme-ov-file):
|
|
138
|
+
```python
|
|
139
|
+
pip install pulp==3.2.1
|
|
140
|
+
```
|
|
141
|
+
- Add CBC to the PATH
|
|
142
|
+
|
|
143
|
+
## CPLEX
|
|
144
|
+
|
|
145
|
+
- Install [CPLEX](https://www.ibm.com/it-it/products/ilog-cplex-optimization-studio) v22.11
|
|
146
|
+
- Install python [pulp](https://github.com/coin-or/PuLP?tab=readme-ov-file):
|
|
147
|
+
```python
|
|
148
|
+
pip install pulp==3.2.1
|
|
149
|
+
```
|
|
150
|
+
- Add CPLEX to the PATH
|
|
151
|
+
|
|
152
|
+
## HiGHS
|
|
153
|
+
|
|
154
|
+
- Install [HiGHS](https://ergo-code.github.io/HiGHS/dev/interfaces/cpp/) v1.10.0
|
|
155
|
+
- Install python [pulp](https://github.com/coin-or/PuLP?tab=readme-ov-file):
|
|
156
|
+
```python
|
|
157
|
+
pip install pulp==3.2.1
|
|
158
|
+
```
|
|
159
|
+
- Add HiGHS to the PATH
|
|
92
160
|
|
|
93
161
|
⸻
|
|
94
162
|
|
|
@@ -54,17 +54,85 @@ The file `CONFIG.ini` is structured as follows:
|
|
|
54
54
|
```text
|
|
55
55
|
[DEFAULT]
|
|
56
56
|
debugPrint = False
|
|
57
|
-
relaxMilp = False
|
|
58
57
|
epsilon = 0.001
|
|
59
58
|
maxIndividuals = -1
|
|
59
|
+
owlAnnotationLabel = fuzzyLabel
|
|
60
|
+
milpProvider = mip
|
|
60
61
|
```
|
|
61
62
|
|
|
62
63
|
| Configuration Variable | Description |
|
|
63
64
|
|----------------------|-----------------------------------|
|
|
64
65
|
| debugPrint | Enable/disable debugging |
|
|
65
|
-
| relaxMilp | Enable/disable MILP constraint relaxation. Important: The solution may be wrong by enabling this flag |
|
|
66
66
|
| epsilon | Define the precision of the solution. For instance, epsilon = 0.001 means that the solution will be calculated with an accuracy to the third decimal place |
|
|
67
67
|
| maxIndividuals | Define the maximal number of individuals to handle. The value -1 indicate that there is no maximum |
|
|
68
|
+
| owlAnnotationLabel | Define the Annotation label used to build the Fuzzy OWL 2 RDF/XML ontology |
|
|
69
|
+
| milpProvider | Define the MILP provider used by the reasoner. The supported providers are listed below. |
|
|
70
|
+
|
|
71
|
+
Supported MILP Providers:
|
|
72
|
+
| Provider | milpProvider |
|
|
73
|
+
|--------------|----------------------|
|
|
74
|
+
| Gurobi | gurobi |
|
|
75
|
+
| CPLEX | pulp_cplex |
|
|
76
|
+
| CBC | pulp |
|
|
77
|
+
| GLPK | pulp_glpk |
|
|
78
|
+
| HiGHS | pulp_highs |
|
|
79
|
+
| MIP | mip |
|
|
80
|
+
|
|
81
|
+
⸻
|
|
82
|
+
|
|
83
|
+
# MILP Provider Usage and Configuration
|
|
84
|
+
|
|
85
|
+
## GUROBI
|
|
86
|
+
|
|
87
|
+
- Install [gurobipy](https://pypi.org/project/gurobipy/):
|
|
88
|
+
```python
|
|
89
|
+
pip install gurobipy==12.0.0
|
|
90
|
+
```
|
|
91
|
+
- Download the GUROBI license from their [website](https://www.gurobi.com/solutions/licensing/).
|
|
92
|
+
- Add Gurobi to the PATH
|
|
93
|
+
|
|
94
|
+
## MIP
|
|
95
|
+
|
|
96
|
+
- Install python [MIP](https://www.python-mip.com/):
|
|
97
|
+
```python
|
|
98
|
+
pip install mip==1.16rc0
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## GLPK
|
|
102
|
+
|
|
103
|
+
- Install [GLPK](https://www.gnu.org/software/glpk/) v5.0 and [GMP](https://gmplib.org/) v6.3.0
|
|
104
|
+
- Install python [pulp](https://github.com/coin-or/PuLP?tab=readme-ov-file):
|
|
105
|
+
```python
|
|
106
|
+
pip install pulp==3.2.1
|
|
107
|
+
```
|
|
108
|
+
- Add GLPK to the PATH
|
|
109
|
+
|
|
110
|
+
## CBC
|
|
111
|
+
|
|
112
|
+
- Install [CBC](https://github.com/coin-or/Cbc)
|
|
113
|
+
- Install python [pulp](https://github.com/coin-or/PuLP?tab=readme-ov-file):
|
|
114
|
+
```python
|
|
115
|
+
pip install pulp==3.2.1
|
|
116
|
+
```
|
|
117
|
+
- Add CBC to the PATH
|
|
118
|
+
|
|
119
|
+
## CPLEX
|
|
120
|
+
|
|
121
|
+
- Install [CPLEX](https://www.ibm.com/it-it/products/ilog-cplex-optimization-studio) v22.11
|
|
122
|
+
- Install python [pulp](https://github.com/coin-or/PuLP?tab=readme-ov-file):
|
|
123
|
+
```python
|
|
124
|
+
pip install pulp==3.2.1
|
|
125
|
+
```
|
|
126
|
+
- Add CPLEX to the PATH
|
|
127
|
+
|
|
128
|
+
## HiGHS
|
|
129
|
+
|
|
130
|
+
- Install [HiGHS](https://ergo-code.github.io/HiGHS/dev/interfaces/cpp/) v1.10.0
|
|
131
|
+
- Install python [pulp](https://github.com/coin-or/PuLP?tab=readme-ov-file):
|
|
132
|
+
```python
|
|
133
|
+
pip install pulp==3.2.1
|
|
134
|
+
```
|
|
135
|
+
- Add HiGHS to the PATH
|
|
68
136
|
|
|
69
137
|
⸻
|
|
70
138
|
|
|
@@ -122,26 +122,32 @@ class FeatureFunction:
|
|
|
122
122
|
self, a: Individual, milp: MILPHelper
|
|
123
123
|
) -> typing.Optional[Expression]:
|
|
124
124
|
if self.type == FeatureFunctionType.ATOMIC:
|
|
125
|
+
# Get the filler "b" for feature(a)
|
|
125
126
|
rel_set: list[Relation] = a.role_relations.get(self.feature)
|
|
127
|
+
assert len(rel_set) > 0
|
|
126
128
|
b: CreatedIndividual = typing.cast(
|
|
127
129
|
CreatedIndividual, rel_set[0].get_object_individual()
|
|
128
130
|
)
|
|
131
|
+
# Get the variable xB
|
|
129
132
|
x_b: Variable = milp.get_variable(b)
|
|
130
133
|
return Expression(Term(1.0, x_b))
|
|
131
134
|
elif self.type == FeatureFunctionType.NUMBER:
|
|
132
135
|
return Expression(self.n)
|
|
133
136
|
elif self.type == FeatureFunctionType.PRODUCT:
|
|
137
|
+
assert len(self.f) == 1
|
|
134
138
|
ex: Expression = self.f[0].to_expression(a, milp)
|
|
135
|
-
return
|
|
139
|
+
return ex * self.n
|
|
136
140
|
elif self.type == FeatureFunctionType.SUBTRACTION:
|
|
141
|
+
assert len(self.f) == 2
|
|
137
142
|
ex1: Expression = self.f[0].to_expression(a, milp)
|
|
138
143
|
ex2: Expression = self.f[1].to_expression(a, milp)
|
|
139
|
-
return
|
|
144
|
+
return ex1 - ex2
|
|
140
145
|
elif self.type == FeatureFunctionType.SUM:
|
|
146
|
+
assert len(self.f) >= 1
|
|
141
147
|
ex1: Expression = self.f[0].to_expression(a, milp)
|
|
142
148
|
for i in range(1, len(self.f)):
|
|
143
149
|
ex2: Expression = self.f[i].to_expression(a, milp)
|
|
144
|
-
ex1
|
|
150
|
+
ex1 = ex1 + ex2
|
|
145
151
|
return ex1
|
|
146
152
|
return None
|
|
147
153
|
|
|
@@ -129,6 +129,8 @@ from pyowl2.individual.named_individual import OWLNamedIndividual
|
|
|
129
129
|
from pyowl2.literal.literal import OWLLiteral
|
|
130
130
|
from pyowl2.ontology import OWLOntology
|
|
131
131
|
|
|
132
|
+
from fuzzy_dl_owl2.fuzzydl.util.config_reader import ConfigReader
|
|
133
|
+
|
|
132
134
|
|
|
133
135
|
# @utils.timer_decorator
|
|
134
136
|
class FuzzydlToOwl2:
|
|
@@ -149,7 +151,7 @@ class FuzzydlToOwl2:
|
|
|
149
151
|
self.ontology_iri, OWL1_annotations=True
|
|
150
152
|
)
|
|
151
153
|
self.fuzzyLabel: OWLAnnotationProperty = OWLAnnotationProperty(
|
|
152
|
-
IRI(self.ontology_iri.namespace,
|
|
154
|
+
IRI(self.ontology_iri.namespace, ConfigReader.OWL_ANNOTATION_LABEL)
|
|
153
155
|
)
|
|
154
156
|
|
|
155
157
|
self.ontology.add_axiom(OWLDeclaration(self.fuzzyLabel))
|
|
@@ -6435,6 +6435,7 @@ class DatatypeReasoner:
|
|
|
6435
6435
|
k: list[float],
|
|
6436
6436
|
type: InequalityType,
|
|
6437
6437
|
) -> None:
|
|
6438
|
+
# Gets fillers bi from every feature fi
|
|
6438
6439
|
array: set[str] = fun.get_features()
|
|
6439
6440
|
new_variable: bool = False
|
|
6440
6441
|
for feature in array:
|
|
@@ -6454,21 +6455,28 @@ class DatatypeReasoner:
|
|
|
6454
6455
|
x_fi: Variable = kb.milp.get_variable(
|
|
6455
6456
|
ind, bi, feature, VariableType.BINARY
|
|
6456
6457
|
)
|
|
6458
|
+
# (a,bi):Fi >= x_{(a,bi):Fi}
|
|
6457
6459
|
IndividualHandler.add_relation(
|
|
6458
6460
|
ind, feature, bi, DegreeVariable.get_degree(x_fi), kb
|
|
6459
6461
|
)
|
|
6460
|
-
x_bi: Variable = (
|
|
6461
|
-
|
|
6462
|
-
|
|
6463
|
-
|
|
6462
|
+
x_bi: Variable = kb.milp.get_variable(
|
|
6463
|
+
bi,
|
|
6464
|
+
(
|
|
6465
|
+
VariableType.INTEGER
|
|
6466
|
+
if t.get_type() == ConcreteFeatureType.INTEGER
|
|
6467
|
+
else VariableType.CONTINUOUS
|
|
6468
|
+
),
|
|
6464
6469
|
)
|
|
6465
|
-
if new_variable
|
|
6470
|
+
if new_variable and ki is not None:
|
|
6466
6471
|
kb.restrict_range(x_bi, x_fi, ki[0], ki[1])
|
|
6472
|
+
# xIsC <= xFi
|
|
6467
6473
|
kb.milp.add_new_constraint(
|
|
6468
6474
|
Expression(Term(1.0, x_is_c), Term(-1.0, x_fi)),
|
|
6469
6475
|
InequalityType.LESS_THAN,
|
|
6470
6476
|
)
|
|
6477
|
+
# xF \in {0,1}
|
|
6471
6478
|
x_fi.set_binary_variable()
|
|
6479
|
+
# xB is a datatype filler
|
|
6472
6480
|
x_bi.set_datatype_filler_variable()
|
|
6473
6481
|
DatatypeReasoner.write_feature_equation(ind, fun, x_b, x_is_c, x_f, k, type, kb)
|
|
6474
6482
|
|
|
@@ -98,7 +98,7 @@ class Expression:
|
|
|
98
98
|
|
|
99
99
|
def add_term(self, term: Term) -> None:
|
|
100
100
|
for idx, t in enumerate(self.terms):
|
|
101
|
-
if t == term:
|
|
101
|
+
if t.get_var() == term.get_var():
|
|
102
102
|
self.terms[idx] = t + term
|
|
103
103
|
return
|
|
104
104
|
self.terms.append(term)
|
|
@@ -169,6 +169,17 @@ class Expression:
|
|
|
169
169
|
def __truediv__(self, scalar: typing.Union[int, float]) -> typing.Self:
|
|
170
170
|
return self * (1 / scalar)
|
|
171
171
|
|
|
172
|
+
def __hash__(self) -> int:
|
|
173
|
+
return hash(str(self))
|
|
174
|
+
|
|
175
|
+
def __eq__(self, value: typing.Self) -> bool:
|
|
176
|
+
if not isinstance(value, Expression):
|
|
177
|
+
return False
|
|
178
|
+
return len(self.terms) == len(value.terms) and all(term in value.terms for term in self.terms)
|
|
179
|
+
|
|
180
|
+
def __ne__(self, value: typing.Self) -> bool:
|
|
181
|
+
return not (self == value)
|
|
182
|
+
|
|
172
183
|
def __repr__(self) -> str:
|
|
173
184
|
return str(self)
|
|
174
185
|
|
|
@@ -184,5 +195,5 @@ class Expression:
|
|
|
184
195
|
elif n == -1.0:
|
|
185
196
|
parts.append(f"- {term.get_var()}")
|
|
186
197
|
else:
|
|
187
|
-
parts.append(f"{'+ ' if n >= 0 else '- '}{n} {term.get_var()}")
|
|
198
|
+
parts.append(f"{'+ ' if n >= 0 else '- '}{abs(n)} {term.get_var()}")
|
|
188
199
|
return " ".join(parts)
|
|
@@ -43,6 +43,18 @@ class Inequation:
|
|
|
43
43
|
assert self.type == InequalityType.GREATER_THAN
|
|
44
44
|
return ">="
|
|
45
45
|
|
|
46
|
+
def is_zero(self) -> bool:
|
|
47
|
+
return all(term.get_coeff() == 0 for term in self.expr.get_terms()) and self.expr.get_constant() == 0
|
|
48
|
+
|
|
49
|
+
def __hash__(self) -> int:
|
|
50
|
+
return hash(str(self))
|
|
51
|
+
|
|
52
|
+
def __eq__(self, value: typing.Self) -> bool:
|
|
53
|
+
return self.expr == value.expr and self.type == value.type
|
|
54
|
+
|
|
55
|
+
def __ne__(self, value: typing.Self) -> bool:
|
|
56
|
+
return not (self == value)
|
|
57
|
+
|
|
46
58
|
def __repr__(self) -> str:
|
|
47
59
|
return str(self)
|
|
48
60
|
|