1 / 15

MAT 7003 : Mathematical Foundations (for Software Engineering) J Paul Gibson, A207

MAT 7003 : Mathematical Foundations (for Software Engineering) J Paul Gibson, A207 paul.gibson@it-sudparis.eu http://www-public. it-sudparis.eu /~gibson/Teaching/MAT7003/. Logic – Sample Answers …/~gibson/Teaching/MAT7003/L4-Logic-SampleAnswers.pdf. How to Use Propositional Logic?.

media
Download Presentation

MAT 7003 : Mathematical Foundations (for Software Engineering) J Paul Gibson, A207

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MAT 7003 : MathematicalFoundations (for Software Engineering) J Paul Gibson, A207 paul.gibson@it-sudparis.eu http://www-public.it-sudparis.eu/~gibson/Teaching/MAT7003/ Logic – SampleAnswers …/~gibson/Teaching/MAT7003/L4-Logic-SampleAnswers.pdf TSP: MathematicalFoundations

  2. How to Use Propositional Logic? Problem: Determine the validity of the followingreasoning « Paul caneat if he has cooked a meal in the last 30 minutes and heishungry. He ishungryprovidedhe has not eaten in the last 15 minutes and in the last 30 minutes he has not doneany sport. If heisdoing sport hecannotcook a mealat the sametime.Therefore if Paul did not eathehadalreadyeaten in the last 15 minutes or hedid sport in the last 30 minutes » TSP: MathematicalFoundations

  3. Formalising the reasoningusing the set BOOL ( {TRUE, FALSE}) in Event-B NOTE: The importance of the presciseinterpreation of the naturallanguagetext; in particularwordssuch as: can, should, could, must, may. Intuitively, the reasoning (expressed in theoremaxm9) must be false as nothing obliges Paul to eat (or cook). Wewillseethiswhenwelaunch the Rodin prover on thistheorem … TSP: MathematicalFoundations

  4. Formalising the reasoningusing the set BOOL ( {TRUE, FALSE}) in Event-B The prover shows that the theoremis false when Paul is not eating, he has not eaten, he has not done sport and has not cooked TSP: MathematicalFoundations

  5. Alternatively, wecanalso use the proverdirectly to show that the reasoningiswrong Wenow know underwhat conditions the reasoningfails Theorem: the reasoningiswrong TSP: MathematicalFoundations

  6. Alternatively, wecanalso use the proverdirectly to show that the reasoningiswrong TO DO: Change the specificationsothat Paul isobliged to cook and eatwhenheishungry TSP: MathematicalFoundations

  7. Specifications in Predicate Logic Which of the following formulae are valid (true), and why? 1 2 3 45 6 7 TSP: MathematicalFoundations

  8. Specifications in PredicateLogic: lemma 7 This lemmais, perhaps, the mostobviouslytrue. So lets put itinto RODIN in Event-B, using the BOOL set. TSP: MathematicalFoundations

  9. Specifications in PredicateLogic: lemma 7 Not surprisingly, the Proverdischargesthisautomatically TSP: MathematicalFoundations

  10. Specifications in PredicateLogic: lemmas 1 to 3 The proverdischarges 3 automatically, sowe know itistrue (provided the lemmaisproperlyspecified in Event-B). However, lemma1 and lemma2 are not provenautomatically -doesthismeanthey are false? TO DO: verify and complete the lemmasusing the same style (based on BOOL functions) TSP: MathematicalFoundations

  11. Specifications in PredicateLogic: another more direct specification style Wecouldalsorepresent the lemma in a more direct wayusing a set – PSet, say - to explicitlyrepresent the subset if the universe for which the predicatePistrue: QUESTION: Which of the representationsisbest? TO DO: verify and complete the lemmasusingthis new style of specification (based on set membership) TSP: MathematicalFoundations

  12. Specifications in Predicate Logic TSP: MathematicalFoundations

  13. Specifications in Predicate Logic • Express the followingusingpredicatelogic • Susan introduced Mary to a studentthatnobodyliked. • Only-if John has-talked-to everywitnesswill Mary be-satisfied. • John introducedonly MARY to Kate. • John introduces Mary only to KATE. TSP: MathematicalFoundations

  14. Specifications in PredicateLogic: Susan introduced Mary to a studentthatnobodyliked. TO DO: Complete the contextspecification TSP: MathematicalFoundations

  15. Specifications in PredicateLogic • Express the following using predicate logic • All students in the class can program in Java or C++ • Some of the students can program in Java or C++ • Every student who could not program in Java or C++ was paired with a student who could • Some students program in Java some of the time, others never program in Java TO DO: Write an Event-B context to specifytheseproperties FOLLOW A SPECIFICATION STYLE AS USED IN THE PREVIOUS SAMPLE ANSWERS TSP: MathematicalFoundations

More Related