Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 Lecture 3 CS 1813 – Discrete Mathematics Truth Inference and the Logical Way.

Similar presentations


Presentation on theme: "CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 Lecture 3 CS 1813 – Discrete Mathematics Truth Inference and the Logical Way."— Presentation transcript:

1 CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 Lecture 3 CS 1813 – Discrete Mathematics Truth Inference and the Logical Way

2 CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 2  Inference (courtesy of Merriam-Webster)  verb - the act of passing from one proposition, statement, or judgment considered as true to another whose truth is believed to follow from that of the former  noun – a proposition arrived at by inferring  Formal Inference (mathematical logic)  Object Language – notation for stating premises and conclusions WFFs form the object language  Inference Rules – ways to conclude new WFFs from proven WFFs  Metalanguage – notation for proofs of theorems  Formal Inference (Proof) – a set of assumptions together with an ordered collection of inference rules applied to reach a conclusion  Theorem (sequent) – a set of assumptions and a conclusion for which there is a formal inference (that is, a proof) Logical Inference

3 CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 3 Theorem – a statement that can be proved premises (WFFs) conclusion (WFF) turnstile w 1, w 2, …, w n w Theorem Meaning of turnstile: If the premises are true, then there is a path through the rules of inference that leads to the conclusion Fact – a statement that is true (whether provable or not) w 1, w 2, …, w n w double turnstile We will focus on theorems rather than mere facts Theorems  Facts

4 CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 4 Rules of Inference Fig 2.1, Hall/O’Donnell Discrete Mathematics with a Computer Springer, 2000 Conclusion (inferred) Premises (already proven)  Metavariables in rules stand for WFFs name of rule  Rule says: infer conclusion (bottom) if top (premises) has been proven — applying a rule is proves a theorem  Sequents in rules stand for proofs Can be any WFF Proof goes here

5 CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 5 Theorem and Proof  Theorem (  Commutes)  a  b |– b  a  Proof a  b  {  E L } a a  b  {  E R } b  {  I} b  a proof of b given a  b 2 proofs needed to apply  I rule Step uses  E R rule assumption Proof(s) above line Conclusion below line {rule} Natural Deduction proof of a given a  b OK to reuse assumption of theorem Proofs form tree structure: Leaves = premises (assumptions) Root = conclusion Inference rule citations = branches Assumption stands in place of proof  {  I} a  b ab

6 CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 6 Notation for Proof Checker  Theorem (  Commutes)  a  b |– b  a  Proof a  b  {  E L } a a  b  {  E R } b  {  I} b  a natural deduction format Theorem [A `And` B] (B `And` A) AndI (AndER (Assume(A `And` B)) B, AndEL (Assume(A `And` B)) A ) (B `And` A) Notation for Automated Proof Checker

7 CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 7 Some Intrinsic Data Structures in Haskell  Sequences (aka lists — in primitive PLs, these are “linked lists”)  [x 1, x 2, …] all x’s must have same type  Examples: [t] is the type of a sequence whose elements have type t [1, 9, 3, 27] type: [Integer] [And A B, Or P Q, B] type: [Prop]  Tuples (like structs or records in other programming languages)  (c 1, c 2 ) pair – components may have different types  (c 1, c 2, c 3 ) 3-tuple (longer tuples OK—must be at least 2 components)  Examples: (t 1, t 2 ) means a pair where component k has type t k (7, And A B) type: (Integer, Prop) (AndEL (Assume(A `And` B)) A, Assume B) type: (Proof, Proof) Proof

8 CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 8 Type Definitions in Haskell  data Prop = A | B | And Prop Prop | Or Prop Prop Type names start with capital letters Constructor names start with capital letters These constructors require two arguments of type Prop (Prop is an inductive type)  data Theorem = Theorem [Prop] Prop Only one constructor for this type First arg (premises) is a sequence whose elements have type Prop Second arg (conclusion) is a value of type Prop … Full definition of Prop type matches structure of WFF definition

9 CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 9 Another Type Definition  data Proof = Assume Prop | AndI (Proof, Proof) Prop | AndEL Proof Prop | AndER Proof Prop Proof  {  I} Prop Proof  {  E L } Prop  Conclusion: each Proof constructor has a conclusion of type Prop (this represents the proven proposition)  Premises: Proof constructors have one or more premises  Each premise is a Proof (that is, an entity of type Proof)  Exception: the Assume constructor has no premises  Constructors: the full definition of the type Proof in the proof checker has one constructor for each inference rule......

10 CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 10 End of Lecture 3


Download ppt "CS 1813 Discrete Mathematics, Univ Oklahoma Copyright © 2000 by Rex Page 1 Lecture 3 CS 1813 – Discrete Mathematics Truth Inference and the Logical Way."

Similar presentations


Ads by Google