Copyright © 2008 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
This document, developed by the Rule
Interchange Format (RIF) Working Group, specifies thedefines a general
Framework for Logic-based RIF dialects (RIF-FLD). The framework
describes mechanisms for specifying the syntax and semantics of
logic-based RIF dialects through a number of generic concepts such
as signatures, symbol spaces, semantic structures, and so on. The
actual dialects are required to specialize this framework to
produce their syntaxes and semantics.
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.
This document is being published as one of a set of 6 documents:
The Rule Interchange Format (RIF) Working Group seeks public feedback on these Working Drafts. Please send your comments to public-rif-comments@w3.org (public archive). If possible, please offer specific changes to the text that would address your concern. You may also wish to check the Wiki Version of this document for internal-review comments and changes being drafted which may address your concerns.
Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
The RIF Framework for Logic-based Dialects (RIF-FLD) is a
formalism for specifying all logic-based dialects of RIF, including
the RIF Basic Logic Dialect [RIF-BLD .]. It is a logic in which both syntax and semantics
are described through a number of mechanisms that are commonly used
for various logic languages, but are rarely brought all together.
Amalgamation of several different mechanisms is required because
the framework must be broad enough to accommodate several different
types of logic languages and because various advanced mechanisms
are needed to facilitate translation into a common framework.
RIF-FLD gives precise definitions to these mechanisms, but allows
certain details to vary. The design of RIF envisages that future
standard logic dialects will be based on RIF-FLD. Therefore, any
logic dialect being developed to become a stardard should either be
a specialization of FLD or justify its deviations from (or
extensions to) FLD.
The framework described in this document is very general and captures most of the popular logic-based rule languages found in Databases, Logic Programming, and on the Semantic Web. However, it is anticipated that the needs of future dialects might stimulate further evolution of RIF-FLD. In particular, future extensions might include a logic rendering of actions as found in production and reactive rule languages.
This document is mostly intended for the designers of future RIF dialects. All logic-based RIF dialects are required to be derived from RIF-FLD by specialization, as explained in Sections Syntax of a RIF Dialect as a Specialization of RIF-FLD and Semantics of a RIF Dialect as a Specialization of RIF-FLD. In addition to specialization, to lower the barrier of entry for their intended audiences, a dialect designer may choose to specify the syntax and semantics in a direct, but equivalent, way, which does not require familiarity with RIF-FLD. For instance, the RIF Basic Logic Dialect [RIF-BLD] is specified both by specialization from RIF-FLD and also directly, without relying on the framework. Thus, the reader who is interested in [RIF-BLD] only can proceed directly to that document.
RIF-FLD has the following main components:
Syntactic framework. The syntactic framework defines six types of RIF terms:
RIF dialects can choose to support all or some of the aforesaid categories of terms. The syntactic framework also defines the following mechanisms for specializing these terms:
Symbol spaces partition the set of all non-logical symbols
(symbols used as variables, individual constants, predicates, and
functions) and each partition is then given its own semantics. A
symbol space has an identifier and a lexical space, which
defines the "shape" of the symbols in that symbol space. Some
symbol spaces in RIF are used to identify Web entities and their
lexical space consists of strings that syntactically look like
internationalized resource identifiers [RFC-3987], or IRIs (e.g., rif:iri).
Other symbol spaces are used to represent the data types used indatatypes required by
RIF (for example, xsd:integerxs:integer).
Signatures determine which terms and formulas are well-formed. It is a generalization of the notion of a sort in classical first-order logic [Enderton01]. Each nonlogical symbol (and some logical symbols, like =) has an associated signature. A signature defines, in a precise way, the syntactic contexts in which the symbol is allowed to occur.
For instance, the signature associated with a symbol p might allow p to appear in a term of the form f(p), but disallow it to occur in a term like p(a,b). The signature for f, on the other hand, might allow that symbol to appear in f(p) and f(p,q), but disallow f(p,q,r) and f(f). In this way, it is possible to control which symbols are used for predicates and which for functions, where variables can occur, and so on.
Semantic framework. This framework defines the notion of a semantic structure or interpretation (both terms are used in the literature [Enderton01, Mendelson97], but here we will mostly use the first). Semantic structures are used to interpret formulas and to define logical entailment. As with the syntax, this framework includes a number of mechanisms that RIF logic-based dialects can specialize to suit their needs. These mechanisms include:
A set of formulas G logically entails another formula g if for every semantic structure I in some set S, if G is true in I then g is also true in I. Almost all logics define entailment this way. The difference lies in which set S they use. For instance, logics that are based on the classical first-order predicate calculus, such as Description Logic, assume that S is the set of all semantic structures. In contrast, logic programming languages, which use default negation, assume that S contains only the so-called "minimal" Herbrand models of G and, furthermore, only the minimal models of a special kind. See [Shoham87] for a more detailed exposition of this subject.
XML serialization framework. This framework defines the general principles for mapping the presentation syntax of RIF-FLD to the concrete XML interchange format. This includes:
This document is the latest draft of the RIF-FLD specification.
Each RIF dialect that is derived from RIF-FLD will be described in
its own document. The first of such dialects, RIF Basic Logic
Dialect, is described in the document[RIF-BLD .].
The next subsection explains how to derive the presentation syntax of a RIF dialect from the presentation syntax of the RIF framework. The actual syntax of the RIF framework is given in subsequent subsections.
The presentation syntax for a RIF dialect can be obtained from the general syntactic framework of RIF by specializing the following parameters, which are defined later in this document:
Signatures determine which terms in the dialect are well-formed and which are not.
The exact way signatures are assigned depends on the dialect. An assignment can be explicit or implicit (for instance, derived from the context in which each symbol is used).
The RIF logic framework introduces the following types of terms:
A dialect might support all of these terms or just a subset. For instance, some dialects might not support terms with named arguments or frame terms.
Symbol spaces determine the syntax of the constant symbols that are allowed in the dialect.
RIF-FLD allows formulas of the following kind:
A dialect might support all of these formulas or it might impose various restrictions. For instance, the formulas allowed in the conclusion and/or premises of implications might be restricted (e.g., [RIF-BLD] essentially allows Horn rules only), certain types of quantification might be prohibited (e.g., [RIF-BLD] disallows existential quantification in the rule head), classical or default negation (or both) might not be allowed (as in RIF-BLD), etc. A subdialect of RIF-BLD might disallow equality formulas in the conclusions of the rules.
Note that although the presentation syntax of a RIF logic-based dialect is normative, since semantics is defined in terms of that syntax, the presentation syntax is not intended as a concrete syntax, and conformant systems are not required to implement it.
Definition (Alphabet). The alphabet of the presentation language of RIF-FLD consists of
The set of connective symbols, quantifiers, =, etc., is disjoint from Const and Var. Variables are written as Unicode strings preceded with the symbol "?". The argument names in ArgNames are written as Unicode strings that do not start with a "?". The syntax for constant symbols is given in Section Symbol Spaces.
The symbols =, #, and ## are used in
formulas that define equality, class membership, and subclass
relationships. The symbol -> is used in terms that have
named arguments and in frame terms. The symbol External
indicates that an atomic formula or a function term is defined
externally (e.g., a builtin) andbuiltin), Dialect is a directive used
to indicate the dialect of a RIF document (for those dialects that
require this), the symbols Prefix andBase and Prefix are
used in abridged representations of IRIs.IRIs, and Import is an
import directive.
Finally, the symbol Document is used to define RIF documents, Import is an import directive,for specifying
RIF-FLD documents and the symbol Group is used to organize
RIF-FLD formulas into collections. ☐
Throughout this document, we will be using the following abbreviations:
These and other abbreviations will be used as prefixes in the
compact URI notation [CURIE], a notation for succinct representation of IRIs. The
precise meaning of this notation in RIF is defined in the document Data Types and Builtins .[RIF-DTB].
The set of all constant symbols in a RIF dialect is partitioned
into a number of subsets, called symbol spaces, which are
used to represent XML Schema data types, data typesdatatypes, datatypes defined in other
W3C specifications, such as rdf:XMLLiteral, and to distinguish other sets of
constants. All constant symbols have a syntax (and sometimes also
semantics) imposed by the symbol space to which they belong.
Definition (Symbol space). A symbol space is a named subset of the set of all constants, Const. The semantic aspects of symbol spaces will be described in Section Semantic Framework. Each symbol in Const belongs to exactly one symbol space.
Each symbol space has an associated lexical space and a unique identifier. More precisely,
The identifiers for symbol spaces are not themselves constant symbols in RIF. ☐
To simplify the language, we will often use symbol space
identifiers to refer to the actual symbol spaces (for instance, we
may use "symbol space xsd:stringxs:string" instead of "symbol space
identified by xsd:stringxs:string").
To refer to a constant in a particular RIF symbol space, we use the following presentation syntax:
"literal"^^symspace
where literal is called the lexical part
of the symbol, and symspace is an identifier of the symbol
space. Here literal is a sequence of Unicode characters
that must be an element in the lexical space of the symbol space
symspace. For instance, "1.2"^^xsd:decimal"1.2"^^xs:decimal and
"1"^^xsd:decimal"1"^^xs:decimal are legal symbols because 1.2 and 1 are
members of the lexical space of the XML Schema data type xsd:decimaldatatype
xs:decimal. On the other hand, "a+2"^^xsd:decimal"a+2"^^xs:decimal
is not a legal symbol, since a+2 is not part of the
lexical space of xsd:decimalxs:decimal.
The set of all symbol spaces that partition Const is considered to be part of the logic language of RIF-FLD.
RIF requires that all dialects include the symbol spaces listed
in Section Constants and Symbol Spaces of the document Data Types and Built-Ins .[RIF-DTB]. These symbol spaces include constants that
belong to several important XML Schema data types,datatypes, certain RDF
data types,datatypes, and constant symbols specific to RIF. The latter include
the symbol spaces rif:iri and rif:local,
which are used to represent internationalized resource identifiers
(IRIs) and constant symbols that are not visible outside of the RIF
document in which they occur, respectively. Rule sets that are
exchanged through RIF can use additional symbol spaces.
The lexical spaces of the mandatory RIF symbol spaces are
described in Section Constants and
Symbol Spaces of the document Data Types and Built-Ins .[RIF-DTB].
The most basic construct of a logic language is a term. RIF-FLD supports several kinds of terms: constants, variables, the regular positional terms, plus terms with named arguments, equality, classification terms, and frames. The word "term" will be used to refer to any kind of term.
Definition (Term). A term is a statement of one of the following forms:
Positional terms in RIF-FLD generalize the regular notion of a
term used in first-order logic. For instance, the above definition
allows variables everywhere, as in ?X(?Y ?Z(?V
"12"^^xsd:integer))"12"^^xs:integer)), where ?X, ?Y,
?Z, and ?V are variables. Even
?X("abc"^^xsd:string ?W)(?Y ?Z(?V "33"^^xsd:integer))?X("abc"^^xs:string ?W)(?Y ?Z(?V
"33"^^xs:integer)) is a positional term (as in HiLog [CKW93]).
The term t here represents a predicate or a function; s1, ..., sn represent argument names; and v1, ..., vn represent argument values. Terms with named arguments are like regular positional terms except that the arguments are named and their order is immaterial. Note that a term with no arguments, like f(), is both positional and also with named arguments.
For instance, "person"^^xsd:string(name->?Y"person"^^xs:string(name->?Y
address->?Z), ?X("123"^^xsd:integer ?W)(arg->?Y?X("123"^^xs:integer ?W)(arg->?Y
arg2->?Z(?V)), and
"Closure"^^rif:local(relation->"http://example.com/Flight"^^rif:iri)(from->?X
to->?Y) are terms with named arguments. The second of these
terms has a positional term ?X(abc,?W), which occurs in
the position of a function, and the third term's function is
represented by a named arguments term.
Classification terms are used to describe class hierarchies.
Frame terms are used to describe properties of objects. As in the case of the terms with named arguments, the order of the properties pi->vi in a frame is immaterial.
Such terms are used for representing builtin functions and predicates as well as "procedurally attached" terms or predicates, which might exist in various rule-based systems, but are not specified by RIF.
☐Note that the above definition issyntax allows very general. It makes no distinction between constant symbols that represent individuals, predicates, and function symbols. The same symbolgeneral interfaces to
access externally defined data sources: not only predicates can occurbe
used, but also frames. In multiple contexts atthis way, externally defined objects can
be accessed using the more natural frame-based interface. For
instance,
External("http://example.com/acme"^^rif:iri["http://example.com/mycompany/president"^^rif:iri(?Year)
-> ?Pres]) could be an interface provided to access an
externally defined method
"http://example.com/mycompany/president"^^rif:iri of an
external object "http://example.com/acme"^^rif:iri.
☐
The above definitions are very general. They make no distinction between constant symbols that represent individuals, predicates, and function symbols. The same symbol can occur in multiple contexts at the same time. For instance, if p, a, and b are symbols then p(p(a) p(a p c)) is a term. Even variables and general terms are allowed to occur in the position of predicates and function symbols, so p(a)(?v(a c) p) is also a term.
Externally defined data sources can also be interfaced with using very general mechanisms: not only predicates are allowed, but also frames. In this way, externally defined objects can be accessed using the more natural frame-based interface. For instance, External("http://example.com/acme"^^rif:iri["http://example.com/acme/president"^^rif:iri(?Year) -> ?Pres]) could be an interface provided to access an externally defined method "http://example.com/mycompany/president"^^rif:iri in an external object "http://example.com/acme"^^rif:iri .Frame, classification, and other terms can be freely nested, as
exemplified by
p(?X q#r[p(1,2)->s](d->e f->g)).
Some language environments, like FLORA-2 [FL2], OO jDREW [OOjD], NxBRE [NxBRE], and
CycL [CycL] support fairly large
(partially overlapping) subsets of RIF-FLD terms, but most
languages support much smaller subsets. RIF dialects are expected
to carve out the appropriate subsets of RIF-FLD terms, and the
general form of the RIF logic framework allows a considerable
degree of freedom.
Observe that the argument names of frame terms, p1, ..., pn, are base terms and, as a special case, can be variables. In contrast, terms with named arguments can use only the symbols from ArgNames to represent their argument names. They cannot be constants from Const or variables from Var. The reason for this restriction has to do with the complexity of unification, which is integral part of many inference rules underlying first-order logic. We are not aware of any rule language where terms with named arguments use anything more general than what is defined here.
Dialects can alsorestrict the contexts in which the various terms
are allowed by using the mechanism of signatures. The
RIF-FLD language associates a signature with each symbol (both
constant and variable symbols) and uses signatures to define
well-formed terms. Each RIF dialect is expected to select
appropriate signatures for the symbols in its alphabet, and only
the terms that are well-formed according to the selected signatures
are allowed in that particular dialect.
This section introduces the notion of external schemas,
which serve as templates for externally defined terms. These
schemas determine which externally defined terms are acceptable in
a RIF dialect. Externally defined terms include RIF builtins, which
are specified in the document Data Types and Builtins ,[RIF-DTB], but
are more general. They are designed to accommodate the ideas of
procedural attachments and querying of external data sources.
Because of the need to accommodate many difference possibilities,
the RIF logical framework supports a very general notion of an
externally defined term. Such a term is not necessarily a function
or a predicate -- it can be a frame, a classification term, and so
on.
Definition (Schema for external term). An external schema is a statement of the form (?X1 ... ?Xn; τ) where
The names of the variables in an external schema are immaterial, but their order is important. For instance, (?X ?Y; ?X[foo->?Y]) and (?V ?W; ?V[foo->?W]) are considered to be the same schema, but (?X ?Y; ?X[foo->?Y]) and (?Y ?X; ?X[foo->?Y]) are viewed as different schemas.
A term t is an instance of an external schema (?X1 ... ?Xn; τ) iff t can be obtained from τ by a simultaneous substitution ?X1/s1 ... ?Xn/sn of the variables ?X1 ... ?Xn with terms s1 ... sn, respectively. Some of the terms si can be variables themselves. For example, ?Z[foo->f(a ?P)] is an instance of (?X ?Y; ?X[foo->?Y]) by the substitution ?X/?Z ?Y/f(a ?P). ☐
Observe that a variable cannot be an instance of an external schema, since τ in the above definition cannot be a variable. It will be seen later that this implies that a term of the form External(?X) is not well-formed in RIF.
The intuition behind the notion of an external schema, such as
(?X ?Y; ?X["foo"^^xsd:string->?Y])(?X ?Y; ?X["foo"^^xs:string->?Y]) or
(?V; "pred:isTime"^^rif:iri(?V)), is that
?X["foo"^^xsd:string->?Y]?X["foo"^^xs:string->?Y] or
"pred:isTime"^^rif:iri(?V) are invocation patterns for
querying external sources, and instances of those schemas
correspond to concrete invocations. Thus,
External("http://foo.bar.com"^^rif:iri["foo"^^xsd:string->"123"^^xsd:integer])External("http://foo.bar.com"^^rif:iri["foo"^^xs:string->"123"^^xs:integer])
and External("pred:isTime"^^rif:iri("22:33:44"^^xsd:time)External("pred:isTime"^^rif:iri("22:33:44"^^xs:time)
are examples of invocations of external terms -- one querying an
external source and another invoking a builtin.
Definition (Coherent set of external schemas). A set of
external schemas is coherent if there can be no term,
t, that is an instance of two distinct schemas.
☐
The intuition behind this notion is to ensure that any use of an external term is associated with at most one external schema. This assumption is relied upon in the definition of the semantics of externally defined terms. Note that the coherence condition is easy to verify syntactically and that it implies that schemas like (?X ?Y; ?X[foo->?Y]) and (?Y ?X; ?X[foo->?Y]), which differ only in the order of their variables, cannot be in the same coherent set.
It important to understand that external schemas are not part of the language in RIF, since they do not appear anywhere in RIF statements. Instead, like signatures, which are defined below, they are best thought of as part of the grammar of the language. In particular, they will be used to determine which external terms, i.e., the terms of the form External(t) are well-formed.
In this section we introduce the concept of a signature, which is a key mechanism that allows RIF-FLD to control the context in which the various symbols are allowed to occur. For instance, a symbol f with signature {(term term) => term, (term) => term} can occur in terms like f(a b), f(f(a b) a), f(f(a)), etc., if a and b have signature term. But f is not allowed to appear in the context f(a b a) because there is no =>-expression in the signature of f to support such a context.
The above example provides intuition behind the use of
signatures in RIF-FLD. Much of the development, below, is inspired
by [CK95]. It should be
kept in mind that signatures are not part of the logic
language in RIF, since they do not appear anywhere in RIF-FLD
formulas. Instead they are part of the grammar: they are used to
determine which sequences of tokens are in the language and which
are not. The actual way by which signatures are assigned to the
symbols of the language may vary from dialect to dialect. In some
dialects (for example [RIF-BLD ),]), this assignment is derived from the context in
which each symbol occurs and no separate language for signatures is
used. Other dialects may choose to assign signatures explicitly. In
that case, they would require a concrete language for signatures
(which would be separate from the language for specifying the logic
formulas of the dialect).
Definition (Signature name). Let SigNames be a non-empty, partially-ordered finite or countably infinite set of symbols, called signature names. Since signatures are not part of the logic language, their names do not have to be disjoint from Const, Var, and ArgNames. We require that this set includes at least the following signature names:
Dialects may introduce additional signature names. For instance, RIF Basic Logic Dialect [RIF-BLD] introduces one other signature name, individual. The partial order on SigNames is dialect-specific; it is used in the definition of well-formed terms below.
We use the symbol < to represent the partial order on SigNames. Informally, α < β means that terms with signature α can be used wherever terms with signature β are allowed. We will write α ≤ β if either α = β or α < β.
Definition (Signature). A signature is a statement of the form η{e1, ..., en, ...} where η ∈ SigNames is the name of the signature and {e1, ..., en, ...} is a countable set of arrow expressions. Such a set can thus be infinite, finite, or even empty. In RIF-BLD, signatures can have at most one arrow expression. Other dialects (such as HiLog [CKW93], for example) may require polymorphic symbols and thus allow signatures with more than one arrow expression in them.
An arrow expression is defined as follows:
For instance, () ⇒ term and (term) ⇒ term are positional arrow expressions, if term is a signature name.
For instance, (arg1->term arg2->term) => term is an arrow signature expression with named arguments. The order of the arguments in arrow expressions with named arguments is immaterial, so any permutation of arguments yields the same expression. ☐
RIF dialects are always associated with sets of coherent signatures, defined next. The overall idea is that a coherent set of signatures must include all the predefined signatures (such as signatures for equality and classification terms) and the signatures included in a coherent set should not conflict with each other. For instance, two different signatures should not have identical names and if one signature is said to extend another then the arrow expressions of the supersignature should be included among the arrow expressions of the subsignature (a kind of an arrow expression "inheritance").
Definition (Coherent signature set). A set Σ of signatures is coherent iff
All arrow expressions ei here have the form (κ κ) ⇒ γ (the arguments in an equation must be compatible) and at least one of these expressions must have the form (κ κ) ⇒ atomic (i.e., equation terms are also atomic formulas). Dialects may further specialize this signature.
Here all arrow expressions ei are binary (have two arguments) and at least one has the form (κ γ) ⇒ atomic. Dialects may further specialize this signature.
Here all arrow expressions ei have the form (κ κ) ⇒ γ (the arguments must be compatible) and at least one of these arrow expressions has the form (κ κ) ⇒ atomic. Dialects may further specialize this signature.
Here ηA denotes a signature with the name η and the associated set of arrow expressions A; similarly κB is a signature named κ with the set of expressions B. The requirement that B⊆A ensures that symbols that have signature η can be used wherever the symbols with signature κ are allowed. ☐
The requirement that coherent sets of signatures must include the
signatures for =, #, ->, and so on is
just a technicality needed to simplify the definitions. Some of
these signatures may go "unused" in a dialect even though,
technically speaking, they must be present in the signature set
associated with that dialect. If a dialect disallows equality,
classification terms, or frames in its syntax then the
corresponding signatures will remain unused. Such restrictions can
be imposed by specializing RIF-FLD -- see Section Syntax of a RIF Dialect as a
Specialization of RIF-FLD.
An incoherent set of signatures would be one that includes signatures mysig{() ⇒ atomic} and mysig{atomic ⇒ atomic} because it has two different signatures with the same name. Likewise, if this set contains mysig1{() ⇒ atomic} and mysig2{atomic ⇒ atomic} and mysig1 < mysig1 then it is incoherent because the set of arrow expressions of mysig1 does not contain the set of arrow expressions of mysig2.
The presentation language of a RIF dialect is a set of all well-formed formulas, as defined in the next section. The language is determined by the following parameters (see Syntax of a RIF Dialect as a Specialization of RIF-FLD):
Each variable symbol is associated with exactly one signature from a coherent set of signatures. A constant symbol can have one or more signatures, and different symbols can be associated with the same signature. (If variables were allowed to have multiple signatures then well-formed terms would not be closed under substitutions. For instance, a term like f(?X,?X) could be well-formed, but f(a,a) could be ill-formed.)
We have already seen how the alphabet and the symbol spaces are used to define RIF terms. The next section shows how signatures and external schemas are used to further specialize this notion to define well-formed RIF-FLD terms.
Since signature names uniquely identify signatures in coherent signature sets, we will often refer to signatures simply by their names. For instance, if one of f's signatures is atomic{ }, we may simply say that symbol f has signature atomic.
Definition (Well-formed term).
As a special case, when n=0 we obtain that t( ) is a well-formed term with signature σ, if t's signature contains the arrow expression () ⇒ σ.
As a special case, when n=0 we obtain that t( ) is a well-formed term with signature σ, if t's signature contains the arrow expression () ⇒ σ.
Note that, according to the definition of coherent sets of schemas, a term can be an instance of at most one external schema. ☐
Note that, like constant symbols, well-formed terms can have more than one signature. Also note that, according to the above definition, f() and f are distinct terms.
Definition (Well-formed formula). A well-formed term is also
a well-formed atomic formula iff one of its
signatures is atomic or is ≤ atomic. Note
that equality, membership, subclass, and frame terms are atomic
formulas, since atomic is one of their signatures.
More general formulas are constructed out of atomic formulas
with the help of logical connectives. A well-formed
formula is a statement that can have one of the following forms: Atomic : If φ is a well-formed atomic formula then it is also a well-formed formula. Conjunction : If φ 1 , ..., φ n , n ≥ 0 , are well-formed formulas thenforms (1)
-- (9) below. The Group and Document formulas,
defined in (8) and (9), are aggregate formulas while the
formulas in (1) -- (7) are non-aggregate. This distinction
manifests itself in that Group and Document
cannot be part of non-aggregate formulas, and Document
cannot be part of a group.
As a special case, And() is allowed and is treated as a tautology, i.e., a formula that is always true.
When n=0 , we get Or()As a special case; itcase, Or() is treated as a contradiction,
i.e., a formula that is always false.
Group formulas are intended to represent sets of formulas. Note
that some of the ρφi's can be group formulas
themselves, which means that groups can be nested.
Like prefix directives,Base directives do not affect the semantics. They are used as
syntactic shortcuts for expanding relative IRIs into full IRIs, as
described in in Section Constants and
Symbol Spaces of [RIF-DTB].
Like base directives, prefix directives anddo not affect the
group formula --semantics of RIF documents. Instead, they are optional and can be omitted.used as shorthands to
allow more concise representation of IRI constants. This mechanism
is explained in cases (1) -- (7) above, φ , φ i ,[RIF-DTB],
Section Constants and ψ cannot be groupSymbol Spaces.
RIF-FLD defines the semantics for the directive Import(t) only. The directive Import(t p) is reserved for RIF dialects, which might use it to import non-RIF logical entities, such as RDF data and OWL ontologies. The profile might specify what kind of entity is being imported and under what semantics (for instance, the various RDF entailment regimes).
There can be at most one Dialect and at most one Base directive in the sequence of directives in a document formula. The Dialect directive, if present, must be the first in the sequence; followed by Base (again, if present); followed by a sequence of Prefix directives, if any; followed by a sequence Import directives.
In this definition, the component formulas φ, φi, ψi, and Γ are said to be subformulas of the respective formulas (conjunction, disjunction, nagation, implication, group, etc.) that are built with the help of these components. ☐
Observe that the restrictions in (1) -- (8) above imply that groups and documents cannot be nested inside non-aggregate formulas and documents cannot be nested inside groups.
☐Example 1 (Signatures, well-formed terms and
formulas).
We illustrate the above definitions with the following examples. In addition to atomic, let there be another signature, term{ }, which is intended here to represent the context of the arguments to positional terms or atomic formulas.
Consider the term p(p(a) p(a b c)). If p has the (polymorphic) signature mysig{(term)⇒term, (term term)⇒term, (term term term)⇒term} and a, b, c each has the signature term{ } then p(p(a) p(a b c)) is a well-formed term with signature term{ }. If instead p had the signature mysig2{(term term)⇒term, (term term term)⇒term} then p(p(a) p(a b c)) would not be a well-formed term since then p(a) would not be well-formed (in this case, p would have no arrow expression which allows p to take just one argument).
For a more complex example, let r have the signature mysig3{(term)⇒atomic, (atomic term)⇒term, (term term term)⇒term}. Then r(r(a) r(a b c)) is well-formed. The interesting twist here is that r(a) is an atomic formula that occurs as an argument to a function symbol. However, this is allowed by the arrow expression (atomic term)⇒ term, which is part of r's signature. If r's signature were mysig4{(term)⇒atomic, (atomic term)⇒atomic, (term term term)⇒term} instead, then r(r(a) r(a b c)) would be not only a well-formed term, but also a well-formed atomic formula.
An even more interesting example arises when the right-hand side of an arrow expression is something other than term or atomic. For instance, let John, Mary, NewYork, and Boston have signatures term{ }; flight and parent have signature h2{(term term)⇒atomic}; and closure has signature hh1{(h2)⇒p2}, where p2 is the name of the signature p2{(term term)⇒atomic}. Then flight(NewYork Boston), closure(flight)(NewYork Boston), parent(John Mary), and closure(parent)(John Mary) would be well-formed formulas. Such formulas are allowed in languages like HiLog [CKW93], which support predicate constructors like closure in the above example. ☐
RIF-FLD allows every term and formula (including terms and
formulas that occur inside other terms and formulas) to be
optionally preceded by a metadata blockan annotation of the form
(* id φ *) where id is a rif:iri
constant and φ is a RIF formula, which is not a
document-formula. Both items inside the metadata blockannotation are optional.
The id part represents the meta-identifieridentifier of the term (or
formula) to which the metadata blockannotation is attached and φ is the
metadata itself.rest of the annotation. RIF-FLD does not impose any restrictions on
φ apart from what is stated above. In particular, it may
include variables, function symbols, rif:local
constants, and so on.
Observe that thereDocument formulas with and without annotations will be referred
to as RIF-FLD documents.
A convention is certainused to avoid a syntactic ambiguity in the above
definition. For instance, in (* id φ *) t[w -> v] the
metadata blockannotation can be attributed to the term t</>t or to the
entire frame <tt>t[wt[w -> v]. We do not makeSimilarly, for an attempt to resolve this ambiguity in the presentation syntax, since, as explained earlier, this syntaxannotated
HiLog-like term of the form (* id φ *) f(a)(b,c), the
annotation can be attributed to the entire term f(a)(b,c)
or to just f(a). The convention adopted in RIF-FLD is not intendedthat
any annotation is syntactically associated with the largest RIF-FLD
term/formula that appears to be concrete.the concrete XML syntaxright of RIF does not have such ambiguities.that annotation.
Therefore, in our examples the annotation (* id φ *) is
considered to be attached to the entire frame t[w -> v]
and to the entire term f(a)(b,c).
Example 2 (A RIF-FLD document with nested groups and
metadata).annotations).
We illustrate formulas, including documents and groups, with the
following complete example (with apologies to Shakespeare for the
imperfect rendering of the intended meaning in logic). For better
readability, we use the shortcut notation defined in the document Data Types and Builtins .[RIF-DTB]. The example also illustrates
attachment of metadata.annotations.
Document( Prefix(dc http://http://purl.org/dc/terms/) Prefix(ex http://example.org/ontology#) Prefix(hamlet http://www.shakespeare-literature.com/Hamlet/) (* hamlet:assertions hamlet:assertions[dc:title->"Hamlet" dc:creator->"Shakespeare"] *) Group( Exists ?X (And(?X # ex:RottenThing ex:partof(?X <http://www.denmark.dk>))) Forall ?X (Or(hamlet:tobe(?X) Naf hamlet:tobe(?X))) Forall ?X (And(Exists ?B (And(ex:has(?X ?B) ?B # ex:business)) Exists ?D (And(ex:has(?X ?D) ?D # ex:desire))) :- ?X # ex:man) (* hamlet:facts *) Group( hamlet:Yorick # ex:poor hamlet:Hamlet # ex:prince ) ) )
Observe that the above set of formulas has a nested subset with
its own metadata,annotation, hamlet:facts, which contains only a
global IRI. ☐
Up to now we have used mathematical English to specify the syntax of RIF-FLD. We will now specify it using the familiar EBNF notation. The following points about the EBNF notation should be kept in mind:
In view of the above, the EBNF grammar can be viewed as just an intermediary between the mathematical English and the XML. However, it also gives a succinct overview of the syntax of RIF-FLD and as such can be useful for dialect designers and users alike.
Document ::= IRIMETA? 'Document' '('IRIMETA?Directive?Dialect? Base? Prefix* Import* Group? ')'DirectiveDialect ::=Import*'Dialect' '(' Name ')' Base ::= 'Base' '(' IRI ')' Prefix ::= 'Prefix' '(' Name IRI ')' Import ::= IRIMETA? 'Import' '('IRIIRICONST PROFILE? ')' Group ::='Group'IRIMETA? 'Group' '(' (FORMULA | Group)* ')'IRIMETAImplies ::=FrameIRIMETA? FORMULA ':-' FORMULA FORMULA ::= IRIMETA? 'And' '(' FORMULA* ')' | IRIMETA? 'Or' '(' FORMULA* ')' | Implies | IRIMETA? 'Exists'Var+Var* '(' FORMULA ')' | IRIMETA? 'Forall'Var+Var* '(' FORMULA ')' | IRIMETA? 'Neg' FORMULA | IRIMETA? 'Naf' FORMULA | FORMImplies::=FORMULA':-'FORMULAFORM ::=VarIRIMETA? (Var | ATOMIC | 'External' '(' ATOMIC')'')') ATOMIC ::= Const | Atom | Equal | Member | Subclass | Frame Atom ::= UNITERM UNITERM ::= TERM '(' (TERM* | (Name '->' TERM)*) ')' Equal ::= TERM '=' TERM Member ::= TERM '#' TERM Subclass ::= TERM '##' TERM Frame ::= TERM '[' (TERM '->' TERM)* ']' TERM ::=VarIRIMETA? (Var | EXPRIC | 'External' '(' EXPRIC')'')') EXPRIC ::= Const | Expr | Equal | Member | Subclass | Frame Expr ::= UNITERM Const ::= '"' UNICODESTRING '"^^' SYMSPACEIRI| CONSTSHORT IRICONST ::=UNICODESTRING'"' IRI '"^^' 'rif:iri' PROFILE ::=UNICODESTRINGTERM Name ::= UNICODESTRING Var ::= '?' UNICODESTRING SYMSPACE ::=UNICODESTRING3SemanticFrameworkRecallthatthepresentationsyntaxofRIF-BLDallowstheuseofmacros,whicharespecifiedviathePrefixANGLEBRACKIRI | CURIE IRIMETA ::= '(*' IRICONST? (Frame | 'And' '(' Frame* ')')? '*)'
RIF-FLD formulas and Base directives. The semantics, below,terms can be prefixed with optional
annotations, IRIMETA, for identification and metadata.
IRIMETA is describedrepresented using the full syntax, i.e., the description assumes(*...*)-brackets that all macros have already been expandedcontain
an optional IRI constant as explained in Data Types and Builtins , Section Constants and Symbol Spaces . 3.1 Semanticsidentifier followed by an
optional Frame or conjunction of a RIF DialectFrames as
a Specialization of RIF-FLD The RIF-FLD semantic framework definesmetadata. An IRI has the notionsform of an internationalized
resource identifier as defined by [RFC-3987].
The RIF-FLD presentation syntax does not commit to any particular vocabulary and permits arbitrary Unicode strings in constant symbols, argument names, and variables. Constant symbols can have this form: "UNICODESTRING"^^SYMSPACE, where SYMSPACE is a ANGLEBRACKIRI or CURIE that represents an identifier of the symbol space of the constant, and UNICODESTRING is a Unicode string from the lexical space of that symbol space. ANGLEBRACKIRI and CURIE are defined in Section Shortcuts for Constants in RIF's Presentation Syntax of [RIF-DTB]. Constant symbols can also have several shortcut forms, which are represented by the non-terminal CONSTSHORT. These shortcuts are also defined in the same section of [RIF-DTB]. One of them is the CURIE shortcut, which is used in the examples in this document. Names are Unicode character sequences. Variables are composed of UNICODESTRING symbols prefixed with a ?-sign.
Recall that the presentation syntax of RIF-FLD allows the use of macros, which are specified via the Prefix and Base directives. The semantics, below, is described using the full syntax, i.e., the description assumes that all macros have already been expanded, as explained in [RIF-DTB], Section Constants and Symbol Spaces.
The RIF-FLD semantic framework defines the notions of semantic structures and of models for RIF-FLD formulas. The semantics of a dialect is derived from these notions by specializing the following parameters.
The syntax of a dialect may limit the kinds of terms that are supported. For instance, if the dialect does not support frames or terms with named arguments then the parts of the semantic structures whose purpose is to interpret the unsupported types of terms become redundant.
The RIF-FLD semantic framework allows formulas to have truth values from an arbitrary partially ordered set of truth values, TV. A concrete dialect must select a concrete partially or totally ordered set of truth values.
A data typedatatype is a symbol space whose symbols have a fixed
interpretation in any semantic structure. RIF-FLD defines a set of
core data typesdatatypes that each dialect is required to support, but its
semantics does not limit support to just the core types. RIF
dialects can introduce additional data types,datatypes, and each dialect must
define the exact set of data typesdatatypes that it supports.
Logical entailment in RIF-FLD is defined with respect to an unspecified set of intended models. A RIF dialect must define which models are considered to be intended. For instance, one dialect might specify that all models are intended (which leads to classical first-order entailment), another may consider only the minimal models as intended, while a third one might only use well-founded or stable models [GRS91, GL88].
These notions are defined in the remainder of this document.
Definition (Set of truth values). Each RIF dialect must define the set of truth values, denoted by TV. This set must have a partial order, called the truth order, denoted <t. In some dialects, <t can be a total order. We write a ≤t b if either a <t b or a and b are the same element of TV. In addition,
RIF dialects can have additional truth values. For instance, the semantics of some versions of NAF, such as well-founded negation, requires three truth values: t, f, and u (undefined), where f <t u <t t. Handling of contradictions and uncertainty usually requires at least four truth values: t, u, f, and i (inconsistent). In this case, the truth order is partial: f <t u <t t and f <t i <t t.
Definition
(Primitive data type).datatype). A primitive data typedatatype (or
just a data typedatatype, for short) is a symbol space that has
Semantic structures are always defined with respect to a
particular set of data types,datatypes, denoted by DTS. In a
concrete dialect, DTS always includes the data typesdatatypes
supported by that dialect. All RIF dialects must support the
primitive data typesdatatypes that are listed in Section Data Types of
the document Data Types and Built-Ins .[RIF-DTB]. Their value spaces
and the lexical-to-value-space mappings fot these data typesdatatypes are
described in the same section.
Although the lexical and the value spaces might sometimes look
similar, one should not confuse them. Lexical spaces define the
syntax of the constant symbols in the RIF language. Value spaces
define the meaning of the constants. The lexical and the
value spaces are often not even isomorphic. For example,
1.2^^xsd:decimal1.2^^xs:decimal and 1.20^^xsd:decimal1.20^^xs:decimal are two
legal -- and distinct -- constants in RIF because 1.2 and
1.20 belong to the lexical space of xsd:decimalxs:decimal.
However, these two constants are interpreted by the same
element of the value space of the xsd:decimalxs:decimal type.
Therefore, 1.2^^xsd:decimal = 1.20^^xsd:decimal1.2^^xs:decimal = 1.20^^xs:decimal is
a RIF tautology. Likewise, RIF semantics for data typesdatatypes implies
certain inequalities. For instance, abc^^xsd:stringabc^^xs:string ≠
abcd^^xsd:stringabcd^^xs:string is a tautology, since the
lexical-to-value-space mapping of the xsd:stringxs:string type maps
these two constants into distinct elements in the value space of
xsd:stringxs:string.
The central step in specifying a model-theoretic semantics for a logic-based language is defining the notion of a semantic structure, also known as an interpretation. Semantic structures are used to assign truth values to RIF-FLD formulas.
Definition (Semantic structure). A semantic
structure, I, is a tuple of the form
<TV, DTS, D,
IC, IV,
IF, Iframe,
ISF, Isub,
Iisa, I=,
Iexternal,
Itruth>. Here D is a
non-empty set of elements called the domain of
I. We will continue to use Const to refer to
the set of all constant symbols and Var to refer to the
set of all variable symbols. TV denotes the set of
truth values that the semantic structure uses and DTS
is a set of identifiers for primitive data types.datatypes.
The other components of I are total mappings defined as follows:
This mapping interprets constant symbols.
This mapping interprets variable symbols.
This mapping interprets positional terms.
This is analogous to the interpretation of positional terms with two differences:
To see why such repetition can occur, note that argument names may repeat: p(a->b a->c). This can be understood as treating a as a set-valued argument. Identical argument/value pairs can then arise as a result of a substitution. For instance, p(a->?A a->?B) becomes p(a->b a->b) if the variables ?A and ?B are both instantiated with the symbol b.
This mapping interprets frame terms. An argument, d ∈ D, to Iframe represents an object and a finite bag {<a1,v1>, ..., <ak,vk>} represents a bag (multiset) of attribute-value pairs for d. We will see shortly how Iframe is used to determine the truth valuation of frame terms.
Bags are employed here because the order of the attribute/value pairs in a frame is immaterial and the pairs may repeat. For instance, o[a->b a->b]. Such repetitions arise naturally when variables are instantiated with constants. For instance, o[?A->?B ?C->?D] becomes o[a->b a->b] if variables ?A and ?C are instantiated with the symbol a and ?B, ?D with b.
The operator ## is required to be transitive, i.e., c1 ## c2 and c2 ## c3 must imply c1 ## c3. This is ensured by a restriction in Section Interpretation of Formulas.
The relationships # and ## are required to have the usual property that all members of a subclass are also members of the superclass, i.e., o # cl and cl ## scl must imply o # scl. This is ensured by a restriction in Section Interpretation of Formulas.
It gives meaning to the equality operator.
It is used to define truth valuation for formulas.
For every external schema, σ, associated with the
language, Iexternal(σ) is assumed
to be specified externally in some document (hence the name
external schema). In particular, if σ is a schema
of a RIF builtin predicate or function,
Iexternal(σ) is specified in
the document Data Types and Builtins[RIF-DTB] so that:
For convenience, we also define the following mapping I :
Here we use {...} to denote a bag of argument/value pairs.
Here {...} denotes a bag of attribute/value pairs.
Note that, by definition, External(t) is well formed only if t is an instance of an external schema. Furthermore, by the definition of coherent sets of external schemas, t can be an instance of at most one such schema, so I(External(t)) is well-defined.
The effect of signatures. For every signature, sg, supported by a dialect, there is a subset Dsg ⊆ D, called the domain of the signature. Terms that have a given signature, sg, must be mapped by I to Dsg, and if a term has more than one signature it must be mapped into the intersection of the corresponding signature domains. To ensure this, the following is required:
The effect of data types.datatypes. The data typesdatatype identifiers
in DTS impose the following restrictions. If
dt ∈ DTS is a symbol space identifier of a data type,, let LSdt
denote the lexical space of dt,
VSdt denote its value space, and
Ldt: LSdt →
VSdt the lexical-to-value-space mapping.
Then the following must hold:
That is, IC must map the constants of a
data typedatatype dt in accordance with
Ldt. ☐
RIF-FLD does not impose special requirements on
IC for constants in the symbol spaces that
do not correspond to the identifiers of the primitive datatypes in
DTS. Dialects may have such requirements, however. An
example of such a restriction could be a requirement that no
constant in a particular symbol space (such as rif:local)
can be mapped to VSdt of a data typedatatype
dt.
Observe that metadata blocksRIF-FLD annotations are ignored by allstripped before the mappings that
constitue RIF-FLD semantic structures, sostructures are applied. Likewise, they
are stripped before applying the truth valuation,
TValI, in the next section. Thus, identifiers and
metadata hashave no effect on the formal semantics.
Note that although metadataannotations associated with RIF-FLD formulas
isare ignored by the semantics, itthey can be extracted by XML tools.
Since metadata isannotations are represented by frame terms, itthey can be
reasoned with by the rules.
This section defines how a semantic structure, I, determines the truth value TValI(φ) of a RIF-FLD formula, φ, where φ is any formula other than a document formula. Truth valuation of document formulas is defined in the next section.
To this end, we define a mapping, TValI, from
the set of all non-document formulas to TV. Note that
the definition implies that TValI(φ) is
defined only if the set DTS of the data typesdatatypes
of I includes all the data typesdatatypes mentioned in
φ.
Definition (Truth valuation). Truth valuation for well-formed formulas in RIF-FLD is determined using the following function, denoted TValI:
To ensure that equality has precisely the expected properties, it is required that
To ensure that the operator ## is transitive, i.e., c1 ## c2 and c2 ## c3 imply c1 ## c3, the following is required: For all c1, c2, c3 ∈ D, glbt(TValI(c1 ## c2), TValI(c2 ## c3)) ≤t TValI(c1 ## c3).
To ensure that all members of a subclass are also members of the superclass, i.e., o # cl and cl ## scl implies o # scl, the following is required:
Since the bag of attribute/value pairs represents the conjunction of all the pairs, the following is required:
Note that, by definition, External(t) is well-formed only if t is an instance of an external schema. Furthermore, by the definition of coherent sets of external schemas, t can be an instance of at most one such schema, so I(External(t)) is well-defined.
The empty conjunction is treated as a tautology, so TValI(And()) = t.
The empty disjunction is treated as a contradiction, so TValI(Or()) = f.
The symbol ~ here is the idempotent operator of negation on TV introduced in Section Truth Values. Note that both classical and default negation are interpreted the same way in any concrete semantic structure. The difference between the two kinds of negation comes into play when logical entailment is defined.
Here lubt (respectively, glbt) is taken over all interpretations I* of the form <TV, DTS, D, IC, I*V, IF, Iframe, ISF, Isub, Iisa, I=, Iexternal, Itruth>, which are exactly like I, except that the mapping I*V, is used instead of IV. I*V is defined to coincide with IV on all variables except, possibly, on ?v1,... ,?vn.
If Γ is a group formula of the form
Group(ρGroup(φ1 ... ρφn) then
This means that a group of formulas is treated as a conjunction. ☐
Note that rule implications and equality formulas are always two-valued, even if TV has more than two values.
Document formulas are interpreted using semantic multi-structures.
Definition (Semantic multi-structures). A semantic multi-structure is a set {IΔ1, ..., IΔn}, n>0, where IΔ1, ..., IΔn are semantic structures labeled with document formulas. These structures must be identical in all respects except that the mappings ICΔ1, ..., ICΔn might differ on the constants in Const that belong to the rif:local symbol space. The above set is allowed to have at most one semantic structure with the same label. ☐
Definition (Imported document). Let Δ be a document
formula and Import(t)Import(t) be one of its import
directives, which referenceswhere t is an IRI constant that identifies
another document formula, Δ'. In this case, we say that
Δ' is directly imported into Δ.
A document formula Δ' is said to be imported into Δ if it is either directly imported into Δ or it is imported (directly or not) into another formula, which is directly imported into Δ. ☐
With the help of semantic multi-structures we can now explain the semantics of RIF documents.
Definition (Truth valuation of document formulas). Let Δ be a document formula and let Δ1, ..., Δk be all the RIF-FLD document formulas that are imported (directly or indirectly, according to the previous definition) into Δ. Let Γ, Γ1, ..., Γk denote the respective group formulas associated with these documents. If any of these Γi is missing (which is a possibility, since every part of a document is optional), assume that it is a tautology, such as a = a, so that every TVal function maps such a Γi to the truth value t. Let I = {IΔ, IΔ1, ..., IΔk, ...} be a semantic multi-structure, which contains semantic structures labeled with at least the documents Δ, Δ1, ..., Δk. Then we define:
Note that this definition considers only those document formulas
that are reachable via the one-argument import directives. Two
argument import directives are ignored by RIF-FLD. Their semantics
is supposed to be defined by other documents, such as RIF RDF and OWL Compatibility .[RIF-RDF+OWL].
☐
The above definitions make the intent behind the rif:local
constants clear: rif:localoccurrences of these constants that occurin different
documents can be interpreted differently even if they have the same
name. Therefore, each document can choose the names for the
rif:local constants freely and without regard to the names
of such constants used in the imported documents.
From now on, every formula is assumed to be part of some document.
It a formula is not physically part of any document, it will be
said to belong to a special query document. This allows us
to define TValI(φ), where
I is a multi-structure, for arbitrary formulas, not
just for document formulas: If φ is a formula that is not
a document-formula and I is a semantic
multi-structure that contains a component
IΔ that corresponds to the
document of φ, then TValI(φ) is
defined as
TValIΔ(φ).
Otherwise, TValI(φ) is undefined.
Definition (Models). A multi-structure I is a
model of a formula, φ, written as
I|=φ, iff
TValI(φ) is defined and equals t.
☐
The semantics of a set of formulas, Γ, is the set of its intended semantic multi-structures. RIF-FLD does not specify what these intended multi-structures are, leaving this to RIF dialects. Different logic theories may have different criteria for what is considered an intended semantic multi-structure.
For the classical first-order logic, every model is an intended
semantic multi-structure. For RIF-BLD,[RIF-BLD], which is based on Horn rules, intended
multi-structures are defined only for sets of rules: an intended
semantic multi-structure of a RIF-BLD set Γ is the unique
minimal Herbrand model of Γ. For the dialects in which
rule bodies may contain literals negated with the
negation-as-failure connective Naf, only some of
the minimal Herbrand models of a set of rules are intended. Each
logic-based dialect of RIF must define the set of intended semantic
multi-structures precisely. The two most common such theories are
the well-founded models [GRS91] and stable models [GL88].
The following example illustrates the notion of intended semantic structures. Suppose Γ consists of a single rule formula p :- Naf q. If Naf were interpreted as classical negation, not, then this rule would be simply equivalent to Or(p q), and so it would have two kinds of models: those where p is true and those where q is true. In contrast to first-order logic, most rule-based systems do not consider p and q symmetrically. Instead, they view the rule p :- Naf q as a statement that p must be true if it is not possible to establish the truth of q. Since it is, indeed, impossible to establish the truth of q, such theories would derive p even though it does not logically follow from Or(p q). The logic underlying rule-based systems also assumes that only the minimal Herbrand models are intended (minimality here is with respect to the set of true facts). Furthermore, although our example has two minimal Herbrand models -- one where p is true and q is false, and the other where p is false, but q is true, only the first model is considered to be intended.
The above concept of intended models and the corresponding notion of logical entailment with respect to the intended models, defined below, is due to [Shoham87].
We will now define what it means for a set of RIF-FLD formulas to entail another RIF-FLD formula. This notion is typically used for defining queries to knowledge bases and for other tasks, such as testing subsumption of concepts (e.g., in OWL). We assume that each set of formulas has an associated set of intended semantic structures.
Definition
(Logical entailment). Let Γ be a RIF-FLD formula and
φ another RIF-FLD formula. We say that Γ
entails φ, written as
Γ |= φ, if and only if, for every intended
semantic multi-structure I of Γ for which
both TValI(Γ) and
TValI(φ) are defined, it is the case
that TValI(Γ) ≤t
TValI(φ). ☐
This general notion of entailment covers both first-order logic and the non-monotonic logics that underlie many rule-based languages [Shoham87].
Note that one consequence of the multi-document semantics is that
local constants specified in one document cannot be queried from
another document. In particular, they cannot be returned as query answers.appear in entailed
formulas. For instance, if one document, Δ', has the fact
"http://example.com/ppp"^^rif:iri("abc"^^rif:local) while
another document formula, Δ, imports Δ' and has
the rule "http://example.com/qqq"^^rif:iri(?X) :-
"http://example.com/ppp"^^rif:iri(?X) , then Δ |=
"http://example.com/qqq"^^rif:iri("abc"^^rif:local) does
not hold. This is because "abc"^^rif:local in
Δ' and "abc"^^rif:local in the queryformula on the
right-hand side of |= are treated as different constants
by semantic multi-structures.
The RIFRIF-FLD XML serialization framework defines
As explained in the overview section, the design of RIF envisagesenvisions that the
presentation syntaxes of future logic-based RIF dialects will be
specializations of the presentation syntax of RIF-FLD. This means
that every well-formed formula in the presentation syntax of a
standardizedstandard logic RIF dialect must also be well-formed in RIF-FLD. The
goal of the XML serialization framework is to provide a similar
yardstick for the RIF XML syntax. This amounts to the requirement
that any validconformant XML document for a logic-based RIF dialect must
also be a validconformant XML document for RIF-FLD.RIF-FLD (conformance
is defined below). In terms of the presentation-to-XML syntax
mappings, this means that each mapping for a logic-based RIF
dialect must be a restriction of the corresponding mapping for
RIF-FLD. For instance, the mapping from the
presentation syntax of RIF-BLD to XML in [RIF-BLD] is a restriction of the
presentation-syntax-to-XML mapping for RIF-FLD. In this way,
RIF-FLD provides a framework for extensibility and mutual
compatibility between XML syntaxes of RIF dialects.
Editor's Note: This section is incomplete in the present draft:Recall that the syntax of RIF-FLD is not context-free and thus
cannot be fully captured by EBNF and XML Schema. Still, validity
with respect to XML Schema is missing. The next draft will includecan be a full treatmentuseful test. To reflect this
state of affairs, we define two notions of syntactic correctness.
The weaker notion checks correctness only with respect to XML
serialization framework. 4.1 XML forSchema, while the stricter notion represents "true" syntactic
correctness.
Definition (Valid XML document in a logic-based dialect). A
valid RIF-FLD Language Editor's Note:document in the XML syntax, and especially the element tags, are being discussed by the Working Group. Inputsyntax is welcome. See Issue-49 Thean XML
serialization for RIF-FLDdocument that is alternating orvalid w.r.t. the XML schema in Appendix XML Schema for FLD.
If a dialect, D, specializes RIF-FLD then its XML schema is a specialization of the XML schema of RIF-FLD. A valid XML document in D is then one that is valid with respect to the XML schema of D. ☐
Definition (Conformant XML document in a logic-based dialect). A conformant FLD document in the XML syntax is a valid FLD document in the XML syntax that is the image of a well-formed RIF-FLD document in the presentation syntax (see Definition Well-formed formula in Section Well-formed Terms and Formulas) under the presentation-to-XML syntax mapping χfld defined in Section Mapping from the RIF-FLD Presentation Syntax to the XML Syntax.
If a dialect, D, specializes RIF-FLD then an XML document is conformant with respect to D if and only if it is a valid document in D and it is an image of a well-formed document in the presentation syntax of D.
Note that if D requires the directive Dialect(D) as part of its syntax then this implies that any D-conformant document must have this directive. ☐
RIF-FLD uses [XML1.0]
for its XML syntax. The XML serialization for RIF-FLD is
alternating or fully striped [ANF01]. A fully striped
serialization views XML documents as objects and divides all XML
tags into class descriptors, called type tags, and property
descriptors, called role tags .[TRT03]. We usefollow the
tradition of using capitalized names for type tags and lowercase
names for role tags.
The RIF serialization framework forall-uppercase classes in the syntax of SectionEBNF Grammar for the Presentation Syntaxof RIF-FLD usesthe following XML tags. - Group (nested collection of sentences annotated with metadata) - meta (meta role, containing metadata, which is representedpresentation
syntax, such as a Frame) - sentence (sentenceFORMULA, become XML Schema groups in
Appendix XML Schema for FLD.
They act like macros and are not visible in instance markup. The
other classes as well as non-terminals and symbols (such as
Exists or =) become XML elements with optional
attributes, as shown below.
The RIF serialization framework for the syntax of Section EBNF Grammar for the Presentation
Syntax of RIF-FLD uses the following XML tags. While there is a
RIF-FLD element tag for the Import directive and an
attribute for the Dialect directive, there are none for
the Base and Prefix directives: they are handled
as discussed in Section Mapping of the RIF-FLD Rule Language.
- Document (document, with optional 'dialect' attribute, containing optional directive and payload roles) - directive (directive role, containing Import) - payload (payload role, containing Group) - Import (importation, containing location and optional profile) - location (location role, containing IRICONST) - profile (profile role, containing PROFILE) - Group (nested collection of sentences) - sentence (sentence role, containing FORMULA or Group) - Forall (quantified formula for 'Forall', containing declare and formula roles) - Exists (quantified formula for 'Exists', containing declare and formula roles) - declare (declare role, containing a Var) - formula (formula role, containing a FORMULA) - Implies (implication, containing if and then roles) - if (antecedent role, containing FORMULA) - then (consequent role, containing FORMULA) - And (conjunction) - Or (disjunction) - Neg (strong negation, containing a formula role) - Naf (negation as failure, containing a formula role) - Atom (atom formula, positional or with named arguments) - External (external call, containing a content role) - content (content role, containing an Atom, for predicates, or Expr, for functions) - Member (member formula) - Subclass (subclass formula) - Frame (Frame formula) - object (Member/Frame role containing a TERM or an object description) - op (Atom/Expr role for predicates/functions as operations) -arg(argumentargs (Atom/Expr positional arguments role, containing n TERMs) - instance (Member instance role) -upper(Member/Subclassupperclass (Member class role) -lower(Member/Subclasslowerinstance/classsub (Subclass sub-class role) -slot(Atom/Expr/Frameslotrole,containingaProp)super (Subclass super-class role) -Prop(Property,prefixversionofslotinfix'->')-key(Propkey(Atom/Expr or Frame slot role, containing aConst)-val(Propvalrole,containingName or TERM followed by a TERM) - Equal (prefix version of term equation '=') - Expr (expression formula, positional or with named arguments) -sideleft (Equal left-hand sideandrole) - right (Equal right-hand side role) - Const (individual, function, or predicate symbol, with optional 'type' attribute) - Name (name of named argument) - Var (logic variable)Example3(Serializationof- id (identifier role, containing IRICONST) - meta (meta role, containing metadata as anestedFrame or Frame conjunction)
The id and meta elements, which are expansions of the IRIMETA element, can occur optionally as the initial children of any Class element.
The XML Schema Definition of RIF-FLD group annotated with metadata). This example shows anis given in Appendix
XML serializationSchema for FLD.
The formulas in Example 2.XML syntax for convenience of reference,symbol spaces utilizes the type
attribute associated with XML term elements such as Const.
For instance, a literal in the xs:dateTime datatype can be
represented as
<Const type="&xs;dateTime">2007-11-23T03:55:44-02:30</Const>.
RIF-FLD also utilizes the ordered attribute to indicate
the orderedness of children of the elements args and
slot it is associated with.
Example 3 (Serialization of a nested RIF-FLD group with annotations).
This example shows an XML serialization for the formulas in
Example 2. For convenience of reference, the original formulas are
included at the top. For better readability, we again use the
shortcut syntax defined in Data Types and Builtins .[RIF-DTB].
Presentation syntax: Document( Dialect(FOL) Prefix(dc http://http://purl.org/dc/terms/) Prefix(ex http://example.org/ontology#) Prefix(hamlet http://www.shakespeare-literature.com/Hamlet/)Grouphamlet:assertions[dc:title->"Hamlet",dc:creator->"Shakespeare"]((* hamlet:assertions hamlet:assertions[dc:title->"Hamlet" dc:creator->"Shakespeare"] *) Group( Exists ?X (And(?X # ex:RottenThing ex:partof(?X <http://www.denmark.dk>))) Forall ?X (Or(hamlet:tobe(?X) Naf hamlet:tobe(?X))) Forall ?X (And(Exists ?B (And(ex:has(?X ?B) ?B # ex:business)) Exists ?D (And(ex:has(?X ?D) ?D # ex:desire))) :- ?X # ex:man)Grouphamlet:facts[]((* hamlet:facts *) Group( hamlet:Yorick # ex:poor hamlet:Hamlet # ex:prince ) ) ) XML serialization: <!DOCTYPE Document [ <!ENTITY dc "http://purl.org/dc/terms/"> <!ENTITY ex "http://example.org/ontology#"> <!ENTITY hamlet "http://www.shakespeare-literature.com/Hamlet/"> <!ENTITY rif "http://www.w3.org/2007/rif#"> <!ENTITY xs "http://www.w3.org/2001/XMLSchema#"> ]> <Document dialect="FOL"> <payload> <Group> <meta> <Frame> <object> <Consttype="rif:iri">hamlet:assertions</Const>type="&rif;iri">hamlet:assertions</Const> </object><slot><Prop><key><Consttype="rif:iri">dc:title</Const></key><val><Consttype="xsd:string">Hamlet</Const></val></Prop><slot ordered="yes"> <Const type="&rif;iri">&dc;title</Const> <Const type="&xs;string">Hamlet</Const> </slot><slot><Prop><key><Consttype="rif:iri">dc:creator</Const></key><val><Consttype="xsd:string">Shakespeare</Const></val></Prop><slot ordered="yes"> <Const type="&rif;iri">&dc;creator</Const> <Const type="&xs;string">Shakespeare</Const> </slot> </Frame> </meta> <sentence> <Exists> <declare><Var>X</Var></declare> <formula> <And> <formula> <Member><lower><Var>X</Var></lower><upper><Consttype="rif:iri">ex:RottenThing</Const></upper><instance><Var>X</Var></instance> <class><Const type="&rif;iri">ex:RottenThing</Const></class> </Member> </formula> <formula> <Atom> <op><Consttype="rif:iri">ex:partof</Const></op><arg><Var>X</Var></arg><arg><Consttype="rif:iri">http://www.denmark.dk</Const></arg>type="&rif;iri">ex:partof</Const></op> <args ordered="yes"> <Var>X</Var> <Const type="&rif;iri">http://www.denmark.dk</Const> </args> </Atom> </formula> </And> </formula> </Exists> </sentence> <sentence> <Forall> <declare><Var>X</Var></declare> <formula> <Or> <formula> <Atom> <op><Consttype="rif:iri">hamlet:tobe</Const></op><arg><Var>X</Var></arg>type="&rif;iri">hamlet:tobe</Const></op> <args ordered="yes"><Var>X</Var></args> </Atom> </formula> <formula> <Naf> <formula> <Atom> <op><Consttype="rif:iri">hamlet:tobe</Const></op><arg><Var>X</Var></arg>type="&rif;iri">hamlet:tobe</Const></op> <args ordered="yes"><Var>X</Var></args> </Atom> </formula> </Naf> </formula> </Or> </formula> </Forall> </sentence> <sentence> <Forall> <declare><Var>X</Var></declare> <formula> <Implies> <if> <Member><lower><Var>X</Var></lower><upper><Consttype="rif:iri">ex:man</Const></upper><instance><Var>X</Var></instance> <class><Const type="&rif;iri">ex:man</Const></class> </Member> </if> <then> <And> <formula> <Exists> <declare><Var>B</Var></declare> <formula> <And> <formula> <Atom> <op><Consttype="rif:iri">ex:has</Const></op><arg><Var>X</Var></arg><arg><Var>B</Var></arg>type="&rif;iri">ex:has</Const></op> <args> <Var>X</Var> <Var>B</Var> </args> </Atom> </formula> <formula> <Member><lower><Var>B</Var></lower><upper><Consttype="rif:iri">ex:business</Const></upper><instance><Var>B</Var></instance> <class><Const type="&rif;iri">ex:business</Const></class> </Member> </formula> </And> </formula> </Exists> </formula> <formula> <Exists> <declare><Var>D</Var></declare> <formula> <And> <formula> <Atom> <op><Consttype="rif:iri">ex:has</Const></op><arg><Var>X</Var></arg><arg><Var>D</Var></arg>type="&rif;iri">ex:has</Const></op> <args> <Var>X</Var> <Var>D</Var> </args> </Atom> </formula> <formula> <Member><lower><Var>D</Var></lower><upper><Consttype="rif:iri">ex:desire</Const></upper><instance><Var>D</Var></instance> <class><Const type="&rif;iri">ex:desire</Const></class> </Member> </formula> </And> </formula> </Exists> </formula> </And> </then> </Implies> </formula> </Forall> </sentence> <sentence> <Group> <meta> <Frame> <object> <Consttype="rif:iri">hamlet:facts</Const>type="&rif;iri">hamlet:facts</Const> </object> </Frame> </meta> <sentence> <Member><lower><Consttype="rif:iri">hamlet:Yorick</Const></lower><upper><Consttype="rif:iri">ex:poor</Const></upper><instance><Const type="&rif;iri">hamlet:Yorick</Const></instance> <class><Const type="&rif;iri">ex:poor</Const></class> </Member> </sentence> <sentence> <Member><lower><Consttype="rif:iri">hamlet:Hamlet</Const></lower><upper><Consttype="rif:iri">ex:prince</Const></upper><instance><Const type="&rif;iri">hamlet:Hamlet</Const></instance> <class><Const type="&rif;iri">ex:prince</Const></class> </Member> </sentence> </Group> </sentence> </Group> </payload> </Document>
This section defines a translation ofnormative mapping,
χfld, from the presentation syntax of Section
EBNF Grammar for the
Presentation Syntax of RIF-FLD to the XML syntax of RIF-FLD.
This translationThe mapping is specified bygiven via tables where each row specifies the
table below. Sincemapping of a particular syntactic pattern in the presentation
syntaxsyntax. These patterns appear in the first column of RIF-FLD is context sensitive,the translation must differentiate betweentables and
the terms that occur inbold-italic symbols represent metavariables. The
positionsecond column represents the corresponding XML patterns, which may
contain applications of the individuals from terms that occur as atomic formulas.mapping χfld to
this end,these metavariables. When an expression
χfld(metavar) occurs in
the translation table, the positional and named argument terms that occuran XML pattern in the contextright column of atomic formulas are denoted by the expressionsa translation table, it
should be understood as a recursive application of
χfld to the form pred (...) and the terms that occur as individuals are denotedpresentation syntax represented by
expressions ofthe form func (...). Editor's Note: Thismetavariable. The XML syntax translation table is expected to be made more formal in future versionsresult of this draft.such an application is
substituted for the prime symbol (for instance, variable 'expression
χfld(metavar) indicates that the translation function defined. A
sequence of terms containing metavariables with subscripts is
indicated by the table must be applied recursively (i.e.,an ellipsis. A metavariable or a well-formed XML
subelement is marked as optional by appending a bold-italic
question mark, ?, to variable in our example).its right.
The χfld mapping from the presentation
syntax to the XML syntax Group ( clause 1 . . . clause n ) <Group> <sentence> clause 1 ' </sentence> . . . <sentence> clause n ' </sentence> </Group> Group metaframe ( clause 1 . . . clause n ) <Group> <meta> metaframe' </meta> <sentence> clause 1 ' </sentence> . . . <sentence> clause n ' </sentence> </Group> Forall variable 1 . . . variable n ( body ) <Forall> <declare> variable 1 ' </declare> . . . <declare> variable n ' </declare> <formula> body' </formula> </Forall> Exists variable 1 . . . variable nof the non-annotated RIF-FLD Language is
given by the table below. Each row "Presentation |
XML" indicates a χfld translation:
χfld( bodyPresentation) <Exists> <declare> variable 1 ' </declare> . .= XML.
<declare> variable n ' </declare> <formula> body' </formula> </Exists> conclusion :- condition <Implies> <if> condition' </if> <then> conclusion' </then> </Implies>Since the presentation syntax of RIF-FLD is context sensitive, the
mapping must differentiate between the terms that occur in the
position of the individuals from terms that occur as atomic
formulas. To this end, in the translation table, the positional and
( conjunct 1 . . . conjunct n ) <And> <formula> conjunct 1 ' </formula>named argument terms that occur in the context of atomic formulas
are denoted by the expressions of the form pred(...)
and the terms that occur as individuals are denoted by expressions
of the form func(...). In the table, each
metavariable for an (unnamed) positional
argumenti is assumed to be instantiated to
values unequal to the instantiations of named arguments
unicodestringj ->
fillerj.
Note that while the Import and the Dialect directives are handled by the presentation-to-XML syntax mapping, the Prefix and Base directives are not. Instead, these directives should be dealt with by macro-expanding the associated shortcuts (compact URIs). Namely, a prefix name declared in a Prefix directive is expanded into the associated IRI, while relative IRIs are completed using the IRI declared in the Base directive. The mapping χfld applies only to such macro-expanded documents. RIF-FLD also allows other treatments of Prefix and Base provided that they produce equivalent XML documents. One such treatment is employed in the examples in this document, especially Example 3. It replaces prefix names with definitions of XML entities as follows. Each Prefix declaration becomes an ENTITY declaration [XML1.0] within a DOCTYPE DTD attached to the RIF-FLD Document. The Base directive is mapped to the xml:base attribute [XML-Base] in the XML Document tag. Compact URIs of the form prefix:suffix are then mapped to &prefix;suffix.
Presentation Syntax | XML Syntax |
---|---|
Document( Dialect(name)? Import(loc1 prfl1?) . . . |
<Document dialect="name"?> <directive> <Import> <location>χfld( |
Group( clause1 |
<Group> <sentence>χfld(clause1)</sentence> . . . <sentence>χfld(clausen)</sentence> </Group> |
Forall variable1 . . . variablen ( body ) |
<Forall> <declare>χfld(variable1)</declare> . . . <declare>χfld(variablen)</declare> <formula>χfld(body)</formula> </Forall> |
conclusion :- condition |
<Implies> <if>χfld(condition)</if> <then>χfld(conclusion)</then> </Implies> |
And ( conjunct1 . . . conjunctn ) |
<And> <formula>χfld(conjunct1)</formula> . . . <formula>χfld(conjunctn)</formula> </And> |
Or ( disjunct1 . . . disjunctn ) |
<Or> <formula>χfld(disjunct1)</formula> . . . <formula>χfld(disjunctn)</formula> </Or> |
Neg form |
<Neg> <formula> |
Naf form |
<Naf> <formula> |
Exists variable1 . . . variablen ( body ) |
<Exists> <declare>χfld(variable1)</declare> . . . <declare>χfld(variablen)</declare> <formula>χfld(body)</formula> </Exists> |
External ( atomframexpr ) |
<External> <content>χfld(atomframexpr)</content> </External> |
pred ( argument1 . . . argumentn ) |
<Atom> <op> |
func ( argument1 . . . argumentn ) |
<Expr> <op> |
pred ( unicodestring1 -> filler1 . . . unicodestringn -> fillern ) |
<Atom> <op> |
func ( unicodestring1 -> filler1 . . . unicodestringn -> fillern ) |
<Expr> <op> |
inst [ key1 -> filler1 . . . keyn -> fillern ] |
<Frame> <object> |
inst # class |
|
|
|
left = right |
<Equal> |
unicodestring^^space |
<Const type="space">unicodestring</Const> |
?unicodestring |
<Var>unicodestring</Var> |
The data types specifiedχfld mapping from RIF-FLD annotations in
the RIF-DTB document , and suppose Ε is a set of external predicates and functions, which includes the built-ins listed inpresentation syntax to the RIF-DTB document. Let D be a RIF dialect (e.g., RIF-BLD). We say that a formula φ is a D Τ,Ε formula iff itXML syntax is a formula in the dialect D , all the data types used in φ are in Τ, and allspecified by the externally defined functions and predicates used in φ are in Ε. A RIF processor is a conformant D Τ,Ε consumer ifftable
below. It implements a semantics-preserving mapping, μ, fromextends the settranslation table of Section Mapping of all D Τ,Ε formulas tothe
Non-annotated RIF-FLD Language L of. The processor. Formally, this means thatmetavariable
Typetag in the presentation and XML syntaxes stands
for any pair φ, ψof D Τ,Ε formulas for which φ |= D ψ is defined, φ |= D ψ iff μ(φ) |= L μ(ψ). Here |= D denotes the logical entailment inthe RIF dialect Dclass names And |= L is the logical entailment in the language L of, Or,
External, Document, or Group,
Quantifier for Exists or Forall,
and Negation for Neg or Naf. The
RIF processor. In addition, a D Τ,Ε compliant consumer must rejectdollar sign, $, stands for any document that contains a non- D Τ,Ε formula. A RIF processor is a conformant D Τ,Ε producer iff it implements a semantics-preserving mapping, μ, from a subsetof the language L ofbinary infix operator
names #, ##, =, or :-, while
Binop stands for their respective class names
Member, Subclass, Equal, or
Implies. The processormetavariable attr? is used with
Typetag to capture the set of D Τ,Ε formulas. Formally this means that for any pair φ, ψoptional dialect
attribute (with its value) of formulas in LDocument. Again, each
metavariable for which φ |= L ψan (unnamed) positional
argumenti is defined, φ |= L ψ iff μ(φ) |= D μ(ψ). 6 References 6.1 Normative References [RDF-CONCEPTS] Resource Description Framework (RDF): Concepts and Abstractassumed to be instantiated to
values unequal to the instantiations of named arguments
unicodestringj ->
fillerj.
Presentation Syntax | |
---|---|
(* iriconst? frameconj? *) Typetag ( e1 . |
<Typetag attr?> <id>χfld(iriconst)</id>? <meta>χfld(frameconj)</meta>? e1' . |
(* iriconst? frameconj? *) Quantifier variable1 . . . variablen ( body ) |
<Quantifier> <id>χfld(iriconst)</id>? <meta>χfld(frameconj)</meta>? <declare>χfld(variable1)</declare> . . . <declare>χfld(variablen)</declare> <formula>χfld(body)</formula> </Quantifier> |
(* iriconst? frameconj? *) Negation e |
<Negation> <id>χfld(iriconst)</id>? <meta>χfld(frameconj)</meta>? χfld(e) </Negation> |
(* iriconst? frameconj? *) pred ( argument1 . . . argumentn ) |
<Atom> <id>χfld(iriconst)</id>? <meta>χfld(frameconj)</meta>? <op>χfld(pred)</op> <args ordered="yes"> χfld(argument1) . . . χfld(argumentn) </args> </Atom> |
(* iriconst? frameconj? *) func ( argument1 . . . argumentn ) |
<Expr> <id>χfld(iriconst)</id>? <meta>χfld(frameconj)</meta>? <op>χfld(func)</op> <args ordered="yes"> χfld(argument1) . . . χfld(argumentn) </args> </Expr> |
(* iriconst? frameconj? *) pred ( unicodestring1 -> filler1 . . . unicodestringn -> fillern ) |
<Atom> <id>χfld(iriconst)</id>? <meta>χfld(frameconj)</meta>? <op>χfld(pred)</op> <slot ordered="yes"> <Name>unicodestring1</Name> χfld(filler1) </slot> . . . <slot ordered="yes"> <Name>unicodestringn</Name> χfld(fillern) </slot> </Atom> |
(* iriconst? frameconj? *) func ( unicodestring1 -> filler1 . . . unicodestringn -> fillern ) |
<Expr> <id>χfld(iriconst)</id>? <meta>χfld(frameconj)</meta>? <op>χfld(func)</op> <slot ordered="yes"> <Name>unicodestring1</Name> χfld(filler1) </slot> . . . <slot ordered="yes"> <Name>unicodestringn</Name> χfld(fillern) </slot> </Expr> |
(* iriconst? frameconj? *) inst [ key1 -> filler1 . . . keyn -> fillern ] |
<Frame> <id>χfld(iriconst)</id>? <meta>χfld(frameconj)</meta>? <object>χfld(inst)</object> <slot ordered="yes"> χfld(key1) χfld(filler1) </slot> . . . <slot ordered="yes"> χfld(keyn) χfld(fillern) </slot> </Frame> |
(* iriconst? frameconj? *) e1 $ e2 |
<Binop> <id>χfld(iriconst)</id>? <meta>χfld(frameconj)</meta>? e1' e2' </Binop> where Binop, e1', e2' are defined by the equation χfld(e1 $ e2) = <Binop>e1' e2'</Binop> |
(* iriconst? frameconj? *) unicodestring^^symspace |
<Const type="symspace"> <id>χfld(iriconst)</id>? <meta>χfld(frameconj)</meta>? unicodestring </Const> |
(* iriconst? frameconj? *) ?unicodestring |
<Var> <id>χfld(iriconst)</id>? <meta>χfld(frameconj)</meta>? unicodestring </Var> |
RIF does not require or expect the conformant systems to implement the presentation syntax of a RIF dialect. Instead, conformance is described in terms of semantics-preserving transformations.
Let Τ be a set of datatypes, which includes the datatypes specified
in [RIF-DTB], and suppose Ε is
a set of external predicates and functions, which includes the
built-ins listed in [RIF-DTB].
Let D be a RIF dialect (e.g., [RIF-BLD]). We say that a formula φ is a
DΤ,Ε formula iff
A RIF processor is a conformant DΤ,Ε consumer iff it implements a semantics-preserving mapping, μ, from the set of all DΤ,Ε formulas to the language L of the processor.
Formally, this means that for any pair φ, ψ of DΤ,Ε formulas for which φ |=D ψ is defined, φ |=D ψ iff μ(φ) |=L μ(ψ). Here |=D denotes the logical entailment in the RIF dialect D and |=L is the logical entailment in the language L of the RIF processor.
A RIF processor is a conformant DΤ,Ε producer iff it implements a semantics-preserving mapping, μ, from a subset of the language L of the processor to the set of DΤ,Ε formulas.
Formally this means that for any pair φ, ψ of formulas in L for which φ |=L ψ is defined, φ |=L ψ iff μ(φ) |=D μ(ψ).
A conformant document in a logic-based RIF dialect
D is one which conforms to all the syntactic constraints of
D, including the ones that cannot be checked by an XML
Schema validator (see Definition Conformant XML document in a logic-based dialect).
The namespace of RIF is http://www.w3.org/2007/rif#.
XML schemas for the RIF-FLD language are defined below and are also available here with additional examples. For convenience, we define a Baseline module and a Skyline module in XML Schema. The latter schema module extends and modifies the former, and it encompasses the entire RIF-FLD.
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2007/rif#" targetNamespace="http://www.w3.org/2007/rif#" elementFormDefault="qualified" version="Id: FLDBaseline.xsd, v. 0.96, 2008-07-15, hboley/dhirtle"> <xs:annotation> <xs:documentation> This is the Baseline module of FLD. It is the foundation of the full schema defined through the Skyline module. The Baseline XML schema is based on the following EBNF (compared to the full EBNF of RIF-FLD, Group and Document are omitted, and 'Implies' is missing from the production for FORMULA). FORMULA ::= IRIMETA? 'And' '(' FORMULA* ')' | IRIMETA? 'Or' '(' FORMULA* ')' | IRIMETA? 'Exists' Var* '(' FORMULA ')' | IRIMETA? 'Forall' Var* '(' FORMULA ')' | IRIMETA? 'Neg' FORMULA | IRIMETA? 'Naf' FORMULA | FORM FORM ::= IRIMETA? (Var | ATOMIC | 'External' '(' ATOMIC ')') ATOMIC ::= Const | Atom | Equal | Member | Subclass | Frame Atom ::= UNITERM UNITERM ::= TERM '(' (TERM* | (Name '->' TERM)*) ')' Equal ::= TERM '=' TERM Member ::= TERM '#' TERM Subclass ::= TERM '##' TERM Frame ::= TERM '[' (TERM '->' TERM)* ']' TERM ::= IRIMETA? (Var | EXPRIC | 'External' '(' EXPRIC ')') EXPRIC ::= Const | Expr | Equal | Member | Subclass | Frame Expr ::= UNITERM Const ::= '"' UNICODESTRING '"^^' SYMSPACE | CONSTSHORT Name ::= UNICODESTRING Var ::= '?' UNICODESTRING SYMSPACE ::= ANGLEBRACKIRI | CURIE IRIMETA ::= '(*' IRICONST? (Frame | 'And' '(' Frame* ')')? '*)' </xs:documentation> </xs:annotation> <xs:group name="FORMULA"> <xs:choice> <xs:element ref="And"/> <xs:element ref="Or"/> <xs:element ref="Exists"/> <xs:element ref="Forall"/> <xs:element ref="Neg"/> <xs:element ref="Naf"/> <xs:group ref="FORM"/> </xs:choice> </xs:group> <xs:complexType name="External-FORMULA.type"> <xs:sequence> <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/> <xs:element name="content" type="content-FORMULA.type"/> </xs:sequence> </xs:complexType> <xs:complexType name="content-FORMULA.type"> <xs:sequence> <xs:choice> <xs:element ref="Atom"/> <xs:element ref="Frame"/> </xs:choice> </xs:sequence> </xs:complexType> <xs:element name="And"> <xs:complexType> <xs:sequence> <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/> <xs:element ref="formula" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Or"> <xs:complexType> <xs:sequence> <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/> <xs:element ref="formula" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Exists"> <xs:complexType> <xs:sequence> <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/> <xs:element ref="declare" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="formula"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Forall"> <xs:complexType> <xs:sequence> <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/> <xs:element ref="declare" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="formula"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Neg"> <xs:complexType> <xs:sequence> <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/> <xs:element ref="formula" minOccurs="1" maxOccurs="1"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Naf"> <xs:complexType> <xs:sequence> <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/> <xs:element ref="formula" minOccurs="1" maxOccurs="1"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="formula"> <xs:complexType> <xs:sequence> <xs:group ref="FORMULA"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="declare"> <xs:complexType> <xs:sequence> <xs:element ref="Var"/> </xs:sequence> </xs:complexType> </xs:element> <xs:group name="FORM"> <xs:choice> <xs:element ref="Var"/> <xs:group ref="ATOMIC"/> <xs:element name="External" type="External-FORM.type"/> </xs:choice> </xs:group> <xs:complexType name="External-FORM.type"> <xs:sequence> <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/> <xs:element name="content" type="content-FORM.type"/> </xs:sequence> </xs:complexType> <xs:complexType name="content-FORM.type"> <xs:sequence> <xs:group ref="ATOMIC"/> </xs:sequence> </xs:complexType> <xs:group name="ATOMIC"> <xs:choice> <xs:element ref="Const"/> <xs:element ref="Atom"/> <xs:element ref="Equal"/> <xs:element ref="Member"/> <xs:element ref="Subclass"/> <xs:element ref="Frame"/> </xs:choice> </xs:group> <xs:element name="Atom"> <xs:complexType> <xs:sequence> <xs:group ref="UNITERM"/> </xs:sequence> </xs:complexType> </xs:element> <xs:group name="UNITERM"> <xs:sequence> <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/> <xs:element ref="op"/> <xs:choice> <xs:element ref="args" minOccurs="0" maxOccurs="1"/> <xs:element name="slot" type="slot-UNITERM.type" minOccurs="0" maxOccurs="unbounded"/> </xs:choice> </xs:sequence> </xs:group> <xs:element name="op"> <xs:complexType> <xs:sequence> <xs:group ref="TERM"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="args"> <xs:complexType> <xs:sequence> <xs:group ref="TERM" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="ordered" type="xs:string" fixed="yes"/> </xs:complexType> </xs:element> <xs:complexType name="slot-UNITERM.type"> <xs:sequence> <xs:element ref="Name"/> <xs:group ref="TERM"/> </xs:sequence> <xs:attribute name="ordered" type="xs:string" fixed="yes"/> </xs:complexType> <xs:element name="Equal"> <xs:complexType> <xs:sequence> <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/> <xs:element ref="left"/> <xs:element ref="right"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="left"> <xs:complexType> <xs:sequence> <xs:group ref="TERM"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="right"> <xs:complexType> <xs:sequence> <xs:group ref="TERM"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Member"> <xs:complexType> <xs:sequence> <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/> <xs:element ref="instance"/> <xs:element ref="class"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Subclass"> <xs:complexType> <xs:sequence> <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/> <xs:element ref="sub"/> <xs:element ref="super"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="instance"> <xs:complexType> <xs:sequence> <xs:group ref="TERM"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="class"> <xs:complexType> <xs:sequence> <xs:group ref="TERM"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="sub"> <xs:complexType> <xs:sequence> <xs:group ref="TERM"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="super"> <xs:complexType> <xs:sequence> <xs:group ref="TERM"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Frame"> <xs:complexType> <xs:sequence> <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/> <xs:element ref="object"/> <xs:element name="slot" type="slot-Frame.type" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="object"> <xs:complexType> <xs:sequence> <xs:group ref="TERM"/> </xs:sequence> </xs:complexType> </xs:element> <xs:complexType name="slot-Frame.type"> <xs:sequence> <xs:group ref="TERM"/> <xs:group ref="TERM"/> </xs:sequence> <xs:attribute name="ordered" type="xs:string" fixed="yes"/> </xs:complexType> <xs:group name="TERM"> <xs:choice> <xs:element ref="Var"/> <xs:group ref="EXPRIC"/> <xs:element name="External" type="External-TERM.type"/> </xs:choice> </xs:group> <xs:complexType name="External-TERM.type"> <xs:sequence> <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/> <xs:element name="content" type="content-TERM.type"/> </xs:sequence> </xs:complexType> <xs:complexType name="content-TERM.type"> <xs:sequence> <xs:group ref="EXPRIC"/> </xs:sequence> </xs:complexType> <xs:group name="EXPRIC"> <xs:choice> <xs:element ref="Const"/> <xs:element ref="Expr"/> <xs:element ref="Equal"/> <xs:element ref="Member"/> <xs:element ref="Subclass"/> <xs:element ref="Frame"/> </xs:choice> </xs:group> <xs:element name="Expr"> <xs:complexType> <xs:sequence> <xs:group ref="UNITERM"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Const"> <xs:complexType mixed="true"> <xs:sequence> <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/> </xs:sequence> <xs:attribute name="type" type="xs:anyURI" use="required"/> </xs:complexType> </xs:element> <xs:element name="Name" type="xs:string"> </xs:element> <xs:element name="Var"> <xs:complexType mixed="true"> <xs:sequence> <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/> </xs:sequence> </xs:complexType> </xs:element> <xs:group name="IRIMETA"> <xs:sequence> <xs:element ref="id" minOccurs="0" maxOccurs="1"/> <xs:element ref="meta" minOccurs="0" maxOccurs="1"/> </xs:sequence> </xs:group> <xs:element name="id"> <xs:complexType> <xs:sequence> <xs:element name="Const" type="IRICONST.type"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="meta"> <xs:complexType> <xs:choice> <xs:element ref="Frame"/> <xs:element name="And" type="And-meta.type"/> </xs:choice> </xs:complexType> </xs:element> <xs:complexType name="And-meta.type"> <xs:sequence> <xs:element name="formula" type="formula-meta.type" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <xs:complexType name="formula-meta.type"> <xs:sequence> <xs:element ref="Frame"/> </xs:sequence> </xs:complexType> <xs:complexType name="IRICONST.type" mixed="true"> <xs:sequence/> <xs:attribute name="type" type="xs:anyURI" use="required" fixed="http://www.w3.org/2007/rif#iri"/> </xs:complexType> </xs:schema>
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2007/rif#" targetNamespace="http://www.w3.org/2007/rif#" elementFormDefault="qualified" version="Id: FLDSkyline.xsd, v. 0.96, 2008-07-16, hboley/dhirtle"> <xs:annotation> <xs:documentation> This is theSyntaxSkyline schema module ofCycL,Website.Availableathttp://www.cyc.com/cycdoc/ref/cycl-syntax.html.[FL2]FLORA-2:AnObject-OrientedKnowledgeBaseLanguage,M.Kifer.Website.Availableathttp://flora.sourceforge.net.[OOjD]Object-OrientedjDREW,Website.Availableathttp://www.jdrew.org/oojdrew/.[NxBRE].NETBusinessRuleEngine,Website.Availableathttp://nxbre.wiki.sourceforge.net/.[GRS91]FLD. It is split off from theWell-FoundedSemanticsBaseline schema forGeneralLogicPrograms,A.VanGelder,K.A.Ross,J.S.Schlipf.JournalofACM,38:3,pages620-650,1991.[GL88]modularity. TheStableModelSemanticsforLogicProgramming,M.GelfondandV.Lifschitz.LogicProgramming:ProceedingsofSkyline XML schema is based on theFifthConferencefollowing EBNF (which adds Group andSymposium,pages1070-1080,1988.[vEK76]Thesemanticsofpredicatelogicasaprogramminglanguage,M.vanEmdenDocument, andR.Kowalski.Journalbrings 'Implies' into FORMULA): Document ::= IRIMETA? 'Document' '(' Dialect? Base? Prefix* Import* Group? ')' Dialect ::= 'Dialect' '(' Name ')' Base ::= 'Base' '(' IRI ')' Prefix ::= 'Prefix' '(' Name IRI ')' Import ::= IRIMETA? 'Import' '(' IRICONST PROFILE? ')' Group ::= IRIMETA? 'Group' '(' (FORMULA | Group)* ')' Implies ::= IRIMETA? FORMULA ':-' FORMULA FORMULA ::= IRIMETA? 'And' '(' FORMULA* ')' | IRIMETA? 'Or' '(' FORMULA* ')' | Implies | IRIMETA? 'Exists' Var* '(' FORMULA ')' | IRIMETA? 'Forall' Var* '(' FORMULA ')' | IRIMETA? 'Neg' FORMULA | IRIMETA? 'Naf' FORMULA | FORM PROFILE ::= TERM Note that this is an extension of theACM23(1976),733-742.[Enderton01]AMathematicalIntroductiontoLogic,SecondEdition,H.B.Enderton.AcademicPress,2001.[Mendelson97]IntroductiontoMathematicalLogic,FourthEdition,E.Mendelson.Chapman&Hall,1997.syntax for the Baseline schema (FLDBaseline.xsd). </xs:documentation> </xs:annotation> <xs:include schemaLocation="FLDBaseline.xsd"/> <xs:redefine schemaLocation="FLDBaseline.xsd"> <xs:group name="FORMULA"> <xs:choice> <xs:group ref="FORMULA"/> <xs:element ref="Implies"/> </xs:choice> </xs:group> </xs:redefine> <xs:element name="Document"> <xs:complexType> <xs:sequence> <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/> <xs:element ref="directive" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="payload" minOccurs="0" maxOccurs="1"/> </xs:sequence> <xs:attribute name="dialect" type="xs:string"/> </xs:complexType> </xs:element> <xs:element name="directive"> <xs:complexType> <xs:sequence> <xs:element ref="Import"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="payload"> <xs:complexType> <xs:sequence> <xs:element ref="Group"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Import"> <xs:complexType> <xs:sequence> <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/> <xs:element ref="location"/> <xs:element ref="profile" minOccurs="0" maxOccurs="1"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="location"> <xs:complexType> <xs:sequence> <xs:element name="Const" type="IRICONST.type"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="profile"> <xs:complexType> <xs:sequence> <xs:group ref="TERM"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Group"> <xs:complexType> <xs:sequence> <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/> <xs:element ref="sentence" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="sentence"> <xs:complexType> <xs:choice> <xs:group ref="FORMULA"/> <xs:element ref="Group"/> </xs:choice> </xs:complexType> </xs:element> <xs:element name="Implies"> <xs:complexType> <xs:sequence> <xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/> <xs:element ref="if"/> <xs:element ref="then"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="if"> <xs:complexType> <xs:sequence> <xs:group ref="FORMULA"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="then"> <xs:complexType> <xs:sequence> <xs:group ref="FORMULA"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>