2010: J Paul GibsonTSP: Mathematical FoundationsMAT7003/Logic-SampleAnswers.1 MAT 7003 : Mathematical Foundations (for Software Engineering) J Paul Gibson,

Slides:



Advertisements
Similar presentations
Kees van Deemter Matthew Stone Formal Issues in Natural Language Generation Lecture 4 Shieber 1993; van Deemter 2002.
Advertisements

Brief Introduction to Logic. Outline Historical View Propositional Logic : Syntax Propositional Logic : Semantics Satisfiability Natural Deduction : Proofs.
March 1, 2009 Dr. Muhammed Al-Mulhem 1 ICS 482 Natural Language Processing Semantics (Chapter 17) Muhammed Al-Mulhem March 1, 2009.
2009: J Paul GibsonT&MSP-CSC 4504 : Langages formels et applications Event-B/DataStructures.1 CSC 4504 : Langages formels et applications (La méthode Event-B)
Discrete Math Methods of proof 1.
MAT 7003 : Mathematical Foundations (for Software Engineering)
AE1APS Algorithmic Problem Solving John Drake
- Vasvi Kakkad.  Formal -  Tool for mathematical analysis of language  Method for precisely designing language  Well formed model for describing and.
22 March 2009Instructor: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Introduction.
Automated Reasoning Systems For first order Predicate Logic.
2012: J Paul GibsonTSP: MSC SAI Mathematical FoundationsMAT7003.Computability- Answers.1 MAT 7003 : Mathematical Foundations (for Software Engineering)
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
Towards the Formal Verification of a Java Processor in Event-B Neil Evans and Neil Grant AWE, Aldermaston.
3.2 Pumping Lemma for Regular Languages Given a language L, how do we know whether it is regular or not? If we can construct an FA to accept the language.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Structures & Algorithms Basics of Set Theory EECE 320 — UBC.
Instructor: Hayk Melikya
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
1 Mechanical Verification of Timed Automata Myla Archer and Constance Heitmeyer Presented by Rasa Bonyadlou 24 October 2002.
Section 1.6: Sets Sets are the most basic of discrete structures and also the most general. Several of the discrete structures we will study are built.
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.
AI - Week 13 Knowledge Representation, Logic, Semantic Web Lee McCluskey, room 2/07
Introduction to Semantics To be able to reason about the meanings of utterances, we need to have ways of representing the meanings of utterances. A formal.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 18 Program Correctness To treat programming.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 22 Instructor: Paul Beame.
Introduction Using the Pythagorean Theorem to solve problems provides a familiar example of a relationship between variables that involve radicals (or.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 6 Limitations of propositional logic Introduction to predicate logic Symbols, terms and formulae, Parse.
EE1J2 – Discrete Maths Lecture 5 Analysis of arguments (continued) More example proofs Formalisation of arguments in natural language Proof by contradiction.
CSE115/ENGR160 Discrete Mathematics 03/29/11 Ming-Hsuan Yang UC Merced 1.
THE TRANSITION FROM ARITHMETIC TO ALGEBRA: WHAT WE KNOW AND WHAT WE DO NOT KNOW (Some ways of asking questions about this transition)‏
2012: J Paul GibsonTSP: Mathematical FoundationsMAT7003/L5- CountingAndEnumeration.1 MAT 7003 : Mathematical Foundations (for Software Engineering) J Paul.
Equational Reasoning Math Foundations of Computer Science.
Induction and recursion
2012: J Paul GibsonTSP: Mathematical FoundationsMAT7003/SetsAndRelations(Using RODIN).1 MAT 7003 : Mathematical Foundations (for Software Engineering)
Verification and Validation Overview References: Shach, Object Oriented and Classical Software Engineering Pressman, Software Engineering: a Practitioner’s.
Michaelmas Term 2004 Discrete Mathematics CSC 141 Discrete Mathematics Dr. Corina Sas and Ms. Nelly Bencomo
2012: J Paul GibsonTSP: Mathematical FoundationsMAT7003/Sets And Relations-Answers.1 The family tree Event-B context specification is taken from the on-line.
2012: J Paul GibsonTSP: MSC SAI Mathematical FoundationsMAT7003.ProofsWithRodin.1 MAT 7003 : Mathematical Foundations (for Software Engineering) J Paul.
© Gudmund Grov & Andrew Ireland Dependable Systems Group Planning for System Development Gudmund Grov & Andrew Ireland Dependable Systems Group School.
Sept. 13, 2006Math 3621 Predicates and Qualifiers.
Making Decisions (True or False) Relational Operators >greater than =greater than or equal to
Copyright © Cengage Learning. All rights reserved.
COP4020 Programming Languages Introduction to Axiomatic Semantics Prof. Robert van Engelen.
Logical Agents Chapter 7. Outline Knowledge-based agents Logic in general Propositional (Boolean) logic Equivalence, validity, satisfiability.
Naïve Set Theory. Basic Definitions Naïve set theory is the non-axiomatic treatment of set theory. In the axiomatic treatment, which we will only allude.
1 Introduction to Abstract Mathematics Proofs in Predicate Logic , , ~, ,  Instructor: Hayk Melikya Purpose of Section: The theorems.
Artificial Intelligence “Introduction to Formal Logic” Jennifer J. Burg Department of Mathematics and Computer Science.
Chapter 2 With Question/Answer Animations. Section 2.1.
Model Checking for Simple Java Programs Taehoon Lee, Gihwon Kwon Department of Computer Science Kyonggi University, Korea IWFST, Shanghai, China,
2012: J Paul GibsonTSP: Mathematical FoundationsMAT7003/Project.1 MAT 7003 : Mathematical Foundations (for Software Engineering) J Paul Gibson, A207
Formal Semantics Purpose: formalize correct reasoning.
Artificial Intelligence Knowledge Representation.
Interface specifications At the core of each Larch interface language is a model of the state manipulated by the associated programming language. Each.
Copyright 1999Paul F. Reynolds, Jr. Foundations of Logic Programming.
Chapter 2 1. Chapter Summary Sets (This Slide) The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions.
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.
Formal Methods (Spring 2015) Lecture 2 Abid Rauf 1.
Complexity 27-1 Complexity Andrei Bulatov Interactive Proofs (continued)
Lecture 1 – Formal Logic.
Paul Ammann & Jeff Offutt
Great Theoretical Ideas in Computer Science
Programming Languages 2nd edition Tucker and Noonan
Paul Ammann & Jeff Offutt
Discrete Mathematics Lecture 4 & 5: Predicate and Quantifier
Discrete Mathematics Lecture 4 & 5: Predicate and Quantifier
Advanced Analysis of Algorithms
Chapter 2: Analysis and Verification of Non-Real-Time Systems
Everything is an Integer Countable and Uncountable Sets
Programming Languages 2nd edition Tucker and Noonan
Presentation transcript:

2010: J Paul GibsonTSP: Mathematical FoundationsMAT7003/Logic-SampleAnswers.1 MAT 7003 : Mathematical Foundations (for Software Engineering) J Paul Gibson, A207 Logic – Sample Answers …/~gibson/Teaching/MAT7003/L4-Logic-SampleAnswers.pdf

2010: J Paul GibsonTSP: Mathematical FoundationsMAT7003/Logic-SampleAnswers.2 How to Use Propositional Logic? Problem: Determine the validity of the following reasoning « Paul can eat if he has cooked a meal in the last 30 minutes and he is hungry. He is hungry provided he has not eaten in the last 15 minutes and in the last 30 minutes he has not done any sport. If he is doing sport he cannot cook a meal at the same time.Therefore if Paul did not eat he had already eaten in the last 15 minutes or he did sport in the last 30 minutes »

2012: J Paul GibsonTSP: Mathematical FoundationsMAT7003/Logic-SampleAnswers.3 Formalising the reasoning using the set BOOL ( {TRUE, FALSE}) in Event-B NOTE: The importance of the prescise interpreation of the natural language text; in particular words such as: can, should, could, must, may. Intuitively, the reasoning (expressed in theorem axm9) must be false as nothing obliges Paul to eat (or cook). We will see this when we launch the Rodin prover on this theorem …

2012: J Paul GibsonTSP: Mathematical FoundationsMAT7003/L2-PropositionalLogic.4 Formalising the reasoning using the set BOOL ( {TRUE, FALSE}) in Event-B The prover shows that the theorem is false when Paul is not eating, he has not eaten, he has not done sport and has not cooked

2012: J Paul GibsonTSP: Mathematical FoundationsMAT7003/L2-PropositionalLogic.5 Theorem: the reasoning is wrong We now know under what conditions the reasoning fails Alternatively, we can also use the prover directly to show that the reasoning is wrong

2012: J Paul GibsonTSP: Mathematical FoundationsMAT7003/L2-PropositionalLogic.6 Alternatively, we can also use the prover directly to show that the reasoning is wrong TO DO: Change the specification so that Paul is obliged to cook and eat when he is hungry

2010: J Paul GibsonTSP: Mathematical FoundationsMAT7003/Logic-SampleAnswers.7 Specifications in Predicate Logic Which of the following formulae are valid (true), and why?

2010: J Paul GibsonTSP: Mathematical FoundationsMAT7003/Logic-SampleAnswers.8 Specifications in Predicate Logic: lemma 7 This lemma is, perhaps, the most obviously true. So lets put it into RODIN in Event- B, using the BOOL set.

2010: J Paul GibsonTSP: Mathematical FoundationsMAT7003/Logic-SampleAnswers.9 Specifications in Predicate Logic: lemma 7 Not surprisingly, the Prover discharges this automatically

2010: J Paul GibsonTSP: Mathematical FoundationsMAT7003/Logic-SampleAnswers.10 Specifications in Predicate Logic: lemmas 1 to 3 The prover discharges 3 automatically, so we know it is true (provided the lemma is properly specified in Event-B). However, lemma1 and lemma2 are not proven automatically -does this mean they are false? TO DO: verify and complete the lemmas using the same style (based on BOOL functions)

2010: J Paul GibsonTSP: Mathematical FoundationsMAT7003/Logic-SampleAnswers.11 Specifications in Predicate Logic: another more direct specification style We could also represent the lemma in a more direct way using a set – PSet, say - to explicitly represent the subset if the universe for which the predicate P is true: QUESTION: Which of the representations is best? TO DO: verify and complete the lemmas using this new style of specification (based on set membership)

2010: J Paul GibsonTSP: Mathematical FoundationsMAT7003/Logic-SampleAnswers.12 Specifications in Predicate Logic

2010: J Paul GibsonTSP: Mathematical FoundationsMAT7003/Logic-SampleAnswers.13 Specifications in Predicate Logic Express the following using predicate logic 1.Susan introduced Mary to a student that nobody liked. 2.Only-if John has-talked-to every witness will Mary be- satisfied. 3.John introduced only MARY to Kate. 4.John introduces Mary only to KATE.

2010: J Paul GibsonTSP: Mathematical FoundationsMAT7003/Logic-SampleAnswers.14 Specifications in Predicate Logic: Susan introduced Mary to a student that nobody liked. TO DO: Complete the context specification

2010: J Paul GibsonTSP: Mathematical FoundationsMAT7003/Logic-SampleAnswers.15 Specifications in Predicate Logic Express the following using predicate logic 1.All students in the class can program in Java or C++ 2.Some of the students can program in Java or C++ 3.Every student who could not program in Java or C++ was paired with a student who could 4.Some students program in Java some of the time, others never program in Java TO DO: Write an Event-B context to specify these properties FOLLOW A SPECIFICATION STYLE AS USED IN THE PREVIOUS SAMPLE ANSWERS