The challenging research area of Fuzzy Logic Programming is devoted to introduce fuzzy logic concepts into logic programming in order to explicitly treat with uncertainty in a natural way. It has provided a wide variety of PROLOG dialects along the last three decades. Fuzzy logic languages can be classified (among other criteria) regarding the emphasis they assign when fuzzifying the original unification/resolution mechanisms of PROLOG. So, whereas some approaches are able to cope with similarity/proximity relations at unification time [3, 2, 16], other ones extend their operational principles (maintaining syntactic unification) for managing a wide variety of fuzzy connectives and truth degrees on rules/goals beyond the simpler case of true or false [7, 8, 13]. Our research group has been involved in both alternatives, as reveals the design of the Bousi∼Prolog language1 [5, 6, 15], where clauses cohabits with similarity/proximity equations, and the development of the FLOPER system2, which manages fuzzy programs composed by rules richer than clauses [9, 12]. Our current goal for fusing both worlds is somehow inspired by [1], but in our framework we admit a wider set of connectives inside the body of programs rules. Here, we present a first step in our pending task from some years ago for embedding into FLOPER the weak unification algorithm of Bousi∼Prolog.
FASILL is a first order language built upon a signature Σ, that contains the elements of a countably infinite set of variables V, function symbols and predicate symbols with an associated arity –usually expressed as pairs f /n or p/n where n represents its arity–, quantifiers (∀, ∃), the implication symbol (←) and a set of connectives. The language combines the elements of Σ as terms, atoms, rules and formulas. A constant c is a function symbol with arity zero. A term is a variable, a constant or a function symbol f/n applied to n terms t1,...,tn, and is denoted as f(t1,...,tn). We allow values of a lattice L as part of the signature Σ. Therefore, a well-formed formula can be either:
• r, if r ∈ L
• p(t1,...,tn), if t1,...,tn are terms and p/n is an n-ary predicate. This formula is called atom. Particularly, atoms containing no variables are called ground atoms, and atoms built from nullary predicates are called propositional variables
• ς(F1,...,Fn), if F1,...,Fn are well-formed formulas and ς is an n-ary connective with truth function [[ς]] : Ln → L
Definition 1.1 (Complete lattice). A complete lattice is a partially ordered set (L,≤) such that every subset S of L has infimum and supremum elements. Then, it is a bounded lattice, i.e., it has bottom and top elements, denoted by ⊥ and ⊤, respectively. L is said to be the carrier set of the lattice, and ≤ its ordering relation.
The lattice is equipped with a set of connectives3 including
• aggregators denoted by @, whose truth functions [[@]] fulfill the boundary condition:[[@]](⊤,⊤) = ⊤,
[[@]] (⊥,⊥) = ⊥, and monotonicity: (x1,y1) ≤ (x2,y2) ⇒ [[@]] (x1,y1) ≤ [[@]] (x2,y2).
• t-norms and t-conorms [14] (also named conjunctions and disjunctions, that we denote by & and |, respectively) whose truth functions fulfill the following properties:
Here we use the lattice ([0,1],≤), where ≤ is the usual ordering relation, and three sets of connectives corresponding to the fuzzy logics of Gödel, Łukasiewicz and Product (with different capabilities for modeling pessimistic, optimistic and realistic scenarios.)
Definition 1.2 (Similarity relation). Given a domain U and a lattice L with fixed t-norm ∧, a similarity relation R is a fuzzy binary relation on U , that is a fuzzy subset on U × U (namely, a mapping R : U ×U → L), such that fulfills the following properties4:
• Reflexive: R(x,x) = ⊤,∀x ∈ U
• Symmetric: R(x,y) = R(y,x),∀x,y ∈ U
• Transitive: R(x,z) ≥ R(x,y)∧R(y,z),∀x,y,z ∈ U
Certainly, we are interested in fuzzy binary relations on a syntactic domain. We primarily define similarities on the symbols of a signature, Σ, of a first order language. This makes possible to treat as indistinguishable two syntactic symbols which are related by a similarity relation R. Moreover, a similarity relation R on the alphabet of a first order language can be extended to terms by structural induction in the usual way [16]:
1. let x be a variable, Rˆ(x,x) = R(x,x) = 1,
2. let f and g be two n-ary function symbols and let t1, ..., tn, s1, ..., sn be terms,
Rˆ(f(t1,...,tn),g(s1,...,sn)) = R(f,g)∧(∧ni=1 Rˆ(ti,si))
3. otherwise, the approximation degree of two terms is zero.
Analogously for atomic formulas. Note that, following on, we shall not make a notational distinction between the relation R and its extension Rˆ.
Definition 1.3 (Rule). A rule has the form A ← B, where A is an atomic formula called head and B, called body, is a well-formed formula (ultimately built from atomic formulas B1,...,Bn, truth values of L and connectives) 5. In particular, when the body of a rule is r ∈ L (an element of lattice L), this rule is called fact and can be written as A ← r (or simply A if r = ⊤).
Definition 1.4 (Program). A program P is a tuple 〈Π,R,L〉 where Π is a set of rules, R is a similarity relation between the elements of Σ, and L is a complete lattice.
1 Two different programming environments for Bousi∼Prolog are available at http://dectau.uclm.es/bousi/.
2 The tool is freely accessible from the Web site http://dectau.uclm.es/floper/.
3Here, the connectives are binary operations but we usually generalize them with an arbitrary number of arguments.
4For convenience, R(x,y), also denoted xRy, refers both the syntactic expression (that symbolizes that the elements x,y∈U are related by R) and the truth degree μR(x,y), i.e., the affinity degree of the pair (x,y) ∈ U ×U with the verbal predicate R.
5In order to subsume the syntactic conventions of MALP, in our programs we also admit weighted rules with shape “A ←i B with v”, which are internally treated as “A ← (v&iB)” (this transformation preserves the meaning of rules as proved in [10]).