Fuzzy order-sorted feature logic

Order-Sorted Feature (OSF) logic is a knowledge representation and reasoning language based on function-denoting feature symbols and set-denoting sort symbols ordered in a subsumption lattice. OSF logic allows the construction of record-like terms that represent classes of entities and that are themselves ordered in a subsumption relation. The uniﬁcation algorithm for such structures provides an eﬃcient calculus of type subsumption, which has been applied in computational linguistics and implemented in constraint logic programming languages such as LOGIN and LIFE and automated reasoners such as CEDAR. This work generalizes OSF logic to a fuzzy setting. We give a ﬂexible deﬁnition of a fuzzy subsumption relation which generalizes Zadeh’s inclusion between fuzzy sets. Based on this deﬁnition we deﬁne a fuzzy semantics of OSF logic where sort symbols and OSF terms denote fuzzy sets. We extend the subsumption relation to OSF terms and prove that it constitutes a fuzzy partial order with the property that two OSF terms are subsumed by one another in the crisp sense if and only if their subsumption degree is greater than 0. We show how to ﬁnd the greatest lower bound of two OSF terms by unifying them and how to compute the subsumption degree between two OSF terms, and we provide the complexity of these operations.


Introduction
Order-Sorted Feature (OSF) logic is a Knowledge Representation and Reasoning language that originates in Hassan Aït-Kaci's work [1] and, similarly to Description Logics (DLs), it was initially meant as a formalization of Ron Brachmann's structured inheritance networks [2,3].OSF logic and related formalisms -e.g., feature logic [4] or the logic of typed feature structures [5] -have been applied in computational linguistics [5] and implemented in constraint logic programming languages such as LOGIN [6], LIFE [7] and CIL [8] and, more recently, in the very efficient CEDAR Semantic Web reasoner [9,10].
At the core of OSF logic are sort symbols denoting conceptual classes such as person or student, and a sort subsumption relation that denotes inclusion between classes, comparable to the inclusion axioms of a DL terminological box.Concept subsumption relations are a central part of any ontology, and OSF logic and its implementations rely on graph encoding techniques to perform Boolean operations on a concept lattice very efficiently [9,11].Besides sort symbols, OSF logic employs feature symbols to describe attributes of objects, like name, directed_by or written_by.While feature symbols denote total functions, which may appear less versatile than the relational roles of DLs, versions of OSF logic that support partial functions or relations have also been defined [4,5,3].
Together with variables, also named coreference tags, sort symbols and feature symbols can be used to construct record-like structures called OSF terms that can describe complex concepts, such as the following, which denotes the class of movies that are written and directed by the same person: The unification algorithm for such structures provides an efficient way to decide whether two OSF terms are subsumed by each other, and, in general, for finding the most general OSF term that is subsumed by both terms, thus offering an efficient calculus of partially ordered types [6].This work presents a fuzzy generalization of Order-Sorted Feature (OSF) logic in which both sorts and OSF terms are interpreted as fuzzy subsets of the domain of an interpretation rather than crisp subsets, and where the sort subsumption relation is generalized to a fuzzy subsumption relation between sorts, which is then extended to a fuzzy subsumption between OSF terms.
The idea of a fuzzy generalization of OSF logic was first introduced in [12] where a weaker notion of first-order term unification based on similarity relations between term constructors is introduced that also allows mismatches between functor arities and argument positions.While the interpretation of sort symbols (concept names in DL lingo) as fuzzy subsets of a domain and the notion of fuzzy or graded subsumption have already been studied extensively within fuzzy DLs, the generalization of the semantics of OSF logic to a fuzzy setting is novel.In particular, the way in which we interpret fuzzy subsumption relations departs significantly from their treatment in fuzzy DLs, which relies on the fuzzy implication operator [13,14].
In the rest of this section we provide an informal presentation of our definition of fuzzy sort subsumption and how it is extended to the terms of OSF logic, and we motivate the development of fuzzy OSF logic by outlining its possible implementation as an extension of the CEDAR reasoner [9,10] that would be capable of providing approximate solutions in retrieval applications, and as a fuzzy logic programming language.Fuzzy sort subsumption.Let S and F be (finite) sets of sort symbols and feature symbols, respectively, and let us fix an interpretation I = (∆ I , • I ), i.e., a structure with a domain ∆ I and a function • I that provides an interpretation to the elements of S and F1 .In our fuzzy setting, a sort s ∈ S is interpreted as a fuzzy subset2 s I : ∆ I → [0, 1], while a feature symbol f ∈ F is interpreted as a function f I : ∆ I → ∆ I .
In the crisp setting, a subsumption relation ⊆ S × S is a binary relation that denotes set inclusion.A natural fuzzy generalization of this notion is Zadeh's inclusion of fuzzy sets [15], according to which the subsumption s s ′ has the following meaning: if s s ′ , then ∀d ∈ ∆ I : s I (d) ≤ s ′I (d). ( That is, this definition of fuzzy inclusion requires that, whenever d is an instance of s I with degree s I (d) = β ∈ [0, 1], then d must also be an instance of s ′I with a degree greater than or equal to β.We consider a fuzzy subsumption relation as a way to model a weaker notion of inclusion, where the element d can be an instance of s ′I with a degree that may possibly be smaller than its degree of membership to s I .Thus, we define a fuzzy subsumption relation as a fuzzy partial order, i.e., a function • : S 2 → [0, 1] that associates a subsumption degree β k with each pair of sort symbols s, s ′ (and satisfying every constraint of Definition B.6 in Appendix B) and having the following semantics: That is, any object d which is an instance of s I with degree β must also be an instance of s ′I with a degree β ′ that is greater than or equal to the minimum of β and β k .Note that (1) is a special case of this equation with β k = 1.An example of a fuzzy sort subsumption relation is given in Fig. 1 3 .
Fuzzy OSF term subsumption and unification.Sort symbols are analogous to the primitive or named concepts of DLs.Complex concepts can be expressed with OSF terms, structures built from sort symbols, feature symbols (attributes) and variables.For example, the term denotes the class of movies directed by some person and whose genre is thriller.
In this work we will show that a fuzzy subsumption relation between sort symbols can be extended to a fuzzy subsumption relation between OSF terms.For example, consider the fuzzy subsumption relation depicted in Fig. 1 and consider the term This term is more specific that t 1 , as it provides additional information by introducing the feature title and by constraining its value to be of sort string, and because it defines more restrictive constraints, by requiring that the value of the feature directed_by be of sort director, which is subsumed by person, and that the value of the feature genre be of sort slasher, which is subsumed by thriller (with degree 0.5).In this case we say that t 1 subsumes t 2 with degree 0.5.
One of the reasoning tasks supported by OSF logic is deciding whether a given term is subsumed by another, or in general finding the most general term which is subsumed by two given terms.As we will see, this problem can be solved by their unification, a process which aims to combine the constraints expressed by the two terms in a consistent way.For example, t 2 is the unifier of term t 1 and the following term: In particular, the value for the feature genre in t 2 must be of sort slasher, as this sort is subsumed by both thriller and horror (the values of genre in t 1 and t 3 ), and it is the most general one with this property.The unifier t 2 is associated with a unification degree, which depends on the subsumption degrees of its sorts with respect to the corresponding sorts in t 1 and t 3 .In this case the unification degree is 0.5, due to •(slasher, thriller) = 0.5.
Application to fuzzy logic programming.A possible application of OSF logic with a fuzzy subsumption relation is the implementation of a logic programming language (like LOGIN [6]) based on SLD resolution and fuzzy OSF term unification, i.e., where first-order term unification is replaced by the unification of OSF terms over a fuzzy sort subsumption lattice.Logic programming languages and weaker definitions of unification based on fuzzy relations such as similarities and proximities have been researched extensively (e.g., [16,17,18,19,20,21,12]) and implemented in systems such as Bousi∼Prolog [22] and FASILL [23].
There are several potential advantages to using OSF logic in this context.First of all, the unification algorithm for OSF terms takes into account a (fuzzy) sort subsumption relation, which can result in more efficient computations [6,24].Another advantage is the flexibility provided by OSF terms, which lack a fixed arity and can thus easily represent partial information, and are moreover simpler to interpret thanks to their use of features rather than positions to specify arguments [6].
Application to similarity-based reasoning.Another application of our definition of fuzzy subsumption relation is similarity-based reasoning.A possible way to define a fuzzy subsumption relation is by taking advantage of a given similarity relation ∼ : S × S → [0, 1] between sort symbols in order to enrich a crisp subsumption relation ⊆ S × S according to the following intuitive inference rule, which also motivates similarity-based approaches in logic programming (e.g., [18]): if s s ′ and ∼(s ′ , s ′′ ) = β, then •(s, s ′′ ) = β.For example, if slasher horror and ∼(horror, thriller) = β, then •(slasher, thriller) = β.This would mean, for example, that if h is an instance of slasher with degree 1, then h must also be an instance of thriller with degree greater than or equal to β.
This approach could be behind the implementation of a fuzzy logic programming language similar to Bousi∼Prolog [22], where the similarity-based or (proximity-based) first-order term unification of this language may be replaced by similarity-based OSF term unification, with the potential advantages discussed above.
Fuzzy CEDAR.Finally, we plan to apply fuzzy OSF logic to define a fuzzy version of CEDAR, a very efficient Semantic Web reasoner based on OSF logic [9,10].One of the capabilities supported by CEDAR is the optimization of a query expressed as an OSF term according to the knowledge expressed in a given ontology, which can significantly simplify the original query and reduce the instance retrieval search space.The consistency of the input query against the ontology is also ensured during this process, and no answer is provided if the query is inconsistent.The retrieval is further optimized thanks to a custom RDF triple indexing scheme based on OSF sort and attribute information [10].
A fuzzy extension of CEDAR could relax the consistency requirement to provide approximate answers when the input query is inconsistent with the crisp knowledge expressed by the ontology.This would be achieved, for example, by enriching the subsumption relation of the given ontology according to a similarity relation (with the procedure outlined above) in order to obtain a fuzzy subsumption, which would then be taken into account during the query optimization phase.
Structure of the paper.After recalling its syntax in Section 2, our fuzzy generalization of OSF logic begins in Section 3, where we define the interpretation of the syntactic objects of this languagenamely sorts, features, OSF terms and OSF clauses -in structures called fuzzy OSF interpretations, and a special interpretation called the fuzzy OSF graph algebra, whose elements are rooted directed labeled graphs called OSF graphs.
In Section 4 we define structure-preserving mappings between fuzzy OSF interpretations called fuzzy OSF homomorphisms, which are valuable for proving several results regarding the satisfiability of OSF clauses in fuzzy interpretations.
Fuzzy OSF homomorphisms are then employed extensively in Section 5, where we extend the fuzzy sort subsumption ordering to OSF terms and prove that it constitutes a fuzzy partial order.We provide similar orderings for OSF clauses and OSF graphs, and illustrate how the fuzzy OSF term subsumption ordering is related to its crisp counterpart.
Section 6 is devoted to unification.We show how to compute the greatest lower bound of two OSF terms in the fuzzy OSF term subsumption ordering through their unification, and how this procedure can be used to find the degree to which two OSF terms are subsumed by each other.We also discuss the complexity of these computations.
Appendix A presents a reference table of the symbols used in this paper.The basic definitions of fuzzy set theory and fuzzy orders are recalled in Appendix B to fix the notation.

