Computation and Logic Definitions

Similar documents
Language of Propositional Logic

Propositional Logic: Models and Proofs

Part 1: Propositional Logic

Propositional and Predicate Logic - II

CSC Discrete Math I, Spring Propositional Logic

Chapter 11: Automated Proof Systems

CHAPTER 10. Gentzen Style Proof Systems for Classical Logic

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

Natural Deduction. Formal Methods in Verification of Computer Systems Jeremy Johnson

Propositional Calculus: Formula Simplification, Essential Laws, Normal Forms

Advanced Topics in LP and FP

PL: Truth Trees. Handout Truth Trees: The Setup

Propositional Logic Language

Topic 1: Propositional logic

Knowledge representation DATA INFORMATION KNOWLEDGE WISDOM. Figure Relation ship between data, information knowledge and wisdom.

Computational Logic. Davide Martinenghi. Spring Free University of Bozen-Bolzano. Computational Logic Davide Martinenghi (1/30)

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

Notes on Inference and Deduction

Chapter 11: Automated Proof Systems (1)

Section 1.2 Propositional Equivalences. A tautology is a proposition which is always true. A contradiction is a proposition which is always false.

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

Classical Propositional Logic

Propositional Logic. Testing, Quality Assurance, and Maintenance Winter Prof. Arie Gurfinkel

Propositional Logic: Part II - Syntax & Proofs 0-0

Propositional Logic. Yimei Xiang 11 February format strictly follow the laws and never skip any step.

Part Two: The Basic Components of the SOFL Specification Language

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

Logic: Propositional Logic (Part I)

SE 212: Logic and Computation. se212 Nancy Day

3 Propositional Logic

Propositional Language - Semantics

Overview. I Review of natural deduction. I Soundness and completeness. I Semantics of propositional formulas. I Soundness proof. I Completeness proof.

AI Principles, Semester 2, Week 2, Lecture 5 Propositional Logic and Predicate Logic

Deductive Systems. Lecture - 3

Tautologies, Contradictions, and Contingencies

Propositional Resolution

Comp487/587 - Boolean Formulas

02 Propositional Logic

Informatics 1 - Computation & Logic: Tutorial 5 v:1.12 1st November :36:40

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence

cis32-ai lecture # 18 mon-3-apr-2006

Description Logics. Foundations of Propositional Logic. franconi. Enrico Franconi

Part 1: Propositional Logic

UNIT-I: Propositional Logic

Introduction to Metalogic

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

Informal Statement Calculus

Introduction Logic Inference. Discrete Mathematics Andrei Bulatov

Symbolic Logic 3. For an inference to be deductively valid it is impossible for the conclusion to be false if the premises are true.

Truth-Functional Logic

Propositional Logic: Review

ECE473 Lecture 15: Propositional Logic

