Page 1
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.1
CSC 4504 : Langages formels et applications
(La méthode Event-B)
J Paul Gibson, A207
[email protected]
http://www-public.it-sudparis.eu/~gibson/Teaching/Event-B/
OddEven
http://www-public.it-sudparis.eu/~gibson/Teaching/Event-B/OddEven.pdf
Page 2
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.2
Simple proofs on properties of odd and even numbers
Express as theorems and use RODIN to prove:
thm1. The addition of two even numbers is even
thm2. The difference between two odd numbers is even
thm3. The multiplication of an even number with an odd number is even
thm4. The multiplication of two odd numbers is odd
Page 3
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.3
1. The addition of two even numbers is even
Page 4
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.4
1. The addition of two even numbers is even
Page 5
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.5
1. The addition of two even numbers is even
Autoprovers
Page 6
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.6
1. The addition of two even numbers is even
instantiate
Page 7
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.7
1. The addition of two even numbers is even
Page 8
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.8
1. The addition of two even numbers is even
Remove selected hypothesis
Page 9
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.9
1. The addition of two even numbers is even
repeat sequence for instantiation of b
Page 10
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.10
1. The addition of two even numbers is even
Don’t forget to save if you are making progress
Page 11
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.11
1. The addition of two even numbers is even
Add hypothesisand select for proofUsing autoprover
Page 12
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.12
1. The addition of two even numbers is even
Repeat the same sequence for b
Page 13
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.13
1. The addition of two even numbers is even
Free existential variables
Page 14
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.14
1. The addition of two even numbers is even
Remove hypotheses (no longer needed)
Page 15
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.15
1. The addition of two even numbers is even
Try autoprover on original theorem
Page 16
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.16
1. The addition of two even numbers is even
Instantiate with y+y+y0+y0Remove unnecessary hypothesesAdd new hypothesis:
Page 17
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.17
1. The addition of two even numbers is even
Add abstract expression: y+y0
Page 18
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.18
1. The addition of two even numbers is even
This sequence leads to the final proof step
Setting y1 to ae proves the theorem: can the automated prover do this?
p0 fails but p1 manages it
Page 19
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.19
1. The addition of two even numbers is even
Page 20
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.20
1. The addition of two even numbers is even
Save and explore proof tree
Page 21
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.21
1. The addition of two even numbers is even
The theorem has been marked as proved
Page 22
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.22
1. The addition of two even numbers is even
What if we change specification of EVEN?
What if we change theorem to prove?
… lets try theorem 3 with context1
Page 23
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.23
3. The multiplication of an even number with an odd number is even
Page 24
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.24
3. The multiplication of an even number with an odd number is even
Enable/DisablePost-tactic
Reset persepective
context1
Page 25
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.25
3. The multiplication of an even number with an odd number is even
Proof by contradiction(of goal)
Page 26
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.26
3. The multiplication of an even number with an odd number is even
Pruneand run Post-tactics
Page 27
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.27
3. The multiplication of an even number with an odd number is even
Proof by contradiction(of hypothesis)
Page 28
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.28
3. The multiplication of an even number with an odd number is even
Page 29
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.29
3. The multiplication of an even number with an odd number is even
Circular proof steps:
Try to simplify proof tree, where possible
Page 30
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.30
3. The multiplication of an even number with an odd number is even
Proof for context2 … try to complete it yourselves
Page 31
2009: J Paul Gibson T&MSP-CSC 4504 : Langages formels et applications Event-B/OddEven.31
For Next Week: send to me (by email) before 20th March
Prove theorem 2 or theorem 4 for context 2