Fuzzy OSF logic: syntax
In this section we provide the definitions of fuzzy OSF signature and of two formal languages that are used to represent knowledge with OSF logic: OSF terms and OSF clauses.As discussed in the introduction, OSF terms are comparable to the defined concepts of DLs, and they will be interpreted as fuzzy subsets of a domain of interpretation.An OSF clause is an equivalent representation that can be seen as a logical reading of an OSF term, and for which a notion of graded satisfaction will be defined.In OSF logic, both syntactic representation are important from an implementation perspective, as OSF terms are the abstract syntax employed by an user, while OSF clauses are used in the constraint normalization rules needed for OSF term unification [7].
As far as syntax is concerned, the only difference with crisp OSF logic is that we consider a fuzzy sort subsumption relation rather than a crisp one (the most significant differences concern the semantics, as will be seen starting from Section 3).The definitions of OSF terms and OSF constraints and the result concerning their equivalence are reported from [7] for self-containment.Definition 2.1 (Fuzzy OSF signature).A fuzzy OSF signature is a tuple (S, F , •) where S is a set of sort symbols, F is a set of feature symbols, and (S, •) is a fuzzy finite bounded lattice with least element ⊥ and greatest element ⊤4 .Elements of S and F will also simply be called sorts and features, respectively.The greatest lower bound (GLB) s s ′ of two sorts s and s ′ is also called their greatest common subsort.Example 2.2 (Fuzzy OSF signature).As an example of a fuzzy OSF signature we may take the set of sorts and the fuzzy subsumption relation corresponding to the graph of Fig. 1, and F = {directed_by, title} as the set of features.⊲ Definition 2.3 (OSF term [7]).Let V be a countably infinite set of variables (or coreference tags, or simply tags).Let X ∈ V, s ∈ S and f 1 , . . ., f n ∈ F .An OSF term is defined recursively as follows.
• A sorted variable X : s is an OSF term.

