Information Technology Reference
In-Depth Information
in which the variable occurs is the scope of quantification), unless indicated
otherwise, through the
sharedVariables
construct (see Section 7.2.2).
Terms are either identifiers, variables, or constructed terms. An atom is,
as usual, a predicate symbol with a number of terms as arguments. Besides
the usual atoms, WSML has special kinds of atoms, called
molecules
,which
are used to capture information about concepts, instances, attributes and
attribute values. There are two types of molecules, analogous to the situation
in F-Logic:
•
An
isa
molecule is a concept membership molecule of the form
A
memberOf
B
or a subconcept molecule of the form
A
subConceptOf
B
,where
A
and
B
are arbitrary terms.
•
An
object
molecule is an attribute value expression of the form
A
[
B
hasValue
C
]
, a constraining-attribute signature expression of the form
A
[
B
ofType
C
]
, or an inferring-attribute signature expression of the form
A
[
B
ofType
C
]
,where
A,B,
and
C
are arbitrary terms.
WSML has the usual first-order connectives: the unary negation operator
neg
, and the binary operators for conjunction
and
, disjunction
or
, right im-
plication
implies
, left implication
impliedBy
, and dual implication
equivalent
.
Variables may be universally quantified using
forall
or existentially quantified
using
exists
. First-order formulas are obtained by combining atoms using the
above connectives in the usual way. The following are examples of first-order
formulas in WSML:
//Every person has a father
forall
?x (?x
memberOf
Person
implies exists
?y (?x[ father
hasValue
?y])) .
//John is member of a class which has some attribute called 'name'
exists
?x,?y (john
memberOf
?x
and
?x[name
ofType
?y]).
In addition to first-order formulas, WSML allows the use of the negation-
as-failure symbol
naf
on atoms, the special logic programming implication
symbol
:-
, and the integrity constraint symbol
!-
. A Logic Programming rule
consists of a
head
and a
body
, separated by the symbol
:-
. An integrity con-
straint consists of the symbol
!-
followed by a rule body. Negation-as-failure
naf
is allowed to occur only in the body of a logic programming rule or an
integrity constraint. The further use of logical connectives in Logic Program-
ming rules is restricted. The following logical connectives are allowed in the
head of a rule:
and
,
implies
,
impliedBy
,and
equivalent
. The following connec-
tives are allowed in the body of a rule (or constraint):
and
,
or
,and
naf
.The
following are examples of logic programming rules and database constraints:
//Every person has a father
?x[ father
hasValue
f(?y)] :
−
?x
memberOf
Person.
//Man and Woman are disjoint
!
−
?x
memberOf
Man
and
?x
memberOf
Woman.
//In case a person is not involved in a marriage, the person is a bachelor
?x
memberOf
Bachelor :
−
?x
memberOf
Person
and
naf Marriage(?x,?y,?z).
Search WWH ::
Custom Search