B Method Proof assistants May 16, 2017 Lucas Franceschino What is - - PowerPoint PPT Presentation

b method
SMART_READER_LITE
LIVE PREVIEW

B Method Proof assistants May 16, 2017 Lucas Franceschino What is - - PowerPoint PPT Presentation

B Method Proof assistants May 16, 2017 Lucas Franceschino What is B method? B-method goal Actual Specifications program 3 B-method goal Actual Specifications program Machine 3 B-method goal Actual Specifications


slide-1
SLIDE 1

May 16, 2017

B Method

Proof assistants Lucas Franceschino

slide-2
SLIDE 2

What is B method?

slide-3
SLIDE 3

◎ B-method goal

Specifications Actual program

3

slide-4
SLIDE 4

◎ B-method goal

Specifications Actual program

 Machine

3

slide-5
SLIDE 5

◎ B-method goal

Specifications Actual program

 Machine  Refinement 1

3

slide-6
SLIDE 6

◎ B-method goal

Specifications Actual program

 Machine  Refinement 1  Refinement 2

3

slide-7
SLIDE 7

◎ B-method goal

Specifications Actual program

 Machine  Refinement 1  Refinement 2  Refinement 3

3

slide-8
SLIDE 8

◎ B-method goal

Specifications Actual program

 Machine  Refinement 1 C / ada  Refinement 2  Refinement 3

3

slide-9
SLIDE 9

◎ B-method goal

Specifications Actual program

 Machine  Refinement 1 C / ada  Refinement 2  Refinement 3

3

slide-10
SLIDE 10

◎ B-method goal

Specifications Actual program

No gap between specification specification and actual pr actual progr

  • gram

3

slide-11
SLIDE 11

♂ The initiator of B method

Jean-Raymond Abrial

1970

Specification of data structures and programs Initiated the Z-Notation (in Oxford)

  • G. Laffitte,
  • F. Mejia,
  • I. Mc Neal

B4free, Bart, ABTools…

4

slide-12
SLIDE 12

♂ The initiator of B method

Jean-Raymond Abrial

1970

Specification of data structures and programs Initiated the Z-Notation (in Oxford)

Good for formal specifications, not for development

  • G. Laffitte,
  • F. Mejia,
  • I. Mc Neal

4

slide-13
SLIDE 13

♂ The initiator of B method

Jean-Raymond Abrial

1970

Specification of data structures and programs Initiated the Z-Notation (in Oxford)

Good for formal specifications, not for development

1996

Published “The B Book” Atelier B

  • G. Laffitte,
  • F. Mejia,
  • I. Mc Neal

B4free, Bart, ABTools…

4

slide-14
SLIDE 14

♂ The initiator of B method

Jean-Raymond Abrial

1970

Specification of data structures and programs Initiated the Z-Notation (in Oxford)

Good for formal specifications, not for development

1996

Published “The B Book” Atelier B

2010

Published “Modeling in Event-B : system and software engineering” Rodin platform

  • G. Laffitte,
  • F. Mejia,
  • I. Mc Neal

B4free, Bart, ABTools…

4

slide-15
SLIDE 15

♂ The initiator of B method

Jean-Raymond Abrial

1970

Specification of data structures and programs Initiated the Z-Notation (in Oxford)

Good for formal specifications, not for development

1996

Published “The B Book” Atelier B Was in the development team of Ada

2010

Published “Modeling in Event-B : system and software engineering” Rodin platform

  • G. Laffitte,
  • F. Mejia,
  • I. Mc Neal

B4free, Bart, ABTools…

4

slide-16
SLIDE 16

Use cases

slide-17
SLIDE 17

 Train related B projects around the world

Braking system, platform screen doors…

6

slide-18
SLIDE 18

 Use case: Meteor in Paris (line 14)

110 000 lines of B  87 000 lines of Ada  29 000 lemmas 

7

slide-19
SLIDE 19

 Use case: Meteor in Paris (line 14)