⊲
The definition of OSF terms given above does not rule out the presence of redundant or even contradictory information (e.g., consider the OSF term s(f → s 0 , f → s 0 , f → s 1 ), which is contradictory if s 0 s 1 = ⊥).OSF terms that are well-behaved to this regard are called normal OSF terms, and the reader is referred to [7] for their definition.OSF terms in normal form are also called ψ-terms and denoted ψ, ψ i , and so on.For an OSF term ψ in normal form and X ∈ Tags(ψ), we let Sort ψ (X) be the most specific sort s such that X : s appears in ψ.The notation X f − → ψ Y indicates that there is a feature f pointing from a subterm of ψ with root tag X to a subterm of ψ with root tag Y .We let Ψ denote the set of all normal OSF terms.
A method for transforming an OSF term into a normal one is more easily presented as a constraint normalization procedure for OSF constraints, which are defined next.Definition 2.5 (OSF constraints and clauses [7]).An OSF constraint is an expression of the form X : s, X .= X ′ , or X.f .= X ′ .An OSF clause φ is a conjunction of OSF constraints.The set of variables occurring in φ is denoted Tags(φ), while φ[X/Y ] is the OSF clause obtained by replacing all occurrences of Y with X.
Informally, the constraint X : s means that the value assigned to X is of sort s; X .= X ′ means that the same value is assigned to the variables X and X ′ ; while X.f .= X ′ means that applying the feature f to the value assigned to X returns the value assigned to X ′ .Example 2.6 (OSF clause).Let φ be the following OSF clause.
Note that φ is simply a translation of the term from Example 2.4 into an OSF clause.The variables that were left implicit in Example 2.4 must be written explicitly in the OSF clause.⊲ While every OSF term can be rewritten as an OSF clause, the converse is in general only true for the class of rooted solved OSF clauses, which are defined in [7].A rooted OSF clause is denoted φ X , where X is the root of the clause φ.For an OSF clause φ and a variable X ∈ Tags(φ), the maximal subclause of φ rooted in X is denoted φ(X).The set of all OSF clauses in solved form is denoted Φ, and the subset of rooted solved OSF clauses is denoted Φ R .
Note that we use the same symbol φ to denote an OSF clause and the function mapping an OSF term to a clause (and similarly for the symbol ψ), as the meaning is always clear from context.
Finally, we report the constraint normalization rules from [7] that are needed to transform an OSF clause into a solved form.Each rule is of the form

Rule name Premise φ [Side condition] Conclusion φ ′
and it expresses that, whenever the (optional) side condition holds, the premise φ can be simplified into the conclusion φ ′ .The rules of Fig. 2 are the same as the ones from [7], except that we are considering the GLB operation in a fuzzy lattice rather than an ordinary one.Thanks to Proposition B.12, this does not constitute a significant difference as far as the properties of the normalization procedure are concerned.An OSF term ψ can be normalized by applying the constraint normalization rules to φ(ψ) and translating the result back into an OSF term.
Theorem 2.8 (OSF clause normalization [7]).The rules of Fig. 2 are finite terminating and confluent (modulo variable renaming).Furthermore, they always result in a normal form that is either the inconsistent clause or an OSF clause in solved form together with a conjunction of equality constraints.

Fuzzy OSF interpretations
In this section we generalize the semantics of OSF logic [7] to a fuzzy setting.We begin by defining fuzzy OSF interpretations, the structures used to interpret the syntax of OSF logic.These provide the meaning of a fuzzy sort subsumption relation and determine the denotations of sort symbols as fuzzy subsets and of feature symbols as functions.

