Tip:
Highlight text to annotate it
X
We begin our discussion of syntax with a look at the basic words of our language.
We then talk about how these words can be combined to form complex expressions
called terms. And we talk about how terms can be
combined to form sentences. In relational logic we have two types of
words, variables and constants. In our examples here we write both
variables and constants as strings of letters, digits and a few non alpha
numeric characters such as underscore. By convention, variables begin with
letters from the end of the alphabet. Examples include u, v, w, x, y and z.
By convention, all constants begin with either letters other than u, v, w, x, y
and z, or digits. Examples include a, b, c, 123, Comp 225
and Barrack Obama. There are three types of constants in
relational logic. Object constants, function constants and
relation constants. Object constants are used to represent
objects. For example, Joe, Stanford, USA.
23 45. Function constants represent functions on
objects. For example, father or mother, the age of
a person, plus and times. Relation constants represent relations on
objects, for example nose or lumps. Note that there is no distinction in
spelling between object constance, function constance and relation constance.
The type of each word is determined by its usage or, in some cases, in an explicit
specification. As we shall see, functional constants and
relational constants are used in forming complex expressions by combining them with
an appropriate number of arguments. Accordingly each functional constant and
relational constant has some associated arity, that is the number of arguments
with which that functional constant or relational constant can be combined.
A function constant or a relation constant that can be combined with a single
argument is said to be unary. One that can be combined with two
arguments is said to be binary. One that can be combined with three
arguments is said to be ternary. More generally, a function or relation
constant that can be combined with n arguments is said to be n-nary A signature
consists of a nonempty set of object constants, a possibly empty set of
function constants, a nonempty set of relation constants, and an assignment of
arities for each of the function constants and relation constants.
For example, we might consider the signature consisting of object constants A
and B, the unary function constant F, the binary function constant G, the unary
conf, relation constant P, and the binary relation constant Q.
A turn is defined to be a variable and object constant or a functional
expression, as defined in a minute. Terms typically represent objects
presuming to our hypothesis to exist in the world, and as such they are analogous
to noun phrases in natural language. For example Joe or my car's left front
wheel A functional term is an expression formed from an n-nary function constant
and N terms includes in parentheses and separated by commas.
For example, if G is a binary function constant, and if A and Y are terms, then G
of AA is a functional term. As are G of AY and G of YY.
Note that functional terms are terms, and so they be nested inside of other
functional terms. For example, we can apply the function
constant G to the functional term G of AY, and the functional term G of YA to give a
more complex term. Finally, we get to sentences.
There are three types of sentences in relational logic.
There are relational sentences, which are analogous to propositions in propositional
logic. There are logical sentences, which are
analogous to logical sentences in propositional logic.
And there are quantified sentences, which express the significance of variables.
Let's look at each of these types of sentences in turn.
A relational sentence is an expression formed from an n-nary relation constant,
and n terms. For example, if q is a relation constant
with arity two. And if a and y are terms.
Then the expression shown here is this syntactically legal relational sentence.
Q of ay. Note that unlike functional terms,
relational sentences may not be nested within other relational sentences.
Trying to write Q of A, Q of AY would be incorrect.
Logical sentences in relational logic are defined the same as in propositional
logic. There are negations, conjunctions,
disjunctions, implications and equivalences.
The syntax is the same, except that the elementary components are relational
sentences and equations and other explicit sentences rather than propositional
constants. Finally we get to quantified sentences.
These come in two types of sentences-universally quantified sentences
and existentially quantified sentences. Universally quantified sentence is used to
search the all objects have a certain property.
For example, the top sentence here is the universally quantified sentences is here
in a P holes of an object, that if P holes of an object then Q holes of an object and
itself. Universal quantifier is notated with this
upside down A. An existentially quantified sentence is,
is used to assert that there are objects having a certain property.
For example, the middle expression here is an existentially quantified sentence
asserting that there is an object that satisfies P.
And, when paired with itself, satisfies Q as well.
The existential quantifier modifier is notated by an E rotated through a 100 an
eighty degrees Note that quantified sentences can be nested within other
sentences. For example, in the first sentence at the
bottom, we have a quantified sentence inside of a disjunction.
In the second sentence at the bottom, we have a quantified sentence nested inside
of another quantified sentence. As with propositional logic, we can drop
unneeded parenthesis in relational logic, relying on precedence to disambiguate the
structure of unparenthesized sentences. In relational logic, the precedence
relations of the logical operators are the same as in propositional logic.
And quantifiers have higher precedence than logical operators.
Examples here show how to parenthesize sentences with both quantifiers and
logical operators. The sentences on the right are partially
parenthesized versions of the sentences on the left.
To be fully parenthesized, what we need to have, add parentheses around each of the
sentences as a whole. Notice that, in each case, the quantifier
applies only to the sentence to its right. Even though the other sentence also
contains the currencies of the quantified variable.
This exercise tests your grasp for these rules of syntax by asking you to determine
whether various expressions are syntactically legal sentences in
relational logic. Before we leave our look at syntax, we
need to define some useful concepts. A, an expression in the language of
relational logic is said to be ground if and only if it contains no variables.
For example, the sentence, P of A, is ground; whereas the sentence, for all X, P
of X, is not. An occurrence of the variable in a
sentence is bound if and only if it appears in the scope of a quantifier of
that variable, otherwise it's free. For example, X is free and Y is bound in
the sentence shown here. A sentence is open if and only if it has
free variables. Otherwise it is closed.
For example, the first sentence here is open, because it contains a free variable,
X, while the second sentence is closed. In this case, both variables are bound.