Deductive Verification of Object-Oriented Software Part B Bernhard - - PowerPoint PPT Presentation

deductive verification of object oriented software
SMART_READER_LITE
LIVE PREVIEW

Deductive Verification of Object-Oriented Software Part B Bernhard - - PowerPoint PPT Presentation

Deductive Verification of Object-Oriented Software Part B Bernhard Beckert | VTSA, 24.28.08.2015 KIT I NSTITUTE FOR T HEORETICAL C OMPUTER S CIENCE www.kit.edu KIT University of the State of Baden-Wuerttemberg and National Laboratory


slide-1
SLIDE 1

www.kit.edu

KIT – University of the State of Baden-Wuerttemberg and National Laboratory of the Helmholtz Association

Bernhard Beckert | VTSA, 24.–28.08.2015 Part B

Deductive Verification of Object-Oriented Software

KIT – INSTITUTE FOR THEORETICAL COMPUTER SCIENCE

slide-2
SLIDE 2

Part III Program Verification with Dynamic Logic

7

JAVA CARD DL

8

Sequent Calculus

9

Rules for Programs: Symbolic Execution

10 A Calculus for 100% JAVA CARD 11 Taclets – KeY’s Rule Description Language

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 35/102

slide-3
SLIDE 3

Part III Program Verification with Dynamic Logic

7

JAVA CARD DL

8

Sequent Calculus

9

Rules for Programs: Symbolic Execution

10 A Calculus for 100% JAVA CARD 11 Taclets – KeY’s Rule Description Language

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 36/102

slide-4
SLIDE 4

Syntax and Semantics

Syntax

Basis: Typed first-order predicate logic Modal operators p and [p] for each (JAVA CARD) program p Class definitions in background (not shown in formulas)

Semantics (Kripke)

Modal operators allow referring to the final state of p:

[p ] F :

If p terminates, then F holds in the final state (partial correctness)

<p> F : p terminates and F holds in the final state

(total correctness)

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 37/102

slide-5
SLIDE 5

Syntax and Semantics

Syntax

Basis: Typed first-order predicate logic Modal operators p and [p] for each (JAVA CARD) program p Class definitions in background (not shown in formulas)

Semantics (Kripke)

Modal operators allow referring to the final state of p:

[p ] F :

If p terminates, then F holds in the final state (partial correctness)

<p> F : p terminates and F holds in the final state

(total correctness)

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 37/102

slide-6
SLIDE 6

Syntax and Semantics

Syntax

Basis: Typed first-order predicate logic Modal operators p and [p] for each (JAVA CARD) program p Class definitions in background (not shown in formulas)

Semantics (Kripke)

Modal operators allow referring to the final state of p:

[p ] F :

If p terminates, then F holds in the final state (partial correctness)

<p> F : p terminates and F holds in the final state

(total correctness)

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 37/102

slide-7
SLIDE 7

Syntax and Semantics

Syntax

Basis: Typed first-order predicate logic Modal operators p and [p] for each (JAVA CARD) program p Class definitions in background (not shown in formulas)

Semantics (Kripke)

Modal operators allow referring to the final state of p:

[p ] F :

If p terminates, then F holds in the final state (partial correctness)

<p> F : p terminates and F holds in the final state

(total correctness)

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 37/102

slide-8
SLIDE 8

Why Dynamic Logic?

Transparency wrt target programming language Encompasses Hoare Logic More expressive and flexible than Hoare logic Symbolic execution is a natural interactive proof paradigm Programs are “first-class citizens” Real Java syntax

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 38/102

slide-9
SLIDE 9

Why Dynamic Logic?

Transparency wrt target programming language Encompasses Hoare Logic More expressive and flexible than Hoare logic Symbolic execution is a natural interactive proof paradigm Hoare triple

{ψ} α {φ}

  • equiv. to DL formula

ψ − > [α] φ

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 38/102

slide-10
SLIDE 10

Why Dynamic Logic?

Transparency wrt target programming language Encompasses Hoare Logic More expressive and flexible than Hoare logic Symbolic execution is a natural interactive proof paradigm Not merely partial/total correctness: can employ programs for specification (e.g., verifying program transformations) can express security properties (two runs are indistinguishable) extension-friendly (e.g., temporal modalities)

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 38/102

slide-11
SLIDE 11

Why Dynamic Logic?

Transparency wrt target programming language Encompasses Hoare Logic More expressive and flexible than Hoare logic Symbolic execution is a natural interactive proof paradigm

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 38/102

slide-12
SLIDE 12

Dynamic Logic Example Formulas

(balance >= c & amount > 0) − > <charge(amount);> balance > c <x = 1;> ([while (true) {}] false)

Program formulas can appear nested

\forall int val;

  • (<p> x .

= val) < − > (<q> x . = val)

  • p, q equivalent relative to computation state restricted to x

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 39/102

slide-13
SLIDE 13

Dynamic Logic Example Formulas

(balance >= c & amount > 0) − > <charge(amount);> balance > c <x = 1;> ([while (true) {}] false)

Program formulas can appear nested

\forall int val;

  • (<p> x .

= val) < − > (<q> x . = val)

  • p, q equivalent relative to computation state restricted to x

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 39/102

slide-14
SLIDE 14

Dynamic Logic Example Formulas

(balance >= c & amount > 0) − > <charge(amount);> balance > c <x = 1;> ([while (true) {}] false)

Program formulas can appear nested

\forall int val;

  • (<p> x .

= val) < − > (<q> x . = val)

  • p, q equivalent relative to computation state restricted to x

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 39/102

slide-15
SLIDE 15

Dynamic Logic Example Formulas

(balance >= c & amount > 0) − > <charge(amount);> balance > c <x = 1;> ([while (true) {}] false)

Program formulas can appear nested

\forall int val;

  • (<p> x .

= val) < − > (<q> x . = val)

  • p, q equivalent relative to computation state restricted to x

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 39/102

slide-16
SLIDE 16

Dynamic Logic Example Formulas

(balance >= c & amount > 0) − > <charge(amount);> balance > c <x = 1;> ([while (true) {}] false)

Program formulas can appear nested

\forall int val;

  • (<p> x .

= val) < − > (<q> x . = val)

  • p, q equivalent relative to computation state restricted to x

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 39/102

slide-17
SLIDE 17

Dynamic Logic Example Formulas

a != ♥✉❧❧

  • >

< ✐♥t max = 0; ✐❢ ( a.length > 0 ) max = a[0]; ✐♥t i = 1; ✇❤✐❧❡ ( i < a.length ) { ✐❢ ( a[i] > max ) max = a[i]; ++i; } > ( ❭❢♦r❛❧❧ ✐♥t j; (j >= 0 & j < a.length -> max >= a[j]) & (a.length > 0 -> ❭❡①✐sts ✐♥t j; (j >= 0 & j < a.length & max = a[j])) )

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 40/102

slide-18
SLIDE 18

Variables

Logical variables disjoint from program variables

No quantification over program variables Programs do not contain logical variables “Program variables” actually non-rigid functions

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 41/102

slide-19
SLIDE 19

Rigid and Flexible Terms

Example <int i;> \forall int x; (i + 1 . = x − > <i++;> (i . = x))

Interpretation of i depends on computation state

⇒ flexible

Interpretation of x and + do not depend on state