Driverless trains  Extension in 2003  80 million passengers in 2009 

110 000 lines of B  87 000 lines of Ada  29 000 lemmas 

7

slide-20
SLIDE 20

 Use case: Meteor in Paris (line 14)

9.2 km . October 1998  Driverless trains  Extension in 2003  80 million passengers in 2009 

110 000 lines of B  87 000 lines of Ada  29 000 lemmas 

7

slide-21
SLIDE 21

 Use case: Meteor in Paris (line 14)

9.2 km . October 1998  No bugs discovered yet!  Still in version 1.0  Driverless trains  Extension in 2003  80 million passengers in 2009 

110 000 lines of B  87 000 lines of Ada  29 000 lemmas 

7

slide-22
SLIDE 22

Other use cases

  • Peugeot cars: formalization of sub systems (lights system,

airbags, motor) to help building diagnostic tools

  • Modeling of tasks scheduling from the software controlling the

stage separations of Ariane rocket

  • Protocol study
  • JavaCard runtime formalization

Java runtime for smartcard

Provide safe: authentication, data storage, application processing

8

slide-23
SLIDE 23

Developing in B

slide-24
SLIDE 24

B method development

Specification

Integration tests

Conception

Unit tests

Code Validation

10

slide-25
SLIDE 25

B method development

Specification

Integration tests

Conception

Unit tests

Code Validation

10

slide-26
SLIDE 26

B method development

Specification

Integration tests

Conception

Unit tests

Code Validation

10

slide-27
SLIDE 27

B method development

Specification

Integration tests

Conception

Unit tests

Code Validation

10

slide-28
SLIDE 28

B method development

Specification

Integration tests

Conception

Unit tests

Code Validation

10

slide-29
SLIDE 29

B method development

Specification

Integration tests

Conception

Unit tests

Code Validation

10

slide-30
SLIDE 30

How does method B works

 Module: modelling of a sub system

 Component

11

slide-31
SLIDE 31

How does method B works

 Module: modelling of a sub system

 Component Static part Static part Definition of: Variables, constants, sets List of invariants Dynamic part Dynamic part Initialize variables Define operations on variables Pr Proo

  • of

Static part coherence Initializing preserve invariants Operations preserve invariants

11

slide-32
SLIDE 32

How does method B works

 Module: modelling of a sub system  Abstract machine

 Component Static part Static part Definition of: Variables, constants, sets List of invariants Dynamic part Dynamic part Initialize variables Define operations on variables Pr Proo

  • of

Static part coherence Initializing preserve invariants Operations preserve invariants

11

slide-33
SLIDE 33

How does method B works

 Module: modelling of a sub system  Abstract machine  Refinements

 Component Static part Static part Definition of: Variables, constants, sets List of invariants Dynamic part Dynamic part Initialize variables Define operations on variables Pr Proo

  • of

Static part coherence Initializing preserve invariants Operations preserve invariants

11

slide-34
SLIDE 34

How does method B works

 Module: modelling of a sub system  Abstract machine  Refinements

 Component Static part Static part Definition of: Variables, constants, sets List of invariants Dynamic part Dynamic part Initialize variables Define operations on variables Pr Proo

  • of

Static part coherence Initializing preserve invariants Operations preserve invariants

 Implementation

11

slide-35
SLIDE 35

How does method B works

 Module: modelling of a sub system  Abstract machine  Refinements

 Component Static part Static part Definition of: Variables, constants, sets List of invariants Dynamic part Dynamic part Initialize variables Define operations on variables Pr Proo

  • of

Static part coherence Initializing preserve invariants Operations preserve invariants

 Implementation

We refine a previous component: we make it more precise and specific

11

slide-36
SLIDE 36

Machine, refinement, implementation

 Abstract machine  Refinements  Implementation

Substitutions

12

slide-37
SLIDE 37

Machine, refinement, implementation

 Abstract machine  Refinements  Implementation

Substitutions

12