Fuzzy Sort Intersection
In Section 2 we have presented OSF terms and OSF clauses as two alternative (and syntactically equivalent) data structures for representing knowledge with OSF logic.We thus define the denotation of an OSF term as a fuzzy subset of the domain and the graded satisfaction of an OSF clause, and show that these two notions are semantically equivalent too.
There is, in fact, a third syntactic representation level, namely that of OSF graphs.These are rooted directed graphs whose nodes are labeled by sorts and whose edges are labeled by features, and that are also syntactically equivalent to ψ-terms and rooted solved OSF clauses.OSF graphs play an essential role in the semantics of fuzzy OSF logic, as they are the elements of the domain of the fuzzy OSF graph algebra, a fuzzy interpretation in which every solved OSF clause is satisfiable.

Fuzzy OSF interpretations
Let us fix a fuzzy signature (S, F , •) for the rest of the section.
In the following we write d ∈ I and d ∈ ∆ I interchangeably.The motivation behind condition (3) has been discussed in the Introduction.In order to motivate condition (4), let us momentarily switch to a crisp setting, where s I denotes a (crisp) subset of the domain ∆ I , ⊆ S 2 is a binary (subsumption) relation and ⋏ is the GLB operation on (S, ).The definition of an OSF algebra [7] requires that s I 0 ∩ s I 1 ⊆ (s 0 ⋏ s 1 ) I holds for every s 0 , s 1 ∈ S, i.e., whenever an element belongs to the intersection of the denotations of two sorts, then it must also belong to the denotation of their GLB.Our fuzzy generalization of this requirement is very flexible as it does not impose restrictive constraints on the membership degree of d to (s 0 s 1 ) I , but it simply requires that whenever an object is an instance of two sorts s 0 and s 1 with a degree greater than 0, then it must also be an instance of their GLB with a degree greater than 0. • The domain is ∆ I = {psycho, halloween , hitchcock , carpenter , "Psycho ′′ , "Halloween ′′ , null}.
• The interpretation of the feature symbols is defined by letting -directed_by I (psycho) = hitchcock and directed_by I (halloween ) = carpenter ; -title I (psycho) = "Psycho ′′ and title I (halloween ) = "Halloween ′′ ; and all the remaining feature applications are equal to null.This is easily verified to satisfy all constraints of Definition 3.1.In particular thriller I (halloween ) = 0.5 ≥ 1 ∧ 0.5 = slasher I (halloween ) ∧ •(slasher, thriller).⊲ Since features are interpreted as total functions, in the last example the feature title had to be defined also for elements of sort person such as hitchcock .While we can circumvent this issue by assigning title I (hitchcock ) = null , there are versions of OSF logic that interpret features as partial functions instead [4,5,3].An analogous extension of fuzzy OSF logic is left for future work.
We now define subalgebras of fuzzy OSF algebras.
In other words F * (D) is the smallest set containing D and closed under feature application.Definition 3.4 (Fuzzy OSF subalgebra).Let I and J be fuzzy OSF interpretations.Then I is a subalgebra of J if ∆ I ⊆ ∆ J and for all d ∈ ∆ I , all s ∈ S and all f ∈ F :