⇒ rigid

Locations are always flexible Logical variables, standard functions are always rigid

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 42/102

slide-20
SLIDE 20

Rigid and Flexible Terms

Example <int i;> \forall int x; (i + 1 . = x − > <i++;> (i . = x))

Interpretation of i depends on computation state

⇒ flexible

Interpretation of x and + do not depend on state

⇒ rigid

Locations are always flexible Logical variables, standard functions are always rigid

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 42/102

slide-21
SLIDE 21

Rigid and Flexible Terms

Example <int i;> \forall int x; (i + 1 . = x − > <i++;> (i . = x))

Interpretation of i depends on computation state

⇒ flexible

Interpretation of x and + do not depend on state

⇒ rigid

Locations are always flexible Logical variables, standard functions are always rigid

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 42/102

slide-22
SLIDE 22

Rigid and Flexible Terms

Example <int i;> \forall int x; (i + 1 . = x − > <i++;> (i . = x))

Interpretation of i depends on computation state

⇒ flexible

Interpretation of x and + do not depend on state

⇒ rigid

Locations are always flexible Logical variables, standard functions are always rigid

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 42/102

slide-23
SLIDE 23

Rigid and Flexible Terms

Example <int i;> \forall int x; (i + 1 . = x − > <i++;> (i . = x))

Interpretation of i depends on computation state

⇒ flexible

Interpretation of x and + do not depend on state

⇒ rigid

Locations are always flexible Logical variables, standard functions are always rigid

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 42/102

slide-24
SLIDE 24

Validity

A JAVA CARD DL formula is valid iff it is true in all states. We need a calculus for checking validity of formulas

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 43/102

slide-25
SLIDE 25

Validity

A JAVA CARD DL formula is valid iff it is true in all states. We need a calculus for checking validity of formulas

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 43/102

slide-26
SLIDE 26

Part III Program Verification with Dynamic Logic

7

JAVA CARD DL

8

Sequent Calculus

9

Rules for Programs: Symbolic Execution

10 A Calculus for 100% JAVA CARD 11 Taclets – KeY’s Rule Description Language

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 44/102

slide-27
SLIDE 27

Part III Program Verification with Dynamic Logic

7

JAVA CARD DL

8

Sequent Calculus

9

Rules for Programs: Symbolic Execution

10 A Calculus for 100% JAVA CARD 11 Taclets – KeY’s Rule Description Language

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 45/102

slide-28
SLIDE 28

Sequents and their Semantics

Syntax ψ1, . . . , ψm

  • Antecedent

= ⇒ φ1, . . . , φn

  • Succedent

where the φi, ψi are formulae (without free variables)

Semantics

Same as the formula

(ψ1 & · · · & ψm) − > (φ1 | · · · | φn)

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 46/102

slide-29
SLIDE 29

Sequents and their Semantics

Syntax ψ1, . . . , ψm

  • Antecedent

= ⇒ φ1, . . . , φn

  • Succedent

where the φi, ψi are formulae (without free variables)

Semantics

Same as the formula

(ψ1 & · · · & ψm) − > (φ1 | · · · | φn)

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 46/102

slide-30
SLIDE 30

Sequent Rules

General form

rule name

Premisses

  • Γ1 =

⇒ ∆1 · · · Γr = ⇒ ∆r Γ = ⇒ ∆

Conclusion

(r = 0 possible: closing rules)

Soundness

If all premisses are valid, then the conclusion is valid

Use in practice

Goal is matched to conclusion

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 47/102

slide-31
SLIDE 31

Sequent Rules

General form

rule name

Premisses

  • Γ1 =

⇒ ∆1 · · · Γr = ⇒ ∆r Γ = ⇒ ∆

Conclusion

(r = 0 possible: closing rules)

Soundness

If all premisses are valid, then the conclusion is valid

Use in practice

Goal is matched to conclusion

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 47/102

slide-32
SLIDE 32

Sequent Rules

General form

rule name

Premisses

  • Γ1 =

⇒ ∆1 · · · Γr = ⇒ ∆r Γ = ⇒ ∆

Conclusion

(r = 0 possible: closing rules)

Soundness

If all premisses are valid, then the conclusion is valid

Use in practice

Goal is matched to conclusion

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 47/102

slide-33
SLIDE 33

Sequent Rules

General form

rule name

Premisses

  • Γ1 =

⇒ ∆1 · · · Γr = ⇒ ∆r Γ = ⇒ ∆

Conclusion

(r = 0 possible: closing rules)

Soundness

If all premisses are valid, then the conclusion is valid

Use in practice

Goal is matched to conclusion

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 47/102

slide-34
SLIDE 34

Some Simple Sequent Rules

not left

Γ = ⇒ A, ∆ Γ, ! A = ⇒ ∆

imp left

Γ = ⇒ A, ∆ Γ, B = ⇒ ∆ Γ, A − > B = ⇒ ∆

close goal

Γ, A = ⇒ A, ∆

close by true

Γ = ⇒ true, ∆

all left

Γ, \forall t x; φ, {x/e}φ = ⇒ ∆ Γ, \forall t x; φ = ⇒ ∆

where e var-free term of type t′ ≺ t

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 48/102

slide-35
SLIDE 35

Some Simple Sequent Rules

not left

Γ = ⇒ A, ∆ Γ, ! A = ⇒ ∆

imp left

Γ = ⇒ A, ∆ Γ, B = ⇒ ∆ Γ, A − > B = ⇒ ∆

close goal

Γ, A = ⇒ A, ∆

close by true

Γ = ⇒ true, ∆

all left

Γ, \forall t x; φ, {x/e}φ = ⇒ ∆ Γ, \forall t x; φ = ⇒ ∆

where e var-free term of type t′ ≺ t

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 48/102

slide-36
SLIDE 36

Some Simple Sequent Rules

not left

Γ = ⇒ A, ∆ Γ, ! A = ⇒ ∆

imp left

Γ = ⇒ A, ∆ Γ, B = ⇒ ∆ Γ, A − > B = ⇒ ∆

close goal

Γ, A = ⇒ A, ∆

close by true

Γ = ⇒ true, ∆

all left

Γ, \forall t x; φ, {x/e}φ = ⇒ ∆ Γ, \forall t x; φ = ⇒ ∆

where e var-free term of type t′ ≺ t

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 48/102

slide-37
SLIDE 37

Some Simple Sequent Rules

not left

Γ = ⇒ A, ∆ Γ, ! A = ⇒ ∆

imp left

Γ = ⇒ A, ∆ Γ, B = ⇒ ∆ Γ, A − > B = ⇒ ∆

close goal

Γ, A = ⇒ A, ∆

close by true

Γ = ⇒ true, ∆

all left

Γ, \forall t x; φ, {x/e}φ = ⇒ ∆ Γ, \forall t x; φ = ⇒ ∆

where e var-free term of type t′ ≺ t

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 48/102

slide-38
SLIDE 38

Some Simple Sequent Rules

not left

Γ = ⇒ A, ∆ Γ, ! A = ⇒ ∆

imp left

Γ = ⇒ A, ∆ Γ, B = ⇒ ∆ Γ, A − > B = ⇒ ∆

close goal

Γ, A = ⇒ A, ∆

close by true

Γ = ⇒ true, ∆

all left