slide-38
SLIDE 38

Machine, refinement, implementation

 Abstract machine  Refinements  Implementation

 Precondition  Choice  Become such that  Simultaneous operations  Sequencing  While loop  Let bindings Substitutions

12

slide-39
SLIDE 39

Machine, refinement, implementation

 Abstract machine  Refinements  Implementation

 Precondition  Choice  Become such that  Simultaneous operations  Sequencing  While loop  Let bindings

Predicated-based IF

Substitutions

12

slide-40
SLIDE 40

Machine, refinement, implementation

 Abstract machine  Refinements  Implementation

 Precondition  Choice  Become such that  Simultaneous operations  Sequencing  While loop  Let bindings

Predicated-based IF ANY x WHERE x ∈ S

Substitutions

12

slide-41
SLIDE 41

Machine, refinement, implementation

 Abstract machine  Refinements  Implementation

 Precondition  Choice  Become such that  Simultaneous operations  Sequencing  While loop  Let bindings

Predicated-based IF ANY x WHERE x ∈ S a := 1 ; ; b := 1

Substitutions

12

slide-42
SLIDE 42

Machine, refinement, implementation

 Abstract machine  Refinements  Implementation

 Precondition  Choice  Become such that  Simultaneous operations  Sequencing  While loop  Let bindings

Predicated-based IF ANY x WHERE x ∈ S a := 1 ; ; b := 1 x : (x ∈ INT ∧ x < 20) not deterministic

Substitutions

12

slide-43
SLIDE 43

Machine, refinement, implementation

 Abstract machine  Refinements  Implementation

 Precondition  Choice  Become such that  Simultaneous operations  Sequencing  While loop  Let bindings

Predicated-based IF ANY x WHERE x ∈ S a := 1 ; ; b := 1 a := 1 || || b := 1 b := 1 || || a := 1 x : (x ∈ INT ∧ x < 20) not deterministic

Substitutions

12

slide-44
SLIDE 44

Machine, refinement, implementation

 Abstract machine  Refinements  Implementation

 Precondition  Choice  Let bindings  Become such that  Simultaneous operations  Sequencing  While loop  Precondition  Choice  Become such that  Simultaneous operations  Sequencing  While loop  Let bindings

Predicated-based IF ANY x WHERE x ∈ S a := 1 ; ; b := 1 a := 1 || || b := 1 b := 1 || || a := 1 x : (x ∈ INT ∧ x < 20) not deterministic

Substitutions

12

slide-45
SLIDE 45

Machine, refinement, implementation

 Abstract machine  Refinements  Implementation

 Precondition  Choice  Let bindings  Become such that  Simultaneous operations  Sequencing  While loop  Precondition  Choice  Let bindings  Become such that  Simultaneous operations  Sequencing  While loop  Precondition  Choice  Become such that  Simultaneous operations  Sequencing  While loop  Let bindings

Predicated-based IF ANY x WHERE x ∈ S a := 1 ; ; b := 1 a := 1 || || b := 1 b := 1 || || a := 1 x : (x ∈ INT ∧ x < 20) not deterministic

Substitutions

12

slide-46
SLIDE 46

Machine, refinement, implementation

 Abstract machine  Refinements  Implementation

 Precondition  Choice  Let bindings  Become such that  Simultaneous operations  Sequencing  While loop  Precondition  Choice  Let bindings  Become such that  Simultaneous operations  Sequencing  While loop  Precondition  Choice  Become such that  Simultaneous operations  Sequencing  While loop  Let bindings

Predicated-based IF ANY x WHERE x ∈ S a := 1 ; ; b := 1 a := 1 || || b := 1 b := 1 || || a := 1 x : (x ∈ INT ∧ x < 20) not deterministic M a k i n g p r

  • g

r a m m

  • r

e c

  • n

c r e t e

Substitutions

12

slide-47
SLIDE 47

More substitutions

