Introduction to Logic Programming

Size: px
Start display at page:

Download "Introduction to Logic Programming"

Transcription

1 Introduction to Logic Programming Foundations, First-Order Language Temur Kutsia RISC, Johannes Kepler University Linz, Austria

2 What is a Logic Program Logic program is a set of certain formulas of a first-order language. In this lecture: syntax and semantics of a first-order language.

3 Introductory Examples Representing John loves Mary : loves(john, Mary). loves: a binary predicate (relation) symbol. Intended meaning: The object in the first argument of loves loves the object in its second argument. John, Mary: constants. Intended meaning: To denote persons John and Mary, respectively.

4 Introductory Examples father: A unary function symbol. Intended meaning: The father of the object in its argument. John s father loves John: loves(father(john), John).

5 First-Order Language Syntax Semantics

6 Syntax Alphabet Terms Formulas

7 Alphabet A first-order alphabet consists of the following disjoint sets of symbols: A countable set of variables V. For each n 0, a set of n-ary function symbols F n. Elements of F 0 are called constants. For each n 0, a set of n-ary predicate symbols P n. Logical connectives,,,,. Quantifiers,. Parenthesis (, ), and comma,.

8 Alphabet A first-order alphabet consists of the following disjoint sets of symbols: A countable set of variables V. For each n 0, a set of n-ary function symbols F n. Elements of F 0 are called constants. For each n 0, a set of n-ary predicate symbols P n. Logical connectives,,,,. Quantifiers,. Parenthesis (, ), and comma,. Notation: x, y, z for variables. f, g for function symbols. a, b, c for constants. p, q for predicate symbols.

9 Terms Definition A variable is a term. If t 1,..., t n are terms and f F n, then f (t 1,..., t n ) is a term. Nothing else is a term.

10 Terms Definition A variable is a term. If t 1,..., t n are terms and f F n, then f (t 1,..., t n ) is a term. Nothing else is a term. Notation: s, t, r for terms.

11 Terms Definition A variable is a term. If t 1,..., t n are terms and f F n, then f (t 1,..., t n ) is a term. Nothing else is a term. Notation: s, t, r for terms. Example plus(plus(x, 1), x) is a term, where plus is a binary function symbol, 1 is a constant, x is a variable.

12 Terms Definition A variable is a term. If t 1,..., t n are terms and f F n, then f (t 1,..., t n ) is a term. Nothing else is a term. Notation: s, t, r for terms. Example plus(plus(x, 1), x) is a term, where plus is a binary function symbol, 1 is a constant, x is a variable. father(father(john)) is a term, where father is a unary function symbol and John is a constant.

13 Formulas Definition If t 1,..., t n are terms and p P n, then p(t 1,..., t n ) is a formula. It is called an atomic formula. If A is a formula, ( A) is a formula. If A and B are formulas, then (A B), (A B), (A B), and (A B) are formulas. If A is a formula, then ( x.a) and ( x.a) are formulas. Nothing else is a formula.

14 Formulas Definition If t 1,..., t n are terms and p P n, then p(t 1,..., t n ) is a formula. It is called an atomic formula. If A is a formula, ( A) is a formula. If A and B are formulas, then (A B), (A B), (A B), and (A B) are formulas. If A is a formula, then ( x.a) and ( x.a) are formulas. Nothing else is a formula. Notation: A, B for formulas.

15 Eliminating Parentheses Excessive use of parentheses often can be avoided by introducing binding order.,, bind stronger than. binds stronger than. binds stronger than and. Furthermore, Omit the outer parentheses and associate,,, to the right.

16 Eliminating Parentheses Example The formula ( y.( x.((p(x)) ( r(y))) (( q(x)) (A B))))) due to binding order can be rewritten into ( y.( x.(p(x) r(y) q(x) (A B)))) which thanks to the convention of the association to the right and omitting the outer parentheses further simplifies to y. x.(p(x) r(y) q(x) A B).

17 Example Translating English sentences into first-order logic formulas: 1. Every rational number is a real number. Assume: rational, real, prime: unary predicate symbols. : binary predicate symbol.

18 Example Translating English sentences into first-order logic formulas: 1. Every rational number is a real number. x.(rational(x) real(x)) Assume: rational, real, prime: unary predicate symbols. : binary predicate symbol.

19 Example Translating English sentences into first-order logic formulas: 1. Every rational number is a real number. x.(rational(x) real(x)) 2. There exists a number that is prime. Assume: rational, real, prime: unary predicate symbols. : binary predicate symbol.

20 Example Translating English sentences into first-order logic formulas: 1. Every rational number is a real number. x.(rational(x) real(x)) 2. There exists a number that is prime. x. prime(x) Assume: rational, real, prime: unary predicate symbols. : binary predicate symbol.

21 Example Translating English sentences into first-order logic formulas: 1. Every rational number is a real number. x.(rational(x) real(x)) 2. There exists a number that is prime. x. prime(x) 3. For every number x, there exists a number y such that x < y. Assume: rational, real, prime: unary predicate symbols. : binary predicate symbol.

22 Example Translating English sentences into first-order logic formulas: 1. Every rational number is a real number. x.(rational(x) real(x)) 2. There exists a number that is prime. x. prime(x) 3. For every number x, there exists a number y such that x < y. Assume: x. y. x < y rational, real, prime: unary predicate symbols. : binary predicate symbol.

23 Example Translating English sentences into first-order logic formulas: 1. There is no natural number whose immediate successor is 0. Assume: zero: constant succ, pred: unary function symbols. =:. binary predicate symbol.

24 Example Translating English sentences into first-order logic formulas: 1. There is no natural number whose immediate successor is 0. x.zero. = succ(x) Assume: zero: constant succ, pred: unary function symbols. =:. binary predicate symbol.

25 Example Translating English sentences into first-order logic formulas: 1. There is no natural number whose immediate successor is 0. x.zero. = succ(x) 2. For each natural number there exists exactly one immediate successor natural number. Assume: zero: constant succ, pred: unary function symbols. =:. binary predicate symbol.

26 Example Translating English sentences into first-order logic formulas: 1. There is no natural number whose immediate successor is 0. x.zero. = succ(x) 2. For each natural number there exists exactly one immediate successor natural number. x. y.(y. = succ(x) z.(z. = succ(x) y. = z)) Assume: zero: constant succ, pred: unary function symbols. =:. binary predicate symbol.

27 Example Translating English sentences into first-order logic formulas: 1. There is no natural number whose immediate successor is 0. x.zero. = succ(x) 2. For each natural number there exists exactly one immediate successor natural number. x. y.(y. = succ(x) z.(z. = succ(x) y. = z)) 3. For each nonzero natural number there exists exactly one immediate predecessor natural number. Assume: zero: constant succ, pred: unary function symbols. =:. binary predicate symbol.

