Modal, Dynamic and Temporal Logics

Slides:



Advertisements
Similar presentations
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Advertisements

Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
CSC 685 Logic Review. Logic: Modeling Human Reasoning syllogistic logic Syllogistic Logic (Aristotle). all/some X are/not Y Propositional Logic (Boole).
LDK R Logics for Data and Knowledge Representation Modal Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages Chapter 3 : Describing Syntax and Semantics Axiomatic Semantics.
Computability and Complexity 9-1 Computability and Complexity Andrei Bulatov Logic Reminder (Cnt’d)
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.
Review of the automata-theoretic approach to model-checking.
Semantics with Applications Mooly Sagiv Schrirber html:// Textbooks:Winskel The.
Operational Semantics Semantics with Applications Chapter 2 H. Nielson and F. Nielson
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 6 Limitations of propositional logic Introduction to predicate logic Symbols, terms and formulae, Parse.
CSE 755, part3 Axiomatic Semantics Will consider axiomatic semantics (A.S.) of IMP: ::=skip | | | | ; | | Only integer vars; no procedures/fns; vars declared.
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.
1st-order Predicate Logic (FOL)
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
CS 363 Comparative Programming Languages Semantics.
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
Rewriting Logic Model of Compositional Abstraction of Aspect-Oriented Software FOAL '10Mar. 15, 2010 Yasuyuki Tahara, Akihiko Ohsuga The University of.
LDK R Logics for Data and Knowledge Representation Modal Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
Program Analysis and Verification Spring 2014 Program Analysis and Verification Lecture 4: Axiomatic Semantics I Roman Manevich Ben-Gurion University.
1 CA 208 Logic PQ PQPQPQPQPQPQPQPQ
CS6133 Software Specification and Verification
1/5/2016Hilbertův kalkul1 Lecture 12 Hilbert-like calculus.
Chapter 9: Syntax and Semantics II : Logic & Proofs July 23, 2009 Karin Howe.
1 Temporal logic. 2 Prop. logic: model and reason about static situations. Example: Are there truth values that can be assigned to x,y simultaneously.
Albert Gatt LIN3021 Formal Semantics Lecture 3. Aims This lecture is divided into two parts: 1. We make our first attempts at formalising the notion of.
An Introduction to Classical Logic (propositional and Predicate Logic)
Program Analysis and Verification
Operational Semantics Mooly Sagiv Reference: Semantics with Applications Chapter 2 H. Nielson and F. Nielson
6/12/20161 a.a.2015/2016 Prof. Anna Labella Formal Methods in software development.
Model Checking Lecture 2. Model-Checking Problem I |= S System modelSystem property.
Model Checking Lecture 2 Tom Henzinger. Model-Checking Problem I |= S System modelSystem property.
Complexity of Compositional Model Checking of Computation Tree Logic on Simple Structures Krishnendu Chatterjee Pallab Dasgupta P.P. Chakrabarti IWDC 2004,
Logics for Data and Knowledge Representation
Chapter 7. Propositional and Predicate Logic
Formal methods: Lecture
Chapter 8 : Fuzzy Logic.
Propositional Logic Russell and Norvig: Chapter 6 Chapter 7, Sections 7.1—7.4 CS121 – Winter 2003.
Advanced Algorithms Analysis and Design
Spring 2017 Program Analysis and Verification
ece 627 intelligent web: ontology and beyond
Advanced Algorithms Analysis and Design
Proposition & Predicates
Methods for Evaluating Validity
EPISTEMIC LOGIC.
CS201: Data Structures and Discrete Mathematics I
Software Verification 2 Automated Verification
Formal Methods in software development
Natural deduction Gerhard Gentzen.
Logic: Top-down proof procedure and Datalog
Principles of proof calculi Natural deduction
Formal Methods in software development
1st-order Predicate Logic (FOL)
MA/CSSE 474 More Math Review Theory of Computation
Computer Security: Art and Science, 2nd Edition
Predicate Transformers
Axiomatic Semantics Will consider axiomatic semantics (A.S.) of IMP:
Computer Science cpsc322, Lecture 20
This Lecture Substitution model
Advanced Analysis of Algorithms
CS201: Data Structures and Discrete Mathematics I
Lecture Notes for SWE 623 by Duminda Wijesekera
Program correctness Axiomatic semantics
Formal Methods in software development
Logical and Rule-Based Reasoning Part I
CIS 720 Lecture 3.
CIS 720 Lecture 3.
Herbrand Semantics Computational Logic Lecture 15
COP4020 Programming Languages
1st-order Predicate Logic (FOL)
Presentation transcript:

Modal, Dynamic and Temporal Logics SWE 623 SWE 623 Duminda Wijesekera

Modal Logic Logic of Necessity and Possibility Has a philosophical background Syntax has two extra symbols [] read as necessity ([] X is “necessarily X”) Also called “box X” <> read as possibility (<> X “possibly X”) Also called “diamond X” See http://turing.wins.uva.nl/~mdr/AiML/background.html SWE 623 Duminda Wijesekera

Kripke Semantics of Modal Logic The “universe” seen as a collection of worlds. Truth defined “in each world”. Say U is the universe. I.e. each w e U is a prepositional or predicate model. W4 W1 W2 W3 SWE 623 Duminda Wijesekera

Kripke Semantics of Modal Logic W1 satisfies [] X if X is satisfied in each world accessible from W1. If W3 and W4 satisfy X. Notation: W1 |= [] X if and only if W3 |= X and W4 |= X W1 W1 satisfies <> X if X is satisfied in at least one world accessible from W1. W4 W1 W2 W3 Notation: W1 |= <> X if and only if W3 |= X or W4 |= X SWE 623 Duminda Wijesekera

Proof Rules for Modal Logic Modal Generalization A [] A Monotonicity of  A  B  A   B Monotonicity of   [] A  []B SWE 623 Duminda Wijesekera

An Axiom System for Prepositional Logic (A  (B  C))  (A  B)  (A  C) A  (B  A) (( A  false )  false ) A Modus Ponens A, A -> B   B SWE 623 Duminda Wijesekera

An Axiom System for Predicate Logic x (A(x)  B(x))  (xA(x)  xB(x)) x A(x)  A[t/x] provided t is free for x in A A  x A(x) provided x is not free in A Modus Ponens A, A -> B B Generalization A x A(x) SWE 623 Duminda Wijesekera

Some Facts About Modal Logic A couple of Valid Modal Formulas:  (A  B ) <-> ( A)  ( B) [](A  B ) <-> ([] A)  ([] B)  (false) (false) ( A)  ([]B)   (A  B ) Counter-examples to invalid modal formulas ( A)  ( [] A ) SWE 623 Duminda Wijesekera

Proving Modal Formulas SWE 623 Duminda Wijesekera

A counter-example in Modal Logic SWE 623 Duminda Wijesekera

Dynamic Logic A special kind of Modal Logic where each world is a system state. Definition of State The set of variables x1, … xn. x1= a1, … xn= an. is a state, where each variable takes a value. Accessibility is state change perhaps due to executing code. x1= a1, … xn= an is changed to x1= b1, … xn= an by the program (x1 := b1). SWE 623 Duminda Wijesekera

Dynamic Logic Issues: Two Levels What kind of program constructs result in what type of state change What is the logic Two Levels Prepositional: Only deals with state change at (abstract) symbolic level Predicate: Details of variables, values and programming operators Deals well with non-determinism, concurrency etc. SWE 623 Duminda Wijesekera

Prepositional Dynamic Logic Syntax If A, B propositions and a, b programs, Following are formulas A /\ B, A  B,  A, A  B, [a]A, < a>A are formulas. Following are programs U b = non-deterministic choice a; b = sequential composition (A?) a = test. a* = non-deterministic iteration SWE 623 Duminda Wijesekera

Prepositional Dynamic Logic Semantics A collection of states: S = {si : i >= 0}. For each state si a notion of satisfiability of atomic prepositions. I.e. si |= A for each A. For each each atomic program a, a relation Ra on SxS. Raub = Ra u Rb R(A?) = { (s,s) : s |= A } Ra;b = Ra ; Rb ={ (s1,s3) :  s2 (s1,s2) e Ra and (s2,s3) e Rb } Ra* = U {Rai : i >=0 }. Where Rai is defined inductively as Ra(i+1) = Rai ; Ra and Ra0 = Identity. SWE 623 Duminda Wijesekera

PDL Semantics - Satisfaction Prepositional connectives as usual: I.e. si |= A /\ B if si |= A and si |= B I.e. si |= A  B if si |= A or si |= B Modal Connectives as in Modal Logic I.e. si |= [a]A, if for all states sj such that (si , sj) e Ra sj |= A I.e. si |= <a>A, there is a state sj with (si , sj) e Ra and sj |= A SWE 623 Duminda Wijesekera