Machine Refinement Implementation Block Y Y Y Identical Y Y Y Becomes Equal Y Y Y Precondition Y Y N Assertion Y Y Y Bounded choice Y Y N IF conditional Y Y Y Conditional Bounded choice Y Y N Case Conditional Y Y Y Unbounded choice Y Y N Local Definition Y Y N Becomes Element of Y Y N Becomes such that Y Y N Local Variable N Y Y Sequencing N Y Y Operation Call Y Y Y While Loop N N Y Simultaneous Y Y N

13

slide-48
SLIDE 48

B language

14

slide-49
SLIDE 49

B language

State oriented

S1 S2

14

slide-50
SLIDE 50

B language

State oriented

S1 S2

Hoare logic

14

slide-51
SLIDE 51

B language

State oriented

S1 S2

Hoare logic

  • y := 3 3

2 x := x*x 4

14

slide-52
SLIDE 52

B language

State oriented

S1 S2

Hoare logic

  • y := 3 3

2 x := x*x 4 / ≔

ASSIGNMENT

14

slide-53
SLIDE 53

B language

State oriented

S1 S2

Hoare logic

  • y := 3 3

2 x := x*x 4 / ≔

ASSIGNMENT

, ;

COMPOSITION

14

slide-54
SLIDE 54

B language

State oriented

S1 S2

Hoare logic

  • y := 3 3

2 x := x*x 4 / ≔

ASSIGNMENT

, ;

COMPOSITION

∧ , ∧ if then else end

CONDITIONAL

14

slide-55
SLIDE 55

B language

State oriented

S1 S2

Hoare logic

  • y := 3 3

2 x := x*x 4 / ≔

ASSIGNMENT

, ;

COMPOSITION

∧ , ∧ if then else end

CONDITIONAL

∧ while do done ∧

WHILE

14

slide-56
SLIDE 56

B language

State oriented

S1 S2

Hoare logic

  • y := 3 3

2 x := x*x 4 / ≔

ASSIGNMENT

, ;

COMPOSITION

∧ , ∧ if then else end

CONDITIONAL

∧ while do done ∧

WHILE

→ , , →

CONSEQUENCE

14

slide-57
SLIDE 57

B language

15

slide-58
SLIDE 58

B language

Arithmetic

15

slide-59
SLIDE 59

B language

Arithmetic

15

slide-60
SLIDE 60

B language

Arithmetic

15

slide-61
SLIDE 61

B language

∏ ∑ Arithmetic

15

slide-62
SLIDE 62

B language

Functions and relations ∏ ∑ Arithmetic

15

slide-63
SLIDE 63

B language

Partial / total functions, surjections, lambda, domain/range manipulations, closure, inversions… Functions and relations ∏ ∑ Arithmetic

15

slide-64
SLIDE 64

B language

Partial / total functions, surjections, lambda, domain/range manipulations, closure, inversions… Functions and relations ∏ ∑ Arithmetic

15

slide-65
SLIDE 65

B language

Sets Partial / total functions, surjections, lambda, domain/range manipulations, closure, inversions… Functions and relations ∏ ∑ Arithmetic

15

slide-66
SLIDE 66

B language

Set comprehension, generalized union & intersections Sets Partial / total functions, surjections, lambda, domain/range manipulations, closure, inversions… Functions and relations ∏ ∑ Arithmetic

15

slide-67
SLIDE 67

B language

Records Set comprehension, generalized union & intersections Sets Partial / total functions, surjections, lambda, domain/range manipulations, closure, inversions… Functions and relations ∏ ∑ Arithmetic

15

slide-68
SLIDE 68

B language

Trees Records Set comprehension, generalized union & intersections Sets Partial / total functions, surjections, lambda, domain/range manipulations, closure, inversions… Functions and relations ∏ ∑ Arithmetic

15

slide-69
SLIDE 69

B language

Sequences Trees Records Set comprehension, generalized union & intersections Sets Partial / total functions, surjections, lambda, domain/range manipulations, closure, inversions… Functions and relations ∏ ∑ Arithmetic