28 Example Translating English sentences into first-order logic formulas: 1. There is no natural number whose immediate successor is 0. x.zero. = succ(x) 2. For each natural number there exists exactly one immediate successor natural number. x. y.(y. = succ(x) z.(z. = succ(x) y. = z)) 3. For each nonzero natural number there exists exactly one immediate predecessor natural number. x.( (x. = zero) y.(y. = pred(x) z.(z. = pred(x) y. = z))) Assume: zero: constant succ, pred: unary function symbols. =:. binary predicate symbol.

29 Semantics Meaning of a first-order language consists of an universe and an appropriate meaning of each symbol. This pair is called structure. Structure fixes interpretation of function and predicate symbols. Meaning of variables is determined by a variable assignment. Interpretation of terms and formulas.

30 Structure Structure: a pair (D, I). D is a nonempty universe, the domain of interpretation. I is an interpretation function defined on D that fixes the meaning of each symbol associating to each f F n an n-ary function f I : D n D, (in particular, c I D for each constant c) to each p P n different from. =, an n-ary relation p I on D.

31 Variable Assignment A structure S = (D, I) is given. Variable assignment σ S maps each x V into an element of D: σ S (x) D. Given a variable x, an assignment ϑ S is called an x-variant of σ S iff ϑ S (y) = σ S (y) for all y x.

32 Interpretation of Terms A structure S = (D, I) and a variable assignment σ S are given.

33 Interpretation of Terms A structure S = (D, I) and a variable assignment σ S are given. Value of a term t under S and σ S, Val S,σS (t): Val S,σS (x) = σ S (x). Val S,σS (f (t 1,..., t n )) = f I (Val S,σS (t 1 ),..., Val S,σS (t n )).

34 Interpretation of Formulas A structure S = (D, I) and a variable assignment σ S are given.

35 Interpretation of Formulas A structure S = (D, I) and a variable assignment σ S are given. Value of an atomic formula under S and σ S is one of true, false:

36 Interpretation of Formulas A structure S = (D, I) and a variable assignment σ S are given. Value of an atomic formula under S and σ S is one of true, false: Val S,σS (s =. t) = true iff Val S,σS (s) = Val S,σS (t).

37 Interpretation of Formulas A structure S = (D, I) and a variable assignment σ S are given. Value of an atomic formula under S and σ S is one of true, false: Val S,σS (s =. t) = true iff Val S,σS (s) = Val S,σS (t). Val S,σS (p(t 1,..., t n )) = true iff (Val S,σS (t 1 ),..., Val S,σS (t n )) p I.

38 Interpretation of Formulas A structure S = (D, I) and a variable assignment σ S are given.

39 Interpretation of Formulas A structure S = (D, I) and a variable assignment σ S are given. Values of compound formulas under S and σ S are also either true or false:

40 Interpretation of Formulas A structure S = (D, I) and a variable assignment σ S are given. Values of compound formulas under S and σ S are also either true or false: ValS,σS ( A) = true iff Val S,σS (A) = false.

41 Interpretation of Formulas A structure S = (D, I) and a variable assignment σ S are given. Values of compound formulas under S and σ S are also either true or false: ValS,σS ( A) = true iff Val S,σS (A) = false. ValS,σS (A B) = true iff Val S,σS (A) = true or Val S,σS (B) = true.

42 Interpretation of Formulas A structure S = (D, I) and a variable assignment σ S are given. Values of compound formulas under S and σ S are also either true or false: ValS,σS ( A) = true iff Val S,σS (A) = false. ValS,σS (A B) = true iff Val S,σS (A) = true or Val S,σS (B) = true. Val S,σS (A B) = true iff Val S,σS (A) = true and Val S,σS (B) = true.

43 Interpretation of Formulas A structure S = (D, I) and a variable assignment σ S are given. Values of compound formulas under S and σ S are also either true or false: ValS,σS ( A) = true iff Val S,σS (A) = false. ValS,σS (A B) = true iff Val S,σS (A) = true or Val S,σS (B) = true. Val S,σS (A B) = true iff Val S,σS (A) = true and Val S,σS (B) = true. Val S,σS (A B) = true iff Val S,σS (A) = false or Val S,σS (B) = true.

44 Interpretation of Formulas A structure S = (D, I) and a variable assignment σ S are given. Values of compound formulas under S and σ S are also either true or false: ValS,σS ( A) = true iff Val S,σS (A) = false. ValS,σS (A B) = true iff Val S,σS (A) = true or Val S,σS (B) = true. Val S,σS (A B) = true iff Val S,σS (A) = true and Val S,σS (B) = true. Val S,σS (A B) = true iff Val S,σS (A) = false or Val S,σS (B) = true. ValS,σS (A B) = true iff Val S,σS (A) = Val S,σS (B).

45 Interpretation of Formulas A structure S = (D, I) and a variable assignment σ S are given. Values of compound formulas under S and σ S are also either true or false: ValS,σS ( A) = true iff Val S,σS (A) = false. ValS,σS (A B) = true iff Val S,σS (A) = true or Val S,σS (B) = true. Val S,σS (A B) = true iff Val S,σS (A) = true and Val S,σS (B) = true. Val S,σS (A B) = true iff Val S,σS (A) = false or Val S,σS (B) = true. ValS,σS (A B) = true iff Val S,σS (A) = Val S,σS (B). ValS,σS ( x.a) = true iff Val S,ϑS (A) = true for some x-variant ϑ S of σ S.

46 Interpretation of Formulas A structure S = (D, I) and a variable assignment σ S are given. Values of compound formulas under S and σ S are also either true or false: ValS,σS ( A) = true iff Val S,σS (A) = false. ValS,σS (A B) = true iff Val S,σS (A) = true or Val S,σS (B) = true. Val S,σS (A B) = true iff Val S,σS (A) = true and Val S,σS (B) = true. Val S,σS (A B) = true iff Val S,σS (A) = false or Val S,σS (B) = true. ValS,σS (A B) = true iff Val S,σS (A) = Val S,σS (B). ValS,σS ( x.a) = true iff Val S,ϑS (A) = true for some x-variant ϑ S of σ S. Val S,σS ( x.a) = true iff Val S,ϑS (A) = true for all x-variants ϑ S of σ S.

47 Interpretation of Formulas A structure S = (D, I) is given.

48 Interpretation of Formulas A structure S = (D, I) is given. The value of a formula A under S is either true or false: ValS (A) = true iff Val S, σ S (A) = true for all σ S.

49 Interpretation of Formulas A structure S = (D, I) is given. The value of a formula A under S is either true or false: ValS (A) = true iff Val S, σ S (A) = true for all σ S. S is called a model of A iff Val S (A) = true.

50 Interpretation of Formulas A structure S = (D, I) is given. The value of a formula A under S is either true or false: ValS (A) = true iff Val S, σ S (A) = true for all σ S. S is called a model of A iff Val S (A) = true. Written S A.

51 Example Formula: x.(p(x) q(f (x), a))

52 Example Formula: x.(p(x) q(f (x), a)) Define S = (D, I) as D = {1, 2}, ai = 1, fi (1) = 2, f I (2) = 1, p I = {2}, q I = {(1, 1), (1, 2), (2, 2)}.