Γ, \forall t x; φ, {x/e}φ = ⇒ ∆ Γ, \forall t x; φ = ⇒ ∆

where e var-free term of type t′ ≺ t

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 48/102

slide-39
SLIDE 39

Sequent Calculus Proofs

Proof tree

Proof is tree structure with goal sequent as root Rules are applied from conclusion (old goal) to premisses (new goals) Rule with no premiss closes proof branch Proof is finished when all goals are closed

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 49/102

slide-40
SLIDE 40

Sequent Calculus Proofs

Proof tree

Proof is tree structure with goal sequent as root Rules are applied from conclusion (old goal) to premisses (new goals) Rule with no premiss closes proof branch Proof is finished when all goals are closed

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 49/102

slide-41
SLIDE 41

Sequent Calculus Proofs

Proof tree

Proof is tree structure with goal sequent as root Rules are applied from conclusion (old goal) to premisses (new goals) Rule with no premiss closes proof branch Proof is finished when all goals are closed

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 49/102

slide-42
SLIDE 42

Sequent Calculus Proofs

Proof tree

Proof is tree structure with goal sequent as root Rules are applied from conclusion (old goal) to premisses (new goals) Rule with no premiss closes proof branch Proof is finished when all goals are closed

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 49/102

slide-43
SLIDE 43

Part III Program Verification with Dynamic Logic

7

JAVA CARD DL

8

Sequent Calculus

9

Rules for Programs: Symbolic Execution

10 A Calculus for 100% JAVA CARD 11 Taclets – KeY’s Rule Description Language

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 50/102

slide-44
SLIDE 44

Part III Program Verification with Dynamic Logic

7

JAVA CARD DL

8

Sequent Calculus

9

Rules for Programs: Symbolic Execution

10 A Calculus for 100% JAVA CARD 11 Taclets – KeY’s Rule Description Language

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 51/102

slide-45
SLIDE 45

Proof by Symbolic Program Execution

Sequent rules for program formulas? What corresponds to top-level connective in a program?

The Active Statement in a Program

Sequent rules execute symbolically the active statement

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 52/102

slide-46
SLIDE 46

Proof by Symbolic Program Execution

Sequent rules for program formulas? What corresponds to top-level connective in a program?

The Active Statement in a Program l:{try{ i=0; j=0; } finally{ k=0; }}

Sequent rules execute symbolically the active statement

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 52/102

slide-47
SLIDE 47

Proof by Symbolic Program Execution

Sequent rules for program formulas? What corresponds to top-level connective in a program?

The Active Statement in a Program l:{try{ i=0; j=0; } finally{ k=0; }}

Sequent rules execute symbolically the active statement

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 52/102

slide-48
SLIDE 48

Proof by Symbolic Program Execution

Sequent rules for program formulas? What corresponds to top-level connective in a program?

The Active Statement in a Program l:{try{

  • π

i=0; j=0; } finally{ k=0; }}

  • ω

passive prefix

π

active statement

i=0;

rest

ω

Sequent rules execute symbolically the active statement

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 52/102

slide-49
SLIDE 49

Proof by Symbolic Program Execution

Sequent rules for program formulas? What corresponds to top-level connective in a program?

The Active Statement in a Program l:{try{

  • π

i=0; j=0; } finally{ k=0; }}

  • ω

passive prefix

π

active statement

i=0;

rest

ω

Sequent rules execute symbolically the active statement

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 52/102

slide-50
SLIDE 50

Rules for Symbolic Program Execution

If-then-else rule Γ, B = true = ⇒ <p ω> φ, ∆ Γ, B = false = ⇒ <q ω> φ, ∆ Γ = ⇒ <if (B) { p } else { q } ω> φ, ∆ Complicated statements/expressions are simplified first, e.g. Γ = ⇒ <v=y; y=y+1; x=v; ω> φ, ∆ Γ = ⇒ <x=y++; ω> φ, ∆ Simple assignment rule Γ = ⇒ {loc := val}<ω> φ, ∆ Γ = ⇒ <loc=val; ω> φ, ∆

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 53/102

slide-51
SLIDE 51

Rules for Symbolic Program Execution

If-then-else rule Γ, B = true = ⇒ <p ω> φ, ∆ Γ, B = false = ⇒ <q ω> φ, ∆ Γ = ⇒ <if (B) { p } else { q } ω> φ, ∆ Complicated statements/expressions are simplified first, e.g. Γ = ⇒ <v=y; y=y+1; x=v; ω> φ, ∆ Γ = ⇒ <x=y++; ω> φ, ∆ Simple assignment rule Γ = ⇒ {loc := val}<ω> φ, ∆ Γ = ⇒ <loc=val; ω> φ, ∆

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 53/102

slide-52
SLIDE 52

Rules for Symbolic Program Execution

If-then-else rule Γ, B = true = ⇒ <p ω> φ, ∆ Γ, B = false = ⇒ <q ω> φ, ∆ Γ = ⇒ <if (B) { p } else { q } ω> φ, ∆ Complicated statements/expressions are simplified first, e.g. Γ = ⇒ <v=y; y=y+1; x=v; ω> φ, ∆ Γ = ⇒ <x=y++; ω> φ, ∆ Simple assignment rule Γ = ⇒ {loc := val}<ω> φ, ∆ Γ = ⇒ <loc=val; ω> φ, ∆

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 53/102

slide-53
SLIDE 53

Extending DL by Explicit State Updates

Updates

explicit syntactic elements in the logic

Elementary Updates {loc := val} φ

where (roughly) loc a program variable x, an attribute access o.attr, or an array access a[i] val is same as loc, or a literal, or a logical variable

Parallel Updates {loc1 := t1 || · · · || locn := tn} φ

no dependency between the n components (but ‘right wins’ semantics)

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 54/102

slide-54
SLIDE 54

Extending DL by Explicit State Updates

Updates

explicit syntactic elements in the logic

Elementary Updates {loc := val} φ

where (roughly) loc a program variable x, an attribute access o.attr, or an array access a[i] val is same as loc, or a literal, or a logical variable

Parallel Updates {loc1 := t1 || · · · || locn := tn} φ

no dependency between the n components (but ‘right wins’ semantics)

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 54/102

slide-55
SLIDE 55

Extending DL by Explicit State Updates

Updates

explicit syntactic elements in the logic

Elementary Updates {loc := val} φ

where (roughly) loc a program variable x, an attribute access o.attr, or an array access a[i] val is same as loc, or a literal, or a logical variable

Parallel Updates {loc1 := t1 || · · · || locn := tn} φ

no dependency between the n components (but ‘right wins’ semantics)

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 54/102

slide-56
SLIDE 56

Why Updates?

Updates are:

lazily applied (i.e. substituted into postcondition) eagerly parallelised + simplified

Advantages

no renaming required delayed/minimized proof branching (efficient aliasing treatment)

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 55/102

slide-57
SLIDE 57

Why Updates?

Updates are:

lazily applied (i.e. substituted into postcondition) eagerly parallelised + simplified

Advantages

no renaming required delayed/minimized proof branching (efficient aliasing treatment)

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 55/102

slide-58
SLIDE 58

Symbolic Execution with Updates (by Example)

x < y = ⇒ x < y

. . .

x < y = ⇒ {x:=y || y:=x}<> y < x

. . .