Denotation of an OSF term
We now define the meaning of an OSF term in a fuzzy OSF interpretation.Let Val (I) be the set of all variable assignments α : V → ∆ I .Definition 3.7 (Denotation of an OSF term).Let t = X : s(f 1 → t 1 , . . ., f n → t n ) be an OSF term, let I = (∆ I , • I ) be a fuzzy OSF interpretation, and let α : V → ∆ I be a variable assignment.The denotation of t in the interpretation I under the assignment α is the fuzzy subset of ∆ I defined by letting, for all d ∈ ∆ I : The denotation of t in the interpretation I is defined as Definition 3.7 is a direct generalization of the crisp denotation of an OSF term in an OSF interpretation under an assignment α [7].Note that the crisp denotation of a term is always a singleton or the empty set, while [[t]] I,α has a value grater than 0 for at most one element d ∈ ∆ I .
Example 3.8 (Denotation of an OSF term).Continuing from Example 3.2, let t be the term X : thriller (directed_by → Y : director) and α be an assignment such that α(X) = halloween and α(Y ) = carpenter .Then (with h def = halloween and c def = carpenter ): Remark 1 (Denotation of an OSF term).Let t = X : s(f 1 → t 1 , . . ., f n → t n ) be an OSF term and X i = RootTag(t i ) for each i.Let I be an OSF interpretation and d ∈ ∆ I .It is easy to see that, if α 0 and α 1 are assignments such that then it must be the case that α 0 (Y ) = α 1 (Y ) for all Y ∈ Tags(t), and thus β 0 = β 1 .Indeed, it must be the case that α 0 (X) = α 1 (X) = d, and so for each f i is must hold that α 0 (X i ) = f I i (d) = α 1 (X i ), and so on for all subterms.Hence the set {β |

Satisfaction of OSF clauses in an OSF algebra
We now define the graded satisfaction of an OSF clause in a fuzzy OSF interpretation, generalizing the crisp definition from [7].Definition 3.9 (Satisfaction of an OSF clause in an OSF algebra).If I = (∆ I , • I ) is a fuzzy OSF interpretation and α : V → ∆ I is an assignment, then the satisfaction of an OSF clause φ to a degree β ∈ [0, 1] in the interpretation I under the assignment α (notation: I, α |= β φ) is defined recursively as follows: If I, α |= β φ, then α is called a solution in I for the clause φ with degree β, and φ is said to be satisfiable in I with degree β.The clause φ is said to be satisfiable in I if there is some α : V → ∆ I and β > 0 such that I, α |= β φ, and φ is said to be satisfiable if there is some I such that φ is satisfiable in I.
Note that I, α |= 0 φ always holds for any fuzzy OSF interpretation I, assignment α and OSF clause φ (the satisfaction degree of a clause for a given assignment and interpretation is always greater than or equal to 0).Moreover, for any β ∈ (0, 1], Proposition 3.10 (Denotation and satisfaction in subalgebras).Let I be a subalgebra of J .Then, for every OSF term t, every OSF clause φ, every assignment α : V → ∆ I and every We now provide the connection between the denotation of an OSF term t in a fuzzy interpretation and the degree of satisfaction of the corresponding OSF clause φ(t).Proposition 3.11 (Equivalence of terms denotation and constraints satisfaction).For every OSF term t (with root variable X), every interpretation I, every assignment α, and every The constraint normalization rules of Fig. 2 preserve the satisfiability of an OSF clause.Proposition 3.12 (Solution-preservation of OSF clause normalization).For any rule of Fig. 2 with premise φ and conclusion φ ′ , for every fuzzy OSF algebra I and assignment α: Note that the degrees β and β ′ in the last proposition may be not be the same, so that the degree of satisfaction of an OSF constraint in an algebra I according to some assignment α may be different from the degree of satisfaction of its solved form in the same algebra and according to the same assignment.Together with Proposition 3.11, this implies that the denotation of an OSF term t in a fuzzy OSF interpretation may not coincide with the denotation of its normal form ψ obtained by applying the constraint normalization procedure to φ(t).This constitutes a significant departure from crisp OSF logic, where in any OSF algebra every OSF clause is equivalent to its solved form, and every OSF term has the same denotation as its normal form.

OSF graphs and fuzzy OSF graph algebra
We introduce yet another class of objects that are in 1-to-1 correspondence with normal OSF terms and rooted solved OSF clauses, namely that of OSF graphs, originally defined in [7].Definition 3.13 (OSF graph [7]).An OSF graph is a directed labeled graph g = (N, E, λ N , λ E , X) such that • N ⊆ V and X ∈ N is a distinguished node called the root of g; • λ N : N → S is a node labeling function such that each node of g is labeled by a non-bottom sort, i.e., λ N (N ) ⊆ S \ {⊥}; • λ E : E → F is an edge labeling function that assigns a feature to each edge (Y , Z) ∈ E in such a way that no two edges outgoing from the same node are labeled by the same feature, i.e., if • every nodes lies on a directed path starting at the root.
The OSF graph g is depicted in Fig. 3, where the root node is identified with a double ellipse, and the node identifiers (i.e., the variables) are omitted.Let ψ be the OSF term from Example 2.4 and φ be the OSF clause from Example 2.6: then g = G(φ) = G(ψ), φ = φ(g) and ψ = ψ(g).⊲ OSF graphs play a fundamental role in the semantics of crisp OSF logic [7] and, as we will see, in that of our fuzzy generalization of this language.In particular, they are the elements of the domain of the fuzzy OSF graph algebra, a fuzzy OSF interpretation which will be essential for proving many results about fuzzy OSF logic.This fuzzy interpretation is defined next.Definition 3.16 (Fuzzy OSF graph algebra).The fuzzy OSF graph algebra is the pair G = (∆ G , • G ) defined as follows.
1.The domain ∆ G is the set of all OSF graphs.2. For each s ∈ S and for each graph g  3.For each f ∈ F, the function f G : ∆ G → ∆ G is defined by letting, for any g = (N, E, λ N , λ E , X):

where
• g Y is the maximally connected subgraph of g rooted at Y ; and • G(Z f ,g : ⊤) denotes the trivial OSF graph ({Z f ,g }, ∅, {(Z f ,g , ⊤)}, ∅, Z f ,g ) whose only node is the new variable Z f ,g ∈ V \ N -labeled ⊤ -which is uniquely determined by the feature f and the graph g, i.e., if This definition generalizes the OSF graph algebra of [7]: the interpretation of feature symbols is the same, but the denotation of a sort symbol s is now a fuzzy set whose value for a graph g with root X is the subsumption degree of the root sort λ N (X) with respect to s. • thriller G (g) = 1 for any OSF graph g whose root is labeled by thriller or by ⊥; • thriller G (g) = 0.5 for any OSF graph g whose root is labeled by slasher; and • thriller G (g) = 0 for any other OSF graph g.Fig. 4 shows how features are interpreted in the fuzzy OSF graph algebra.OSF graphs are represented inside boxes.For a feature f , the application of f G to a graph g is represented as an arrow originating from the box containing g and pointing at the box containing f G (g).The figure shows the iterative application of a few features to the graph g corresponding to the term Note that the result of applying the function f G to a graph that does not contain this feature results in a trivial graph (e.g., the application of Every solved OSF clause φ is satisfiable in a subalgebra of the fuzzy OSF graph algebra, namely the subalgebra generated by the graphs corresponding to the maximal rooted subclauses of φ.Definition 3.19 (Canonical graph algebra).Let φ be a solved OSF clause.The subalgebra G[∆ G,φ ] of the OSF algebra G generated by ∆ G,φ def = {G(φ(X)) | X ∈ Tags(φ)} is called the canonical graph algebra induced by φ.

Proposition 3.20 (Satisfiability). Any solved clause
The following is a corollary of Propositions 3.10 and 3.20.

Corollary 3.21 (Canonical solution)
. Any solved OSF clause φ is satisfiable in the OSF graph algebra G with degree 1 under any assignment α :

Fuzzy OSF algebra homomorphisms
In this section we introduce fuzzy β-homomorphisms, mappings between fuzzy OSF interpretations that preserve feature applications and, to some degree, the sorts of the elements of the domain.
Fuzzy β-morphisms allow us to prove several results regarding the satisfaction of OSF clauses in fuzzy OSF interpretations.In particular, we prove that the OSF graph algebra G is canonical in the sense that any OSF clause is satisfiable if and only if it is satisfiable in G.We also prove that the denotation of a normal OSF term ψ in a fuzzy OSF interpretation can be characterized through the existence of fuzzy homomorphisms from the subalgebra of G generated by G(ψ).In the next section, β-morphisms will be used to define a fuzzy ordering on the domain of any fuzzy OSF interpretation, which will eventually lead to the fuzzy subsumption ordering between OSF terms.Definition 4.1 (Fuzzy OSF algebra β-morphism).A β-morphism (or β-homomorphism) γ : I → J between two fuzzy OSF interpretations I and J is a function γ : ∆ I → ∆ J such that, for all f ∈ F , all s ∈ S, and all d ∈ ∆ I : γ(f Our definition of fuzzy OSF algebra β-morphism generalizes the analogous crisp one from [7].The condition on features is unchanged: a β-morphism must preserve the structure of the input algebra I, i.e., it must commute with function applications.The original crisp condition on sorts states that, whenever d is an element of the interpretation of s in I, then its image γ(d) must be an element of the interpretation of s in J .A direct fuzzy generalization of this statement would specify that, for all s ∈ S and d ∈ ∆ I , Similarly to our definition of a fuzzy subsumption relation, we further generalize this constraint by requiring that, in order for γ to be a β-morphisms, whenever d is a member of s I with degree β 0 , then γ(d) must be a member of s J with degree greater than or equal to the minimum of β and β 0 .Clearly ( 3) is recovered simply by setting β = 1.
In general it is not true that, for any fuzzy interpretations I and J , there is a maximum β such that there exists a β-morphism γ : I → J .This property -which will be valuable later -holds however for specific homomorphisms relating subalgebras generated by singletons.3.There is a maximum β ′ such that there exists a β ′ -morphism γ ′ :

For any β
As should be expected, the satisfiability of an OSF clause is preserved (modulo degree β) under OSF algebra β-morphisms.Proposition 4.5 (Extending solutions).Let I and J be two fuzzy OSF interpretations and γ : I → J be a β-morphism.For every OSF clause φ and assignment α : An interesting property that carries over from crisp OSF logic [7] is that it is always possible to define a β-morphism from any fuzzy interpretation I into the fuzzy OSF graph algebra for some positive degree β.The following corollary follows directly from the last result and Proposition 4.5.

Corollary 4.7 (Canonicity of G). An OSF clause is satisfiable if and only if it is satisfiable in the fuzzy OSF graph algebra.
Another interesting property is that any solution α for a clause φ in any fuzzy interpretation I can be obtained as a homomorphism from the canonical graph algebra induced by φ, as stated next.An example of the application of this theorem was given in Example 4.2.
Theorem 4.8 (Extracting solutions).For any solved OSF clause φ, fuzzy interpretation I, assignment α : V → ∆ I and β ∈ (0, 1] such that I, α |= β φ there exists an OSF algebra β- Thanks to Proposition 3.11 and Theorem 4.8 we can show that the denotation of a normal OSF term ψ in a fuzzy OSF interpretation can be characterized through the existence of fuzzy homomorphisms from the canonical graph algebra induced by G(ψ).Theorem 4.9 (Denotation of ψ-terms via fuzzy morphisms).Let ψ be a normal OSF term, let φ = φ(ψ) and let I be a fuzzy OSF interpretation.Then, for all d ∈ ∆ I and β ∈ (0, 1]:

Fuzzy OSF orderings and subsumption
In this section we define a fuzzy approximation ordering between OSF graphs, a fuzzy subsumption ordering between OSF terms and a graded implication ordering between OSF clauses.We show that these fuzzy relations are equivalent and that they constitute fuzzy partial orders5 on, respectively, OSF graphs, normal OSF terms and rooted solved OSF clauses.We give both a semantic and syntactic definition of fuzzy subsumption of OSF terms, and prove that they are equivalent.We also provide a link between the crisp definition of subsumption of OSF terms [7] and our fuzzy generalization.
We begin by defining a fuzzy preorder on the elements of any fuzzy OSF interpretation.ti tl e we say that d approximates d ′ with degree β.Example 5.2 (Endomorphic approximation).Let g 0 = G(X 0 : slasher (directed_by → Y 0 : director, title → Z 0 : string)) and This is depicted in Fig. 6 (where not all trivial graphs are shown, and some names are shortened).In particular γ(g 0 ) = g 1 .The function γ is a 0.5-morphisms witnessing ⊑ G (g 0 , g 1 ) = 0.5.⊲ Remark 2. Let I be a fuzzy OSF algebra and d, d ′ ∈ ∆ I .Suppose that ⊑ I (d, d ′ ) = β ′ > 0. Then Proposition 4.4 guarantees that there exists a β ′ -morphism γ ′ : Proposition 5.3 (Endomorphic approximation fuzzy preorder).For all fuzzy OSF interpretations I, the fuzzy binary relation ⊑ I is a fuzzy preorder.
Like the subsumption lattice of first-order terms [25,26], which is antisymmetric modulo variable renaming, our fuzzy partial orders on OSF graphs, OSF terms and OSF clauses will only satisfy antisymmetry between equivalence classes of these objects.Our situation is slightly complicated by the fact that features are interpreted as total functions, and thus, for instance, there exist OSF terms that are semantically equivalent (i.e., they have the same denotation in every fuzzy OSF interpretation) without being variable renamings of each other.An example is given by the terms We now define an equivalence relation on OSF graphs that takes care of this issue.Definition 5.4 (OSF graph equivalence).Two OSF graphs g 0 and g 1 are equivalent (notation: Informally, two graphs g 0 and g 1 are equivalent if they are essentially the same graph modulo trivial subgraphs, i.e., g 0 may contain subgraphs consisting of a single node labeled ⊤ that are not in g 1 , and viceversa. Example 5.5 (OSF graph equivalence).Consider the OSF terms and let g 0 = G(ψ 0 ) and g 1 = G(ψ 1 ).Let γ 0 : G[g 0 ] → G[g 1 ] be defined by letting, for all g ∈ G[g 0 ] = w G (g 0 ) for some w ∈ F * , γ 0 (g) = w G (g 1 ).Similarly, let γ 1 : G[g 1 ] → G[g 0 ] be defined by letting, for all g ∈ G[g 1 ] = w G (g 1 ) for some w ∈ F * , γ 1 (g) = w G (g 0 ).In particular γ 0 (g 0 ) = g 1 and γ 1 (g 1 ) = g 0 .These are easily verified to be 1-morphisms, and thus g 0 ≡ g 1 .This is depicted in Fig. 7 ⊲ We can thus prove that ⊑ G is a fuzzy partial ordering on OSF graphs modulo OSF graph equivalence.
Theorem 5.6 (Endomorphic graph approximation fuzzy partial order).The fuzzy binary relation ⊑ G is a fuzzy partial order on (equivalence classes of ) OSF graphs, i.e., if ⊑ G (g 0 , g 1 ) > 0 and ⊑ G (g 1 , g 0 ) > 0, then g 0 ≡ g 1 .The equivalence relation on OSF graphs induces analogous equivalence relations on normal OSF terms and rooted solved OSF constraints by letting ψ 0 ≡ ψ 1 ⇔ G(ψ 0 ) ≡ G(ψ 1 ), and φ 0 ≡ φ 1 ⇔ G(φ 0 ) ≡ G(φ 1 ).As expected, in every fuzzy OSF interpretation equivalent normal OSF terms have the same denotation, and equivalent rooted solved OSF clauses are satisfied with the same degree.We now give a semantic definition of fuzzy OSF term subsumption.Recall that the fuzzy sort subsumption •(slasher, thriller) = β means that, on any interpretation I, every object that is an instance of slasher I with degree β ′ must also be an instance of thriller I with degree greater than or equal to β ∧ β ′ .Along these lines, we may say that an OSF term t 1 is subsumed by a term t 2 with degree β if, on any interpretation I, every object in the denotation of t 1 with degree β ′ also belongs to the denotation of t 2 with degree greater than or equal to β ′ ∧ β.We thus define fuzzy OSF term subsumption as the fuzzy relation that assigns to each pair of OSF terms the supremum of all degrees β ∈ [0, 1] that satisfy this property.Definition 5.9 (Semantic OSF term subsumption).The sort subsumption relation • : S 2 → [0, 1] is extended to a fuzzy binary relation on OSF terms by letting, for all OSF terms t 1 and t 2 : We provide an analogous definition for the graded implication of OSF clauses, which generalizes the crisp one from [7].Theorem 5.12 (Equivalence of fuzzy OSF orderings).If the normal OSF terms ψ and ψ ′ (with roots Y and X, respectively, and no common variables), the OSF graphs g and g ′ , and the rooted solved OSF clauses φ Y and φ ′ X respectively correspond to one another though the syntactic mappings, then the following are equivalent: (1) The fact that • and |= are fuzzy partial orders on normal OSF terms and rooted solved OSF clauses (modulo OSF term and OSF clause equivalence), respectively, is obtained as a corollary of Theorems 5.6 and 5.12.
Corollary 5.13.The fuzzy relation • is a fuzzy partial order on normal OSF terms modulo OSF term equivalence.The fuzzy relation |= is a fuzzy partial order on rooted solved OSF clauses modulo OSF clause equivalence.
Next, we provide a syntactic definition of OSF term subsumption and prove that it is equivalent to the semantic one of Definition 5.9.The syntactic definition -which was originally presented in [27] -will be useful in Section 6 for the computation of the subsumption degree between two OSF terms.
The next corollary follows from Theorem 5.16 and the analogous result for crisp OSF logic.
Corollary 5.17 (Fuzzy OSF term lattice).The fuzzy binary relation • is a fuzzy lattice on (equivalence classes) of normal OSF terms.

Fuzzy OSF term unification
Unification is an essential operation in automated reasoning.In crisp OSF logic, the unification of two OSF terms allows to find their GLB in the OSF term subsumption lattice.This operation is at the core of the application of OSF logic and its variants in computational linguistics [5] and, more recently, it has enabled the implementation of the very efficient CEDAR Semantic Web reasoner [9,10].In this section we prove that computing the GLB of two OSF terms in the fuzzy subsumption lattice is no more difficult than computing it in the crisp setting, as the same unification procedure can be employed, and we also provide the complexity of computing the subsumption degree of one term with respect to another.Definition 6.1 (Fuzzy OSF term unification).The unifier of two normal OSF terms ψ 1 and ψ 2 is their GLB in the OSF term fuzzy subsumption lattice (modulo OSF term equivalence) and is denoted ψ 1 ψ 2 .The unification degree of ψ 1 and ψ 2 is defined as min( •(ψ 1 ψ 2 , ψ 1 ), •(ψ 1 ψ 2 , ψ 2 )).We write ψ 1 β ψ 2 if the unification degree of ψ 1 and ψ 2 is β.

Example 6.3 (Fuzzy OSF term unification). Consider the OSF terms
t.An application of the rules of Figure 2 8a as the fuzzy subsumption) yields = .The unifier of ψ 0 and ψ 1 can be constructed from φ using these new variables 6 , resulting in ψ = Z 0 : q(f → Z 1 : s(g → Z 0 , h → Z 2 : r)).

Complexity of OSF term subsumption and unification
In terms of complexity, finding the unifier of two normal OSF terms ψ 0 and ψ 1 in this fuzzy setting has the same complexity of deciding the problem in the crisp setting.This is due to the fact that GLBs in a fuzzy lattice and its crisp counterpart can be computed in the same way (also see Proposition B.12), and the rules for fuzzy OSF constraint normalization and crisp OSF constraint normalization are essentially the same.The algorithm from [6] is based on the union-find problem [28] and has a worst-case complexity of O(mG(m)), where G(m) ≤ 5 for all practical purposes, and m = |Tags(ψ 0 ) ∪ Tags(ψ 1 )|.
Regarding the computation of the unification degree (and thus also of the subsumption degree), the following steps are required.
As shown in Example 6.3, this amounts to finding partitions of the set Tags(ψ 0 ) ∪ Tags(ψ 1 ) and mapping each variable to its partition.This is an application of the union-find problem and thus its complexity is O(mG(m)), where m = |Tags(ψ 0 ) ∪ Tags(ψ 1 )|, and G is as above.
• The second step involves finding the degrees β 0 and β 1 by computing β 0 = min{ •(Sort ψ0 ψ1 (h 0 (X)), Sort ψ0 (X)) | X ∈ Tags(ψ 0 )} and where the complexity of computing •(s, s ′ ) for two sorts s, s ′ ∈ S is the same as the complexity of computing shortest paths in a DAG [29], i.

Conclusion
We have defined a fuzzy semantics of OSF logic in which sort symbols denote fuzzy subsets of a domain of interpretation.This semantics is based on a fuzzy sort subsumption lattice • : S × S → [0, 1] whose interpretation generalizes Zadeh's inclusion of fuzzy sets by requiring that, whenever •(s, s ′ ) = β, then for any interpretation I = (∆ I , • I ) and any element d ∈ ∆ I the value of s ′I (d) must be greater than or equal to the minimum of s I (d) and β.As argued in the introduction, this notion of fuzzy subsumption may be applied, for example, in fuzzy logic programming languages based on fuzzy OSF term unification, or in similarity-based reasoning, where a crisp subsumption relation ⊆ S 2 may be extended to a fuzzy subsumption relation • according to a given similarity ∼ : S 2 → [0, 1].
The generalization to a fuzzy semantics provides OSF logic with the capability to perform approximate reasoning.In particular, we have shown how to decide whether two OSF terms are subsumed by each other, and to which degree, via their unification.The fact that the same unification procedure as crisp OSF logic can be used to find the GLB of two OSF terms in the fuzzy subsumption lattice constitutes a benefit in terms of developing fuzzy OSF logic reasoners, since it would be possible to take advantage of existing implementation techniques.
There are several avenues for future work.For instance, it would be interesting to study the semantics of fuzzy OSF logic under other t-norms besides the minimum t-norm adopted in this paper.Another direction could consist in developing a version of fuzzy OSF logic that supports a more expressive language that also includes negation and disjunction, and possibly in which features are interpreted as partial functions rather than total functions.Ultimately, the goal of this research would be to develop a fuzzy version of the CEDAR reasoner [9,10] which is able to provide approximate answers to queries posed to a knowledge base by relying on a fuzzy sort subsumption relation or a sort similarity relation.

Definition 3 . 1 (
Fuzzy OSF interpretation).A (fuzzy) OSF interpretation (or algebra) for (S, F , •) is a pair I = (∆ I , • I ) such that 1. ∆ I is a set called the domain or universe of the interpretation; 2. for each s ∈ S, s I : ∆ I → [0, 1] is a fuzzy subset of ∆ I (where in particular ⊤ I = 1 ∆ I and

Example 3 . 2 (
Fuzzy OSF interpretation).Consider the fuzzy OSF signature of Example 2.2 and let I = (∆ I , • I ) be defined as follows.

Definition 3 .
3 (F -closure).Let I be an OSF interpretation.For each feature composition w = f 1 . . .f n ∈ F * let w I = f I n • . . .• f I 1 be the corresponding function composition on ∆ I .For any non-empty subset D of ∆ I the F -closure of D is the set

Definition 3 . 5 (
OSF subalgebra generated by a set).Let I = (∆ I , • I ) be a fuzzy OSF interpretation and D ⊆ ∆ I be nonempty.Then the fuzzy OSF subalgebra generated by D is the structureI[D] = (F * (D), • I[D] ) such that, for each s ∈ S, s I[D] = s I ⩀ 1 F * (D) , and for each f ∈ F , f I[D] is the restriction of f I to F * (D).When D = {d} is a singleton we write I[d] instead of I[{d}].Proposition 3.6 (Least OSF subalgebra generated by a set).Let I = (∆ I , • I ) be an OSF interpretation.For any non-empty subset D ⊆ ∆ I the structure I[D] is the least fuzzy subalgebra of I containing D.

Example 3 . 17 (
OSF graph algebra).Consider the fuzzy subsumption relation corresponding to the graph of Fig. 1.Then, for example, thriller G is the function such that:

Figure 4 :
Figure 4: Feature application in the fuzzy OSF graph algebra.

Example 4 . 2 (
Fuzzy OSF algebra β-homomorphism).Consider the fuzzy interpretation I, the assignment α and the term t = X : thriller (directed_by → Y : director) from Example 3.8.Consider the subalgebra of G generated from the element G(t) and define a function γ : ∆ G[G(t)] → ∆ I by setting, for g

Figure 7 :
Figure 7: OSF graphs and morphisms of Example 5.5

Figure 8 :
Figure 8: Fuzzy subsumption relation and unification of Example 6.3
e., O(|S| + e), where e is the number of edges in the DAG representation of the fuzzy sort subsumption relation.The overall complexity is thus O(m(|S| + e)), where m = |Tags(ψ 0 ) ∪ Tags(ψ 1 )|.

•
If t 1 , ..., t n are OSF terms, then an attributed sorted variable t = X : s(f1 → t 1 , . .., f n → t n ) is an OSF term.We let Tags(t) def = {X} ∪ ⋃ 1≤i≤n Tags(t i ).The variable X is called the root tag of t and is denoted RootTag(t).