This worksheet deals with first-order logic, the most powerful kind of logic discussed in our module. Some of the questions below will require thorough attention and work to familiarize yourselves with the concepts and the notation from first-order logic. Also confer the literature: The book by Erciyes is a good source for beginners.
First, make sure that you understand how predicates work (see also Problem 4.6.3) and how the universal quantifier ∀ ("for all") and the existential quantifier ∃ ("there is") are used in first-order logic:
For the variables to which quantifiers are applied, the possible values are taken from what is referred to as the domain of quantification (or just the domain). Every model comes with a domain; e.g., if the model is visualized as a knowledge graph, the domain often consists of the nodes and node labels, or it consists of the nodes only. The domain might also consist of words in a language, numbers from a certain set (e.g., natural numbers), and similar.
Then, "∀x …" translates to "for all values from the domain of quantification, if assigned to x, …," and "∃x …" translates to "for at least one value from the domain of quantification, if assigned to x, …"
Assume that we are making statements about directed graphs using the binary predicate edge(), with edge(v, w) to be understood as "there is an edge from the vertex v to the vertex w."
Accordingly, the human-language expression "every node in the graph can be reached from every node by a path that consists of two edges" can be expressed by the first-order logic statement:
S0 = ∀x ∀y ∃z (edge(x, z) ∧ (edge(z, y)).
Consider the following three first-order logic statements which use a binary predicate greater_than(), with greater_than(v, w) to be understood as "the value v is greater than the value w."
S4 = ¬∃x ∃y (greater_than(x, y) ∧ greater_than(y, x))
S5 = ∀x ∀y ∀z ((greater_than(x, y) ∧ greater_than(y, z)) → greater_than(x, z))
S6 = ∀x ∃y greater_than(y, x)
Are the following statements satisfiable? (Defined just like for propositional logic: Can they become True? Do they have a model?)
Above, P(), Q(), and R() are predicates.
For first-order logic, entailment is defined in the same way as for propositional logic: Premises entail a conclusion if all the joint models of all the premises are also models of the conclusion. In other words, whenever all the premises become True, the conclusion must also be True. Here, consider the axioms S4, S5, and S6 from Problem 4.7.2 as premises.
This worksheet will be discussed in the 29th March 2022 lecture. If you are interested in feedback on your work, send an email to Oliver Kerr and Martin Horsch.