FASILL documentation Source fasill_linearization

Linearization

This library provides predicates for linearization of FASILL programs.

A term or atom is linear if it does not contain multiple occurrences of the same variable. Any term or atom that is not linear is said to be nonlinear. Given a nonlinear atom $A$, the linearization of $A$ is a process by which the structure $\langle A_l, C_l\rangle$ is computed, where: $A_l$ is a linear atom built from $A$ by replacing each one of the $n_i$ multiple occurrences of the same variable $x_i$ by new fresh variables $y_k$ $(1 \leq k \leq n_i)$; and $C_l$ is a set of proximity constrains $x_i \sim y_k$ (with $1 \leq k \leq n_i$). The operator "$s \sim t$" is asserting the similarity of two terms $s$ and $t$. Now, let $R = A \leftarrow \mathcal{B}$ be a rule and $\langle A_l, C_l\rangle$ be the linearization of $A$, where $C_l = \{x_1 \sim y_1, \dots, x_n \sim y_n\}$, $lin(R) = A_l \leftarrow x_1 \sim y_1 \wedge \dots \wedge x_n \sim y_n \wedge \mathcal{B}$. For a set $\Pi$ of rules, $lin(\Pi) = \{lin(R) : R \in \Pi\}$.

Given a FASILL program $\mathcal{P} = \langle\Pi, \mathcal{R}, L\rangle$, where $\Pi$ is a set of rules, $\mathcal{R}$ is a similarity relation, and $L$ is a complete lattice. Let $\lambda \in L$ be a cut value. The set of rules which are similar to the rules in $lin(\Pi)$, for a level $\lambda$, $\mathcal{K}_\lambda(\Pi) = \{H \leftarrow \alpha \wedge \mathcal{B}: H' \leftarrow \mathcal{B} \in lin(\Pi), \mathcal{R}(H,H') = \alpha \geq \lambda\}$ are reflecting the meaning induced by the similarity relation $\mathcal{R}$ into the set of rules $\Pi$. Note that the concept of extended program, $\mathcal{K}_\lambda(\Pi)$, is a purely instrumental notion, which does not take part in the definition of the operational semantics of the language.

For more details see:

• Julián-Iranzo, Pascual, Ginés Moreno, and Jaime Penabad. "Thresholded semantic framework for a fully integrated fuzzy logic language." Journal of logical and algebraic methods in programming 93 (2017): 42-67. https://doi.org/10.1016/j.jlamp.2017.08.002

linearize_rename/3

linearize_rename( +Expression, ?Renamed, ?Substitution )

This predicate renames the expression Expression, replacing the variables of the expression by fresh variables. Renamed is the expression Expression with fresh variables.

linearize_substitution/2

linearize_substitution( ?Substitution, ?Body )

This predicate succeeds when ?Substitution is a FASILL substitution of variables and Body is the linearized body of the substitution.

This predicate succeeds linearizing the FASILL rule Rule. This predicate has the side effect of retracting the rule Rule and asserting the new linearized rule.

This predicate succeeds when Rule is a FASILL rule and Linearized is a linearized rule of Rule.

This predicate succeeds linearizing the FASILL rule with identifier Id. This predicate has the side effect of retracting the rule and asserting the new linearized rule.

This predicate succeeds when Id is the identifier of a FASILL rule and Linearized is a linearized rule.

This predicate succeeds linearizing the FASILL rules of the current program. This predicate has the side effect of retracting the rules and asserting the new linearized rules.

extend_term/3

extend_term( +Term, -ExtendedTerm, -TD )

This predicate succeeds when ExtendedTerm is an extended term of Term with truth degree TD. It can be used to generate, by reevaluation, all possible extended terms of a given term.

extend_rule/1

extend_rule( +Rule )

This predicate succeeds extending the FASILL rule Rule. This predicate has the side effect of retracting the rule Rule and asserting the new extended rules.

extend_rule/2

extend_rule( +Rule, ?Extended )

This predicate succeeds when Rule is a FASILL rule and Extended is an extended rule of Rule.

extend_rule_by_id/1

extend_rule_by_id( ?Id )

This predicate succeeds extending the FASILL rule with identifier Id. This predicate has the side effect of retracting the rule and asserting the new extended rules.

extend_rule_by_id/2

extend_rule_by_id( ?Id, ?Extended )

This predicate succeeds when Id is the identifier of a FASILL rule and Extended is a extended rule.

extend_program/0

extend_program

This predicate succeeds extending the FASILL rules of the current program. This predicate has the side effect of retracting the rules and asserting the new extended rules.