x < y = ⇒ {t:=x || x:=y || y:=x}<> y < x

. . .

x < y = ⇒ {t:=x || x:=y}{y:=t}<> y < x

. . .

x < y = ⇒ {t:=x}{x:=y}<y=t;> y < x

. . .

x < y = ⇒ {t:=x}<x=y; y=t;> y < x

. . .

= ⇒ x < y − > <int t=x; x=y; y=t;> y < x

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 56/102

slide-59
SLIDE 59

Symbolic Execution with Updates (by Example)

x < y = ⇒ x < y

. . .

x < y = ⇒ {x:=y || y:=x}<> y < x

. . .

x < y = ⇒ {t:=x || x:=y || y:=x}<> y < x

. . .

x < y = ⇒ {t:=x || x:=y}{y:=t}<> y < x

. . .

x < y = ⇒ {t:=x}{x:=y}<y=t;> y < x

. . .

x < y = ⇒ {t:=x}<x=y; y=t;> y < x

. . .

= ⇒ x < y − > <int t=x; x=y; y=t;> y < x

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 56/102

slide-60
SLIDE 60

Symbolic Execution with Updates (by Example)

x < y = ⇒ x < y

. . .

x < y = ⇒ {x:=y || y:=x}<> y < x

. . .

x < y = ⇒ {t:=x || x:=y || y:=x}<> y < x

. . .

x < y = ⇒ {t:=x || x:=y}{y:=t}<> y < x

. . .

x < y = ⇒ {t:=x}{x:=y}<y=t;> y < x

. . .

x < y = ⇒ {t:=x}<x=y; y=t;> y < x

. . .

= ⇒ x < y − > <int t=x; x=y; y=t;> y < x

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 56/102

slide-61
SLIDE 61

Symbolic Execution with Updates (by Example)

x < y = ⇒ x < y

. . .

x < y = ⇒ {x:=y || y:=x}<> y < x

. . .

x < y = ⇒ {t:=x || x:=y || y:=x}<> y < x

. . .

x < y = ⇒ {t:=x || x:=y}{y:=t}<> y < x

. . .

x < y = ⇒ {t:=x}{x:=y}<y=t;> y < x

. . .

x < y = ⇒ {t:=x}<x=y; y=t;> y < x

. . .

= ⇒ x < y − > <int t=x; x=y; y=t;> y < x

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 56/102

slide-62
SLIDE 62

Symbolic Execution with Updates (by Example)

x < y = ⇒ x < y

. . .

x < y = ⇒ {x:=y || y:=x}<> y < x

. . .

x < y = ⇒ {t:=x || x:=y || y:=x}<> y < x

. . .

x < y = ⇒ {t:=x || x:=y}{y:=t}<> y < x

. . .

x < y = ⇒ {t:=x}{x:=y}<y=t;> y < x

. . .

x < y = ⇒ {t:=x}<x=y; y=t;> y < x

. . .

= ⇒ x < y − > <int t=x; x=y; y=t;> y < x

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 56/102

slide-63
SLIDE 63

Symbolic Execution with Updates (by Example)

x < y = ⇒ x < y

. . .

x < y = ⇒ {x:=y || y:=x}<> y < x

. . .

x < y = ⇒ {t:=x || x:=y || y:=x}<> y < x

. . .

x < y = ⇒ {t:=x || x:=y}{y:=t}<> y < x

. . .

x < y = ⇒ {t:=x}{x:=y}<y=t;> y < x

. . .

x < y = ⇒ {t:=x}<x=y; y=t;> y < x

. . .

= ⇒ x < y − > <int t=x; x=y; y=t;> y < x

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 56/102

slide-64
SLIDE 64

Symbolic Execution with Updates (by Example)

x < y = ⇒ x < y

. . .

x < y = ⇒ {x:=y || y:=x}<> y < x

. . .

x < y = ⇒ {t:=x || x:=y || y:=x}<> y < x

. . .

x < y = ⇒ {t:=x || x:=y}{y:=t}<> y < x

. . .

x < y = ⇒ {t:=x}{x:=y}<y=t;> y < x

. . .

x < y = ⇒ {t:=x}<x=y; y=t;> y < x

. . .

= ⇒ x < y − > <int t=x; x=y; y=t;> y < x

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 56/102

slide-65
SLIDE 65

Program State Representation

Local program variables

Modeled as non-rigid constants

Heap

Modeled with theory of arrays:

heap : → Heap (the heap in the current state) select : Heap × Object × Field → Any store : Heap × Object × Field × Any → Heap Heap axioms (excerpt) select(store(h, o, f, x), o, f) = x select(store(h, o, f, x), u, f) = select(h, u, f) if o = u

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 57/102

slide-66
SLIDE 66

Program State Representation

Local program variables

Modeled as non-rigid constants

Heap

Modeled with theory of arrays:

heap : → Heap (the heap in the current state) select : Heap × Object × Field → Any store : Heap × Object × Field × Any → Heap Heap axioms (excerpt) select(store(h, o, f, x), o, f) = x select(store(h, o, f, x), u, f) = select(h, u, f) if o = u

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 57/102

slide-67
SLIDE 67

Program State Representation

Local program variables

Modeled as non-rigid constants

Heap

Modeled with theory of arrays:

heap : → Heap (the heap in the current state) select : Heap × Object × Field → Any store : Heap × Object × Field × Any → Heap Heap axioms (excerpt) select(store(h, o, f, x), o, f) = x select(store(h, o, f, x), u, f) = select(h, u, f) if o = u

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 57/102

slide-68
SLIDE 68

Handling Abrupt Termination

Abrupt termination handled by program transformations Changing control flow = rearranging program parts

Example

TRY-THROW

Γ = ⇒ if (exc instanceof T)

{try {e=exc; r} finally {s}} else {s throw exc;}

ω

  • φ, ∆

Γ = ⇒ <try{throw exc; q} catch(T e){r} finally{s} ω> φ, ∆

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 58/102

slide-69
SLIDE 69

Handling Abrupt Termination

Abrupt termination handled by program transformations Changing control flow = rearranging program parts

Example

TRY-THROW

Γ = ⇒ if (exc instanceof T)

{try {e=exc; r} finally {s}} else {s throw exc;}

ω

  • φ, ∆

Γ = ⇒ <try{throw exc; q} catch(T e){r} finally{s} ω> φ, ∆

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 58/102

slide-70
SLIDE 70

Handling Abrupt Termination

Abrupt termination handled by program transformations Changing control flow = rearranging program parts

Example

TRY-THROW

Γ = ⇒ π if (exc instanceof T)

{try {e=exc; r} finally {s}} else {s throw exc;}

ω

  • φ, ∆

Γ = ⇒ <π try{throw exc; q} catch(T e){r} finally{s} ω> φ, ∆

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 58/102

slide-71
SLIDE 71

Part III Program Verification with Dynamic Logic

7

JAVA CARD DL

8

Sequent Calculus

9

Rules for Programs: Symbolic Execution

10 A Calculus for 100% JAVA CARD 11 Taclets – KeY’s Rule Description Language

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 59/102

slide-72
SLIDE 72

Part III Program Verification with Dynamic Logic

7

JAVA CARD DL

8

Sequent Calculus

9

Rules for Programs: Symbolic Execution