53 Example Formula: x.(p(x) q(f (x), a)) Define S = (D, I) as D = {1, 2}, ai = 1, fi (1) = 2, f I (2) = 1, p I = {2}, q I = {(1, 1), (1, 2), (2, 2)}. If σ S (x) = 1, then Val S,σS ( x.(p(x) q(f (x), a))) = true.

54 Example Formula: x.(p(x) q(f (x), a)) Define S = (D, I) as D = {1, 2}, ai = 1, fi (1) = 2, f I (2) = 1, p I = {2}, q I = {(1, 1), (1, 2), (2, 2)}. If σ S (x) = 1, then Val S,σS ( x.(p(x) q(f (x), a))) = true. If σ S (x) = 2, then Val S,σS ( x.(p(x) q(f (x), a))) = true.

55 Example Formula: x.(p(x) q(f (x), a)) Define S = (D, I) as D = {1, 2}, ai = 1, fi (1) = 2, f I (2) = 1, p I = {2}, q I = {(1, 1), (1, 2), (2, 2)}. If σ S (x) = 1, then Val S,σS ( x.(p(x) q(f (x), a))) = true. If σ S (x) = 2, then Val S,σS ( x.(p(x) q(f (x), a))) = true. Hence, S A.

56 Validity, Unsatisfiability A formula A is valid, if S A for all S. Written A.

57 Validity, Unsatisfiability A formula A is valid, if S A for all S. Written A. A formula A is unsatisfiable, if S A for no S.

58 Validity, Unsatisfiability A formula A is valid, if S A for all S. Written A. A formula A is unsatisfiable, if S A for no S. If A is valid, then A is unsatisfiable and vice versa.

59 Validity, Unsatisfiability A formula A is valid, if S A for all S. Written A. A formula A is unsatisfiable, if S A for no S. If A is valid, then A is unsatisfiable and vice versa. The notions extend to (multi)sets of formulas.

60 Validity, Unsatisfiability A formula A is valid, if S A for all S. Written A. A formula A is unsatisfiable, if S A for no S. If A is valid, then A is unsatisfiable and vice versa. The notions extend to (multi)sets of formulas. For {A 1,..., A n }, just formulate them for A 1 A n.

61 Validity, Unsatisfiability A formula A is valid, if S A for all S. Written A. A formula A is unsatisfiable, if S A for no S. If A is valid, then A is unsatisfiable and vice versa. The notions extend to (multi)sets of formulas. For {A 1,..., A n }, just formulate them for A 1 A n. Formulas

62 Validity, Unsatisfiability A formula A is valid, if S A for all S. Written A. A formula A is unsatisfiable, if S A for no S. If A is valid, then A is unsatisfiable and vice versa. The notions extend to (multi)sets of formulas. For {A 1,..., A n }, just formulate them for A 1 A n. Valid Non-valid

63 Validity, Unsatisfiability A formula A is valid, if S A for all S. Written A. A formula A is unsatisfiable, if S A for no S. If A is valid, then A is unsatisfiable and vice versa. The notions extend to (multi)sets of formulas. For {A 1,..., A n }, just formulate them for A 1 A n. Valid Non-valid Satisfiable Unsat

64 Validity, Unsatisfiability A formula A is valid, if S A for all S. Written A. A formula A is unsatisfiable, if S A for no S. If A is valid, then A is unsatisfiable and vice versa. The notions extend to (multi)sets of formulas. For {A 1,..., A n }, just formulate them for A 1 A n. Valid Non-valid sat Unsat

65 Validity, Unsatisfiability Valid Non-valid sat Unsat x.p(x) y.p(y) is valid. p(a) x.p(x) is satisfiable non-valid. x.p(x) y. p(y) is unsatisfiable.

66 Logical Consequence Definition A formula A is a logical consequence of the formulas B 1,..., B n, if every model of B 1 B n is a model of A.

67 Logical Consequence Definition A formula A is a logical consequence of the formulas B 1,..., B n, if every model of B 1 B n is a model of A. Example mortal(socrates) is a logical consequence of x.(person(x) mortal(x)) and person(socrates). cooked(apple) is a logical consequence of x.( cooked(x) tasty(x)) and tasty(apple). genius(einstein) is not a logical consequence of x.person(x) genius(x) and person(einstein).

68 Logic Programs Logic programs: finite non-empty sets of formulas of a special form, called program clauses.

69 Logic Programs Logic programs: finite non-empty sets of formulas of a special form, called program clauses. Program clause: where x x k. B 1 B n A, k, n 0, A and the B s are atomic formulas, x1,..., x k are all the variables which occur in A, B 1,..., B n.

70 Logic Programs Logic programs: finite non-empty sets of formulas of a special form, called program clauses. Program clause: where x x k. B 1 B n A, k, n 0, A and the B s are atomic formulas, x1,..., x k are all the variables which occur in A, B 1,..., B n. Usually written in the inverse implication form without quantifiers and conjunctions: A B 1,..., B n

71 Goal Goals or queries of logic programs: formulas of the form x x k. B 1 B n, where k, n 0, the B s are atomic formulas, x1,..., x k are all the variables which occur in B 1,..., B n.

72 Goal Goals or queries of logic programs: formulas of the form x x k. B 1 B n, where k, n 0, the B s are atomic formulas, x1,..., x k are all the variables which occur in B 1,..., B n. Usually written without quantifiers and conjunction: B 1,..., B n

73 Goal Goals or queries of logic programs: formulas of the form x x k. B 1 B n, where k, n 0, the B s are atomic formulas, x1,..., x k are all the variables which occur in B 1,..., B n. Usually written without quantifiers and conjunction: B 1,..., B n The problem is to find out whether a goal is a logical consequence of the given logic program or not.

74 The Problem and the Idea Let P be a program and G be a goal. Problem: Is G a logical consequence of P?

75 The Problem and the Idea Let P be a program and G be a goal. Problem: Is G a logical consequence of P? Idea: Try to show that the set of formulas P { G} is inconsistent.

76 The Problem and the Idea Let P be a program and G be a goal. Problem: Is G a logical consequence of P? Idea: Try to show that the set of formulas P { G} is inconsistent. How? This we will learn in this course.

77 Example Let P consist of the two clauses: x.mortal(x) person(x). person(socrates). Goal: G = x.mortal(x).

78 Example Let P consist of the two clauses: x.mortal(x) person(x). person(socrates). Goal: G = x.mortal(x). G is equivalent to x. mortal(x).

79 Example Let P consist of the two clauses: x.mortal(x) person(x). person(socrates). Goal: G = x.mortal(x). G is equivalent to x. mortal(x). The set { x.mortal(x) person(x), person(socrates), x. mortal(x)} is inconsistent.

80 Example Let P consist of the two clauses: x.mortal(x) person(x). person(socrates). Goal: G = x.mortal(x). G is equivalent to x. mortal(x). The set { x.mortal(x) person(x), person(socrates), x. mortal(x)} is inconsistent. Hence, G is a logical consequence of P.