A brief introduction to Logic. (slides from

Logic As Algebra COMP1600 / COMP6260. Dirk Pattinson Australian National University. Semester 2, 2017

Propositional Logic Arguments (5A) Young W. Lim 10/11/16

Decision Procedures for Satisfiability and Validity in Propositional Logic

Propositional Logic: Methods of Proof (Part II)

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Propositional logic (revision) & semantic entailment. p. 1/34

PROPOSITIONAL CALCULUS

Chapter 4: Classical Propositional Semantics

Propositional Resolution

Foundations of Artificial Intelligence

Section 1.1: Logical Form and Logical Equivalence

CS156: The Calculus of Computation

Department of Computer Science & Software Engineering Comp232 Mathematics for Computer Science

The Calculus of Computation: Decision Procedures with Applications to Verification. Part I: FOUNDATIONS. by Aaron Bradley Zohar Manna

Propositional Logic Arguments (5A) Young W. Lim 11/8/16

Natural Deduction for Propositional Logic

LOGIC PROPOSITIONAL REASONING

Artificial Intelligence. Propositional Logic. Copyright 2011 Dieter Fensel and Florian Fischer

Propositional Logic Basics Propositional Equivalences Normal forms Boolean functions and digital circuits. Propositional Logic.

Inference in Propositional Logic

Propositional and Predicate Logic - V

Intelligent Systems. Propositional Logic. Dieter Fensel and Dumitru Roman. Copyright 2008 STI INNSBRUCK

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

CS206 Lecture 03. Propositional Logic Proofs. Plan for Lecture 03. Axioms. Normal Forms

Tecniche di Verifica. Introduction to Propositional Logic

Logic. Introduction to Artificial Intelligence CS/ECE 348 Lecture 11 September 27, 2001

Proofs. Joe Patten August 10, 2018

7 LOGICAL AGENTS. OHJ-2556 Artificial Intelligence, Spring OHJ-2556 Artificial Intelligence, Spring

Propositional logic. First order logic. Alexander Clark. Autumn 2014

Propositional Logic Review

1.3 Propositional Equivalences

Automated Reasoning Lecture 2: Propositional Logic and Natural Deduction

Introduction to Artificial Intelligence Propositional Logic & SAT Solving. UIUC CS 440 / ECE 448 Professor: Eyal Amir Spring Semester 2010

CS 512, Spring 2017, Handout 10 Propositional Logic: Conjunctive Normal Forms, Disjunctive Normal Forms, Horn Formulas, and other special forms

Propositional and First Order Reasoning

CS 7180: Behavioral Modeling and Decision- making in AI

Mat 243 Exam 1 Review

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning.

Intelligent Agents. First Order Logic. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University. last change: 19.

Propositional Equivalence

Logic and Inferences

The semantics of propositional logic

Artificial Intelligence Chapter 7: Logical Agents

15414/614 Optional Lecture 1: Propositional Logic

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning

3 The Semantics of the Propositional Calculus

Transcription:

Computation and Logic Definitions True and False Also called Boolean truth values, True and False represent the two values or states an atom can assume. We can use any two distinct objects to represent truth values, for example, True False 1 0 Sets and Subsets A set S is a collection of elements. We write x S to mean that x is an element of S and y S to mean that y is not an element of S. For example the set B of Boolean truth values { True, False } has two elements. True B False B 42 B A is a subset of B, in symbols, A B, iff every element of A is an element of B, which means that, for all x A. x B In this case we also say B is a superset of A, in symbols, B A A is a proper subset of B if A B and A B, i.e. if there is some element of B that is not in A. Atom These are the basic propositions (often represented by single letters) that can be in one of two states, true or false. They the variables in Boolean algebra, sometimes called propositional variables. Expression/Well-Formed Formula/WFF Expressions are built from the atoms by applying the logical connectives (negation, conjunction, disjunction, implication, etc.) Every atom is a WFF If P and Q are WFFs so are P Q P Q P Q P We sometimes consider languages with more (e.g.,, ), or fewer connectives. Expressions that are not atoms are called compound expressions. Negation : When an expressions is negated using NOT ( )

Literal A literal is either an atom or its negation. If L is the literal A then when talking about literals we may write L for the literal A. (If K is the literal B then K is the literal B.) Valuation A valuation is an assignment of truth values to a set of atoms. If a valuation is total if it assigns a value to every atom. Any total valuation V determines a value for each expression. The value of a compound expression is computed by applying the truth table corresponding to each logical connective occurring in the expression, to the values of its subexpressions. Using Haskell notation for the operations on Boolean values we can express this as follows: V(P Q) = V(P) V(Q) V(P Q) = V(P) && V(Q) V(P Q) = if V(P) then V(Q) else True V ( P) = not (V(P)) We often use valuations to represent the states of some system, and refer to the valuations that make an expression E true, as the set of states in which E is true. E is true in state V iff V(E) = True How do valuations relate to Venn diagrams? A Venn-Diagram represents the Boolean function corresponding to an expression. Each region (by which we mean, each area within the diagram bounded by arcs of the circles) of the Venn diagram corresponds to a valuation. The colored regions represent the valuations that make the expression true. Two expressions are equivalent iff have the same Venn diagram. This means that the same valuations In a three-circle Venn-Diagram we represent sets of states for a system with 8 states encoded by three state variables. Each region of the diagram represents one of the 8 states, and we colour the regions corresponding to the states in the set of interest. Satisfiability An expression is satisfiable if and only if there exists some valuation of the atoms which makes the expression true. Tautology An expression is tautologous if and only if it is true for all valuations of its atoms.

Contingent An expression is contingent if and only if it is satisfiable but not tautologous, that is, it is true for some valuations, but not all. Consistency A set of expressions is consistent if there is some valuation that makes every expression in the set true. A set of expressions is inconsistent if no valuation makes every expression in the set true. Boolean Algebra If E and F are Boolean expressions, we write E = F to mean that every valuation V gives the same value to E and F for all V. V(E) = V(F) Boolean Algebra is the study of such equations. For example, (A B) C = (A C) (B C) (distributivity) Clausal Form In Boolean Algebra the operations of disjunction,, and conjunction,, are symmetric, associative, and idempotent. So any combination of disjunctions, or any combination of disjunctions can be written without parentheses or repetition. We can write S and S for the conjunction/disjunction of a finite set of expressions, S. For V a valuation, V( S ) = iff for all e S. V(e) = V( S ) = iff for some e S. V(e) = These definitions tell us that we should interpret {} as and S as Furthermore, X A A = X = so any disjunctive combination of literals can be rewritten either as, or as the disjunction of a set of literals in which no atom occurs both positively and negatively. We call a set S of literals in which no atom occurs both positively and negatively a clause, and interpret it as representing the disjunction S. When talking about clauses, we may write for the empty clause A clausal form is a set C of clauses, interpreted as representing the conjunction C. If the empty clause is in C, that is, C, then V(C) =, for every valuation V. We can use Boolean algebra to convert any Boolean expression to an equivalent clausal form. This is called a conjunctive normal form (CNF), because it expresses any boolean function as a conjunction of disjunctions of literals.

Resolution Resolution is an inference rule for clauses given by: X A Y A X Y More formally, if we have two clauses X and Y such that A X and A Y, then by resolution we can derive the clause (X Y) { A, A }, whose elements are those literals occurring in X or Y (or both) that do not mention A. The key property of this rule is that it is sound: If V(X) = and V( Y) = then V((X Y) { A, A }) = Or contrariwise, If V((X Y) { A, A }) = then V(X) = or V( Y) = If we start from a clausal form C, and the resolution process produces the empty clause (which is not satisfied by any valuation), this shows us that the conjunction of the clauses excludes all valuations. Thus we can see that the clausal form has no satisfying valuations; it is contradictory. Thus, resolution provides a method for determining whether a given set of constraints, expressed in CNF, is consistent. Contradiction Contradiction occurs when a set of clauses is inconsistent. It contains clauses that contradict each other (there is no valuation of atoms that makes all clauses true) Note that we can construct an inconsistent set of n clauses Such that any proper subset of these is consistent. (Hint: construct an inconsistent cycle of implications.) DNF (Disjunctive Normal Form) : An expression is in DNF if it is a disjunction of conjunctions of literals. So {{A B} {C D}} is an example. Sequent Premises - Conclusions, where the premises on the LHS and the conclusions on the RHS are both finite sets of expressions. An entailment is a sequent with exactly one conclusion Counterexample A valuation is a counterexample to a sequent if it makes everything on the LHS (left-hand side) of the sequent true and everything to the RHS (right-hand side ) of the sequent false. An entailment is simply a sequent with exactly one expression on the RHS. A valuation is a counterexample to an entailment if it makes everything on the LHS (left-hand side) of the turnstile true and the expression on the RHS (right-hand side ) of the entailment false.

Valid and Invalid A sequent is valid if it has no counterexample. We can also express this positively, for both entailments and sequents An entailment is valid iff every valuation that makes all of the premises true also makes the conclusion true. A sequent is valid iff every valuation that makes all of the premises true also makes at least one of the conclusions true. Rule A rule of the form has a finite set of assumptions, β 0 β n-1 and a single conclusion, α. In different proof systems the assumptions and conclusions may be expressions, entailments, or sequents. We focus on Gentzen s sequent calculus. A proof tree is constructed by connecting rules so that the conclusion of one rule becomes an assumption of another. A proof is a proof tree such that every branch terminates in a rule with no assumptions. It proves the sequent at the root of the tree. (In Gentzen s sequent calculus, the only rule with no assumptions is the immediate rule, (I).) A sequent is provable iff it has a proof. Sound A proof system is sound if any sequent that is provable is valid. A rule is sound iff whenever all of the assumptions are valid, then so is the conclusion. So, if all of the rules we use are sound then any provable sequent is valid - and the proof system is sound. In fact this is a necessary and sufficient condition for soundness. We can also show that a rule is sound by showing that any counterexample to the conclusion is a counterexample to (at least) one of the assumptions. Complete A proof system is complete if every sequent that is valid is provable. One way to show that a proof system is complete is to show that if a sequent is not provable, then it has a counterexample. Some authors say that a rule is complete if a counterexample to any of the assumptions provides a counterexample to the conclusion. However, having a set of complete rules, in this sense, is neither a necessary nor a sufficient condition for the completeness of a proof system.

Nevertheless, for Gentzen s system the completeness of each rule is a key component of the proof of completeness. Automaton (DFA/NFA) An automaton has states Q, including a set A of accepting states and a set B of start states, an alphabet Σ, and transitions δ. Each transition is an arrow between two states (which may be the same state), labelled with a symbol from the alphabet Σ. State (DFA/NFA) A position within an Automaton. Start State: A state in the set of start states. Accepting State: A state in the set of accepting states Alphabet: A set of symbols used to label transitions Transition s : a b An ordered pair (a, b) of states, together with a symbol s from the alphabet. Trace A trace for a string of length n is a sequence of n+1 states (say states s 0... s n ) connected by a chain of n transitions, t i : s i 1 s i, for i=1 n, such that the i th transition is labelled by the i th symbol in the string. A trace is just the path that you follow given a string. Like how you might "trace" your finger over the arrows to keep track of what state you're in. An automaton accepts a string σ if there is a trace s 0... s n for σ such that s 0 is a start state and s n is an accepting state. The language accepted by the automaton is the set of strings that the automaton accepts. Regular Expression (RegEx): We define a regular expression for an alphabet Σ Every symbol s in Σ is a regular expression If R and S are regular expressions so are R* iteration RS sequence R S alternation The precedence of these operations is Iteration > sequence > alternation and we use parentheses where necessary. This document was written by Asmita Dulan, Riccardo Fiorista, and Likhitha Sai, and revised by Michael Fourman.