10 A Calculus for 100% JAVA CARD 11 Taclets – KeY’s Rule Description Language

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 60/102

slide-73
SLIDE 73

Supported Java Features

method invocation with polymorphism/dynamic binding

  • bject creation and initialisation

arrays abrupt termination throwing of NullPointerExceptions, etc. bounded integer data types transactions All JAVA CARD language features are fully addressed in KeY

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 61/102

slide-74
SLIDE 74

Supported Java Features

method invocation with polymorphism/dynamic binding

  • bject creation and initialisation

arrays abrupt termination throwing of NullPointerExceptions, etc. bounded integer data types transactions All JAVA CARD language features are fully addressed in KeY

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 61/102

slide-75
SLIDE 75

Java—A Language of Many Features

Ways to deal with Java features

Program transformation, up-front Local program transformation, done by a rule on-the-fly Modeling with first-order formulas Special-purpose extensions of program logic Pro: Feature needs not be handled in calculus Contra: Modified source code Example in KeY: Very rare: treating inner classes

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 62/102

slide-76
SLIDE 76

Java—A Language of Many Features

Ways to deal with Java features

Program transformation, up-front Local program transformation, done by a rule on-the-fly Modeling with first-order formulas Special-purpose extensions of program logic Pro: Flexible, easy to implement, usable Contra: Not expressive enough for all features Example in KeY: Complex expression eval, method inlining, etc., etc.

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 62/102

slide-77
SLIDE 77

Java—A Language of Many Features

Ways to deal with Java features

Program transformation, up-front Local program transformation, done by a rule on-the-fly Modeling with first-order formulas Special-purpose extensions of program logic Pro: No logic extensions required, enough to express most features Contra: Creates difficult first-order POs, unreadable antecedents Example in KeY: Dynamic types and branch predicates

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 62/102

slide-78
SLIDE 78

Java—A Language of Many Features

Ways to deal with Java features

Program transformation, up-front Local program transformation, done by a rule on-the-fly Modeling with first-order formulas Special-purpose extensions of program logic Pro: Arbitrarily expressive extensions possible Contra: Increases complexity of all rules Example in KeY: Method frames, updates

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 62/102

slide-79
SLIDE 79

Components of the Calculus

1

Non-program rules

first-order rules rules for data-types first-order modal rules induction rules

2

Rules for reducing/simplifying the program (symbolic execution) Replace the program by

case distinctions (proof branches) and sequences of updates

3

Rules for handling loops

using loop invariants using induction

4

Rules for replacing a method’s invocation by the method’s contract

5

Update simplification

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 63/102

slide-80
SLIDE 80

Components of the Calculus

1

Non-program rules

first-order rules rules for data-types first-order modal rules induction rules

2

Rules for reducing/simplifying the program (symbolic execution) Replace the program by

case distinctions (proof branches) and sequences of updates

3

Rules for handling loops

using loop invariants using induction

4

Rules for replacing a method’s invocation by the method’s contract

5

Update simplification

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 63/102

slide-81
SLIDE 81

Components of the Calculus

1

Non-program rules

first-order rules rules for data-types first-order modal rules induction rules

2

Rules for reducing/simplifying the program (symbolic execution) Replace the program by

case distinctions (proof branches) and sequences of updates

3

Rules for handling loops

using loop invariants using induction

4

Rules for replacing a method’s invocation by the method’s contract

5

Update simplification

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 63/102

slide-82
SLIDE 82

Components of the Calculus

1

Non-program rules

first-order rules rules for data-types first-order modal rules induction rules

2

Rules for reducing/simplifying the program (symbolic execution) Replace the program by

case distinctions (proof branches) and sequences of updates

3

Rules for handling loops

using loop invariants using induction

4

Rules for replacing a method’s invocation by the method’s contract

5

Update simplification

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 63/102

slide-83
SLIDE 83

Components of the Calculus

1

Non-program rules

first-order rules rules for data-types first-order modal rules induction rules

2

Rules for reducing/simplifying the program (symbolic execution) Replace the program by

case distinctions (proof branches) and sequences of updates

3

Rules for handling loops

using loop invariants using induction

4

Rules for replacing a method’s invocation by the method’s contract

5

Update simplification

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 63/102

slide-84
SLIDE 84

Part III Program Verification with Dynamic Logic

7

JAVA CARD DL

8

Sequent Calculus

9

Rules for Programs: Symbolic Execution

10 A Calculus for 100% JAVA CARD 11 Taclets – KeY’s Rule Description Language

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 64/102

slide-85
SLIDE 85

Part III Program Verification with Dynamic Logic

7

JAVA CARD DL

8

Sequent Calculus

9

Rules for Programs: Symbolic Execution

10 A Calculus for 100% JAVA CARD 11 Taclets – KeY’s Rule Description Language

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 65/102

slide-86
SLIDE 86

Taclets: KeY’s Rule Description Language

Taclets ... represent sequent calculus rules in KeY use a simple text-based format are descriptive, but with operational flavor are not a tactic metalanguage

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 66/102

slide-87
SLIDE 87

Taclet Syntax

andLeft

Γ, A, B = ⇒ ∆ Γ, A & B = ⇒ ∆ Taclet andLeft { \find ( A & B ==> ) \replacewith ( A, B ==>) };

Unique name Find expression:

Formula (Term) to be modified Sequent arrow ==> formula must occur top level and on the corresponding side of the sequent.

Goal Description: describes new sequent

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 67/102

slide-88
SLIDE 88

Taclet Syntax

andLeft

Γ, A, B = ⇒ ∆ Γ, A & B = ⇒ ∆ Taclet andLeft { \find ( A & B ==> ) \replacewith ( A, B ==>) };

Unique name Find expression:

Formula (Term) to be modified Sequent arrow ==> formula must occur top level and on the corresponding side of the sequent.

Goal Description: describes new sequent

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 67/102

slide-89
SLIDE 89

Taclet Syntax

andLeft

Γ, A, B = ⇒ ∆ Γ, A & B = ⇒ ∆ Taclet andLeft { \find ( A & B ==> ) \replacewith ( A, B ==>) };

Unique name Find expression:

Formula (Term) to be modified Sequent arrow ==> formula must occur top level and on the corresponding side of the sequent.

Goal Description: describes new sequent

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 67/102

slide-90
SLIDE 90

Taclet Syntax

andLeft

Γ, A, B = ⇒ ∆ Γ, A & B = ⇒ ∆ Taclet andLeft { \find ( A & B ==> ) \replacewith ( A, B ==>) };

Unique name Find expression:

Formula (Term) to be modified Sequent arrow ==> formula must occur top level and on the corresponding side of the sequent.

Goal Description: describes new sequent

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 67/102

slide-91
SLIDE 91

Taclet Syntax

andLeft

Γ, A, B = ⇒ ∆ Γ, A & B = ⇒ ∆ Taclet andLeft { \find ( A & B ==> ) \replacewith ( A, B ==>) };

Unique name Find expression:

Formula (Term) to be modified Sequent arrow ==> formula must occur top level and on the corresponding side of the sequent.

Goal Description: describes new sequent

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 67/102

slide-92
SLIDE 92

Taclet Syntax

Some rules are only sound in a certain context modusPonens

Γ, A, B = ⇒ ∆ Γ, A, A − > B = ⇒ ∆ Taclet modusPonens { \assumes ( A ==> ) \find ( A -> B ==> ) \replacewith( B ==> ) };

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 68/102