81 Example Let P consist of the two clauses: x.mortal(x) person(x). person(socrates). Goal: G = x.mortal(x). G is equivalent to x. mortal(x). The set { x.mortal(x) person(x), person(socrates), x. mortal(x)} is inconsistent. Hence, G is a logical consequence of P. We can even compute the witness term for the goal: x = socrates.

82 Example Let P consist of the two clauses: x.mortal(x) person(x). person(socrates). Goal: G = x.mortal(x). G is equivalent to x. mortal(x). The set { x.mortal(x) person(x), person(socrates), x. mortal(x)} is inconsistent. Hence, G is a logical consequence of P. We can even compute the witness term for the goal: x = socrates. How? This we will learn in this lecture.

What is a Logic Program. Introduction to Logic Programming. Introductory Examples. Introductory Examples. Foundations, First-Order Language

What is a Logic Program. Introduction to Logic Programming. Introductory Examples. Introductory Examples. Foundations, First-Order Language What is a Logic Program Introduction to Logic Programming Foundations, First-Order Language Temur Kutsia Research Institute for Symbolic Computation Johannes Kepler University Linz, Austria kutsia@risc.jku.at

More information

Overview. CS389L: Automated Logical Reasoning. Lecture 6: First Order Logic Syntax and Semantics. Constants in First-Order Logic.

Overview. CS389L: Automated Logical Reasoning. Lecture 6: First Order Logic Syntax and Semantics. Constants in First-Order Logic. Overview CS389L: Automated Logical Reasoning Lecture 6: First Order Logic Syntax and Semantics Işıl Dillig So far: Automated reasoning in propositional logic. Propositional logic is simple and easy to

More information

Automated Reasoning Systems

Automated Reasoning Systems Automated Reasoning Systems Resolution Theorem Proving: Prover9 Temur Kutsia RISC, Johannes Kepler University of Linz, Austria kutsia@risc.uni-linz.ac.at May 11, 2011 Prover9 Automated theorem prover from

More information

Lecture 4: January 12, 2015

Lecture 4: January 12, 2015 32002: AI (First Order Predicate Logic, Interpretation and Inferences) Spring 2015 Lecturer: K.R. Chowdhary Lecture 4: January 12, 2015 : Professor of CS (VF) Disclaimer: These notes have not been subjected

More information

Lecture 5: Predicate Calculus. ffl Predicate Logic ffl The Language ffl Semantics: Structures

Lecture 5: Predicate Calculus. ffl Predicate Logic ffl The Language ffl Semantics: Structures Lecture 5: Predicate Calculus ffl Predicate Logic ffl The Language ffl Semantics: Structures 1 Why Predicate Logic? Propositional logic is not powerful enough to express statements such as ffl For every

More information

Chapter 1.3 Quantifiers, Predicates, and Validity. Reading: 1.3 Next Class: 1.4. Motivation

Chapter 1.3 Quantifiers, Predicates, and Validity. Reading: 1.3 Next Class: 1.4. Motivation Chapter 1.3 Quantifiers, Predicates, and Validity Reading: 1.3 Next Class: 1.4 1 Motivation Propositional logic allows to translate and prove certain arguments from natural language If John s wallet was

More information

Foundations of AI. 9. Predicate Logic. Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution

Foundations of AI. 9. Predicate Logic. Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution Foundations of AI 9. Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution Wolfram Burgard, Andreas Karwath, Bernhard Nebel, and Martin Riedmiller 09/1 Contents Motivation

More information

Chapter 3: Propositional Languages

Chapter 3: Propositional Languages Chapter 3: Propositional Languages We define here a general notion of a propositional language. We show how to obtain, as specific cases, various languages for propositional classical logic and some non-classical

More information

Review Material: First Order Logic (FOL)

Review Material: First Order Logic (FOL) Information Integration on the WEB with RDF, OWL and SPARQL Review Material: First Order Logic (FOL) Grant Weddell October 7, 2013 Syntax of FOL Signatures Vocabularies are called signatures in FOL. The

More information

Notes. Notes. Introduction. Notes. Propositional Functions. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry.

Notes. Notes. Introduction. Notes. Propositional Functions. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry Spring 2006 1 / 1 Computer Science & Engineering 235 Introduction to Discrete Mathematics Sections 1.3 1.4 of Rosen cse235@cse.unl.edu Introduction

More information

Integrity Constraints (Chapter 7.3) Overview. Bottom-Up. Top-Down. Integrity Constraint. Disjunctive & Negative Knowledge. Proof by Refutation

Integrity Constraints (Chapter 7.3) Overview. Bottom-Up. Top-Down. Integrity Constraint. Disjunctive & Negative Knowledge. Proof by Refutation CSE560 Class 10: 1 c P. Heeman, 2010 Integrity Constraints Overview Disjunctive & Negative Knowledge Resolution Rule Bottom-Up Proof by Refutation Top-Down CSE560 Class 10: 2 c P. Heeman, 2010 Integrity

More information

Part I Logic programming paradigm

Part I Logic programming paradigm Part I Logic programming paradigm 1 Logic programming and pure Prolog 1.1 Introduction 3 1.2 Syntax 4 1.3 The meaning of a program 7 1.4 Computing with equations 9 1.5 Prolog: the first steps 15 1.6 Two

More information

Warm-Up Problem. Let L be the language consisting of as constant symbols, as a function symbol and as a predicate symbol. Give an interpretation where

Warm-Up Problem. Let L be the language consisting of as constant symbols, as a function symbol and as a predicate symbol. Give an interpretation where Warm-Up Problem Let L be the language consisting of as constant symbols, as a function symbol and as a predicate symbol Give an interpretation where is false Use a finite domain in your interpretation

More information

SC/MATH Boolean Formulae. Ref: G. Tourlakis, Mathematical Logic, John Wiley & Sons, York University

SC/MATH Boolean Formulae. Ref: G. Tourlakis, Mathematical Logic, John Wiley & Sons, York University SC/MATH 1090 1- Boolean Formulae Ref: G. Tourlakis, Mathematical Logic, John Wiley & Sons, 2008. York University Department of Computer Science and Engineering York University- MATH 1090 01-Boolean 1 Overview

More information

Resolution (14A) Young W. Lim 6/14/14

Resolution (14A) Young W. Lim 6/14/14 Copyright (c) 2013-2014. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free

More information

CSE 20 DISCRETE MATH. Fall

CSE 20 DISCRETE MATH. Fall CSE 20 DISCRETE MATH Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/ Final exam The final exam is Saturday December 16 11:30am-2:30pm. Lecture A will take the exam in Lecture B will take the exam

More information

Chapter 2 & 3: Representations & Reasoning Systems (2.2)

Chapter 2 & 3: Representations & Reasoning Systems (2.2) Chapter 2 & 3: A Representation & Reasoning System & Using Definite Knowledge Representations & Reasoning Systems (RRS) (2.2) Simplifying Assumptions of the Initial RRS (2.3) Datalog (2.4) Semantics (2.5)

