MUFLON: Matrix Utility for Intuitionistic Fuzzy Relational Equations
MUFLON is a Python library for computations with intuitionistic fuzzy values and intuitionistic fuzzy relational systems of equations.
The library treats an intuitionistic fuzzy value as a pair
$(\mu,\nu)\in L^{},\qquad L^{}={(\mu,\nu)\in[0,1]^2:\mu+\nu\le 1}$
The first coordinate $(\mu)$ is the membership degree, and the second coordinate $(\nu)$ is the non-membership degree. Every input and output pair should satisfy the condition
$\mu+\nu\le 1.$
Mathematical model
The library supports intuitionistic fuzzy relational systems of the form
$A^{\vee,{*}}_{\wedge,\diamond}\circ x=b.$
The system is decomposed into two fuzzy relational systems:
$\max_j(a^{\mu}_{ij}*x^{\mu}_j)=b^{\mu}_i,$
and
$\min_j(a^{\nu}_{ij}\diamond x^{\nu}_j)=b^{\nu}_i.$
Here () is the membership operation and $(\diamond)$ is the non-membership operation. In the most common cases, $()$ is a t-norm and $(\diamond)$ is its dual t-conorm, for example $(T_M,S_M)$, $(T_P,S_P)$, or $(T_L,S_L)$. More generally, the operations should satisfy the assumptions required for the corresponding fuzzy relational equation.
Data format
MUFLON works with CSV files in which each cell contains one intuitionistic fuzzy value.
Example:
0.3, 0.4; 0.2, 0.1; 0.5, 0.2
0.7, 0.1; 0.6, 0.2; 1.0, 0.0
The semicolon ; separates columns. The comma , separates the membership and non-membership coordinates inside a cell. Decimal numbers should use a dot.
Recommended parsing function:
from muflon.data_io import parse_ifs_csv_to_components
membership_matrix, nonmembership_matrix = parse_ifs_csv_to_components(df)
Composition of intuitionistic fuzzy matrices
For the membership component, the composition is
$$C^{\mu}{ik}=\max_j(a^{\mu}{ij}*b^{\mu}_{jk}).$$
For the non-membership component, the composition is
$$C^{\nu}{ik}=\min_j(a^{\nu}{ij}\diamond b^{\nu}_{jk}).$$
Recommended usage:
from muflon.ifs_operators import get_operator
from muflon.ifs_operations import (
compose_component_matrices,
combine_components_to_ifs,
validate_l_star_condition,
)
membership_operation = get_operator("T_M")
nonmembership_operation = get_operator("S_M")
membership_result = compose_component_matrices(
A_mu,
B_mu,
component_ops=[membership_operation],
aggregation=np.max,
)
nonmembership_result = compose_component_matrices(
A_nu,
B_nu,
component_ops=[nonmembership_operation],
aggregation=np.min,
)
ifs_matrix = combine_components_to_ifs(membership_result, nonmembership_result)
is_valid, sums = validate_l_star_condition(membership_result, nonmembership_result)
The high-level function
compose_ifs_matrices(...)
computes both components and returns a matrix of intuitionistic fuzzy pairs. The result should still be checked with validate_l_star_condition().
Solving the decomposed system
For the membership system
$$\max_j(a^{\mu}_{ij}*x^{\mu}_j)=b^{\mu}_i,$$
the candidate for the greatest membership solution is computed by the induced implication:
$$u^{\mu}j=\min_i(a^{\mu}{ij}\to_{*} b^{\mu}_i).$$
For the non-membership system
$$\min_j(a^{\nu}_{ij}\diamond x^{\nu}_j)=b^{\nu}_i,$$
the corresponding component is computed by the dual induced implication:
$$z^{\nu}j=\max_i(a^{\nu}{ij}\leftarrow_\diamond b^{\nu}_i).$$
Recommended usage:
from muflon.ifs_operators import get_operator
from muflon.ifs_operations import (
solve_component_system,
solve_ifs_system_candidate,
validate_l_star_condition,
)
induced_implication_mu = get_operator("IMP_T_M")
dual_induced_implication_nu = get_operator("DIMP_S_M")
greatest_membership_solution = solve_component_system(
A_mu,
b_mu,
induced_implication_mu,
aggregation=np.min,
)
least_nonmembership_solution = solve_component_system(
A_nu,
b_nu,
dual_induced_implication_nu,
aggregation=np.max,
)
is_valid, sums = validate_l_star_condition(
greatest_membership_solution,
least_nonmembership_solution,
)
The term least_nonmembership_solution means the least solution of the non-membership component in the usual order on $([0,1])$. Together with the greatest membership solution it forms a candidate for the greatest solution in the intuitionistic order. This candidate must satisfy the $(L^{*})$ condition.
Available operators
| Meaning | Identifier |
|---|---|
| Minimum t-norm | T_M |
| Product t-norm | T_P |
| Łukasiewicz t-norm | T_L |
| Drastic t-norm | T_D |
| Fodor t-norm | T_FD |
| Maximum t-conorm | S_M |
| Probabilistic sum | S_P |
| Łukasiewicz t-conorm | S_L |
| Drastic sum | S_D |
| Fodor t-conorm | S_FD |
Induced implication for T_M |
IMP_T_M |
Induced implication for T_P |
IMP_T_P |
Induced implication for T_L |
IMP_T_L |
Induced implication for T_FD |
IMP_T_FD |
Dual induced implication for S_M |
DIMP_S_M |
Dual induced implication for S_P |
DIMP_S_P |
Dual induced implication for S_L |
DIMP_S_L |
Reduced matrices and minimal component solutions
The reduced matrix is computed componentwise.
A_reduced = compute_reduced_matrix(A, x_component, b_component, operator, mode="eq")
A_binary = binarize_reduced_matrix(A_reduced)
minimal_component_solutions = find_minimal_component_solutions(
A,
b_component,
A_reduced,
dual_implication,
operator,
mode="eq",
)
The function find_minimal_component_solutions() concerns one component system. It does not by itself produce the full family of intuitionistic fuzzy solutions. The full intuitionistic result must also satisfy the condition $(\mu+\nu\le 1)$.Important notes
- A joined matrix of pairs is not automatically a valid intuitionistic fuzzy matrix. It is valid only if every pair satisfies $(\mu+\nu\le 1)$.
- The membership component should use induced implications such as
IMP_T_M,IMP_T_P, orIMP_T_L. - The non-membership component should use dual induced implications such as
DIMP_S_M,DIMP_S_P, orDIMP_S_L. - The non-membership operation should be described as $(\diamond)$, not simply as an arbitrary s-conorm. In standard dual cases, $(\diamond)$ is the t-conorm dual to $({*})$.
- If a complement transformation $(1-\nu)$ is used in an algorithm, it must be explicitly implemented and documented. Otherwise, the description should not claim that such a transformation is automatic.
Metadata
Release files for muflon 1.3.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| muflon-1.3.7.tar.gz | 9.4 kB | Without provenance | Details for muflon-1.3.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| muflon-1.3.7-py3-none-any.whl | Python 3 | none | any | Details for muflon-1.3.7-py3-none-any.whl |
Total release size: 17.4 kB
Release files / muflon-1.3.7.tar.gz
| Download URL | muflon-1.3.7.tar.gz |
|---|---|
| Size | 9.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d83c8d7c41d7bf567fe828d6185b99f2ba5b2cd8ef41352eeed37878beb2a82a
|
|
BLAKE2b-256 checksum How to use checksums |
de08a95523292d5b1a19ef0ba79a8235179923ca1236e3150d33c3f321e8bb81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.0
|
Release files / muflon-1.3.7-py3-none-any.whl
| Download URL | muflon-1.3.7-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f9f31af853e0f50bd78470b75a6f0b6cc4bdd634e3292ebb81d9e4576ef2b1b4
|
|
BLAKE2b-256 checksum How to use checksums |
fc509b8c99c7c68315e983fec0fe7e36c3967d04208f33895c5d2bcf70e08286
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.0
|
Security for muflon 1.3.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.