slide-93
SLIDE 93

Taclet Syntax

Some rules are only sound in a certain context modusPonens

Γ, A, B = ⇒ ∆ Γ, A, A − > B = ⇒ ∆ Taclet modusPonens { \assumes ( A ==> ) \find ( A -> B ==> ) \replacewith( B ==> ) };

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 68/102

slide-94
SLIDE 94

Taclet Syntax

Some rules are only sound in a certain context modusPonens

Γ, A, B = ⇒ ∆ Γ, A, A − > B = ⇒ ∆ Taclet modusPonens { \assumes ( A ==> ) \find ( A -> B ==> ) \replacewith( B ==> ) };

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 68/102

slide-95
SLIDE 95

Taclet Syntax

Proof Splitting: andRight Γ = ⇒ A, ∆ Γ = ⇒ B, ∆ Γ = ⇒ A & B, ∆ andRight { \find ( ==> A & B ) \replacewith (==> A ); \replacewith (==> B ) }; Variable Conditions: allRight Γ = ⇒ {x/c}Φ, ∆ Γ = ⇒ ∀T x; Φ, ∆ , c new allRight { \find ( ==> \forall x;phi ) \varcond(\♥❡✇(c,\dependingOn(phi))) \replacewith ( ==> {\subst x;c}phi ) };

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 69/102

slide-96
SLIDE 96

Taclet Syntax

Proof Splitting: andRight Γ = ⇒ A, ∆ Γ = ⇒ B, ∆ Γ = ⇒ A & B, ∆ andRight { \find ( ==> A & B ) \replacewith (==> A ); \replacewith (==> B ) }; Variable Conditions: allRight Γ = ⇒ {x/c}Φ, ∆ Γ = ⇒ ∀T x; Φ, ∆ , c new allRight { \find ( ==> \forall x;phi ) \varcond(\♥❡✇(c,\dependingOn(phi))) \replacewith ( ==> {\subst x;c}phi ) };

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 69/102

slide-97
SLIDE 97

Taclets for Program Transformations

