Predicate Logic for software Engineers Sagnik Bhattacharya Siddharth Dalal.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

Charting the Potential of Description Logic for the Generation of Referring Expression SELLC, Guangzhou, Dec Yuan Ren, Kees van Deemter and Jeff.
Discrete Math Methods of proof 1.
Introduction to Proofs
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
Chapter 1: The Foundations: Logic and Proofs 1.1 Propositional Logic 1.2 Propositional Equivalences 1.3 Predicates and Quantifiers 1.4 Nested Quantifiers.
L41 Lecture 2: Predicates and Quantifiers.. L42 Agenda Predicates and Quantifiers –Existential Quantifier  –Universal Quantifier 
Of 27 lecture 7: owl - introduction. of 27 ece 627, winter ‘132 OWL a glimpse OWL – Web Ontology Language describes classes, properties and relations.
Knowledge Representation Methods
RMIT University; Taylor's College This is a story about four people named Everybody, Somebody, Anybody and Nobody. There was an important job to be done.
Predicate Logic for Software Engineering David Lorge Parnas McMaster University, Ontario, Canada.
Logic and Proof. Argument An argument is a sequence of statements. All statements but the first one are called assumptions or hypothesis. The final statement.
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic Autumn 2011 CSE 3111.
1 Predicates and quantifiers Chapter 8 Formal Specification using Z.
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic, Logical Inference Spring
CSCI2110 – Discrete Mathematics Tutorial 9 First Order Logic Wong Chung Hoi (Hollis)
A Brief Summary for Exam 1 Subject Topics Propositional Logic (sections 1.1, 1.2) –Propositions Statement, Truth value, Proposition, Propositional symbol,
Formal Logic Mathematical Structures for Computer Science Chapter Copyright © 2006 W.H. Freeman & Co.MSCS SlidesFormal Logic.
Introduction to Proofs
MATH 224 – Discrete Mathematics
First Order Logic Chapter 7. PL is a Weak Representational Language §Propositional Logic (PL) is not a very expressive language because: §Hard to identify.
1 Chapter 7 Propositional and Predicate Logic. 2 Chapter 7 Contents (1) l What is Logic? l Logical Operators l Translating between English and Logic l.
Chapter 1 Logic Section 1-1 Statements Open your book to page 1 and read the section titled “To the Student” Now turn to page 3 where we will read the.
Declarative vs Procedural Programming  Procedural programming requires that – the programmer tell the computer what to do. That is, how to get the output.
Theory and Applications
Database Management Systems, R. Ramakrishnan1 Relational Calculus Chapter 4.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
CMPF144 FUNDAMENTALS OF COMPUTING THEORY Module 5: Classical Logic.
The Science of Good Reasons
First Order Logic Lecture 2: Sep 9. This Lecture Last time we talked about propositional logic, a logic on simple statements. This time we will talk about.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
1 Predicate (Relational) Logic 1. Introduction The propositional logic is not powerful enough to express certain types of relationship between propositions.
Copyright © Curt Hill Quantifiers. Copyright © Curt Hill Introduction What we have seen is called propositional logic It includes.
Formal Methods in Software Engineering 1
CSE 311 Foundations of Computing I Lecture 7 Logical Inference Autumn 2012 CSE
Predicates and Quantified Statements
Theory and Applications
Lecture 4: Predicates and Quantifiers; Sets.
1 Introduction to Abstract Mathematics Chapter 2: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 2.3.
Course: Software Engineering Unit 2: Theories and SchemasSlide Number 1 Unit 2: Theories and Schemas This lecture aims to: Recall some concepts in logic:
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 02: QUANTIFIERS Sections 1.3 and 1.4 Jarek Rossignac CS1050:
For Wednesday Read chapter 9, sections 1-3 Homework: –Chapter 7, exercises 8 and 9.
CS 285- Discrete Mathematics Lecture 4. Section 1.3 Predicate logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
For Friday Read chapter 8 Homework: –Chapter 7, exercises 2 and 10 Program 1, Milestone 2 due.
Predicates and Quantifiers Dr. Yasir Ali. 1.Predicates 2.Quantifiers a.Universal Quantifiers b.Existential Quantifiers 3.Negation of Quantifiers 4.Universal.
Predicate Logic One step stronger than propositional logic Copyright © Curt Hill.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Basic Concepts and Background.
Lecture 041 Predicate Calculus Learning outcomes Students are able to: 1. Evaluate predicate 2. Translate predicate into human language and vice versa.
Metalogic Soundness and Completeness. Two Notions of Logical Consequence Validity: If the premises are true, then the conclusion must be true. Provability:
Propositional Logic. Assignment Write any five rules each from two games which you like by using propositional logic notations.
Section 1.7. Section Summary Mathematical Proofs Forms of Theorems Direct Proofs Indirect Proofs Proof of the Contrapositive Proof by Contradiction.
Knowledge Representation Lecture 2 out of 5. Last Week Intelligence needs knowledge We need to represent this knowledge in a way a computer can process.
Proof And Strategies Chapter 2. Lecturer: Amani Mahajoub Omer Department of Computer Science and Software Engineering Discrete Structures Definition Discrete.
Introduction to Logic for Artificial Intelligence Lecture 2
ece 720 intelligent web: ontology and beyond
CS201: Data Structures and Discrete Mathematics I
The Foundations: Logic and Proofs
Copyright © Cengage Learning. All rights reserved.
CSE 311 Foundations of Computing I
CS201: Data Structures and Discrete Mathematics I
Mathematics for Computer Science MIT 6.042J/18.062J
A Brief Summary for Exam 1
Discrete Mathematics Lecture 4 & 5: Predicate and Quantifier
Negations of quantifiers
Discrete Mathematics Lecture 4 & 5: Predicate and Quantifier
Predicates and Quantifiers
This Lecture Substitution model
CS201: Data Structures and Discrete Mathematics I
CS201: Data Structures and Discrete Mathematics I
Agenda Proofs (Konsep Pembuktian) Direct Proofs & Counterexamples
Presentation transcript:

Predicate Logic for software Engineers Sagnik Bhattacharya Siddharth Dalal

Why logic in software engineering? Engineers need mathematical tools. Theoretical, yet quantitative study of software. Parnas says so…. From a drop of water a logician could infer the possibility of an Atlantic or a Niagara without having seen or heard of one or the other. - Sir Arthur Conan Doyle

Problems with existing logic Logicians are conservative? Lacks precise meaning for logical expression. (* values) Complexity of expressions. Assumption of total functions. There can never be surprises in logic.

Parnas Proposes…. Get rid of *(maybe) values. Use partial functions. Make use of bounded quantification optional. 'Contrariwise', continued Tweedledee, 'if it was so, it might be, and if it were so, it would be; but as it isn't, it ain't. That's logic!' - Lewis Carroll - Alice in Wonderland

Basics Predicate – A predicate is a feature which we can use to make a statement about something. “Peter is tall” The property that an animal is a dog can be expressed by the predicate: dog(x) This predicate holds for all animals x which are dogs. For other animals, the predicate is false Logic is the art of going wrong with confidence.

Propositional Logic A proposition is a language construct which can be assigned a truth value More complex propositions can be formed by applying the logical operators (¬, , , etc..) Propositional logic formula –Eg. ¬((a  b)  c) Against logic there is no armor like ignorance.

Predicate Logic Predicate logic is a more powerful formalism which is obtained by extending propositional logic with 1.“Predicates” which describe properties or relations of objects in a certain domain ; 2.“variables” ranging over arbitrary domains; 3.the possibility to quantify over “variables”. Logic: The art of thinking and reasoning in strict accordance with the limitations and incapacities of the human misunderstanding.

Quantifiers We distinguish two quantifiers: –universal quantifier:  –existential quantifier:  The grand aim of all science is to cover the greatest number of empirical facts by logical deduction from the smallest number of hypotheses or axioms.

Quantifiers We distinguish two quantifiers: –universal quantifier:  –existential quantifier:  Example: –There exists an integer x divisible by 5.  x | divisible_by(x,5) –All integers y are divisible by 1.  y | divisible_by(y,1) The grand aim of all science is to cover the greatest number of empirical facts by logical deduction from the smallest number of hypotheses or axioms.

Tuples U = {true, false} Simple n-tuple –Ordered list of n members of U Eg. n-tuple –Ordered list of n simple tuples –Eg., true, > Logic works, metaphysics contemplates.

Exercise >, true, >> –3-tuple (not simple) “true”, “ ”, “ >” –Equivalent simple 1-tuple!! The fact that logic cannot satisfy us awakens an almost insatiable hunger for the irrational.

Relations and Functions Difference? –Function can’t be one-to-many. Partial vs. Total Functions –Partial functions not defined for all values in domain e.g. Division over integer domain not defined for 0 The want of logic annoys. Too much logic bores. Life eludes logic, and everything that logic alone constructs remains artificial and forced.

Predicates Revisited Predicate – function whose range contains no member other than true and false Characteristic Predicate (R) –X=set of simple tuples –S k =set of all simple k-tuples –S=S 1  S 2  ……..  S u u=length of largest tuple in X –R is a predicate whose domain is S and for every b  X the value of R is true There can never be surprises in logic.

Primitive Expressions Primitive Expression is a string of the form R(V) –R is a characteristic predicate –V is a list of comma separated terms (called arguments) e.g. divisible_by(x, 5) Logic is like the sword--those who appeal to it, shall perish by it.

Predicate Expressions All primitive expressions are predicate expressions. If P, Q: predicate expressions, x: variable, then following are also predicate expressions: –  (x, P) – (P) –(P)  (Q) – (P)  (Q) –¬(P) There are no other predicate expressions. –What about  (x, P) ??? Logic is neither a science or an art, but a dodge.

Use in Documentation B[j]=xtrue false (  i, B[i]=x)¬(  i, B[i]=x) j| present= Logic merely enables one to be wrong with authority.

Use in Documentation What next after simple search? –Palindrome (  m, (  i, 0<=i<n  B[m+i]=N[m+n-1-i])) –A7E?? Where in Documentation? What about non-inspection operations? Logic, like whiskey, loses its beneficial effect when taken in too large quantities.

Conclusion Keep it Simple –Was the use of this type of logic useful? –What about more complicated programs? –Was it more precise? –Was it easier to understand? You can only find truth with logic if you have already found truth without it.