15

slide-70
SLIDE 70

B language

No algebraic data types Sequences Trees Records Set comprehension, generalized union & intersections Sets Partial / total functions, surjections, lambda, domain/range manipulations, closure, inversions… Functions and relations ∏ ∑ Arithmetic

15

slide-71
SLIDE 71

Proofs with B

slide-72
SLIDE 72

How does B method handles proofs?

Component

 Abstract machine  Refinements  Implementation 17

slide-73
SLIDE 73

How does B method handles proofs?

Component

 Abstract machine  Refinements  Implementation

MACHINE Name(input1, input2, ...)

17

slide-74
SLIDE 74

How does B method handles proofs?

Component

 Abstract machine  Refinements  Implementation

MACHINE Name(input1, input2, ...) CONSTRAINTS input1 ∈ INT ∧ input2 ∈ INT ...

17

slide-75
SLIDE 75

How does B method handles proofs?

Component

 Abstract machine  Refinements  Implementation

MACHINE Name(input1, input2, ...) CONSTRAINTS input1 ∈ INT ∧ input2 ∈ INT ... CONSTANTS cst1, cst2, ...

17

slide-76
SLIDE 76

How does B method handles proofs?

Component

 Abstract machine  Refinements  Implementation

MACHINE Name(input1, input2, ...) CONSTRAINTS input1 ∈ INT ∧ input2 ∈ INT ... CONSTANTS cst1, cst2, ... VARIABLES var1, var2, ...

17

slide-77
SLIDE 77

How does B method handles proofs?

Component

 Abstract machine  Refinements  Implementation

MACHINE Name(input1, input2, ...) CONSTRAINTS input1 ∈ INT ∧ input2 ∈ INT ... CONSTANTS cst1, cst2, ... VARIABLES var1, var2, ... INVARIANT var1 + var2 ∈ {x . X**(1/2) ∈ } ∧ ...

17

slide-78
SLIDE 78

How does B method handles proofs?

Component

 Abstract machine  Refinements  Implementation

MACHINE Name(input1, input2, ...) CONSTRAINTS input1 ∈ INT ∧ input2 ∈ INT ... CONSTANTS cst1, cst2, ... VARIABLES var1, var2, ... INVARIANT var1 + var2 ∈ {x . X**(1/2) ∈ } ∧ ... ASSERTIONS predicate1 ∧ predicate2 ∧ ...

17

slide-79
SLIDE 79

How does B method handles proofs?

Component

 Abstract machine  Refinements  Implementation

MACHINE Name(input1, input2, ...) CONSTRAINTS input1 ∈ INT ∧ input2 ∈ INT ... CONSTANTS cst1, cst2, ... VARIABLES var1, var2, ... INVARIANT var1 + var2 ∈ {x . X**(1/2) ∈ } ∧ ... ASSERTIONS predicate1 ∧ predicate2 ∧ ...

17

slide-80
SLIDE 80

How does B method handles proofs?

Component

 Abstract machine  Refinements  Implementation

MACHINE Name(input1, input2, ...) CONSTRAINTS input1 ∈ INT ∧ input2 ∈ INT ... CONSTANTS cst1, cst2, ... VARIABLES var1, var2, ... INVARIANT var1 + var2 ∈ {x . X**(1/2) ∈ } ∧ ... ASSERTIONS predicate1 ∧ predicate2 ∧ ...

Prove all predicates

17

slide-81
SLIDE 81

How does B method handles proofs?

Component

 Abstract machine  Refinements  Implementation

MACHINE Name(input1, input2, ...) CONSTRAINTS input1 ∈ INT ∧ input2 ∈ INT ... CONSTANTS cst1, cst2, ... VARIABLES var1, var2, ... INVARIANT var1 + var2 ∈ {x . X**(1/2) ∈ } ∧ ... ASSERTIONS predicate1 ∧ predicate2 ∧ ... INITIALISATION var1 := expr || var2 := expr