Γ = ⇒ π if (exc == null) {

try{ throw new NPE(); catch(T e) {r}; } else if (exc instanceof T) {e=exc; r} else throw exc; ω

  • φ

Γ = ⇒ <π try{throw exc; q} catch(T e){r}; ω> φ

\find ( <.. tr② { t❤r♦✇ #se; #slist } ❝❛t❝❤ ( #t #v0 ) { #slist1 } ...> post ) \replacewith ( <.. ✐❢ (#se == ♥✉❧❧) { tr② { t❤r♦✇ ♥❡✇ NullPointerException (); } ❝❛t❝❤ (#t #v0) { #slist1 } } ❡❧s❡ ✐❢ (#se ✐♥st❛♥❝❡♦❢ #t) { #t #v0 = (#t) #se; #slist1 } ❡❧s❡ t❤r♦✇ #se; ...> post )

JAVA CARD DL Sequent Calculus Symbolic Execution A Calculus for 100% JAVA CARD Taclets Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 70/102

slide-98
SLIDE 98

Part IV Verifying Information-Flow Properties

12 Information Flow 13 Formalisation in DL 14 Objects and Information Flow

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 71/102

slide-99
SLIDE 99

Part IV Verifying Information-Flow Properties

12 Information Flow 13 Formalisation in DL 14 Objects and Information Flow

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 72/102

slide-100
SLIDE 100

Language-based Information Security

Secret and public information

Partitioning of the set of program variables into variables which contain confidential information (“high variables”) – NOT observable by the attacker – variables which contain non-confidential information (“low variables”) – observable by the attacker –

Informal definition of non-interference

A program is secure, if the initial values of the high variables do not interfere with the final values of the low variables.

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 73/102

slide-101
SLIDE 101

Language-based Information Security

Secret and public information

Partitioning of the set of program variables into variables which contain confidential information (“high variables”) – NOT observable by the attacker – variables which contain non-confidential information (“low variables”) – observable by the attacker –

Informal definition of non-interference

A program is secure, if the initial values of the high variables do not interfere with the final values of the low variables.

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 73/102

slide-102
SLIDE 102

Examples

Note

Sequential Java programs Termination not considered Which methods are secure?

✈♦✐❞ m_1() { low = high; } ✈♦✐❞ m_3() { ✐❢ (high > 0) {low = 1;} ❡❧s❡ {low = 2;}; }

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 74/102

slide-103
SLIDE 103

Examples

Note

Sequential Java programs Termination not considered Which methods are secure?

✈♦✐❞ m_1() { low = high; } ✈♦✐❞ m_3() { ✐❢ (high > 0) {low = 1;} ❡❧s❡ {low = 2;}; }

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 74/102

slide-104
SLIDE 104

Examples

Note

Sequential Java programs Termination not considered Which methods are secure?

✈♦✐❞ m_1() { low = high; }

NOT SECURE

✈♦✐❞ m_3() { ✐❢ (high > 0) {low = 1;} ❡❧s❡ {low = 2;}; }

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 74/102

slide-105
SLIDE 105

Examples

Note

Sequential Java programs Termination not considered Which methods are secure?

✈♦✐❞ m_1() { low = high; }

NOT SECURE

✈♦✐❞ m_3() { ✐❢ (high > 0) {low = 1;} ❡❧s❡ {low = 2;}; }

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 74/102

slide-106
SLIDE 106

Examples

Note

Sequential Java programs Termination not considered Which methods are secure?

✈♦✐❞ m_1() { low = high; }

NOT SECURE

✈♦✐❞ m_3() { ✐❢ (high > 0) {low = 1;} ❡❧s❡ {low = 2;}; }

NOT SECURE

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 74/102

slide-107
SLIDE 107

Examples

Which methods are secure?

✈♦✐❞ m_4() { high = 0; low = high; } ✈♦✐❞ m_5() { low = high; low = low -high; } ✈♦✐❞ m_6() { ✐❢ (❢❛❧s❡) low = high; }

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 75/102

slide-108
SLIDE 108

Examples

Which methods are secure?

✈♦✐❞ m_4() { high = 0; low = high; }

SECURE

✈♦✐❞ m_5() { low = high; low = low -high; } ✈♦✐❞ m_6() { ✐❢ (❢❛❧s❡) low = high; }

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 75/102

slide-109
SLIDE 109

Examples

Which methods are secure?

✈♦✐❞ m_4() { high = 0; low = high; }

SECURE

✈♦✐❞ m_5() { low = high; low = low -high; } ✈♦✐❞ m_6() { ✐❢ (❢❛❧s❡) low = high; }

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 75/102

slide-110
SLIDE 110

Examples

Which methods are secure?

✈♦✐❞ m_4() { high = 0; low = high; }

SECURE

✈♦✐❞ m_5() { low = high; low = low -high; }

SECURE

✈♦✐❞ m_6() { ✐❢ (❢❛❧s❡) low = high; }

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 75/102

slide-111
SLIDE 111

Examples

Which methods are secure?

✈♦✐❞ m_4() { high = 0; low = high; }

SECURE

✈♦✐❞ m_5() { low = high; low = low -high; }

SECURE

✈♦✐❞ m_6() { ✐❢ (❢❛❧s❡) low = high; }

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 75/102

slide-112
SLIDE 112

Examples

Which methods are secure?

✈♦✐❞ m_4() { high = 0; low = high; }

SECURE

✈♦✐❞ m_5() { low = high; low = low -high; }

SECURE

✈♦✐❞ m_6() { ✐❢ (❢❛❧s❡) low = high; }

SECURE

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 75/102

slide-113
SLIDE 113

Information-flow Analysis Approaches

performance security type systems precision / expressiveness graph-theoretical reachability

  • n dependence graph

explicit dependency tracking by ghost code approximative calculi for Hoare style logics formalization in higher order logic formalization in by self-composition Hoare style logics

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 76/102

slide-114
SLIDE 114

Information-flow Analysis Approaches

performance precision / expressiveness formalization in by self-composition Hoare style logics

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 77/102

slide-115
SLIDE 115

Non-Interference

Definition (Low-equivalence on states)

Two states are low-equivalent if they assign the same values to low variables.

Definition (Non-interference)

Starting P in two arbitrary low-equivalent states results in two final states that are also low-equivalent.

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 78/102

slide-116
SLIDE 116

Non-Interference

Definition (Low-equivalence on states)

Two states are low-equivalent if they assign the same values to low variables.

Definition (Non-interference)

Starting P in two arbitrary low-equivalent states results in two final states that are also low-equivalent.

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 78/102

slide-117
SLIDE 117

Non-interference

P a program L the set of low variables s1 s2 P s′

1

s1 ≃L s′

1

s′

2

P s2 ≃L s′

2

where

si ≃L s′

i

⇔ ∀ v ∈ L (vsi = vs′

i) Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 79/102

slide-118
SLIDE 118

Non-interference

P a program L1, L2 sets of low variables s1 s2 P s′

1

s1 ≃L1 s′

1

s′

2

P s2 ≃L2 s′

2

where

si ≃Li s′

i

⇔ ∀ v ∈ Li (vsi = vs′

i) Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 80/102

slide-119
SLIDE 119

Non-Interference in JavaDL (Version 1)

Encoding with alternating quantifiers

For all low input values inl, there exist low output values r such that for all high input values inh, if we assign the values inl to the program variables

low and inh to the program variables high, then after execution of P the

values of low are r.

∀inl∃r∀inh({low := inl || high := inh}[P]low = r) Problem

Not suitable for automatic verification

instantiation of existential quantifier difficult.

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 81/102

slide-120
SLIDE 120

Non-Interference in JavaDL (Version 1)

Encoding with alternating quantifiers

For all low input values inl, there exist low output values r such that for all high input values inh, if we assign the values inl to the program variables

low and inh to the program variables high, then after execution of P the

values of low are r.

∀inl∃r∀inh({low := inl || high := inh}[P]low = r) Problem

Not suitable for automatic verification

instantiation of existential quantifier difficult.

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 81/102

slide-121
SLIDE 121

Non-Interference in JavaDL (Version 2)

Encoding with self-composition

Running two instances of P on the same low values but on arbitrary high values results in low variables which have the same values.

∀inl∀in1

h∀in2 h∀out1 l ∀out2 l {low := inl}(

{high := in1

h}[P]out1 l = low

∧ {high := in2

h}[P]out2 l = low

→ out1

l = out2 l

)

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 82/102

slide-122
SLIDE 122

Declassification

Intuition

Let T(high, low) be a term. The only thing the attacker is allowed to learn about the secret inputs is the value of T in the initial state.

Definition (Non-interference with declassification)

Starting P in two arbitrary low-equivalent states coinciding in the value

  • f T results in two final states that are also low-equivalent.

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 83/102

slide-123
SLIDE 123

Declassification

Intuition

Let T(high, low) be a term. The only thing the attacker is allowed to learn about the secret inputs is the value of T in the initial state.

Definition (Non-interference with declassification)

Starting P in two arbitrary low-equivalent states coinciding in the value

  • f T results in two final states that are also low-equivalent.

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 83/102

slide-124
SLIDE 124

Declassification in JavaDL

Encoding non-interference with declassification

Running two instances of P on the same low values and arbitrary high values coinciding on T results in low variables which have the same values.

∀inl∀in1

h∀in2 h∀out1 l ∀out2 l {low := inl}(

{high := in1

h}T = {high := in2 h}T

∧ {high := in1

h}[P]out1 l = low

∧ {high := in2

h}[P]out2 l = low

→ out1

l = out2 l

)

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 84/102

slide-125
SLIDE 125

DEMO

Verifying Information-flow Properties with the KeY Tool

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 85/102

slide-126
SLIDE 126

Object-Sensitive Non-interference

Leakage by aliasing

✈♦✐❞ m() { C c1 = ♥❡✇ C(); // new obj C c2 = c1; // alias c2.x = high; low = c1.x; }

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 86/102

slide-127
SLIDE 127

Object-Sensitive Non-interference

Leakage by aliasing

✈♦✐❞ m() { C c1 = ♥❡✇ C(); // new obj C c2 = c1; // alias c2.x = high; low = c1.x; }

NOT SECURE

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 86/102

slide-128
SLIDE 128

Object-Sensitive Non-interference

Object creation and object identity

✐❢ (high >0) { low1 = ♥❡✇ C(); low2 = ♥❡✇ C(); } ❡❧s❡ { low2 = ♥❡✇ C(); low1 = ♥❡✇ C(); } Assumption

References are opaque Only comparison of objects by == is observable

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 87/102

slide-129
SLIDE 129

Object-Sensitive Non-interference

Object creation and object identity

✐❢ (high >0) { low1 = ♥❡✇ C(); low2 = ♥❡✇ C(); } ❡❧s❡ { low2 = ♥❡✇ C(); low1 = ♥❡✇ C(); }

SECURE

Assumption

References are opaque Only comparison of objects by == is observable

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 87/102

slide-130
SLIDE 130

Object-Sensitive Non-interference

Object creation and object identity

✐❢ (high >0) { low1 = ♥❡✇ C(); low2 = ♥❡✇ C(); } ❡❧s❡ { low2 = ♥❡✇ C(); low1 = ♥❡✇ C(); }

SECURE

Assumption

References are opaque Only comparison of objects by == is observable

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 87/102

slide-131
SLIDE 131

Object-Sensitive Non-interference

Object creation and object identity

low1 = ♥❡✇ C(); low2 = ♥❡✇ C(); ✐❢ (high >0) { low1 = low2; } ✐❢ (high >0) { low = ♥❡✇ C() }

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 88/102

slide-132
SLIDE 132

Object-Sensitive Non-interference

Object creation and object identity

low1 = ♥❡✇ C(); low2 = ♥❡✇ C(); ✐❢ (high >0) { low1 = low2; }

NOT SECURE

✐❢ (high >0) { low = ♥❡✇ C() }

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 88/102

slide-133
SLIDE 133

Object-Sensitive Non-interference

Object creation and object identity

low1 = ♥❡✇ C(); low2 = ♥❡✇ C(); ✐❢ (high >0) { low1 = low2; }

NOT SECURE

✐❢ (high >0) { low = ♥❡✇ C() }

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 88/102

slide-134
SLIDE 134

Object-Sensitive Non-interference

Object creation and object identity

low1 = ♥❡✇ C(); low2 = ♥❡✇ C(); ✐❢ (high >0) { low1 = low2; }

NOT SECURE

✐❢ (high >0) { low = ♥❡✇ C() }

NOT SECURE

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 88/102

slide-135
SLIDE 135

Object-Sensitive Non-interference

Idea

ISOMORPHIC object structures in low variables IDENTITY NOT required Instead of

si ≃Li s′

i

⇔ ∀ v ∈ Li (vsi = vs′

i)

use

si ≃πi

Li s′ i

⇔ ∀ v ∈ Li (πi(vsi) = vs′

i)

where

π1, π2 are compatible

i.e.

π1(o) = π2(o)

if o observable in both s1 and s2

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 89/102

slide-136
SLIDE 136

Object-Sensitive Non-interference

s1: high → 1 s2: low1 →

  • 1

low2 →

  • 2

high → 1 P s′

1: high → −1

π1 = id s′

2:

low1 → o2 low2 → o1 high → −1 P π2(o1) = o2, π2(o2) = o1

Secure because o1, o2 not observable in s1

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 90/102

slide-137
SLIDE 137

Object-Sensitive Non-interference

s1: high → 1 s2: low1 →

  • 1

low2 →

  • 2

high → 1 P s′

1: high → −1

π1 = id s′

2:

low1 → o2 low2 → o1 high → −1 P π2(o1) = o2, π2(o2) = o1

Secure because o1, o2 not observable in s1

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 90/102

slide-138
SLIDE 138

Object-Sensitive Non-interference

s1: high → 1 s2: low1 →

  • 1

low2 →

  • 2

high → 1 P s′

1: high → −1

π1 = id s′

2:

low1 → o2 low2 → o2 high → −1 P π2 =?

Not secure because no suitable π2 exists

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 91/102

slide-139
SLIDE 139

Object-Sensitive Non-interference

s1: high → 1 s2: low1 →

  • 1

low2 →

  • 2

high → 1 P s′

1: high → −1

π1 = id s′

2:

low1 → o2 low2 → o2 high → −1 P π2 =?

Not secure because no suitable π2 exists

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 91/102

slide-140
SLIDE 140

Object-Sensitive Non-interference

s1: low → o1 high → 1 s2: low → o2 high → 1 P s′

1: low → o1

high → −1 π1 = id s′

2: low → o1

high → −1 P π2(o2) = o1

Not secure because o1 observable in s1 and π1(o1) = π2(o1)

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 92/102

slide-141
SLIDE 141

Object-Sensitive Non-interference

s1: low → o1 high → 1 s2: low → o2 high → 1 P s′

1: low → o1

high → −1 π1 = id s′

2: low → o1

high → −1 P π2(o2) = o1

Not secure because o1 observable in s1 and π1(o1) = π2(o1)

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 92/102

slide-142
SLIDE 142

Object-Sensitive Non-interference

Optimisations L1, L2 sequences of low terms (instead of sets of variables) π1 can be fixed to be id

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 93/102

slide-143
SLIDE 143

DEMO

Objects and Information-flow with the KeY Tool

Information Flow Formalisation in DL Objects and Information Flow Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 94/102

slide-144
SLIDE 144

Part V Wrap Up

15 Further Usage of Verification Technology 16 Directions of Current Research in KeY

Further Usage of Verification Technology Directions of Current Research in KeY Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 95/102

slide-145
SLIDE 145

Part V Wrap Up

15 Further Usage of Verification Technology 16 Directions of Current Research in KeY

Further Usage of Verification Technology Directions of Current Research in KeY Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 96/102

slide-146
SLIDE 146

Further Usage of Verification Technology

Verification performs deep Program Analysis Information in (partial) proofs usable for other purposes

Further Usage of Verification Technology Directions of Current Research in KeY Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 97/102

slide-147
SLIDE 147

Further Usage: Verification-Driven Test Generation

Specification- and code-based approach Achieve strong hybrid coverage criteria Exploit strong correspondence: proof branches ↔ program execution paths Each leaf of (partial) proof branch contains constraint on inputs resulting in corresponding path condition

Further Usage of Verification Technology Directions of Current Research in KeY Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 98/102

slide-148
SLIDE 148

Further Usage: Verification-Driven Test Generation

Specification- and code-based approach Achieve strong hybrid coverage criteria Exploit strong correspondence: proof branches ↔ program execution paths Each leaf of (partial) proof branch contains constraint on inputs resulting in corresponding path condition

Further Usage of Verification Technology Directions of Current Research in KeY Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 98/102

slide-149
SLIDE 149

Further Usage: Verification-Driven Test Generation

Specification- and code-based approach Achieve strong hybrid coverage criteria Exploit strong correspondence: proof branches ↔ program execution paths Each leaf of (partial) proof branch contains constraint on inputs resulting in corresponding path condition

Further Usage of Verification Technology Directions of Current Research in KeY Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 98/102

slide-150
SLIDE 150

Further Usage: Verification-Driven Test Generation

Specification- and code-based approach Achieve strong hybrid coverage criteria Exploit strong correspondence: proof branches ↔ program execution paths Each leaf of (partial) proof branch contains constraint on inputs resulting in corresponding path condition

Further Usage of Verification Technology Directions of Current Research in KeY Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 98/102

slide-151
SLIDE 151

Part V Wrap Up

15 Further Usage of Verification Technology 16 Directions of Current Research in KeY

Further Usage of Verification Technology Directions of Current Research in KeY Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 99/102

slide-152
SLIDE 152

Part V Wrap Up

15 Further Usage of Verification Technology 16 Directions of Current Research in KeY

Further Usage of Verification Technology Directions of Current Research in KeY Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 100/102

slide-153
SLIDE 153

Directions of Current Research with KeY

Topics

Scalability (combine with light-weight techniques) Usability (support user in understanding proof state) Concurrency and distribution Information-flow / security properties Application: eVoting

Further Usage of Verification Technology Directions of Current Research in KeY Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 101/102

slide-154
SLIDE 154

Directions of Current Research with KeY

Topics

Scalability (combine with light-weight techniques) Usability (support user in understanding proof state) Concurrency and distribution Information-flow / security properties Application: eVoting

Further Usage of Verification Technology Directions of Current Research in KeY Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 101/102

slide-155
SLIDE 155

Directions of Current Research with KeY

Topics

Scalability (combine with light-weight techniques) Usability (support user in understanding proof state) Concurrency and distribution Information-flow / security properties Application: eVoting

Further Usage of Verification Technology Directions of Current Research in KeY Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 101/102

slide-156
SLIDE 156

Directions of Current Research with KeY

Topics

Scalability (combine with light-weight techniques) Usability (support user in understanding proof state) Concurrency and distribution Information-flow / security properties Application: eVoting

Further Usage of Verification Technology Directions of Current Research in KeY Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 101/102

slide-157
SLIDE 157

Directions of Current Research with KeY

Topics

Scalability (combine with light-weight techniques) Usability (support user in understanding proof state) Concurrency and distribution Information-flow / security properties Application: eVoting

Further Usage of Verification Technology Directions of Current Research in KeY Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 101/102

slide-158
SLIDE 158

THE END

(for now)

Further Usage of Verification Technology Directions of Current Research in KeY Bernhard Beckert – Deductive Verification of Object-Oriented Software VTSA, 24.–28.08.2015 102/102