meta-logic programming for a synonymy logic
TRANSCRIPT
ORIGINAL PAPER
Meta-logic programming for a synonymy logic
Daniele Genito Æ Giangiacomo Gerla ÆAlessandro Vignes
Published online: 27 February 2009
� Springer-Verlag 2009
Abstract In order to give a suitable framework for a
synonymy-based logic programming, we argue about the
possibility of reducing fuzzy logic programming to clas-
sical logical programming. More precisely, we show that
given a fuzzy program in a language L, we can translate it
into an equivalent classical program in a (meta-)language
Lm in which every predicate name in L becomes a constant
in Lm: This enables us to admit in Lm meta-relations among
predicates and therefore, in particular, the synonymy.
Keywords Synonymy logic � Logic programming �Fuzzy logic � Translation
1 Introduction
Recently, there have been several interesting proposals to
extend logic programming in such a way to admit vague
predicates. An important step in such a direction was made
in Vojtas (2001) where the basic theoretical notions for
fuzzy logic programming were established (see also;
Ebrahim 2001; Gerla 2005 where applications to fuzzy
control are suggested). A promising idea is to extend fuzzy
logic programming to take into account the synonymy
relation among predicates in accordance with the similarity
logic proposed by Ying (1994). The idea of Ying is that it
is possible to relax the application of the inference rules
in such a way that it is also admitted an approximate
matching of the predicate names. As an example it is
admitted that from a and a0 ! b we can infer b even in the
case that a0 is only approximately equal to a. An applica-
tion to such an idea to logic programming was done in
several papers (see Biacino and Gerla 1998; Fontana et al.
1998; Alsinet and Godo 2004; Biacino et al. 2000) where
the definition of synonymy refers to Godel’s norm.
Successively, in Medina and Ojeda-Aciego (2004) one
shows that it is possible to define a similarity logic pro-
gramming (in particular a synonymy logic programming)
in the framework of multi-adjoint logic programming. The
proposed procedure works with any triangular norm and
the author shows that the resulting logic coincides with the
existing ones in the case of Godel’s norm.
In this paper we start from a different point of view.
Indeed, we observe that since the synonymy is a meta-
relation, in order to define a synonymy logic we have to
consider a suitable meta-logic. On the other hand, all the
definitions in fuzzy logic programming and in similarity
logic programming can be expressed by positive clauses in
classical logic programming. Then, we show that given a
fuzzy program in a language L, we can translate it into an
equivalent classical program in a suitable (meta-) language
Lm: Since the predicate names in L become constants in
Lm; this enables us to admit in Lm meta-relations among
predicates. In particular, the meta-relation the paper is
interested is the synonymy and this enable us to define a
synonymy-sensitive fuzzy logic programming.
Three reasons in favor of such a logic are exhibited. The
first one is that, differently from the papers (Biacino and
Gerla 1998; Fontana et al. 1998; Alsinet and Godo 2004),
D. Genito (&) � G. Gerla � A. Vignes
Dipartimento di Matematica ed Informatica,
Universita di Salerno, via Ponte don Melillo,
84084 Fisciano (SA), Italy
e-mail: [email protected]
G. Gerla
e-mail: [email protected]
A. Vignes
e-mail: [email protected]
123
Soft Comput (2010) 14:299–311
DOI 10.1007/s00500-009-0404-6
all the triangular norms are admitted. The second is that the
resulting notion of fuzzy Herbrand model is uniformly
continuous with respect to the synonymy relation (a basic
property for a synonymy logic, in our opinion). Finally,
another reason is that the resulting logic is a similarity
logic in the abstract sense given in Gerla (2001) This
means that its deduction operator is the closure operator
obtained by combining the similarity closure operator with
the one-step consequence operator associated with the
given fuzzy program.
Finally, we analyze the computational features of the
proposed logic by referring to the notion of recursively
enumerable fuzzy subset given in Gerla (2001), (2006).
As usual, if L is a first order language, then we denote
by Form(L) the set of formulas of L, by B(L) the Herbrand
base, i.e. the set of facts, by Cl(L) the related set of positive
clauses. A positive program is a set P of positive clause.
We call least Herbrand model of P, the set MP of facts we
can prove from P. Denote by Gr(P) the set of ground
instances of the formulas in P and by Fact(P) the set of
facts in Gr(P). Then, the one-step consequence operator is
the function TP : P B Lð Þð Þ ! P B Lð Þð Þ defined by setting
TP Sð Þ ¼ a 2 BP : a a1 ^ � � � ^ am 2 Gr Pð Þ;fa1 2 S; . . .; am 2 Sg [ Fact Pð Þ
for every subset S of BL: Such an operator enables us to
obtain the least Herbrand model MP of P by the equation
MP ¼ [n2NTnPð[Þ:
2 Translation of a classical program
As a first step, we consider a way to translate a classical
program (in a language L) into another simple classical
program (in a suitable ‘‘meta-language’’ Lm). Successively
we will extend this to the fuzzy case. As an example,
consider the following program P
r(a, b)
r(b, c)
r(c, d)
r(s, s)
sr X; Yð Þ r Y ;Xð Þsr X; Yð Þ r X; Yð Þ:
The language L of P has two predicate symbols r and sr
and the constants a, b, c, d, s. Now, we can interpret a fact
as r(a, b) at a meta-linguistic level by claiming that:
the sentence ‘‘the relation r is satisfied by a and b’’ is an
axiom.
Likewise, we can interpret the instance sr b; að Þ r a; bð Þ of the rule sr X; Yð Þ r Y ;Xð Þ by claiming
if the sentence ‘‘the relation r is satisfied by a and b’’ is a
theorem,
then the sentence ‘‘the relation sr is satisfied by b and a’’
is a theorem.
Then we have to consider a language Lm in which, by a
reification process, the predicate symbols r and sr become
two constants and in which there are two predicates cor-
responding to the notions ‘‘to be an axiom’’ and ‘‘to be a
theorem’’. In such a language we can translate the program
P into the following program
ax(r, a, b)
ax(r, b, c)
ax(r, c, d)
ax(r, s, s)
th sr;X; Yð Þ th r;X; Yð Þth sr;X; Yð Þ th r; Y;Xð Þ:
Obviously, we have to add also a general rule to claim
that any axiom is a theorem
th R;X; Zð Þ ax R;X; Zð Þ:
We can also avoid such a rule and to substitute directly
ax with th. Notice that we cannot interpret th sr;X; Yð Þ th r; Y;Xð Þ as ‘‘if r(Y, X) is a theorem then r(X, Y) is a
theorem’’ since this should be the interpretation of the
formula 8X8Y sr X; Yð Þð Þ 8X8Y r Y ;Xð Þð Þð Þ: Instead a
ground instance as th sr; b; að Þ th r; a; bð Þ of such a rule
is correctly interpreted as ‘‘if r(a, b) is a theorem then
r(b, a) is a theorem’’.
Definition 2.1 Given a first order language L we denote
by Lm the language such that:
– the constants of Lm are obtained by adding to the
constants of L all the predicate symbols of L
– the function symbols are the same as in L
– there is a predicate symbol thn of arity nþ 1 for every
arity n of a predicate symbol in L.
A translation function from L to Lm is defined as
follows.
Definition 2.2 The translation function is the map s :Form Lð Þ ! Form Lmð Þ defined by setting
s r t1; . . .; tnð Þð Þ ¼ thn r; t1; . . .; tnð Þ:sða1 ^ a2Þ ¼ s a1ð Þ ^ s a2ð Þ;sða1 _ a2Þ ¼ s a1ð Þ _ s a2ð Þ;s :að Þ ¼ :s að Þ;sð8xiaÞ ¼ 8xis að Þ:
In particular, the translation of a (positive) clause a a1 ^ � � � ^ ah is the (positive) clause s að Þ s a1ð Þ ^ � � � ^s ahð Þ: This means that if P is a (positive) program, then
s(P) is a (positive) program, too. To simplify our notations,
300 D. Genito et al.
123
in the sequel we will write th r; t1; . . .; tnð Þ instead of
thn r; t1; . . .; tnð Þ: Equivalently, we can consider only a
monadic predicate th in Lm and some way to represent a
vector ðx0; x1; . . .; xnÞ: For example, we can add in Lm a
name List for a binary function, and to write ðx0; x1; . . .; xnÞto denote the term Listððx0; x1; . . .; xn�1Þ; xnÞ and x0ð Þ to
denote x0: Then the translation can be defined by substi-
tuting the first rule with
s r t1; . . .; tnð Þð Þ ¼ th r; t1; . . .; tnð Þð Þ:
It is evident that,
T ‘ a, s Tð Þ ‘ s að Þ
where ‘ is the classical entailment relation, T is a theory
and a a formula. To show this it is sufficient to observe
that:
– if Ax is the set of logical axioms, then a 2 Ax if and
only if s að Þ 2 Ax
– the translation is compatible with the inference rules.
In particular, if P is a program and a a fact,
a 2 MP , s að Þ 2 MsðPÞ
where MP and Ms Pð Þ are the Herbrand models of P and
s(P), respectively. We give a step-by-step proof of such an
equivalence in the perspective of its extension to fuzzy
logic programming.
Theorem 2.3 Let P be a positive program and let MP and
Ms Pð Þ be the Herbrand models of P and s(P), respectively.
Then,
a 2 MP , s að Þ 2 MsðPÞ: ð2:1Þ
Proof It is not restrictive to assume that P is ground. To
prove (2.1) it is sufficient to prove that, for every fact a and
n 2 N;
a 2 TnPð[Þ , s að Þ 2 Tn
s Pð Þð[Þ: ð2:2Þ
We will prove this by induction on n. Indeed, in the
case n = 1, since TPð[Þ ¼ Fact Pð Þ and Ts Pð Þð[Þ ¼Fact s Pð Þð Þ ¼ s Fact Pð Þð Þ; (2.2) is evident. Consider the
case n 6¼ 1; assume that (2.2) is satisfied by n� 1 and that
a 2 TnPð[Þ ¼ TPðTn�1
P ð[ÞÞ: Then either a 2 Tn�1P ð[Þ or
there is a rule a a1 ^ � � � ^ ah in P such that a1 2Tn�1
P ð[Þ; . . .; ah 2 Tn�1P ð[Þ: In the first case, by the
induction hypothesis s að Þ 2 Tn�1P ð[Þ and therefore s að Þ 2
TnPð[Þ: In the latter, by the induction hypothesis s a1ð Þ 2
Tn�1sðPÞ ð[Þ; . . .; s ahð Þ 2 Tn�1
sðPÞ ð[Þ and, since the rule s að Þ s a1ð Þ ^ � � � ^ s ahð Þ is in s(P), this entails that s að Þ2 Tn
s Pð Þð[Þ:Conversely, assume that s að Þ 2 Tn
sðPÞð[Þ ¼ TsðPÞTn�1
sðPÞð[Þ� �
: Then either s að Þ 2 Tn�1s Pð Þð[Þ or there is a rule
b1 ^ � � � ^ bh ! b with b ¼ s að Þ in s(P) such that b1 2Tn�1
s Pð Þ ð[Þ; . . .; bh 2 Tn�1s Pð Þð[Þ: In the first case by induction
hypothesis a 2 Tn�1P ð[Þ and therefore a 2 Tn
Pð[Þ: In the
latter, let a0 a1 ^ � � � ^ ah be a rule in P whose transla-
tion is b b1 ^ � � � ^ bh: Then
s a0ð Þ ¼ b ¼ s að Þ;s a1ð Þ ¼ b1 2 Tn�1
s Pð Þ ð[Þ; . . .; s ahð Þ ¼ bh 2 Tn�1s Pð Þ ð[Þ:
Since by inductive hypothesis, a1 2 Tn�1P ð[Þ; . . .; ah 2
Tn�1P ð[Þ; this entails that a0 2 Tn
Pð[Þ: Since s is injective,
we can conclude that a 2 TnPð[Þ:
The translation of a program P into the meta-program
s(P) is proposed as a first step toward a possible trans-
lation of a fuzzy logic program into a classical meta-
program. Nevertheless, perhaps this translation gives
some advantages also in the case we confine ourselves to
classical logic programming. As an example, if we admit
the meta-predicate ‘‘is the symmetric extension of’’, then
we can consider the following translation of the proposed
example:
th(r, a, b)
th(r, b, c)
th(r, c, d)
th(r, s, s)
symm exten sr; rð Þth R2;X; Yð Þ symm exten R2;R1ð Þ ^ th R1;X; Yð Þth R2;X; Yð Þ symm exten R2;R1ð Þ ^ th R1; Y ;Xð Þ:
The advantage of such a translation is that the two meta-
rules give a general procedure for the symmetric extension
of a relation. So we can add such a procedure to our library.
In a similar uniform way we can define, for example,
procedures for the reflexive extension and the transitive
extension of a relation.
Observe that the idea for a translation of classical logic
into classical logic programming was examined in litera-
ture in an extensive way (see for example Costantini 2002;
Hill and Gallagher 1998).
3 Deduction apparatus for fuzzy logic
First order fuzzy logic is based on the notion of fuzzy
subset. If (V, B, 0, 1) is a complete lattice and S a non-
empty set, then a fuzzy subset of S is any map s : S! V:
For every x 2 S; the value s(x) is interpreted as a mem-
bership degree. We say that s is finite provided that its
support fx 2 S : s xð Þ 6¼ 0g is finite. We denote by VS the
class of all the fuzzy subsets of S. If sið Þi2I is a family of
fuzzy subsets of S, then [i2Isi and \i2Isi are the fuzzy
subsets defined by the equations
Meta-logic programming for a synonymy logic 301
123
ð[i2IsiÞ xð Þ ¼ Supi2Isi xð Þ; ð\i2IsiÞ xð Þ ¼ Infi2Isi xð Þ:
In all the logics the deduction apparatus is a tool to
elaborate pieces of information. In fuzzy logic a piece of
information is represented by a fuzzy subset s :
Form Lð Þ ! V of formulas we call a fuzzy theory or fuzzy
subset of proper axioms. The intended meaning of a fuzzy
theory is that, given a formula a, s(a) represents the
information
‘‘the truth value of a is at least s(a)’’.
We call fuzzy formula any pair (a, k) where a is a for-
mula and k 2 V: Let s be a finite fuzzy theory whose
support is fa1; . . .; ang: Then we can represent s by the
finite set f a1; k1ð Þ; . . .; an; knð Þg of fuzzy formulas where
ki ¼ s aið Þ: Equivalently, we represent s by a list as
a1 k1½ �� � �an kn½ �
We can improve the available information s by the proofs
and, in turn, this requires a notion of fuzzy inference rule.
The following are examples of ‘‘fuzzyfication’’ of three
famous classical rules (modus ponens, particularization, and
^-introduction rule):
a; a! bb
;k; lk� l
� �;
8xaaðtÞ ;
kk
� �;
a; ba ^ b
;k; l
k� l
� �
where t is any term, a and b are formulas in L, k, l ele-
ments in V and � is a suitable binary operation. Notice that
the values k and l in the inference rules are not intended as
truth values but as constraints on the possible truth values.
So, the operation � expresses a way to calculate a con-
straint on the truth value of the conclusion from constraints
on the truth values of the premises. More in particular, the
meaning of these rules is the following.
Extended modus ponens if it is proved that the truth
value of a is at least k and that the truth value of a! b is at
least l, then we can claim that the truth value of b is at
least k� l:
Extended particularization if it is proved that the truth
value of 8xa is at least k and t is a term, then the truth value
of a(t) is at least k.
Extended ^-introduction rule if it is proved that the
truth value of a is at least k and that the truth value of b is
at least l, then we can claim that the truth value of a ^ b is
at least k� l:
In a large and basic class of fuzzy logics one assumes
that the valuation structure is a residuated lattice
ðV; �; !; � ; 0; 1Þ and that the fuzzy inference rules are
defined by the product � in such a lattice. Also, we
assume that � satisfies the continuity condition, i.e. x�ðSupi2IxiÞ ¼ Supi2Ix� xi for every family xið Þi2I of ele-
ments in V. Important examples are obtained by setting V
equal to the interval [0, 1] and by assuming that � is a
continuous triangular norm. More in general a fuzzy
inference rule is defined as a pair r ¼ rsyntax; rsemantics
� �where rsyntax is a partial n-ary operation defined in the set
of sentences (i.e. an inference rule in the usual sense) and
rsemantics is an n-ary operation in the set V of truth values
satisfying a continuity property.
Definition 3.1 Let L be a first order language, then a
fuzzy deduction apparatus in L is a pair (IR, la) where IR is
a set of fuzzy inference rules and la : Form Lð Þ ! V is a
fixed fuzzy set of formulas we call the fuzzy subset of
logical axioms.
Notice that, as in classical logic, the fuzzy subset of
logical axiom is fixed in a fuzzy logic while the fuzzy
subset of proper axioms varies. In classical logic given a
set T of hypothesis a proof is a finite sequence of formulas
such that every formula is either a logical axiom, or a
hypothesis, or is obtained by an inference rule from early
proved formulas. Instead in fuzzy logic we can admit every
formula as a logical axiom or as a hypothesis. The valua-
tion of the correctness degree of the proof depends on the
correctness degree of these assumptions.
Definition 3.2 A proof p of a formula a is any sequence
a1; . . .; am of formulas such that am ¼ a; together with the
related ‘‘justifications’’. This means that, for any formula
ai; we must specify whether
(i) ai is assumed as a logical axiom; or
(ii) ai is assumed as a hypothesis; or
(iii) ai is obtained by a rule (in this case we have to
indicate also the rule and the formulas from
a1; . . .; ai�1 used to obtain ai).
The importance of the justifications is that they are
necessary to define the validity degree of the proof. Such a
definition is by induction on the length of p (see Pavelka
1979; Gerla 2001). Observe that, as in the classical case,
for any i�m; the initial segment a1; . . .; ai is a proof of ai
we denote by p ið Þ:
Definition 3.3 Given a fuzzy theory s and a proof p, the
valuation Val(p, s) of p with respect to s is defined by
induction on the length m of p in accordance with the
following rules:
Val p; sð Þ ¼ la amð Þ if am is assumed as a logical axiom,
Val p; sð Þ ¼ s amð Þ if am is assumed as a hypothesis.
Val p; sð Þ ¼ rsemantics Val p i 1ð Þð Þ; sð Þ; . . .;Val p i nð Þð Þ; sð Þð Þif am is obtained by the rule r ¼ rsyntax; rsemantics
� �; and
302 D. Genito et al.
123
am ¼ rsyntax aið1Þ; . . .; aiðnÞ� �
with 1� i 1ð Þ\m; . . .; 1� i nð Þ\mÞ:
Notice that we have only two proofs of a whose length is
equal to 1. The formula a with the justification that a is
assumed as a logical axiom and the formula a with the
justification that a is assumed as a hypothesis. So, the first
two lines of the definition of 3.3 give also the induction
basis. The value Val p; sð Þ is interpreted as a piece of
information on the truth value of a, more precisely, the
information: ‘‘the truth value if a is at least Val(p, s)’’.
Different proofs of the same formula a give different pieces
of information on the truth value of a. This suggests the
following definition.
Definition 3.4 Given a fuzzy deduction apparatus
(IR, la), the deduction operator is the operator D :
VFormðLÞ ! VFormðLÞ such that, for every s 2 VFormðLÞ the
fuzzy subset D(s) is defined by setting,
D sð Þ að Þ ¼ Sup Val p; sð Þ : p is a proof of af g ð3:1Þ
for every formula a.
We emphasize that D(s)(a) represents the best possible
information on a we can draw from s.
4 Fuzzy logic programming
We can apply the just exposed definitions to give a basis
for fuzzy logic programming. We refer to a residuated
lattice V; �; !; � ; 0; 1ð Þ: The following definition of
least fuzzy Herbrand model is syntactical in nature. It is
possible to prove that such a definition is equivalent with
the usual one, semantic in nature (see Gerla 2005).
Definition 4.1 Consider a fuzzy deduction apparatus
(IR, la). Then we call fuzzy program any fuzzy subset p :
Cl Lð Þ ! V of positive clauses. We call least fuzzy Her-
brand model of p the fuzzy subset of facts mp we can derive
from p, i.e. the restriction of D(p) to B(L).
Such a notion depends on the considered deduction
apparatus, obviously. In this paper we refer to a deduction
apparatus with no logical axiom and whose fuzzy rules are
the extended Modus Ponens, the extended ^-introduction
rule and the extended particularization. As an example,
consider the following fuzzy program p in the interval
[0, 1]:
loves(carl, luise) [0.3]
loves(carl, mary) [0.2]
loves carl;Xð Þ young Xð Þ ^ beautiful Xð Þ 0:9½ �beautiful(mary) [0.8]
young(mary) [0.7]
young(helen) [0.7]
we represent by a set of fuzzy rules, i.e. as the set of pair
a; p að Þð Þ; p að Þ 6¼ 0: Also, assume that we will calculate, for
example, the value mp loves carl;maryð Þð Þ: Then, a simple
proof of the fact loves(carl, mary), we denote by p1;
consists in the observation that such a formula is an axiom
at degree 0.2 (i.e. it is true at least at degree 0.2), and this
gives the constraint Val p1; pð Þ ¼ 0:2: A different proof p2
is obtained by observing that, by particularization, we
obtain the formula
loves carl;maryð Þ young maryð Þ ^ beautiful maryð Þ
with truth degree 0.9. On the other hand, by the
^-introduction rule, we obtain the formula
young maryð Þ ^ beautiful maryð Þ
with truth degree 0:8� 0:7: Afterwards by Modus Ponens
we get
loves carl;maryð Þ
with truth degree 0:9� 0:8� 0:7: In the case � is the usual
product, this gives the value val p2; pð Þ ¼ 0:504: Since
there is no further proof for such a fact, we can conclude
that
mp loves carl;maryð Þð Þ ¼ max Val p1; pð Þ;Val p2; pð Þf g¼ 0:504:
Instead, if we consider the fact loves(carl, helen), then
there is no proof for such a fact using the formulas in the
support of p. On the other hand, since the fuzzy program p
assigns to loves(carl, helen) the value 0, the observation
that loves(carl, helen) is an axiom at degree 0 is a proof
with degree 0. Then,
mp loves carl; helenð Þð Þ ¼ 0:
A general way to calculate the least Herbrand model
of a fuzzy program, is obtained by extending the fixed
point method of classical logic programming. To give a
notion of one-step consequence operator, given a fuzzy
program p, we define the fuzzy subset of ground
instances of clauses in p as the fuzzy program Gr pð Þ :
Cl Lð Þ ! V defined by setting Gr pð Þ að Þ ¼ 0 if a is not
ground and
Gr pð Þ að Þ ¼ Sup pða�Þ : a is a ground instance of a clause a�
n o;
otherwise. The supremum is justified by the fact that it is
possible for a formula a to be the ground instance of more
than one formula in supp(p). As an example if p r x; bð Þð Þ ¼0:7 and p r a; yð Þð Þ ¼ 0:5; then we have to set
Gr pð Þ r a; bð Þð Þ ¼ max 0:5; 0:7f g ¼ 0:7: We say that p is
ground if G pð Þ ¼ p: We define the fuzzy subset of fact of p
as the restriction of Gr(p) to the Herbrand base, i.e. the
fuzzy subset Fact pð Þ : B Lð Þ ! V defined by
Meta-logic programming for a synonymy logic 303
123
Fact pð Þ að Þ ¼ Supfpða�Þ: a is a ground instance of an atomic formula a�g:
In the case p is ground,
Fact pð Þ að Þ ¼ p að Þ:
Definition 4.2 Let p : Cl Lð Þ ! V be a fuzzy program.
Then the one-step consequence operator is the operator
Tp : VBðLÞ ! VBðLÞ defined by setting, for every s 2 VB Lð Þ;
Tp sð Þ ¼ T�p sð Þ [ Fact pð Þ
where, in turn T�p : VBðLÞ ! VBðLÞ is defined by setting, for
every a 2 B Lð Þ;T�p sð Þ að Þ ¼ Sup Gr pð Þða a1 ^ � � � ^ amÞ�fs a1ð Þ � � � � � s amð Þ : a a1 ^ � � � ^ am 2 Supp Gr pð Þð Þg:
The supremum is justified by the fact that it is possible
that in Supp(Gr(p)) there are different rules with the same
head a. As in the classical case, the one-step consequence
operator enables us to give a simple characterization of the
least Herbrand model of p (see, Pavelka 1979; Medina and
Ojeda-Aciego 2004).
Proposition 4.3 Let p : Cl Lð Þ ! V be a fuzzy program
and mp the least fuzzy Herbrand model for p, then
mp ¼ [n2NTnp ð[Þ:
This proposition entails that the fuzzy least Herbrand
model of p coincides with the fuzzy least Herbrand model
of Gr(p). So, in all the proofs it is not restrictive to assume
that p is ground.
5 A meta-logic for fuzzy logic programming
In this section we will show how translate a fuzzy program
in a language L into a classical meta-program in a language
Lm: To this aim, again we have assumed that in Lm there
are the predicate names thn and a constant for every
predicate name in L. In addition, since we have to write in
an explicit way the involved truth values, in Lm we put
constants to denote the truth values. More precisely, since
it is not reasonable to admit a language which is not enu-
merable, it is useful to refer only to a particular class of
truth values. Then, in accordance with domain theory, we
consider the following definition where � is the relation in
V defined by setting b � x provided that for every non-
empty upward directed subset A of V
x� supA) there is a 2 A such that b� a:
Definition 5.1 We say that a residuated lattice
V; � ; �; !; 0; 1ð Þ is a continuous residuated lattice
with enumerable basis B, provided that � is continuous, B
is an enumerable sublattice of V closed with respect to �and, for every x 2 V;
x ¼ supðfb 2 B : b � xgÞ
In other words, in a continuous residuated lattice all the
elements can be approximate ‘‘from below’’ by elements
in B. As an example, we can consider the case V is the
lattice [0, 1], B is the set of rational numbers in [0, 1] and
� is the usual product. In such a case � is the strict
order. Further examples are obtained by assuming that �is one of the triangular norms usually considered in
literature. Also, every finite residuated lattice is a con-
tinuous residuated lattice provided that we put B ¼ V: In
such a case � coincides with the order relation B. If S is
an enumerable set, then P(S) is a continuous residuated
lattice in which a basis is defined by the class of all the
finite subsets of S. In such a case b � x if and only if b is
a finite part of x.
In the following we consider only continuous residuated
lattices with an enumerable basis B and fuzzy programs
with values in B. Also, in the meta-language Lm we put
only an enumerable amount of constants to denote the
elements in B.
Another question is that in the translation we have to
represent in some way the product �: To do this we assume
that in Lm there is a predicate product and that in the
translation we consider the diagram of the algebraic
structure ðB;�Þ; i.e. the (decidable) set of facts
Diagr Bð Þ ¼ fproduct k; l; cð Þ : c ¼ k� l; k; l; c 2 Bg:
As an example, the translation of the fuzzy program
given in Sect. 4 is obtained by adding to Diagr(B) the
program
th(loves, carl, luise, 0.3).
th(loves, carl, mary, 0.2).
th loves; carl;X; Zð Þ th young;X; Z1ð Þ^th beautiful;X; Z2ð Þ ^ product Z1; Z2; Z3ð Þ^product Z3; 0:9; Zð Þ:th(beautiful, mary, 0.8).
th(young, mary, 0.7).
th(young, helen, 0.7).
More precisely we have to consider also the default rules
th(R, X, 0).
th(R, X, Y, 0).
claiming that that every fact in L can be proved at least
with truth degree 0. Thus, we propose the following gen-
eral definition.
Definition 5.2 Let L be a first order language and let
V; �; !; � ; 0; 1ð Þ be a residuated lattice with an
304 D. Genito et al.
123
enumerable basis B. Then we denote by Lm the first order
language such that
– the constants of Lm are obtained by adding to the
constants in L all the predicate symbols of L and all the
elements k in B
– the function symbols in Lm are the same as in L
– in Lm there is a predicate symbol thn for every n which
is the arity of a predicate symbol in L
– in Lm there is a predicate product.
As early argued in Sect. 2, we can assume also that in
Lm there is only a monadic predicate th. In the next defi-
nition we write Z ¼ X � Y to denote the formula
product X; Y ; Zð Þ; Z ¼ X � Y � A to denote the formula
product X; Y ; Z1ð Þ ^ product Z1;A; Zð Þ and so on.
Definition 5.3 Consider a first order language L, a con-
tinuous residuated lattice ðV ; �; !; � ; 0; 1Þ with an
enumerable basis B and the corresponding meta-language
Lm: Then, given a clause a and a variable Z, we define the
formula s(a, Z) in Lm by setting
s r t1; . . .; tnð Þ;Zð Þ ¼ th r; t1; . . .; tn; Zð Þfor every atomic formula r t1; . . .; tnð Þ in L
sða a1 ^ � � � ^ an; ZÞ ¼ s a; Znþ1ð Þ s a1; Z1ð Þ ^ � � � ^ s an; Znð Þ^ Znþ1 ¼ Z1 � � � � � Zn � Zð Þ
for every rule a a1 ^ � � � ^ an in L and where the vari-
ables Z; Z1; . . .; Znþ1 are pairwise distinct and not occurring
in a; a1; . . .; an:
For example,
s loves carl;Xð Þ young Xð Þ ^ beautiful Xð Þð Þ¼ s loves carl;Xð Þ; Z3ð Þ s young Xð Þ; Z1ð Þ^ s beautiful Xð Þ; Z2ð Þ ^ ðZ3 ¼ Z1 � Z2 � ZÞ¼ th loves; carl;X; Z3ð Þ th young;X;Z1ð Þ^ th beautiful;X; Z2ð Þ ^ ðZ3 ¼ Z1 � Z2 � ZÞ:
To translate a program we have to consider the set Dfl of
default formulas th R;X; 0ð Þ; th R;X; Y ; 0ð Þ; . . .; :
Definition 5.4 Consider a fuzzy program p : Cl Lð Þ ! B
in the language L. Then the translation of p is the classical
program s(p) in Lm defined by setting
s pð Þ ¼ s a; Zð ÞZ=pðaÞ: a is a positive clausen o
[ Diagr Bð Þ[ Dfl
where s a; Zð ÞZ=pðaÞ denotes the formula obtained from
s(a, Z) by substituting in Z the value p(a).
In order to simplify our notation we avoid writing the
diagram of the valuation structure and the default rules in
an explicit way. So the translation of the fuzzy program in
Sect. 3 becomes:
th(loves, carl, luise, 0.3).
th(loves, carl, mary, 0.2).
th(beautiful, mary, 0.8).
th(young, mary, 0.7).
th(young, helen, 0.7).
th loves; carl;X; Z3ð Þ th young;X; Z1ð Þ^th beautiful;X; Z2ð Þ ^ ðZ3 ¼ Z1 � Z2 � 0:9Þ
In such a case, given the query th(loves, carl, mary, Z),
we obtain the answers Z = 0, Z = 0.2 and Z = 0.504. In
accordance with (3.1), this means that the best constraint
on the truth value of the formula loves(carl, mary) is the
maximum 0.504.
To prove the equivalence between a fuzzy program p
and its translation s(p), it is useful the following very
interesting lemma given in Wiedermann (2002).
Lemma 5.5 Let ðM; �; � ; 1Þ be a finitely generated
ordered monoid. Then every nonempty subset of M admits
a maximal element and therefore every nonempty totally
ordered subset of M admits a maximum.
As an immediate consequence we obtain the following
lemma.
Lemma 5.6 Assume that V is totally ordered and that the
fuzzy program p assumes only a finite number of values in
B. Let ðM; �; � ; 1Þ be the submonoid of ðB; �; � ; 1Þgenerated by the values assumed by p and let s be a fuzzy
subset of facts assuming its values in M. Then for every fact
a there is a rule a a1 ^ � � � ^ am such that
T�p sð Þ að Þ ¼ pða a1 ^ � � � ^ amÞ � s a1ð Þ � � � � � s amð Þð5:1Þ
Proof Since
pða a1 ^ � � � ^ amÞ � s a1ð Þ � � � � � s anð Þ : a a1f
^ � � � ^ am 2 Supp pð Þg
is a subset of M, by Lemma 5.5 it admits a maximum m.
Then a rule a a1 ^ � � � ^ am exists such that m ¼ pða a1 ^ � � � ^ amÞ � s a1ð Þ � � � � � s amð Þ and such a rule satis-
fies (5.1).
Theorem 5.7 Assume that V is totally ordered and that
the fuzzy program p assumes only a finite number of truth
values. Then, for every fact r t1; . . .; tkð Þ;mp r t1; . . .; tkð Þð Þ ¼ Sup k 2 B : th r; t1; . . .; tk; kð Þ 2 Ms pð Þ
� �:
ð5:2Þ
Proof It is not limitative to assume that p is ground. To
prove (5.2) it is sufficient to prove that, for every k 2 B and
n 2 N;
Meta-logic programming for a synonymy logic 305
123
Tnp ð[Þ r t1; . . .; tkð Þð Þ ¼ k, thðr; t1; . . .; tk; kÞ 2 Tn
s pð Þð[Þ:ð5:3Þ
Now in the case n = 1 observe that Tpð[Þ r t1; . . .; tkð Þð Þ¼ Fact pð Þ r t1; . . .; tkð Þð Þ ¼ p r t1; . . .; tkð Þð Þ and Ts pð Þð[Þ ¼Fact s pð Þð Þ ¼ s Fact pð Þð Þ: Then (5.3) follows from the
definition of s. Consider the case n = 1 and, by induction
hypothesis, assume that (5.3) is satisfied by n� 1: Then, if
Tnp ð[Þ r t1; . . .; tkð Þð Þ ¼ k; since
Tnp ð[Þ r t1; . . .; tkð Þð Þ ¼ Tp Tn�1
p ð[Þ r t1; . . .; tkð Þð Þ� �
¼ T�p Tn�1p ð[Þ
� �r t1; . . .; tkð Þð Þ _ Fact pð Þ r t1; . . .; tkð Þð Þ;
we have to consider two cases. In the case k ¼Fact pð Þ r t1; . . .; tkð Þð Þ; it is evident that th r; t1; . . .; tk; kð Þ 2Fact s pð Þð Þ � Tn
s pð Þð[Þ: In the case k ¼ T�p ðTn�1p ð[ÞÞ
r t1; . . .; tkð Þð Þ; by Lemma 5.6 there is a fuzzy inference
rule in p,
r t1; . . .; tkð Þ r1ðt1;1; . . .; t1;kð1ÞÞ ^ � � � ^ rmðtm;1; . . .; tm;kðmÞÞl½ �;
such that,
k ¼ l� Tn�1p ð[Þ r1 t1;1; . . .; t1;kð1Þ
� �� �� � � �
� Tn�1p ð[Þ rm tm;1; . . .; tm;kðmÞ
� �� �:
Set ki ¼ Tn�1p ð[Þ ri tm;1; . . .; ti;kðiÞ
� �� �; then, since by
induction hypothesis thðri; ti;1; . . .; ti;kðiÞ; kiÞ 2 Tn�1s pð Þ ð[Þ and
th r; t1; . . .; tk; kð Þ thðr1; t1;1; . . .; t1;kð1Þ; k1Þ ^ � � �^ thðrm; tm;1; . . .; tm;kðmÞ; kmÞ ^ ðk
¼ k1 � � � � � km � lÞ;
is a ground instance of a rule in s(p), we can conclude that
th r; t1; . . .; tk; kð Þ 2 Tns pð Þð[Þ:
Conversely, assume that th r; t1; . . .; tk; kð Þ 2 Tns pð Þð[Þ
and that th r; t1; . . .; tk; kð Þ is obtained fromTn�1sðpÞ ð[Þ by the
rule
th r; t1; . . .; tk;Znþ1ð Þ tðr1; t1;1; . . .; t1;kð1Þ;Z1Þ ^ � � �
^ thðrm; tm;1; . . .; tm;kðmÞ;ZmÞ
^ ðZnþ1 ¼ Z1 � � � � � Zm � lÞ;
Then there is a ground instance
th r; t1; . . .; tk; kð Þ thðr1; t1;1; . . .; t1;kð1Þ; k1Þ ^ � � �^ thðrm; tm;1; . . .; tm;kðmÞ; kmÞ ^ ðk
¼ k1 � � � � � km � lÞ;
of such a rule such that
thðr1; t1;1; . . .; t1;kð1Þ; k1Þ 2 Tn�1s pð Þ ð[Þ; . . .;
thðrm; tm;1; . . .; tm;kðmÞ; kmÞ 2 Tn�1s pð Þ ð[Þ:
Let
r t1; . . .; tkð Þ r1 t1;1; . . .; t1;kð1Þ� �
^ � � � ^ rm
tm;1; . . .; tm;kðmÞ� �
l½ �;
be the fuzzy rule in the fuzzy program p whose translation
coincides with the considered rule in s(p). Then, since by
inductive hypothesis,
Tn�1p ð[Þ r1; t1;1; . . .; t1;kð1Þ
� �¼ k1; . . .; Tn�1
p ð[Þ
rm; tm;1; . . .; tm;kðmÞ� �
¼ km
we can conclude that
Tnp ð[Þ r t1; . . .; tkð Þð Þ ¼ l� Tn�1
p ð[Þ r1; t1;1; . . .; t1;kð1Þ� �
� � � � � Tn�1p ð[Þ
rm; tm;1; . . .; tm;kðmÞ� �
¼ k:
6 Similarity logic and synonymy
We are now ready to face the main question we are
interested. We start from an example. Let us suppose that a
bookshop assistant have a request, by a customer, for an
adventurous and economic book. Moreover, let us suppose
that he does not find any book with these characteristics,
then he tries to recommend a book which is sufficiently
close to the customer’s request. For example he could
propose a fantasy book which is not expensive. This atti-
tude is a typical use of synonymy in reasoning in everyday
life. Now, it is evident that the available information is
vague in nature and therefore that we have to represent it
by a fuzzy set of claims as
if x is adventurous and economic then x is good (at
degree 1)
‘‘I Robot’’ is a fantasy story (at degree 0.6)
‘‘I Robot’’ is not expensive (at degree 1)
‘‘adventurous’’ is a synonymous of ‘‘fantasy’’ (at degree
0.8)
‘‘economic’’ is synonymous of ‘‘not expensive’’ (at
degree 0.7)
More formally
Adventurous xð Þ ^ Economic xð Þ) Good xð Þ at degree 1ð ÞFantasy(‘‘I_robot’’) (at degree 0.6)
Not_expensive(‘‘I_robot’’) (at degree 1)
synonymous(‘‘adventurous’’, ‘‘fantasy’’) (at degree 0.8)
synonymous(‘‘economic’’, ‘‘not expensive’’) (at degree
0.7)
306 D. Genito et al.
123
Unfortunately, we cannot consider such a list of fuzzy
formulas in the framework of first order fuzzy logic.
Indeed, there are words as adventurous, fantasy, economic,
not expensive occurring both as predicates symbols and as
constants. In a series of papers (see, for example, Fontana
et al. 1998; Formato et al. 2000) such a question was faced
by relaxing the notion of matching between predicates.
This means that one considers only the first order fuzzy
formulas
Adventurous xð Þ ^ Economic xð Þ ) Good xð Þ 1½ �Fantasy(‘‘I_robot’’) [0.6]
Not_expensive(‘‘I_robot’’) [1]
while the information about the synonymy between
predicates is used to calculate the degree of admissibility of
an approximate matching. In this paper we propose a dif-
ferent approach in which we simply add to the meta-
language Lm the predicate symbol ‘‘synonymous’’. In
accordance, we formalize the information in the considered
example by the program
th good;X; Zð Þ th adventurous;X;V1ð Þ^th economic;X;V2ð Þ ^ ðZ ¼ V1 � V2Þ:th(fantasy, I_robot, 0.6).
th(not expensive, I_robot, 1).
synonymous(adventurous, fantasy, 0.8).
synonymous(economic, not expensive, 0.7).
th A;X;Vð Þ synonymous A;A0;V1ð Þ ^ th
A;X;V2ð Þ ^ ðV ¼ V1 � V2Þ:
As usual in fuzzy logic, the intended meaning of a
fact as synonymous(economic, not expensive, 0.7) is that
economic is a synonymous of not expensive at degree at
last 0.7. Equivalently, we can consider the predicate
symbol synonymous as a constant and to consider the
program
th good;X; Zð Þ th adventurous;X;V1ð Þ^th economic;X;V2ð Þ ^ ðZ ¼ V1 � V2Þ:th(fantasy, I_robot, 0.6).
th(not expensive, I_robot, 1).
th(synonymous, adventurous, fantasy, 0.8).
th(synonymous, economic, not expensive, 0.7).
th A;X;Vð Þ th synonymous;A;A0;V1ð Þ ^ th
A0;X;V2ð Þ ^ ðV ¼ V1 � V2Þ:
Given such a program and, for example, the query
th(good, I_robot, Z), we obtain the answer Z ¼ 1� 0:8�0:6� 0:7� 1: Notice that such a program is not complete
since it is natural to assume that a synonymy satisfies
suitable properties, namely that it is a similarity.
Definition 6.1 Let S be a nonempty set, then a fuzzy
relation sim : S S! V is a �-similarity if for every x, y,
z in S,
(a) sim(x, x) = 1 (reflexivity),
(b) sim x; yð Þ sim x; zð Þ � sim z; yð Þ (transitivity),
(c) sim(x, y) = sim(y, x) (symmetry).
Given a first order language L, we call �-synonymy, in
brief synonymy, any �-similarity syn on the set of predicate
symbols such that syn r; r0ð Þ ¼ 0 for every pair of predicate
symbols r and r0 with different arities.
It is evident that a synonymy is a fuzzy model of a
suitable fuzzy program. Then, it is useful to represent it by
a (small) fuzzy set of facts and suitable rules corresponding
to conditions (a), (b) and (c). We write such a program
directly into a suitable extension of the language Lm as
follows.
Definition 6.2 Let LSyn be the language obtained by
adding to Lm the predicate name synonymous. Then a
definition of a synonymy is a program Syn containing a set
of facts like synonymous(r, r0, k) where r and r0 are pred-
icate names with the same arity and k 6¼ 0; together with
the rules
synonymous(R, R, 1)
synonymous R;R00;Vð Þ synonymous R;R0;V1ð Þ^synonymous R0;R00;V2ð Þ ^ ðV ¼ V1 � V2Þsynonymous R0;R;V1ð Þ synonymous R;R0;V1ð Þsynonymous(R0, R, 0).
Since we assume that in the language L there is only a
finite set of predicate names, Syn is a finite set. We denote
by syn the interpretation of synonymous in the least Her-
brand model of Syn, namely
syn r; r0ð Þ ¼ Sup k 2 B : synonymous r; r0; kð Þ 2 MSyn
� �:
ð6:1Þ
Due to the finiteness of Syn, the values of syn are in B.
Definition 6.3 Let p be a fuzzy program and Syn be a
definition of a synonymy. Then the translation of p given
Syn is the classical program s(p, Syn) in the language LSyn
obtained by adding to the program s(p) the program Syn
and the synonymy rules
th R;X1; . . .;Xn;Vð Þ synonymous R;R0;V1ð Þ
^ th R0;X1; . . .;Xn;V2ð Þ
^ ðV ¼ V1 � V2Þ:
Notice that such a rule is strictly related with a rule
considered in Medina and Ojeda-Aciego (2004) (see
the proof of Theorem 23). As it is usual, we denote
by Ms p;Synð Þ and Ts p;Synð Þ the least Herbrand model and
the one-step consequence operator of s p; Synð Þ;respectively.
Meta-logic programming for a synonymy logic 307
123
We are now ready to define a suitable notion of least
Herbrand model for a similarity-based logic programming.
Definition 6.4 Let p be a fuzzy program and Syn the
definition of a synonymy. Then we call least Herbrand syn-
model of p the fuzzy set of facts mSynp : B Lð Þ ! V defined
by setting, for every rðt1; . . .; tnÞ 2 B Lð Þ;mSyn
p r t1; . . .; tnð Þð Þ
¼ Sup k 2 B : th r; t1; . . .; tn; kð Þ 2 Msðp;SynÞ� �
: ð6:2Þ
7 A justification for the proposed synonymy logic
Obviously, the question arises whether Definition 6.4 is
an adequate one for a synonymy logic. Now, usually one
proves the adequateness of a logic by the exhibition of a
completeness theorem. Unfortunately it is not evident
if this can be done for synonymy logic since it is
not evident whether the notion of synonymy is seman-
tic in nature or not. Nevertheless it is possible to give
some arguments in favor of such a definition. To do this,
at first we prove the following useful proposition
in which the synonymy syn is extended to B(L) by
setting
syn a;a0ð Þ ¼ syn r;r0ð Þ if a¼ r t1; . . .; tnð Þ and a0 ¼ r0 t1; . . .; tnð Þsyn a;a0ð Þ ¼ 0 otherwise:
Theorem 7.1 Assume that V is totally ordered and let aand a0 be two facts. Then
mSynp a0ð Þ � syn a; a0ð Þ �mSyn
p að Þ ð7:1Þ
and therefore,
syn a; a0ð Þ � mSynp að Þ $ mSyn
p a0ð Þ� �
ð7:2Þ
Proof In the case syn a; a0ð Þ ¼ 0; then (7.1) is trivial.
Otherwise, assume that a ¼ rðt1; . . .; tnÞ; a0 ¼ r0ðt1; . . .; tnÞand set
A ¼ k 2 B : thðr; t1; . . .; tn; kÞ 2 Ms p;Synð Þ� �
and
A0 ¼ k0 2 B : thðr0; t1; . . .; tn; k0Þ 2 Ms p;Synð Þ
� �:
Then, by the synonymy rule for every x 2 B such that
synonymous r; r0; xð Þ 2 MSyn we have
k0 2 A0 ) k0 � x 2 A
and therefore, since in (6.1) the value syn r; r0ð Þ ¼ syn a; a0ð Þis obtained as a maximum,
k0 2 A0 ) k0 � syn a; a0ð Þ 2 A:
So, k0 � syn a; a0ð Þ : k0 2 A0f g � A and, by the
continuity of �;
mSynp ðr0ðt1; . . .; tnÞÞ� syn a;a0ð Þ ¼ ðSupfk0 2 A0gÞ� syn a;a0ð Þ
¼ Supfk0 � syn a;a0ð Þ : k0 2A0g
�Supfk : k2Ag¼mSynp ðrðt1; . . .; tnÞÞ:
To prove (7.2) observe that (7.1) entails
syn a; a0ð Þ �mSynp a0ð Þ ! mSyn
p að Þ
and therefore by symmetry
syn a; a0ð Þ �mSynp að Þ ! mSyn
p a0ð Þ:
Since in a totally ordered residuated lattice
mSynp a0ð Þ $ mSyn
p að Þ¼ mSyn
p a0ð Þ ! mSynp að Þ
� �
^ mSynp að Þ ! mSyn
p a0ð Þ� �
;
(7.2) follows.
Inequality (7.2) says that mSynp is continuous with respect
to syn, in a sense. We can express such a claim in a more
precise way by referring to the following results proved by
Valverde (1985).
Proposition 7.2 Let h : 0; 1½ � ! 0;1½ � be an additive
generator, i.e. a strictly decreasing continuous map h :0; 1½ � ! 0;1½ � such that h(1) = 0. Define the operation �
by setting
x� y ¼ h�1 h xð Þ þ h yð Þð Þ if h xð Þ þ h yð Þ� h 0ð Þx� y ¼ 0 otherwise:
Then � is an Archimedean triangular norm. If$ is the
associated equivalence, then
h x$ yð Þ ¼ h yð Þ � h xð Þj j: ð7:3Þ
As an example, if h xð Þ ¼ 1� x; then � is the
Łukasiewicz norm and h x$ yð Þ ¼ y� xj j: In the case
h xð Þ ¼ �log xð Þ for x = 0 and h 0ð Þ ¼ 1; � is the usual
product and h x$ yð Þ ¼ log yð Þ � log xð Þj j:
Proposition 7.3 Assume that � is an Archimedean norm
whose additive generator is the map h : 0; 1½ � ! 0;1½ �;and let syn be a �-synonymy. Then the map d : B Lð Þ B Lð Þ ! 0;1½ � defined by setting
dsynða; a0Þ ¼ h syn a; a0ð Þð Þ
for every a and a0 in B(L) is an extended pseudo-distance.
Theorem 7.4 In the case � is an Archimedean norm, the
function mSynp : B Lð Þ ! 0; 1½ � is a continuous map from the
extended pseudo-metric space B Lð Þ; dsyn
� �to [0, 1].
Proof By (7.2) and (7.3) for every pair a and a0 of facts
308 D. Genito et al.
123
dsyn a; a0ð Þ ¼ h syn a; a0ð Þð Þ h mSynp að Þ $ mSyn
p a0ð Þ� �
¼ h msynp að Þ
� �� h mSyn
p a0ð Þ� �
This inequality entails that h�msynp is continuous. Since h
is a injective continuous map defined in the compact set
[0, 1] and with values in a Hausdorff space, h�1 is
continuous. So, we can conclude that msynp is continuous,
too.
8 Another justification
Another argument in favor of Definition 6.4 is that it is in
accordance with the abstract definition of a similarity logic
given in Gerla (2001). In such a book an abstract fuzzy
logic is defined as a continuous (conservative) operator
H : VF ! VF defined in the class VF of all the fuzzy
subsets of a given set F. H is named the one-step conse-
quence operator. H(s) is interpreted as the fuzzy subset of
formulas we can obtain from s by an one-step proof. The
deduction operator is the closure operator D : VF ! VF
generated by H. This means that, for every fuzzy subset s
of formulas
D sð Þ ¼ [n2NHn sð Þ:
Let sim be a synonymy relation, then a continuous
operator SYN : VF ! VF is defined by setting,
SYN sð Þ að Þ ¼ Sup syn a0; að Þ � s a0ð Þ : a0 2 B Lð Þf g: ð8:1Þ
SYN(s) is interpreted as the fuzzy subsets of facts which are
a synonymous of a fact in s. A fuzzy subset s of facts is a
fixed point for SYN if and only if, for every a, a0 [ B(L),
syn a0; að Þ � s a0ð Þ � s að Þ: ð8:2Þ
Definition 8.1 Let H be the one-step consequence
operator of an abstract fuzzy logic and let SYN be a
synonymy operator. Then we call abstract synonymy logic
the abstract logic whose one-step consequence operator is
the composition H�SYN (see Gerla 2001).
In the case F coincides with B(L) and H is the one-step
consequence operator Tp of a fuzzy program p, we obtain
an abstract synonymy logic programming. The Herbrand
models of such a logic are the fixed points of Tp�SYN; i.e.
the Herbrand models of Tp which are fixed points for SYN.
Theorem 8.2 The least Herbrand model mSynp given in
Definition 6.4 coincides with the least Herbrand model of
the abstract synonymy logic defined by Tp and SYN.
Proof We have to prove that mSynp is a fixed point for both
SYN and Tp and that if m is a fixed point for SYN and Tp
then m � mSynp : Now, from (7.1) it follows that mSyn
p is a
fixed point of SYN. To prove that mSynp is a fixed point of Tp
we have to prove that, for every fact a,
T�p mSynp
� �að Þ _ Fact pð Þ að Þ�mSyn
p að Þ:
Since Fact pð Þ að Þ�mSynp að Þ; this is equivalent to prove
that
T�p mSynp
� �að Þ�mSyn
p að Þ
and therefore that, given any ground rule a r1
t11; . . .; t1
nð1Þ
� �^ � � � ^ rm tm
1 ; . . .; tmnðmÞ
� �;
l� mSynp r1 t1
1; . . .; t1nð1Þ
� �� �� � � �
� mSynp rm tm
1 ; . . .; tmnðmÞ
� �� ��mSyn
p að Þ
where l ¼ Gr pð Þ a r1 t11; . . .; t1
nð1Þ
� �^ � � � ^ rm
�
tm1 ; . . .; tm
nðmÞ
� �Þ: Now
l� mSynp ðr1ðt1
1; . . .; t1nð1ÞÞÞ � � � � � mSyn
p ðrmðtm1 ; . . .; tm
nðmÞÞÞ¼ l� ðSupfk1 : thðr1; t
11; . . .; t1
nð1Þ; k1Þ 2 Ms p;Synð ÞgÞ� � � � � ðSupfkm : thðrm; t
m1 ; . . .; tm
nðmÞ; kmÞ 2 Ms p;Synð ÞgÞ¼ Supfk1 � � � � � km � l : thðr1; t
11; . . .; t1
nð1Þ; k1Þ2 Msðp;SynÞ; . . .; thðrm; t
m1 ; . . .; tm
nðmÞ; kmÞ 2 Ms p;Synð Þg:
On the other hand, if a is the formula rðt1; . . .; tnÞ; the
translation of the rule a r1 t11; . . .; t1
nð1Þ
� �^ � � � ^
rm tm1 ; . . .; tm
nðmÞ
� �is
thðr; t1; . . .; tn; Zmþ1Þ th r1; t11; . . .; t1
nð1Þ; Z1
� �^ � � �
^ th rm; tm1 ; . . .; tm
nðmÞ; Zm
� �^ ðZmþ1
¼ Z1 � � � � � Zm � lÞ:
Such a rule enables us to claim that if thðr1;
t11; . . .; t1
nð1Þ; k1Þ 2 Ms p;Synð Þ; . . .; thðrm; tm1 ; . . .; tm
nðmÞ; kmÞ 2Ms p;Synð Þ; then thðr; t1; . . .; tn; k1 � � � � � km � lÞ 2Ms p;Synð Þ: In turn, this entails that
Supfk1 � � � � � km � l : thðr1; t11; . . .; t1
nð1Þ; k1Þ2 Ms p;Synð Þ; . . .; thðrm; t
m1 ; . . .; tm
nðmÞ; kmÞ 2 Msðp;SynÞg� Supfk : thðr; t1; . . .; tn; kÞ2 Ms p;Synð Þg ¼ mSyn
p ðrðt1; . . .; tnÞÞ
Thus, mSynp is a fixed point of Tp:
Let m be a fixed point for both SYN and Tp: Then to
prove that m � mSynp ; it is sufficient to prove that, given
k 2 B;
thðr; t1; . . .; tn; kÞ 2 Tnsðp;SynÞð[Þ ) mðrðt1; . . .; tnÞÞ k
for every n 2 N: We will prove this by induction on n.
Indeed, in the case n = 1, since T�p mð Þ [ Fact pð Þ � m; we
have
Meta-logic programming for a synonymy logic 309
123
thðr; t1; . . .; tn;kÞ 2 Tsðp;SynÞð[Þ ) thðr; t1; . . .; tn;kÞ2 Fact s pð Þð Þ ) pðrðt1; . . .; tnÞÞ ¼ k) mðrðt1; . . .; tnÞÞk:
Assume that the implication holds true for n and that
thðr; t1; . . .; tn; kÞ 2 Tnþ1sðp;SynÞð[Þ ¼ Tsðp;SynÞðTn
sðp;SynÞð[ÞÞ:
Then it is possible that thðr; t1; . . .; tn; kÞ is obtained by
the rule
thðr; t1; . . .; tn; kÞ th r1; t11; . . .; t1
nð1Þ; k1
� �^ � � � ^
th rq; tq1; . . .; tq
nðqÞ; kq
� �^ ðk ¼ k1 � � � � � kq � lÞ
in s(p) with thðri; ti1; . . .; ti
nðiÞ; kiÞ 2 Tns p;Synð Þð[Þ: In such a
case, by induction hypothesis, we have that
mðriðti1; . . .; ti
nðiÞÞÞ ki: Since m is a fixed point for Tp;
k ¼ k1 � � � � � km � l� l� mðr1ðt11; . . .; t1
nð1ÞÞÞ � � � �� mðrqðtq
1; . . .; tqnðqÞÞÞ�mðrðt1; . . .; tnÞÞ:
Assume that thðr; t1; . . .; tn; kÞ is obtained by the rule
thðr; t1; . . .; tn; kÞ synonymous r; r0; k1ð Þ^ thðr0; t1; . . .; tn; k2Þ ^ ðk
¼ k1 � k2Þ:
in Syn with thðr0; t1; . . .; tn; k2Þ 2 Tns p;Synð Þð[Þ: Then by
inductive hypothesis mðr0ðt1; . . .; tnÞÞ k2: Since m is a
fixed point for SYN,
k ¼ k1 � k2� k1 � mðr0ðt1; . . .; tnÞÞ�mðrðt1; . . .; tnÞÞ:
Finally, it is possible that thðr; t1; . . .; tn; kÞ 2 Fact
s p; Synð Þð Þ; i.e. that thðr; t1; . . .; tn; kÞ 2 Fact s pð Þð Þ: In
such case we proceed as in the case n = 1.
Since both the operators Tp and SYN are continuous, in
accordance with the fixed point theorem for continuous
operators (see for example Gerla 2001), such a theorem
entails that we can obtain msynp as the limit of the sequence
Tpð[Þ � SYNðTpð[ÞÞ � TpðSYNðTpð[ÞÞÞ � � � �
Equivalently, since the operators SYN�Tp; Tp�SYN and
Tp _ SYN define the same class of fixed points, we can
obtain mSynp also as the limit of the sequence
SYNð[Þ � TpðSYNð[ÞÞ � SYNðTpðSYNð[ÞÞÞ � � � �
or of the sequence
Tp _ SYN� �
ð[Þ � Tp _ SYN� �
Tp _ SYN� �
ð[Þ� �
� Tp _ SYN� �
Tp _ SYN� �
Tp _ SYN� �
ð[Þ� �� �
� � � �
9 Recursive enumerability in fuzzy logic programming
and in synonymy logic programming
In classical logic programming there is no difficulty to
represent all the recursive enumerable subsets and this
shows that the associated paradigm of computability is in
accordance with Church thesis. We can formulate an
analogous question for fuzzy logic programming and
synonymy-based logic programming. In order to do
this we will refer to a notion of recursive enumerability
for fuzzy subsets which is in accordance with the the-
ory proposed in Biacino and Gerla (1987) and Gerla
(2006).
Definition 9.1 We say that a continuous residuated lattice
ðV; � ; �; !; 0; 1Þ is effective provided that there is
coding of its basis B such that
– the lattice operations and � are effectively computable
in B
– the relation � is recursively enumerable in B.
All the examples of continuous residuated lattices in
Sect. 5 are also effective.
Definition 9.2 Let S be a coded set and s : S! V a fuzzy
subset of S. Then we say that s is recursively enumerable
provided that a computable function h : S N ! B exists
which is increasing with respect to the second variable and
such that, for every x 2 S;
s xð Þ ¼ Supn2Nh x; nð Þ: ð9:1Þ
Assume that in ðV ; � ; �; !; 0; 1Þ an involution * is
defined which is computable in B, then we can define the
notion of complement -s of a fuzzy subset s by setting
�sð Þ xð Þ ¼ s xð Þ: Then we say that a fuzzy subset s is
recursively co-enumerable if its complement -s is
recursively enumerable. If s is both recursively enumerable
and recursively co-enumerable, the we say that s is
decidable.
Definition 9.3 Let L be a first order language and UL the
related Herbrand universe. Then we say that a fuzzy subset
s : UL ! V of UL is representable by a fuzzy program p
provided that a predicate name r exists such that s xð Þ ¼mp r xð Þð Þ for every x in UL:
Theorem 9.4 Consider a finite fuzzy program p with truth
values in B. Then, mp is recursively enumerable. Conse-
quently every fuzzy subset of UL representable by a fuzzy
program is recursively enumerable.
Proof Since Mp is recursively enumerable, we can define
the function h : B Lð Þ N ! B as follows. Let r t1; . . .; tkð Þbe an element in B(L), then
• we generate step-by-step all the elements k1; . . .; ki; . . .
of the set fk 2 B : th r; t1; . . .; tk; kð Þ 2 Mpg• at the same time we generate the increasing sequence
h r t1; . . .; tkð Þ; nð Þð Þn2N by setting
h r t1; . . .; tkð Þ; 1ð Þ ¼ k1;
310 D. Genito et al.
123
h r t1; . . .; tkð Þ; ið Þ ¼ h r t1; . . .; tkð Þ; i� 1ð Þ _ ki
It is evident that h is computable and order-preserving
with respect to the second variable and that
mp r t1; . . .; tkð Þð Þ ¼ Supn2Nh r t1; . . .; tkð Þ; nð Þ: ð9:2Þ
Now, the question arises whether every recursively
enumerable fuzzy subset can be represented in such a way
or not. Unfortunately, the answer is negative.
Theorem 9.5 There are recursively enumerable fuzzy
subsets which are not definable by a fuzzy program.
Proof In Biacino and Gerla (1987) one defines d-enu-
merable a recursively enumerable fuzzy subset in which
instead of (9.1) we have that s xð Þ ¼ Maxn2Nh x; nð Þ; i.e.
every s(x) is obtained as a maximum of the sequence
h(x, n). Also, one proves that, in the case V is the interval
[0, 1], there is a recursively enumerable fuzzy subset s
which is not d-recursively enumerable. On the other hand,
since by Lemma 5.5 the sequence h r t1; . . .; tkð Þ; nð Þð Þn2N
admits a maximum, all the fuzzy subsets representable by a
fuzzy program are d-enumerable.
It is evident that we can extend Theorems 9.4 and 9.5 to
the synonymy-based logic programming.
We conclude by observing that (apparently) we can
obtain msynp r t1; . . .; tnð Þð Þ by the findall operation in Prolog
and by a predicate enabling us to calculate the maximum of
a list. Indeed, we can consider the rule
Herbrand modelðr; t1; . . .; tn; ZÞ findallðZ1; thðr; t1; . . .; tn; Z1Þ; ListÞ^ maximum List; Zð Þ
or, in a most general way:
Herbrand modelðR;X1; . . .;Xn; ZÞÞ findallðZ1; thðR;X1; . . .;Xn; Z1Þ; ListÞ^ maximum List; Zð Þ:
Regrettably, in spite of the fact fk 2 V : thðr; t1; . . .;
tn; kÞg is finite, there is no general criterion to establish if
all the elements in such a set where attained at a given step
of the computation. Equivalently, in spite of the fact that
we can compute the increasing sequence h r t1; . . .; tkð Þ; 1ð Þ� h r t1; . . .; tkð Þ; 1ð Þ� � � � and that such a sequence
becomes constant after a finite number of steps, there is
no general criterion to establish if the maximum is attained
at a given step. Obviously, this is not surprising since it is
in accordance with the notion of recursive enumerability.
References
Alsinet T, Godo L (2004) Adding similarity-based reasoning capabil-
ities to a Horn fragment of possibilistic logic with fuzzy constants.
Fuzzy Sets Syst 144:43–65. doi:10.1016/j.fss.2003.10.013
Biacino L, Gerla G (1987) Recursively enumerable L-sets. Z Math
Logik Grundlagen Math 33(2):107–113. doi:10.1002/malq.
19870330204
Biacino L, Gerla G (1998) Logics with approximate premises. Int J
Intell Syst 13:1–10. doi:10.1002/(SICI)1098-111X(199801)
13:1\1::AID-INT1[3.0.CO;2-U
Biacino L, Gerla G, Ying M (2000) Approximate reasoning based on
similarity. Math Log Q 46:77–86. doi:10.1002/(SICI)1521-
3870(200001)46:1\77::AID-MALQ77[3.0.CO;2-X
Costantini S (2002) Meta-reasoning: a survey. In: Lecture notes in
computer science, computational logic: logic programming and
beyond, vol 2408/2002. Springer, Berlin/Heidelberg
Ebrahim R (2001) Fuzzy logic programming. Fuzzy Sets Syst
117:215–230. doi:10.1016/S0165-0114(98)00300-5
Fontana A, Formato F, Gerla G (1998) Fuzzy unification as a
foundation of fuzzy logic programming. In: Logic programming
and soft computing. RSP-Wiley, England, pp 51–68
Formato F, Gerla G, Sessa MI (2000) Similarity-based unification.
Fundamenta Informaticae 41(4):393–414
Gerla G (2001) Fuzzy logic: mathematical tools for approximate
reasoning. Kluwer, Norwell
Gerla G (2005) Fuzzy logic programming and fuzzy control. Stud Log
79:231–254. doi:10.1007/s11225-005-2977-0
Gerla G (2006) Effectiveness and multivalued logics. J Symbolic Log
71:137–162. doi:10.2178/jsl/1140641166
Hill PM, Gallagher J (1998) Meta-programming in logic program-
ming. Handbook of logic in artificial intelligence and logic
programming, vol 5. Oxford University Press, New York, pp
421–497
Medina J, Ojeda-Aciego M, Vojtas P (2004) Similarity-based
unification: a multi-adjoint approach. Fuzzy Sets Syst 146:43–
62. doi:10.1016/j.fss.2003.11.005
Pavelka J (1979) On fuzzy logic I: many-valued rules of inference. Z
Math Logik Grundlagen Math 25:45–52. doi:10.1002/malq.
19790250304
Valverde L (1985) On the structure of F-indistinguishability opera-
tors. Fuzzy Sets Syst 17:313–328. doi:10.1016/0165-0114(85)
90096-X
Vojtas P (2001) Fuzzy logic programming. Fuzzy Sets Syst 124:361–
370. doi:10.1016/S0165-0114(01)00106-3
Wiedermann J (2002) Fuzzy turing machines revised. Comput Inf
21(3):251–263
Ying M (1994) A logic for approximate reasoning. J Symbolic Log
59:830–837. doi:10.2307/2275910
Meta-logic programming for a synonymy logic 311
123