1Properties of Relational LogicComputational Logic Lecture 8Michael Genesereth Autumn 20112ProgrammeExpressiveness What we can say in First-Order Logic And what we cannotSemidecidability and Decidability Using Godel’s Completeness TheoremComplexity of Arithmetic Godel’s Incompleteness Theorem23StructuresA structure is a vector consisting of a universe ofdiscourse and values for the items in the signature of alanguage (when the signature is ordered).Interpretation: Signature →StructureNote that there is no additional information in astructure. It is just a different (but useful) way ofthinking about an interpretation.4ExampleSignature: 〈a, b, f, r〉Interpretation: |i| = {1, 2} i(a) = 1 i(b) = 2 i(f) = {1→2, 2→1} i(r) = {〈1,2〉, 〈1,1〉, 〈2,2〉}Structure:〈{1, 2}, 1, 2, {1→2, 2→1}, {〈1,2〉 , 〈1,1〉, 〈2,2〉}〉35DefinabilityOne of the roles of logic is to define classes ofstructures, distinguishing those that are in the classfrom those that are not.Example - Open Partial Orders: ¬r(x,x) r(x,y) ⇒ ¬r(y,x) r(x,y) ∧ r(y,z) ⇒ r(x,z)Examples: Non-Examples: {〈{a,b,c}, {〈a,b〉,〈b,c〉,〈a,c〉}〉 {〈{a,b,c}, {〈a,a〉,〈a,b〉,〈a,c〉}〉 {〈{a,b,c}, {〈a,b〉,〈a,c〉}〉 {〈{a,b,c}, {〈a,b〉,〈b,a〉}〉 {〈{a,b,c}, {}〉 {〈{a,b,c}, {〈a,b〉,〈b,c〉}〉6ExampleDefinition of Open Partial Orders: ¬r(x,x) r(x,y) ⇒ ¬r(y,x) r(x,y) ∧ r(y,z) ⇒ r(x,z)Examples: {〈{a,b,c}, {〈a,b〉,〈b,c〉,〈a,c〉}〉 {〈{a,b,c}, {〈a,b〉,〈a,c〉}〉 {〈{a,b,c}, {}〉Non-Examples: {〈{a,b,c}, {〈a,a〉,〈a,b〉,〈a,c〉}〉 {〈{a,b,c}, {〈a,b〉,〈b,a〉}〉 {〈{a,b,c}, {〈a,b〉,〈b,c〉}〉47Elementary EquivalenceNB: There are pairs of structures that cannot bedistinguished from each other in Relational Logic.Two structures are elementarily equivalent if and onlyif they satisfy the same set of sentences for allsignatures.8Examples〈{1,2}, 1, 2, {〈1,2〉, 〈2,1〉}〉〈{1,2}, 2, 1, {〈1,2〉, 〈2,1〉}〉〈{3,4}, 3, 4, {〈3,4〉, 〈4,3〉}〉〈{,}, , , {〈,〉, 〈,〉}〉Note, however, that these structures are isomorphic -they have the same structure.〈Q, <〉〈R, <〉59Transitivity TheoremIt is not possible in first-order logic to definetransitive closure in first-order logic.More precisely, it is not possible characterize the setof structures 〈U,p,r〉 consisting of an arbitraryuniverse U, an arbitrary binary relation p, and thetransitive closure r of that relation.NB: This is similar to the open partial ordersproblem earlier except that (1) we do not care aboutreflexivity and antisymmetry and (2) we care aboutthe relationship between two relations (p and r).10Really? What about this definition?r(x,z) ⇔ p(x,z) ∨ ∃y.(r(x,y) ∧ r(y,z))Counterexample 1:Counterexample 2:In other words, there is a point between every pair ofpoints between 3 and 4. Require infinite universe.Counterargument and Rebuttal1 321 32 4611Size of the UniverseModels with universes of at least size 2:∃x.∃y.(p(x) ∧ ¬p(y))∃x.∃y.(x≠y)Models with universes of at most size 2:∃x.∃y.∀z.(z=x ∨ z=y)Models with infinite universes:∀x.∀z.(r(x,z) ⇔ p(x,z) ∨ ∃y.(r(x,y) ∧ r(y,z)))∀x.∃y.(p(x,y) ∧ ¬r(x,z))12Lowenheim Skolem Tarski TheoremIf there is a model of a set of first-order sentences ofany infinite cardinality, then there is a model ofevery infinite cardinality.713ProgrammeExpressiveness What we can say in First-Order Logic And what we cannotSemidecidability and Decidability Using Godel’s Completeness TheoremComplexity of Arithmetic Godel’s Incompleteness Theorem14Logical EntailmentA set of premises logically entails a conclusion if andonly if every interpretation that satisfies the premisesalso satisfies the conclusion.815Formal ProofsA formal proof of ϕ from Δ is a sequence ofsentences terminating in ϕ in which each item iseither:1. a premise (a member of Δ)2. an instance of an axiom schema3. the result of applying a rule of inference to earlieritems in the sequence.A sentence ϕ is provable from a set of sentences Δ ifand only if there is a finite formal proof of ϕ from Δusing only Modus Ponens, Universal Generalization,and the Mendelson axiom schemata.16Soundness and CompletenessSoundness Theorem: If ϕ is provable from Δ, then Δlogically entails ϕ.Completeness Theorem (Godel): If Δ logically entailsϕ, then ϕ is provable from Δ.917DecidabilityA class of questions is decidable if and only if there isa procedure such that, when given as input anyquestion in the class, the procedure halts and says yesif the answer is positive and no if the answer isnegative.Example: For any natural number n, determiningwhether n is prime.18SemidecidabilityA class of questions is semidecidable if and only ifthere is a procedure that halts and says yes if theanswer is positive.Obvious Fact: If a class of questions is decidable, it issemidecidable.1019Semidecidability of Logical Entailmentproof <- kbgoal in proof?r <- choose(rules)p <- choose(proof)q <- choose(proof)c <- apply(r,p,q)proof <- proof|cSuccessgoalkbrules20Decidability Not ProvedNote that we have not shown that logical entailmentfor Relational Logic is decidable.The procedure may not halt.p(x) ⇒ p(f(x))p(f(f(a)))p(f(b))?We cannot just run procedure on negated sentencebecause that may not be logically entailed either!p(x) ⇒ p(f(x))p(f(f(a)))¬p(f(b))?1121Undecidability of Logical EntailmentMetatheorem: Logical Entailment for RelationalLogic is not decidable.Proof: Suppose there is a machine p that decides thequestion of logical entailment. Its inputs are Δ and ϕ.We can encode the behavior of this machine and itsinputs as sentences and ask whether the machine haltsas a conclusion.What happens if we give this description and questionto p? It says yes.YesNopΔφ22Undecidability (continued)It is possible to construct a larger machine p’ that entersan infinite loop if p says yes and halts if p says no.We can also encode a description of this machine as aset of sentences and ask whether the machine halts as aconclusion.What happens if we give this description and questionto p’? If p says yes, then p’ runs forever, contradictingthe hypothesis that p computes correctly. If p says no,then p’ halts, once again leading to contradiction. QEDNopHaltsΔ1223ClosureThe closure S* of a set S of sentences is the set of allsentences logically entailed
View Full Document