CAPITULO 2. CRECIMIENTO DE CHILE MIAHUATECO 5
2.6 LITERATURA CITADA 36
Generally, a fuzzy program is a setΠof fuzzy clauses each weighted by a realϑ∈]0, 1]:
α:ϑ←β
where the atomαis called the head of the clause and the bodyβis a conjunction of atomsβ1, . . . ,βnwith n ≥ 0.
It should be noted that some systems disallow clauses to be weighted. We will interpret the weightϑas the truth degree of the conclusion of the rule given the truth ofβ. Furthermore,
• An atom p(t1, . . . ,tn) consists of an n-nary predicate symbol p and n terms ti. • A predicate symbol starts with a lowercase letter.
• A term is either a variable, a constant or an n-ary functor f (t1, . . . ,tn) consisting of a function symbol and n terms ti.
• A function symbol starts with a lowercase letter.
• Traditionally a variable symbol starts with a capital while a constant symbol starts with a lowercase letter. Free variables are considered to be universally quantified.
While atoms and terms might look the same, there’s an important difference as atoms can be assigned truth values while terms cannot. A fuzzy factα:ϑ← orα:ϑ. is a
fuzzy clause with n = 0. A fuzzy query is a clause of the form ? :ϑ←βwhereϑis allowed to be instantiated.
In the following sections, the semantics and refutation procedure of this “Fuzzy Pro- log” will be developed analogous to that of crisp Prolog.
3.3.1.2 Model Semantics
Herbrand universe U The Herbrand universe UΠof programΠis the set of all ground terms (a grounded term doesn’t contain any variables) constructed from the func- tors and constants in the program. An arbitrary constant can be chosen when the program lacks constants.
Herbrand base BΠ A Herbrand base BΠis the set of ground atoms constructed from
Π’s predicates with elements of Herbrand Universe UΠas arguments.
Herbrand interpretation I A Herbrand interpretation I is the tuple hBΠI,τIi where BΠI⊂βΠis a subset of the Herbrand base andτI: BΠI→]0, 1] is a truth valuation function. Under this definition, elements of BΠIare considered to be more or less true.
Herbrand model of a program An interpretation I = hBΠI,τIi is a model of a pro- gramΠif it is a model of each clause inΠ.
Herbrand model of a clause An interpretation I = hBΠI,τIi is a model of a clause α:ϑ←βif and only if
• α∈ BΠI whenever ∀0 ≤ i ≤ n :βi∈ BΠI When n = 0 we only requireα∈ BΠI.
This means that each ground atom α∈ BΠI is logically entailed by the program.
• τI(α) =→ ((τI(β1, . . .βn),ϑ)
This definition is based on modus ponens (which is used backwards by the resolution refutation):
β: b.
α: a ←β
α: x
Given a query ? : x ←αour operational semantics will be to use the above backwards in order to obtain the quantifaction x of its answer:
x =→ (b, a)
The least Herbrand model captures a program’s meaning as it contains all ground atoms from the Herbrand base which are logically entailed by the program. Substitutionθ A substitution is a mapping of variables to terms. An example substi-
tution is {[X /1]} which substitutes 1 for X . A substitutionθ= {[X1/t1], . . . [Xn/tn]} is applied to a formulaϕby simultaneously replacing all variables Xiby the right component tiof their corresponding equation [Xi/ti] resulting in a new formula ϕθ.
Query Answer A substitutionθis a correct answer to a query ? : x ←αwith respect to a programΠif and only if every model I ofΠ(I |=Π) is also a model ofαθ (I |=αθ).
3.3.1.3 Fix-point Semantics
The least Herbrand model of a programΠis the fix-point of the immediate consequence operator TΠapplied on a starting I = hBΠI=/0,τI(x) = 0i, that is I is the least Herbrand model if and only if:
TΠ(I) = I = TΠ(. . . (TΠ(TΠ(hBΠI=/0,τI(x) = 0i)))) where the immediate consequence operator TΠis defined as:
TΠ(hBΠI,τIi) = hB0ΠI,τ0Ii
B0ΠI = {αθ:θis a grounding substitution,
∃α:ϑ←β1, . . .βn∈Π, ∀1 ≤ i ≤ n,βiθ∈ BΠI or ∃α:ϑ.}
τ0 I(x) =
max(sup{→ (τI
(βi),ϑ) :αis a clause }, sup{ϑ:αis a fact }) x =αθ
τI(x) otherwise
3.3.1.4 Operational Semantics
We are now ready to define the operational semantics which are equivalent to the se- mantics we discussed earlier.
An SLD-resolution tree for a programΠand a query goal ? :ϑ←αconsist of nodes
hA,σ,τi where A represents a possibly empty goal set, σis the set of substitutions
applied so far andτis a truth assigning function.
Then, given a node ha ∪ A,σ,τ(x)i, its successor is defined as: • hAθ,σ◦θ,τ(a) =ϑi
iff a0:ϑ←∈Πandθis the most general unifier MGU (a0, a) • h(A ∪ B)θ,σ◦θ,τ(a) =→ (τ(B),ϑ)i
iff a0:ϑ← B ∈Πandθis the most general unifier MGU (a0, a) • ε
iff none of the above rules apply
Solutions to the query ? :ϑ←αconsist of branches in the SLD-resolution tree starting from the root node and ending in the empty goal node containing the correct answer substitutions:
{:τ(ασ) ←ασ|hα,ε,truei →∗h/0,σ,τ(x)i}
The above inference procedure is a conservative extension of regular SLD-resolution (i.e. their solutions collapse on the boundaries of the unit interval) in which S stands for the selection rule which selects from a goal set the goal which will be resolved in the next step (Prolog uses a left-to-right selection rule). L emphasises the linear shape of the obtained proof trees while D stands for definite clauses.
As the described inference method might give rise to infinite trees (for instance in the advent of recursive predicates), resolution and fuzzy resolution aren’t complete. This means that not every logical consequence of a Prolog program can be derived using
resolution.
Regular Prolog is sound under the condition that unification incorporates an occur check which will be discussed in greater detail in the following section. This means that every conclusion derived by resolution is a logical consequence of the program. Lee [Lee72] was the first to prove the equivalent soundness of fuzzy resolution using only clauses whose truth value lies within the interval [0.5, 1] for inference.
3.3.2
Similarity-Based Unification
Until now, we have mainly concentrated on expressing uncertainty present in the do- main knowledge. Approximate reasoning adds to this some fuzziness in the reasoning process itself, possibly by extending the unification procedure to allow partial matches. 3.3.2.1 Classical Unification
The above resolution procedure relies for its resolvents on a function MGU which returns the most general unifier between two clause heads if it exists. We will need some additional definitions:
More General Substitution A substitutionθis more general than a substitutionσif and only if their exists a substitutionλfor whichθλ=σ.
Unifier A substitutionθis a unifier for two atomsϕandψif and only ifϕθ=ψθ. Most General Unifier A unifierθof two atomsϕ,ψis the most general unifier ofϕ,ψ
if and only if it is more general than any other unifier ofϕandψ.
The most general unifier (MGU) of two atoms (starting with the same predicate symbol and of the same arity) p(t1, . . . ,tn) and p(s1, . . . , sn) can be calculated from the set of equations S = {t1= s1, . . . ,tn= sn} with the following algorithm:
Choose non-deterministically one equation from Si and apply one of the following
rules depending on the form of the equation until the algorithm fails or no more
changes are applied to Si+1:
• f (t1, . . . ,tn) = f (s1, . . . , sn) . replace equation by the equations {ti= si: ∀0 < i ≤ n}
• f (t1, . . . ,tn) = g(s1, . . . , sm), f 6= g, m 6 n . stop with failure • x = x . remove the equation
• t = x,t is not a variable . replace by x = t
• x = y, x is a variable different from y and x occurs at least once more in Si. we perform an occurrence check by failing whenever X occurs in y and otherwise we replace all occurrences of x by y in every other equation
3.3.2.2 Weak Unification
A natural extension of the unification algorithm above allows for two atoms to be uni- fied even when they are syntactically different, but can be considered semantically or syntactically similar up to a certain degree.
Similarity can be expressed by a similarity relation R : U ×U → [0, 1] which is a binary fuzzy relation defined on the universe U for which the following properties are required to hold (generalisation of the concept of an equivalence relation):
• reflexive ∀x ∈ U : R(x, x) = 1
• symmetric ∀x, y ∈ U : R(x, y) = R(y, x)
• transitive ∀x, y, z ∈ U : R(x, z) ≥ supR(x, y) ∗ R(y, z) where ∗ is a t-norm with the definition of fuzzy relational composition from section 3.2.2.5 in mind.
A similarity relation R between function and predicate symbols is used in [Ses02] to allow approximate inferences when the exact unification procedure fails.
The following algorithm finds a weakλ-unifier for two atoms p(t1, . . . ,tn), q(s1, . . . , sn) of equal arity. The similarity relation R associates a unification degree ofλwith this unifier.
Choose non-deterministically one equation from Si and apply one of the following
rules depending on the form of the equation until the algorithm fails or no more
changes are applied to Si+1:
• f (t1, . . . ,tn) = g(s1, . . . , sn) where R( f , g) > 0 . replace equation by the equa-
tions {ti= si: ∀0 < i ≤ n} and setλ= min(λ, R( f , g)).
• f (t1, . . . ,tn) = g(s1, . . . , sm) where R( f , g) = 0 or m 6= n . stop with failure • x = x . remove the equation
• t = x,t is not a variable . replace by x = t
• x = y, x is a variable different from y and x occurs at least once more in Si. we perform an occurrence check by failing whenever X occurs in y and otherwise we replace all occurrences of x by y in every other equation
The unification degree of the most general unifier calculated by this algorithm can be used further on in a “Fuzzy Prolog” system supporting approximate reasoning and reasoning with uncertainty.