Prove all predicates

17

slide-82
SLIDE 82

How does B method handles proofs?

Component

 Abstract machine  Refinements  Implementation

MACHINE Name(input1, input2, ...) CONSTRAINTS input1 ∈ INT ∧ input2 ∈ INT ... CONSTANTS cst1, cst2, ... VARIABLES var1, var2, ... INVARIANT var1 + var2 ∈ {x . X**(1/2) ∈ } ∧ ... ASSERTIONS predicate1 ∧ predicate2 ∧ ... INITIALISATION var1 := expr || var2 := expr

Prove all predicates For each initialization, prove invariant conservations

17

slide-83
SLIDE 83

How does B method handles proofs?

Component

 Abstract machine  Refinements  Implementation

MACHINE Name(input1, input2, ...) CONSTRAINTS input1 ∈ INT ∧ input2 ∈ INT ... CONSTANTS cst1, cst2, ... VARIABLES var1, var2, ... INVARIANT var1 + var2 ∈ {x . X**(1/2) ∈ } ∧ ... ASSERTIONS predicate1 ∧ predicate2 ∧ ... INITIALISATION var1 := expr || var2 := expr OPERATIONS varOutput1 ← fun1(i1, i2, ...) = ... varOutput2 ← fun2(i1, i2, ...) = ...

Prove all predicates For each initialization, prove invariant conservations

17

slide-84
SLIDE 84

How does B method handles proofs?

Component

 Abstract machine  Refinements  Implementation

MACHINE Name(input1, input2, ...) CONSTRAINTS input1 ∈ INT ∧ input2 ∈ INT ... CONSTANTS cst1, cst2, ... VARIABLES var1, var2, ... INVARIANT var1 + var2 ∈ {x . X**(1/2) ∈ } ∧ ... ASSERTIONS predicate1 ∧ predicate2 ∧ ... INITIALISATION var1 := expr || var2 := expr OPERATIONS varOutput1 ← fun1(i1, i2, ...) = ... varOutput2 ← fun2(i1, i2, ...) = ...

Prove all predicates For each initialization, prove invariant conservations Show each operation conserve invariants

17

slide-85
SLIDE 85

How does B method handles proofs?

Component

 Abstract machine  Refinements  Implementation

MACHINE Name(input1, input2, ...) CONSTRAINTS input1 ∈ INT ∧ input2 ∈ INT ... CONSTANTS cst1, cst2, ... VARIABLES var1, var2, ... INVARIANT var1 + var2 ∈ {x . X**(1/2) ∈ } ∧ ... ASSERTIONS predicate1 ∧ predicate2 ∧ ... INITIALISATION var1 := expr || var2 := expr OPERATIONS varOutput1 ← fun1(i1, i2, ...) = ... varOutput2 ← fun2(i1, i2, ...) = ...

Prove all predicates For each initialization, prove invariant conservations Show each operation conserve invariants

 Proof Obligations

17

slide-86
SLIDE 86

Proving with B method: interactive only

18

slide-87
SLIDE 87

Proving with B method: interactive only

18

slide-88
SLIDE 88

Proving with B method: interactive only

18

slide-89
SLIDE 89

Proving with B method: interactive only

18

slide-90
SLIDE 90

Proving with B method: interactive only

18

slide-91
SLIDE 91

Proving with B method: interactive only

18

slide-92
SLIDE 92

Proving with B method: interactive only

18

slide-93
SLIDE 93

How does B method internally prove things?

First, expressions are normalized

19

slide-94
SLIDE 94

How does B method internally prove things?

First, expressions are normalized

1

19

slide-95
SLIDE 95

How does B method internally prove things?

First, expressions are normalized

1 S ⊆ 1,2,3 ∈ 1 ∪ 2 ∪ 3

19

slide-96
SLIDE 96

How does B method internally prove things?