More information

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/27

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/27 CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter 2.1-2.7 p. 1/27 CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer

More information

Logic Programming and Resolution Lecture notes for INF3170/4171

Logic Programming and Resolution Lecture notes for INF3170/4171 Logic Programming and Resolution Lecture notes for INF3170/4171 Leif Harald Karlsen Autumn 2015 1 Introduction This note will explain the connection between logic and computer programming using Horn Clauses

More information

Module 6. Knowledge Representation and Logic (First Order Logic) Version 2 CSE IIT, Kharagpur

Module 6. Knowledge Representation and Logic (First Order Logic) Version 2 CSE IIT, Kharagpur Module 6 Knowledge Representation and Logic (First Order Logic) 6.1 Instructional Objective Students should understand the advantages of first order logic as a knowledge representation language Students

More information

Lecture 7: January 15, 2014

Lecture 7: January 15, 2014 32002: AI (First order Predicate Logic, Syntax and Semantics) Spring 2014 Lecturer: K.R. Chowdhary Lecture 7: January 15, 2014 : Professor of CS (GF) Disclaimer: These notes have not been subjected to

More information

Introduction to Logic Programming

Introduction to Logic Programming Introduction to Logic Programming York University CSE 3401 Vida Movahedi York University CSE 3401 V. Movahedi 1 Overview Programming Language Paradigms Logic Programming Functional Programming Brief review

More information

Computer Science and Mathematics. Part I: Fundamental Mathematical Concepts Winfried Kurth

Computer Science and Mathematics. Part I: Fundamental Mathematical Concepts Winfried Kurth Computer Science and Mathematics Part I: Fundamental Mathematical Concepts Winfried Kurth http://www.uni-forst.gwdg.de/~wkurth/csm17_home.htm 1. Mathematical Logic Propositions - can be either true or

More information

CSE 20 DISCRETE MATH. Winter

CSE 20 DISCRETE MATH. Winter CSE 20 DISCRETE MATH Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/ Final exam The final exam is Saturday March 18 8am-11am. Lecture A will take the exam in GH 242 Lecture B will take the exam

More information

Set 7: Predicate logic Chapter 8 R&N. ICS 271 Fall 2015

Set 7: Predicate logic Chapter 8 R&N. ICS 271 Fall 2015 Set 7: Predicate logic Chapter 8 R&N ICS 271 Fall 2015 Outline New ontology objects, relations, properties, functions New Syntax Constants, predicates, properties, functions New semantics meaning of new

More information

Lecture 5. Logic I. Statement Logic

Lecture 5. Logic I. Statement Logic Ling 726: Mathematical Linguistics, Logic. Statement Logic V. Borschev and B. Partee, September 27, 2 p. Lecture 5. Logic I. Statement Logic. Statement Logic...... Goals..... Syntax of Statement Logic....2.

More information

15-819M: Data, Code, Decisions

15-819M: Data, Code, Decisions 15-819M: Data, Code, Decisions 08: First-Order Logic André Platzer aplatzer@cs.cmu.edu Carnegie Mellon University, Pittsburgh, PA André Platzer (CMU) 15-819M/08: Data, Code, Decisions 1 / 40 Outline 1

More information

LTCS Report. Concept Descriptions with Set Constraints and Cardinality Constraints. Franz Baader. LTCS-Report 17-02

LTCS Report. Concept Descriptions with Set Constraints and Cardinality Constraints. Franz Baader. LTCS-Report 17-02 Technische Universität Dresden Institute for Theoretical Computer Science Chair for Automata Theory LTCS Report Concept Descriptions with Set Constraints and Cardinality Constraints Franz Baader LTCS-Report

More information

Automated Reasoning. Natural Deduction in First-Order Logic

Automated Reasoning. Natural Deduction in First-Order Logic Automated Reasoning Natural Deduction in First-Order Logic Jacques Fleuriot Automated Reasoning Lecture 4, page 1 Problem Consider the following problem: Every person has a heart. George Bush is a person.

More information

Definition: A context-free grammar (CFG) is a 4- tuple. variables = nonterminals, terminals, rules = productions,,

Definition: A context-free grammar (CFG) is a 4- tuple. variables = nonterminals, terminals, rules = productions,, CMPSCI 601: Recall From Last Time Lecture 5 Definition: A context-free grammar (CFG) is a 4- tuple, variables = nonterminals, terminals, rules = productions,,, are all finite. 1 ( ) $ Pumping Lemma for

More information

SOFTWARE ENGINEERING DESIGN I

SOFTWARE ENGINEERING DESIGN I 2 SOFTWARE ENGINEERING DESIGN I 3. Schemas and Theories The aim of this course is to learn how to write formal specifications of computer systems, using classical logic. The key descriptional technique

More information

logic importance logic importance (2) logic importance (3) specializations of logic Horn logic specializations of logic RDF and OWL

logic importance logic importance (2) logic importance (3) specializations of logic Horn logic specializations of logic RDF and OWL logic importance - high-level language for expressing knowledge - high expressive power - well-understood formal semantics - precise notion of logical consequence - systems that can automatically derive

More information

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 37 Resolution Rules

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 37 Resolution Rules Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras Lecture - 37 Resolution Rules If some literals can be unified, the same algorithm should be able

More information

Constraint Solving. Systems and Internet Infrastructure Security

Constraint Solving. Systems and Internet Infrastructure Security Systems and Internet Infrastructure Security Network and Security Research Center Department of Computer Science and Engineering Pennsylvania State University, University Park PA Constraint Solving Systems

More information

This book is licensed under a Creative Commons Attribution 3.0 License

This book is licensed under a Creative Commons Attribution 3.0 License 6. Syntax Learning objectives: syntax and semantics syntax diagrams and EBNF describe context-free grammars terminal and nonterminal symbols productions definition of EBNF by itself parse tree grammars

More information

CSL105: Discrete Mathematical Structures. Ragesh Jaiswal, CSE, IIT Delhi

CSL105: Discrete Mathematical Structures. Ragesh Jaiswal, CSE, IIT Delhi is another way of showing that an argument is correct. Definitions: Literal: A variable or a negation of a variable is called a literal. Sum and Product: A disjunction of literals is called a sum and a

More information

Decision Procedures in First Order Logic

Decision Procedures in First Order Logic in First Order Logic for Equality Logic Daniel Kroening and Ofer Strichman 1 Outline Introduction Definition, complexity Reducing Uninterpreted Functions to Equality Logic Using Uninterpreted Functions

More information

Recap Datalog Datalog Syntax Datalog Semantics. Logic: Datalog. CPSC 322 Logic 6. Textbook Logic: Datalog CPSC 322 Logic 6, Slide 1