PDL Axiom System Axioms of prepositional logic [a] (A  B)  ([a]A [a]B) [a] (A /\ B) <-> ([a]A /\ [a]B) [a U b]A <-> ([a] A /\ [b] A) [a ; b]A <-> [a] [b] A [B?]A <-> (B /\ A) B /\ [a] [a*] A <-> [a*] A B /\ [a*]( A [a]A)  [a*] A SWE 623 Duminda Wijesekera

PDL Axiom System: Rules Modus Ponens A, A -> B B Modal Generalization A [a] A SWE 623 Duminda Wijesekera

Some Derived Rules for PDL Monotonicity of <a> A -> B <a>A -> <a>B Monotonicity of [a] [a]A -> [a]B SWE 623 Duminda Wijesekera

Some Provable Properties [a] (A /\ B)  ([a]A /\[a]B) <a> (A \/ B) <-> (<a>A \/ <a>B) (<a>A /\ [a] B)  <a>(A /\ B) [a ]A <-> ( <a>( A)) <a>false <-> false <a><b>A <-> <a;b>A, [a][b]A <-> [a;b] A < a U b>A <-> (<a>A \/ <b>B) [ a U b]A <-> ([a]A /\ [b]B) SWE 623 Duminda Wijesekera

Translating Gires’s Style Pre/Post Conditions to PDL Skip == True? Fail == false? If A then a else b == (A?;a) U (A?;b) While A do a == (A?;a)*; (A?) SWE 623 Duminda Wijesekera

First-Order Dynamic Logic Syntax: The same definition as predicate logic except for the additions If A is a formula and a is a program, then [a]A, <a>A are formulas. If A is a formula, then A? is a test. (I.e. a program) If A is quantifier free then its said to be a basic test, and otherwise a rich test. SWE 623 Duminda Wijesekera

First-Order Dynamic Logic Semantics: Transitions between states defined as R(X :=a) = { (S, S’) : if S’(x) = S(a) and S’(y) = S(y) for Y != X } R(A?) = {(S,S) : S |= A } Definitions of U, ; are same as in the prepositional case. SWE 623 Duminda Wijesekera

Axiomatization Axioms All axioms for predicate logic All axioms for PDL A[t/x] <-> < x:= t>A(x) A <-> A’, A’ is obtained by replacing any program a by z:=x; a’; x:=z, where a’ is a with all occurrences of x replaced by z, and z does not appear in a SWE 623 Duminda Wijesekera

Axiomatization: Rules modus ponens A, A -> B B Generalization A A [a] A  x A(x) Infinitary convergence A -> [an]B for all n B -> [a*]B SWE 623 Duminda Wijesekera

Some Example Reductions I Reduce: X:=X+1; ((X:=a) U (X:=b))  A(X) Step1:  X=X+1; (X=a)  (X=b)  A(X) Step2:  X=X+1   (X=a)  A(X)  <X=X+1   (X=b)  A(X) Step3:  X=X+1  A Step4: A(a)  A(b) SWE 623 Duminda Wijesekera

Some Example Reductions II Reduce: [x:=x+1;(x:=a U x:=b)] B(X) Step1: [x:=a+1 U x:=b+1]B(x) Step 2: [x:=a+1]B(x) /\ [x:=b+1]B(x) Step 3: B(a+1) /\ B(b+1) SWE 623 Duminda Wijesekera

Temporal Logic Special kind of modal logic to reason about time. There are many kinds of Temporal Logics Linear and Branching Time Future and Past times Discrete and Continuous time Operators in Temporal Logics (MacMillan’s Notation) O = next time F [] = always G  = some times X  = until U SWE 623 Duminda Wijesekera

Prepositional Syntax Atomic Proposition letters p, q etc. If p, q are propositions then so are. Meaning Logical Notation Model Checking Next Time p: Op Xp All ways p: []p Gp In the future p: p Fp p until q: p  q pUq SWE 623 Duminda Wijesekera

Prepositional Semantics A collection of Kripke Worlds including the current one. Accessibility relation is evolution of time. SWE 623 Duminda Wijesekera

Prepositional Semantics II |= Op if some world accessible from the current satisfies p. |= []p if every world accessible from the current satisfies p. |=  p if some world in the future from the current satisfies p. SWE 623 Duminda Wijesekera

PTL Axioms and Rules I Axioms [](A ->B) ->([]A -> []B) O(A ->B) -> (OA -> OB) (O  A) <-> (OA) []A -> (A /\ O[]A) [](A -> OA) -> (A -> []A) A  B -> B A  B <-> B \/ (A /\ O(A  B )) SWE 623 Duminda Wijesekera

PTL Axioms and Rules II Rules modus ponens generalization A [] A O A SWE 623 Duminda Wijesekera