(btrue => a) == a ; (bvrb(x)) & (x\a) => #x.a == a ; (bvrb(x)) & (x\b) => #x.(a & b) == (#x.a & b) THEORY SimplifyX IS (i => (j => k)) == (i & j => k) ; (a => bfalse) == not(a) ; (bfalse => a) == btrue ; (a => btrue) == btrue ;

Theory files: list of rules

20

slide-97
SLIDE 97

How does B method internally prove things?

(btrue => a) == a ; (bvrb(x)) & (x\a) => #x.a == a ; (bvrb(x)) & (x\b) => #x.(a & b) == (#x.a & b) THEORY SimplifyX IS (i => (j => k)) == (i & j => k) ; (a => bfalse) == not(a) ; (bfalse => a) == btrue ; (a => btrue) == btrue ;

Theory files: list of rules 10.000 lines of rules

20

slide-98
SLIDE 98

How does B method internally prove things?

(btrue => a) == a ; (bvrb(x)) & (x\a) => #x.a == a ; (bvrb(x)) & (x\b) => #x.(a & b) == (#x.a & b) THEORY SimplifyX IS (i => (j => k)) == (i & j => k) ; (a => bfalse) == not(a) ; (bfalse => a) == btrue ; (a => btrue) == btrue ;

Theory files: list of rules 10.000 lines of rules User can add rules  No safe core

20

slide-99
SLIDE 99

How does B method internally prove things?

(btrue => a) == a ; (bvrb(x)) & (x\a) => #x.a == a ; (bvrb(x)) & (x\b) => #x.(a & b) == (#x.a & b) THEORY SimplifyX IS (i => (j => k)) == (i & j => k) ; (a => bfalse) == not(a) ; (bfalse => a) == btrue ; (a => btrue) == btrue ;

Theory files: list of rules 10.000 lines of rules User can add rules  No safe core

Still, we can prove a rule before adding it

20

slide-100
SLIDE 100

How does B method internally prove things?

(btrue => a) == a ; (bvrb(x)) & (x\a) => #x.a == a ; (bvrb(x)) & (x\b) THEORY SimplifyX IS (i => (j => k)) == (i & j => k) ; (a => bfalse) == not(a) ; (bfalse => a) == btrue ; (a => btrue) == btrue ; P == btrue ;

Theory files: list of rules 10.000 lines of rules User can add rules  No safe core

Still, we can prove a rule before adding it

20

slide-101
SLIDE 101

How does B method internally prove things?

Theory files: list of rules  No safe core 10.000 lines of rules User can add rules

THEORY SimplifyX IS (i => (j => k)) == (i & j => k) ; (a => bfalse) == not(a) ; (bfalse => a) == btrue ; (a => btrue) == btrue ;

Automatic prover

  • Applies recursively rules
  • Case proof
  • Tactics

(btrue => a) == a ; (bvrb(x)) & (x\a) => #x.a == a ; (bvrb(x)) & (x\b) P == btrue ; Still, we can prove a rule before adding it

21

slide-102
SLIDE 102

Interactive proofs

Proof construction Search information Browsing proof obligations Command repetition

22

slide-103
SLIDE 103

Interactive proofs

Proof construction Search information Browsing proof obligations Command repetition Repeat (rr), loop (bb)…

22

slide-104
SLIDE 104

Interactive proofs

Proof construction Search information Browsing proof obligations Command repetition Back (ba), Reset (re), Next (ne), Previous (pv), Goto (go)… Repeat (rr), loop (bb)…

22

slide-105
SLIDE 105

Interactive proofs

Proof construction Search information Browsing proof obligations Command repetition Back (ba), Reset (re), Next (ne), Previous (pv), Goto (go)… Repeat (rr), loop (bb)… Search rule / hypothesis / goal, show proof, reduce PO…

22

slide-106
SLIDE 106

Interactive proofs

Proof construction

23

slide-107
SLIDE 107

Interactive proofs

Proof construction Prover call automatic proofs & simplification

23

slide-108
SLIDE 108