Recap Datalog Datalog Syntax Datalog Semantics. Logic: Datalog. CPSC 322 Logic 6. Textbook Logic: Datalog CPSC 322 Logic 6, Slide 1 Logic: Datalog CPSC 322 Logic 6 Textbook 12.2 Logic: Datalog CPSC 322 Logic 6, Slide 1 Lecture Overview 1 Recap 2 Datalog 3 Datalog Syntax 4 Datalog Semantics Logic: Datalog CPSC 322 Logic 6, Slide 2 Top-down

More information

CS 512, Spring 2017: Take-Home End-of-Term Examination

CS 512, Spring 2017: Take-Home End-of-Term Examination CS 512, Spring 2017: Take-Home End-of-Term Examination Out: Tuesday, 9 May 2017, 12:00 noon Due: Wednesday, 10 May 2017, by 11:59 am Turn in your solutions electronically, as a single PDF file, by placing

More information

This is already grossly inconvenient in present formalisms. Why do we want to make this convenient? GENERAL GOALS

This is already grossly inconvenient in present formalisms. Why do we want to make this convenient? GENERAL GOALS 1 THE FORMALIZATION OF MATHEMATICS by Harvey M. Friedman Ohio State University Department of Mathematics friedman@math.ohio-state.edu www.math.ohio-state.edu/~friedman/ May 21, 1997 Can mathematics be

More information

Logic as a framework for NL semantics. Outline. Syntax of FOL [1] Semantic Theory Type Theory

Logic as a framework for NL semantics. Outline. Syntax of FOL [1] Semantic Theory Type Theory Logic as a framework for NL semantics Semantic Theory Type Theory Manfred Pinkal Stefan Thater Summer 2007 Approximate NL meaning as truth conditions. Logic supports precise, consistent and controlled

More information

Lecture 1. 1 Notation