Interactive proofs

Proof construction Prover call automatic proofs & simplification pr

23

slide-109
SLIDE 109

Interactive proofs

Proof construction Prover call automatic proofs & simplification pr ss

23

slide-110
SLIDE 110

Interactive proofs

Proof construction Prover call automatic proofs & simplification Rule applications pr ss

23

slide-111
SLIDE 111

Interactive proofs

Proof construction Prover call automatic proofs & simplification Rule applications pr ss ar

23

slide-112
SLIDE 112

Interactive proofs

Proof construction Prover call automatic proofs & simplification Rule applications Rewrite equality applications, abstract terms pr ss ar

23

slide-113
SLIDE 113

Interactive proofs

Proof construction Prover call automatic proofs & simplification Rule applications Rewrite equality applications, abstract terms pr ss ar eh

23

slide-114
SLIDE 114

Interactive proofs

Proof construction Prover call automatic proofs & simplification Rule applications Rewrite equality applications, abstract terms pr ss ar eh ae

23

slide-115
SLIDE 115

Interactive proofs

Proof construction Prover call automatic proofs & simplification Rule applications Rewrite equality applications, abstract terms pr ss ar eh ae 3 ∧ 3 ∈ ∧ ∈ ⇒

23

slide-116
SLIDE 116

Interactive proofs

Proof construction Prover call automatic proofs & simplification Rule applications Rewrite equality applications, abstract terms pr ss ar eh ae

23

slide-117
SLIDE 117

Interactive proofs

Proof construction Prover call automatic proofs & simplification Rule applications Rewrite equality applications, abstract terms Inference rules contradiction, false hypothesis, cases, instantiate pr ss ar eh ae

23

slide-118
SLIDE 118

Interactive proofs

Proof construction Prover call automatic proofs & simplification Rule applications Rewrite equality applications, abstract terms Inference rules contradiction, false hypothesis, cases, instantiate pr ss ar eh ae ct

23

slide-119
SLIDE 119

Interactive proofs

Proof construction Prover call automatic proofs & simplification Rule applications Rewrite equality applications, abstract terms Inference rules contradiction, false hypothesis, cases, instantiate pr ss ar eh ae ct fh

23

slide-120
SLIDE 120

Interactive proofs

Proof construction Prover call automatic proofs & simplification Rule applications Rewrite equality applications, abstract terms Inference rules contradiction, false hypothesis, cases, instantiate pr ss ar eh ae ct fh dc

23

slide-121
SLIDE 121

Interactive proofs

Proof construction Prover call automatic proofs & simplification Rule applications Rewrite equality applications, abstract terms Inference rules contradiction, false hypothesis, cases, instantiate pr ss ar eh ae ct fh dc se

23

slide-122
SLIDE 122

Interactive proofs

Proof construction Prover call automatic proofs & simplification Rule applications Rewrite equality applications, abstract terms Inference rules contradiction, false hypothesis, cases, instantiate Operations on hypothesis deduction, add hypothesis… pr ss ar eh ae ct fh dc se

23

slide-123
SLIDE 123

Interactive proofs

Proof construction Prover call automatic proofs & simplification Rule applications Rewrite equality applications, abstract terms Inference rules contradiction, false hypothesis, cases, instantiate Operations on hypothesis deduction, add hypothesis… pr ss ar eh ae ct fh dc se dd

23

slide-124
SLIDE 124

Interactive proofs

Proof construction Prover call automatic proofs & simplification Rule applications Rewrite equality applications, abstract terms Inference rules contradiction, false hypothesis, cases, instantiate Operations on hypothesis deduction, add hypothesis… pr ss ar eh ae ct fh dc se dd ah

23

slide-125
SLIDE 125

Concrete case

slide-126
SLIDE 126

Example: seat reservation system

Two operations: reserve a seat or free a seat Data : set of seats and sub set of taken seats

25

slide-127
SLIDE 127

Thank you for listening!

Any questions?