Lecture 1. 1 Notation Lecture 1 (The material on mathematical logic is covered in the textbook starting with Chapter 5; however, for the first few lectures, I will be providing some required background topics and will not be

More information

Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 6 Outline. Unary Relational Operations: SELECT and

Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 6 Outline. Unary Relational Operations: SELECT and Chapter 6 The Relational Algebra and Relational Calculus Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 6 Outline Unary Relational Operations: SELECT and PROJECT Relational

More information

Introduction to Sets and Logic (MATH 1190)

Introduction to Sets and Logic (MATH 1190) Introduction to Sets and Logic () Instructor: Email: shenlili@yorku.ca Department of Mathematics and Statistics York University Dec 4, 2014 Outline 1 2 3 4 Definition A relation R from a set A to a set

More information

CS 6110 S14 Lecture 38 Abstract Interpretation 30 April 2014

CS 6110 S14 Lecture 38 Abstract Interpretation 30 April 2014 CS 6110 S14 Lecture 38 Abstract Interpretation 30 April 2014 1 Introduction to Abstract Interpretation At this point in the course, we have looked at several aspects of programming languages: operational

More information

Propositional Logic Formal Syntax and Semantics. Computability and Logic

Propositional Logic Formal Syntax and Semantics. Computability and Logic Propositional Logic Formal Syntax and Semantics Computability and Logic Syntax and Semantics Syntax: The study of how expressions are structured (think: grammar) Semantics: The study of the relationship

More information

Introduction & Review

Introduction & Review Introduction & Review York University Department of Computer Science and Engineering 1 Why this course? Overview Programming Language Paradigms Brief review of Logic Propositional logic Predicate logic

More information

CS 321 Programming Languages and Compilers. Prolog

CS 321 Programming Languages and Compilers. Prolog CS 321 Programming Languages and Compilers Prolog Prolog PROgramming LOGic Algorithm = Logic + Control Logic programming deals with computing relations rather than functions. To understand Prolog one must

More information

F. Brief review of classical predicate logic (PC)

F. Brief review of classical predicate logic (PC) F. Brief review of classical predicate logic (PC) F.I. Syntax (LfP 4.1) F.I.1. Primitive symbols Primitive vocabulary of PC (LfP 90): connectives: Ñ,, @ variables: x, y,... (with or without numerical subscripts)

More information

Lexicografie computationala Feb., 2012

Lexicografie computationala Feb., 2012 Lexicografie computationala Feb., 2012 Anca Dinu University of Bucharest Introduction When we construct meaning representations systematically, we integrate information from two different sources: 1. The

More information

Automata Theory for Reasoning about Actions

Automata Theory for Reasoning about Actions Automata Theory for Reasoning about Actions Eugenia Ternovskaia Department of Computer Science, University of Toronto Toronto, ON, Canada, M5S 3G4 eugenia@cs.toronto.edu Abstract In this paper, we show

More information

Mathematical Logic

Mathematical Logic Mathematical Logic - 2017 Exercises: DPLL and First Order Logics (FOL) Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia, Rui Zhang, Vincenzo Maltese and Mattia Fumagalli

More information

Going beyond propositional logic

Going beyond propositional logic Going beyond propositional logic Consider the following statements: p: Ling took CS245 q: Ling passed CS245 r: Ling failed CS245 Taken literally, these are all atomic statements, and formally they have

More information

CSC Discrete Math I, Spring Sets

CSC Discrete Math I, Spring Sets CSC 125 - Discrete Math I, Spring 2017 Sets Sets A set is well-defined, unordered collection of objects The objects in a set are called the elements, or members, of the set A set is said to contain its

More information

Decision Procedures for Equality Logic. Daniel Kroening and Ofer Strichman 1

Decision Procedures for Equality Logic. Daniel Kroening and Ofer Strichman 1 in First Order Logic for Equality Logic Daniel Kroening and Ofer Strichman 1 Outline Introduction Definition, complexity Reducing Uninterpreted Functions to Equality Logic Using Uninterpreted Functions

More information

8. Relational Calculus (Part II)

8. Relational Calculus (Part II) 8. Relational Calculus (Part II) Relational Calculus, as defined in the previous chapter, provides the theoretical foundations for the design of practical data sub-languages (DSL). In this chapter, we

More information

First Order Logic Semantics (3A) Young W. Lim 6/1/17

First Order Logic Semantics (3A) Young W. Lim 6/1/17 First Order Logic Semantics (3A) Young W. Lim Copyright (c) 2016-2017 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License,

More information

PCP and Hardness of Approximation

PCP and Hardness of Approximation PCP and Hardness of Approximation January 30, 2009 Our goal herein is to define and prove basic concepts regarding hardness of approximation. We will state but obviously not prove a PCP theorem as a starting

More information

Data types for mcrl2

Data types for mcrl2 Data types for mcrl2 Aad Mathijssen April 5, 2018 We provide a syntax for the standard data types of the mcrl2 language. This syntax is intended to be a practical mix between standard mathematical notation

More information

Automatic Reasoning (Section 8.3)

Automatic Reasoning (Section 8.3) Automatic Reasoning (Section 8.3) Automatic Reasoning Can reasoning be automated? Yes, for some logics, including first-order logic. We could try to automate natural deduction, but there are many proof

More information

Semantics and Pragmatics of NLP Propositional Logic, Predicates and Functions

Semantics and Pragmatics of NLP Propositional Logic, Predicates and Functions , Semantics and Pragmatics of NLP, and s Alex Ewan School of Informatics University of Edinburgh 10 January 2008 , 1 2 3 4 Why Bother?, Aim: 1 To associate NL expressions with semantic representations;

More information

COMP2411 Lecture 20: Logic Programming Examples. (This material not in the book)

COMP2411 Lecture 20: Logic Programming Examples. (This material not in the book) COMP2411 Lecture 20: Logic Programming Examples (This material not in the book) There are several distinct but often equivalent ways to think about logic programs 1. As computing logical consequences of

More information

CSE-321 Programming Languages 2010 Midterm

CSE-321 Programming Languages 2010 Midterm Name: Hemos ID: CSE-321 Programming Languages 2010 Midterm Score Prob 1 Prob 2 Prob 3 Prob 4 Total Max 15 30 35 20 100 1 1 SML Programming [15 pts] Question 1. [5 pts] Give a tail recursive implementation

More information

Logic and Databases. Phokion G. Kolaitis. UC Santa Cruz & IBM Research - Almaden

Logic and Databases. Phokion G. Kolaitis. UC Santa Cruz & IBM Research - Almaden Logic and Databases Phokion G. Kolaitis UC Santa Cruz & IBM Research - Almaden 1 Logic and Databases are inextricably intertwined. C.J. Date -- 2007 2 Logic and Databases Extensive interaction between

More information

COMP 9416, session 1, 2006 p. 1. Datalog. COMP 9416, session 1, 2006

COMP 9416, session 1, 2006 p. 1. Datalog. COMP 9416, session 1, 2006 OMP 9416, session 1, 2006 p. 1 Datalog OMP 9416, session 1, 2006 OMP 9416, session 1, 2006 p. 2 Atoms, integers and variables The fact "person(socrates).", the fact "sum(2,3,y)." and the rule "mortal(x)

More information

Relational Databases

Relational Databases Relational Databases Jan Chomicki University at Buffalo Jan Chomicki () Relational databases 1 / 49 Plan of the course 1 Relational databases 2 Relational database design 3 Conceptual database design 4

More information

Propositional Logic. Part I

Propositional Logic. Part I Part I Propositional Logic 1 Classical Logic and the Material Conditional 1.1 Introduction 1.1.1 The first purpose of this chapter is to review classical propositional logic, including semantic tableaux.

More information

Basic Elements of Computer Algebra in MIZAR

Basic Elements of Computer Algebra in MIZAR Basic Elements of Computer Algebra in MIZAR Adam Naumowicz Czeslaw Bylinski Institute of Computer Science University of Bialystok, Poland adamn@math.uwb.edu.pl Section of Computer Networks University of

More information

Artificial Intelligence. Chapters Reviews. Readings: Chapters 3-8 of Russell & Norvig.

Artificial Intelligence. Chapters Reviews. Readings: Chapters 3-8 of Russell & Norvig. Artificial Intelligence Chapters Reviews Readings: Chapters 3-8 of Russell & Norvig. Topics covered in the midterm Solving problems by searching (Chap. 3) How to formulate a search problem? How to measure

More information

2.2 Set Operations. Introduction DEFINITION 1. EXAMPLE 1 The union of the sets {1, 3, 5} and {1, 2, 3} is the set {1, 2, 3, 5}; that is, EXAMPLE 2

2.2 Set Operations. Introduction DEFINITION 1. EXAMPLE 1 The union of the sets {1, 3, 5} and {1, 2, 3} is the set {1, 2, 3, 5}; that is, EXAMPLE 2 2.2 Set Operations 127 2.2 Set Operations Introduction Two, or more, sets can be combined in many different ways. For instance, starting with the set of mathematics majors at your school and the set of

More information

Programming Languages Third Edition

Programming Languages Third Edition Programming Languages Third Edition Chapter 12 Formal Semantics Objectives Become familiar with a sample small language for the purpose of semantic specification Understand operational semantics Understand

More information

For next Tuesday. Read chapter 8 No written homework Initial posts due Thursday 1pm and responses due by class time Tuesday

For next Tuesday. Read chapter 8 No written homework Initial posts due Thursday 1pm and responses due by class time Tuesday For next Tuesday Read chapter 8 No written homework Initial posts due Thursday 1pm and responses due by class time Tuesday Any questions? Program 1 Imperfect Knowledge What issues arise when we don t know

More information

CITS2211 Discrete Structures Logic

CITS2211 Discrete Structures Logic CITS2211 Discrete Structures Logic Unit coordinator: Rachel Cardell-Oliver August 6, 2017 Highlights All men are mortal, Socrates is a man, therefore Socrates is mortal. Reading Chapter 3: Logical Formulas

More information

COMP Logic for Computer Scientists. Lecture 23

COMP Logic for Computer Scientists. Lecture 23 COMP 1002 Logic for Computer cientists Lecture 23 B 5 2 J Admin stuff Assignment 3 extension Because of the power outage, assignment 3 now due on Tuesday, March 14 (also 7pm) Assignment 4 to be posted

More information

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 9 Normal Forms

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 9 Normal Forms Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras Lecture - 9 Normal Forms In the last class we have seen some consequences and some equivalences,

More information

Lecture 1: Conjunctive Queries

Lecture 1: Conjunctive Queries CS 784: Foundations of Data Management Spring 2017 Instructor: Paris Koutris Lecture 1: Conjunctive Queries A database schema R is a set of relations: we will typically use the symbols R, S, T,... to denote

More information

CIS 500 Software Foundations Midterm I

CIS 500 Software Foundations Midterm I CIS 500 Software Foundations Midterm I October 11, 2006 Name: Student ID: Email: Status: Section: registered for the course not registered: sitting in to improve a previous grade not registered: just taking

More information

CMPSCI 250: Introduction to Computation. Lecture #7: Quantifiers and Languages 6 February 2012

CMPSCI 250: Introduction to Computation. Lecture #7: Quantifiers and Languages 6 February 2012 CMPSCI 250: Introduction to Computation Lecture #7: Quantifiers and Languages 6 February 2012 Quantifiers and Languages Quantifier Definitions Translating Quantifiers Types and the Universe of Discourse

More information

Multi Domain Logic and its Applications to SAT

Multi Domain Logic and its Applications to SAT Multi Domain Logic and its Applications to SAT Tudor Jebelean RISC Linz, Austria Tudor.Jebelean@risc.uni-linz.ac.at Gábor Kusper Eszterházy Károly College gkusper@aries.ektf.hu Abstract We describe a new

More information

ITCS 6150 Intelligent Systems. Lecture 13 First-Order Logic Chapter 8

ITCS 6150 Intelligent Systems. Lecture 13 First-Order Logic Chapter 8 ITCS 6150 Intelligent Systems Lecture 13 First-Order Logic Chapter 8 First-order logic We saw how propositional logic can create intelligent behavior But propositional logic is a poor representation for

More information

CS221 / Autumn 2017 / Liang & Ermon. Lecture 17: Logic II

CS221 / Autumn 2017 / Liang & Ermon. Lecture 17: Logic II CS221 / Autumn 2017 / Liang & Ermon Lecture 17: Logic II Review: ingredients of a logic Syntax: defines a set of valid formulas (Formulas) Example: Rain Wet Semantics: for each formula, specify a set of

More information

Semantics via Syntax. f (4) = if define f (x) =2 x + 55.

Semantics via Syntax. f (4) = if define f (x) =2 x + 55. 1 Semantics via Syntax The specification of a programming language starts with its syntax. As every programmer knows, the syntax of a language comes in the shape of a variant of a BNF (Backus-Naur Form)

More information

Lecture 5: Formation Tree and Parsing Algorithm

Lecture 5: Formation Tree and Parsing Algorithm Discrete Mathematics (II) Spring 2012 Lecture 5: Formation Tree and Parsing Algorithm Lecturer: Yi Li 1 Overview In this lecture, we completely focus on syntax of proposition. And the term proposition

More information

First Order Logic Semantics (3A) Young W. Lim 6/2/17

First Order Logic Semantics (3A) Young W. Lim 6/2/17 First Order Logic (3A) Young W. Lim Copyright (c) 2016-2017 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version

More information

Shared Variables and Interference

Shared Variables and Interference Illinois Institute of Technology Lecture 24 Shared Variables and Interference CS 536: Science of Programming, Spring 2018 A. Why Parallel programs can coordinate their work using shared variables, but

More information

Situation Calculus and YAGI

Situation Calculus and YAGI Situation Calculus and YAGI Institute for Software Technology 1 Progression another solution to the projection problem does a sentence hold for a future situation used for automated reasoning and planning

More information

2/18/14. Uses for Discrete Math in Computer Science. What is discrete? Why Study Discrete Math? Sets and Functions (Rosen, Sections 2.1,2.2, 2.

2/18/14. Uses for Discrete Math in Computer Science. What is discrete? Why Study Discrete Math? Sets and Functions (Rosen, Sections 2.1,2.2, 2. Why Study Discrete Math? Sets and Functions (Rosen, Sections 2.1,2.2, 2.3) TOPICS Discrete math Set Definition Set Operations Tuples Digital computers are based on discrete units of data (bits). Therefore,

More information

Abstract Syntax Trees L3 24

Abstract Syntax Trees L3 24 Abstract Syntax Trees L3 24 Formal languages An extensional view of what constitutes a formal language is that it is completely determined by the set of words in the dictionary : Given an alphabet Σ, wecallanysubsetofσ

More information

Lecture 9: Predicate Logic. First: Finish Propositional Logic in Haskell. Semantics in Haskell. Syntax In Haskell. CS 181O Spring 2016 Kim Bruce

Lecture 9: Predicate Logic. First: Finish Propositional Logic in Haskell. Semantics in Haskell. Syntax In Haskell. CS 181O Spring 2016 Kim Bruce Lecture 9: Predicate Logic CS 181O Spring 2016 Kim Bruce First: Finish Propositional Logic in Haskell Some slide content taken from Unger and Michaelis Syntax In Haskell data Form = P String Ng Form Cnj

More information

Fundamental Concepts. Chapter 1

Fundamental Concepts. Chapter 1 Chapter 1 Fundamental Concepts This book is about the mathematical foundations of programming, with a special attention on computing with infinite objects. How can mathematics help in programming? There

More information

Conjunctive queries. Many computational problems are much easier for conjunctive queries than for general first-order queries.

Conjunctive queries. Many computational problems are much easier for conjunctive queries than for general first-order queries. Conjunctive queries Relational calculus queries without negation and disjunction. Conjunctive queries have a normal form: ( y 1 ) ( y n )(p 1 (x 1,..., x m, y 1,..., y n ) p k (x 1,..., x m, y 1,..., y

More information

Model-Checking Concurrent Systems. The Model Checker Spin. The Model Checker Spin. Wolfgang Schreiner

Model-Checking Concurrent Systems. The Model Checker Spin. The Model Checker Spin. Wolfgang Schreiner Model-Checking Concurrent Systems Wolfgang Schreiner Wolfgang.Schreiner@risc.jku.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.jku.at 1.

More information

Constraint Satisfaction Problems (CSPs)

Constraint Satisfaction Problems (CSPs) Constraint Satisfaction Problems (CSPs) CPSC 322 CSP 1 Poole & Mackworth textbook: Sections 4.0-4.2 Lecturer: Alan Mackworth September 28, 2012 Problem Type Static Sequential Constraint Satisfaction Logic

More information

Logic: TD as search, Datalog (variables)

Logic: TD as search, Datalog (variables) Logic: TD as search, Datalog (variables) Computer Science cpsc322, Lecture 23 (Textbook Chpt 5.2 & some basic concepts from Chpt 12) June, 8, 2017 CPSC 322, Lecture 23 Slide 1 Lecture Overview Recap Top

More information

Syntax-semantics interface and the non-trivial computation of meaning

Syntax-semantics interface and the non-trivial computation of meaning 1 Syntax-semantics interface and the non-trivial computation of meaning APA/ASL Group Meeting GVI-2: Lambda Calculi, Type Systems, and Applications to Natural Language APA Eastern Division 108th Annual

More information

Solutions to Homework 10

Solutions to Homework 10 CS/Math 240: Intro to Discrete Math 5/3/20 Instructor: Dieter van Melkebeek Solutions to Homework 0 Problem There were five different languages in Problem 4 of Homework 9. The Language D 0 Recall that

More information

One of the most important areas where quantifier logic is used is formal specification of computer programs.

One of the most important areas where quantifier logic is used is formal specification of computer programs. Section 5.2 Formal specification of computer programs One of the most important areas where quantifier logic is used is formal specification of computer programs. Specification takes place on several levels

More information

CIS 771: Software Specifications. Lecture: Alloy Logic (part D)

CIS 771: Software Specifications. Lecture: Alloy Logic (part D) CIS 771: Software Specifications Lecture: Alloy Logic (part D) Copyright 2007, John Hatcliff, and Robby. The syllabus and all lectures for this course are copyrighted materials and may not be used in other

More information

8. Negation 8-1. Deductive Databases and Logic Programming. (Sommer 2017) Chapter 8: Negation

8. Negation 8-1. Deductive Databases and Logic Programming. (Sommer 2017) Chapter 8: Negation 8. Negation 8-1 Deductive Databases and Logic Programming (Sommer 2017) Chapter 8: Negation Motivation, Differences to Logical Negation Syntax, Supported Models, Clark s Completion Stratification, Perfect

More information

Reasoning About Imperative Programs. COS 441 Slides 10

Reasoning About Imperative Programs. COS 441 Slides 10 Reasoning About Imperative Programs COS 441 Slides 10 The last few weeks Agenda reasoning about functional programming It s very simple and very uniform: substitution of equal expressions for equal expressions

More information