Presentation of the Abstraction Project Proposal »
Total Page:16
File Type:pdf, Size:1020Kb
« Presentation of the Abstraction project proposal » Patrick Cousot École normale supérieure 45 rue d’Ulm, 75230 Paris cedex 05, France [email protected] www.di.ens.fr/~cousot Projects’ committee — INRIA Rocquencourt Thursday March 8th, 2007 Projects’ committee, INRIA Rocquencourt, 8/3/2007 — 1 — ľ P. Cousot 1. Project Members Projects’ committee, INRIA Rocquencourt, 8/3/2007 — 2 — ľ P. Cousot Project Members Julien Bertrane, PhD student Bruno Blanchet, CR1 CNRS Patrick Cousot,Prof. Jérôme Feret, CDD Laurent Mauborgne, MdC Antoine Miné, ATER David Monniaux,CR1CNRS Xavier Rival, CDD Projects’ committee, INRIA Rocquencourt, 8/3/2007 — 3 — ľ P. Cousot 2. The Problem: The Design of Safe and Secure Computer- Based Systems Projects’ committee, INRIA Rocquencourt, 8/3/2007 — 4 — ľ P. Cousot Software is Everywhere – exponential growth of hardware since 1975 – ) exponential growth of software (favored by software engineering methods) – mainly manual activity ) bugs are everywhere l Projects’ committee, INRIA Rocquencourt, 8/3/2007 — 5 — ľ P. Cousot Guaranteeing the Reliability and Security of Software-Intensive Systems – an objective of the INRIA strategic plan – an industrial categorical imperative, in particular for safety and security critical software (validation can ac- count for up to 60% of software development costs) Projects’ committee, INRIA Rocquencourt, 8/3/2007 — 6 — ľ P. Cousot Validation/Formal Methods – bug-finding methods : unit, integration, and system testing, dynamic verification, bounded model-checking, . – absence of bug proving methods : formally prove that the semantics of a program satisfies a specification - theorem-proving & proof checking - model-checking - abstract interpretation – in practice : complementary methods are used, very difficult to scale up Projects’ committee, INRIA Rocquencourt, 8/3/2007 — 7 — ľ P. Cousot 3. Abstract Interpretation Projects’ committee, INRIA Rocquencourt, 8/3/2007 — 8 — ľ P. Cousot The Theory of Abstract Interpretation – a theory of sound approximation of mathematical structures, in particular those involved in the be- havior of computer systems – systematic derivation of sound methods and algo- rithms for approximating undecidable or highly com- plex problems in various areas of computer science – main current application is on the safety and se- curity of complex hardware and software computer systems Projects’ committee, INRIA Rocquencourt, 8/3/2007 — 9 — ľ P. Cousot Applications of Abstract Interpretation (Cont’d) – Static Program Analysis [119], [124], [120] including Dataflow Analysis; [120], [123], Set-based Analysis [122], Predicate Abstraction [7], . – Grammar Analysis and Parsing [14]; – Hierarchies of Semantics and Proof Methods [121], [10]; – Typing & Type Inference [118]; – (Abstract) Model Checking [123]; Projects’ committee, INRIA Rocquencourt, 8/3/2007 — 10 — ľ P. Cousot Applications of Abstract Interpretation (Cont’d) – Program Transformation [33]; – Software Watermarking [44]; – Bisimulations [129]; – Language-based security [125]; – Semantic-based obfuscated malware detection [128]. All these techniques involve sound approximations that can be formalized by abstract interpretation Projects’ committee, INRIA Rocquencourt, 8/3/2007 — 11 — ľ P. Cousot 4. An Example of Theoretical Ap- plication : Semantics of the Ea- ger –-calculus [1] P. Cousot & R. Cousot. Bi-inductive structural semantics. Februray 15th, 2007. Submitted. Projects’ committee, INRIA Rocquencourt, 8/3/2007 — 12 — ľ P. Cousot Syntax of the Eager –-calculus x; y; z;::: 2 X variables c 2 C constants (X \ C = ?) c ::= 0 j 1 j : : : v 2 V values v ::= c j λ x . a e 2 E errors e ::= c a j e a 0 a; a ; a1;:::; b;;::: 2 T terms a ::= x j v j a a0 Projects’ committee, INRIA Rocquencourt, 8/3/2007 — 13 — ľ P. Cousot Traces – T? (resp. T+, T!, T/ and T1) be the set of finite (resp. nonempty finite, infinite, finite or infinite, and nonempty finite or infinite) sequences of terms T+ – If ff 2 then jffj > 0 and ff = ff0 › ff1 › : : : › ffjffj`1. ! – If ff 2 T then jffj = ! and ff = ff0 › : : : › ffn › : : :. – Given S;T 2 }(T1), we define S+ , S \ T+, S! , S \ T! and S v T , S+ „ T + ^ S! « T !, so that h}(T1); v; T!; T+; t; ui is a complete lattice. Projects’ committee, INRIA Rocquencourt, 8/3/2007 — 14 — ľ P. Cousot Operations on traces – For a 2 T and ff 2 T1, we define a@ff to be ff0 2 T1 0 such that 8i < jffj : ffi = a ffi and, 0 0 – similarly ff@a is ff such that 8i < jffj : ffi = ffi a. Projects’ committee, INRIA Rocquencourt, 8/3/2007 — 15 — ľ P. Cousot Bifinitary Trace Semantics ~S of the Eager –-calculus 1 [121] a[x v] › ff 2 ~S v 2 ~S; v 2 V v; v 2 V (λ x . a) v › a[x v] › ff 2 ~S ! + 0 ff 2 ~S ff › v 2 ~S ; (v b) › ff 2 ~S v v; v 2 V 0 ff@b 2 ~S (ff@b) › (v b) › ff 2 ~S ! + 0 ff 2 ~S ff › v 2 ~S ; (a v) › ff 2 ~S v; a 2 V v; v; a 2 V : 0 a@ff 2 ~S (a@ff) › (a v) › ff 2 ~S 1 Note: a[x b] is the capture-avoiding substitution of b for all free occurences of x within a. We let FV(a) be the free variables of a. We define the call-by-value semantics of closed terms (without free variables) T , fa 2 T j FV(a) = ?g. Projects’ committee, INRIA Rocquencourt, 8/3/2007 — 16 — ľ P. Cousot Abstraction to the Bifinitary Relational Semantics of the Eager –-calculus remember the input/output behaviors, forget about the intermediate computation steps def ¸(T ) = f¸(ff) j ff 2 T g def ¸(ff0 › ff1 › : : : › ffn) = hff0; ffni def ¸(ff0 › : : : › ffn › : : :) = hff0; ?i Projects’ committee, INRIA Rocquencourt, 8/3/2007 — 17 — ľ P. Cousot Bifinitary Relational Semantics of the Eager –-calculus v =) v; v 2 V a =)? b =)? v v; a 2 V a b =)? a b =)? a[x v]=) r v; v 2 V; r 2 V [ f?g (λ x . a) v =) r a =) v; v b =) r v; v 2 V; r 2 V [ f?g a b =) r b =) v; a v =) r v; a 2 V; v 2 V; r 2 V [ f?g : a b =) r Projects’ committee, INRIA Rocquencourt, 8/3/2007 — 18 — ľ P. Cousot Abstraction to the Natural Big-Step Semantics of the Eager –-calculus remember the finite input/output behaviors, forget about non-termination def ¸(T ) = [f¸(ff) j ff 2 T g def ¸(hff0; ffni) = fhff0; ffnig def ¸(hff0; ?i) = ? Projects’ committee, INRIA Rocquencourt, 8/3/2007 — 19 — ľ P. Cousot Natural Big-Step Semantics of the Eager –-calculus [126] v =) v; v 2 V a[x v]=) r „; v 2 V; r 2 V (λ x . a) v =) r a =) v; v b =) r „; v 2 V; r 2 V a b =) r b =) v; a v =) r „; a 2 V; v 2 V; r 2 V : a b =) r Projects’ committee, INRIA Rocquencourt, 8/3/2007 — 20 — ľ P. Cousot Abstraction to the Small-Step Operational Semantics of the Eager –-calculus remember execution steps, forget about their sequencing def ¸(T ) = [f¸(ff) j ff 2 T g def ¸(ff0 › ff1 › : : : › ffn) = fhffi; ffi+1i j 0 6 i ^ i < ng def ¸(ff0 › : : : › ffn › : : :) = fhffi; ffi+1i j i > 0g Projects’ committee, INRIA Rocquencourt, 8/3/2007 — 21 — ľ P. Cousot Small-Step Operational Semantics of the Eager –-calculus [127] ((λ x . a) v) `A a[x v] a0 `A a1 „ a0 b `A a1 b b0 `A b1 „ : v b0 `A v b1 Projects’ committee, INRIA Rocquencourt, 8/3/2007 — 22 — ľ P. Cousot The Abstract Semantics are Correct by Calculational Design b ω ′ þ ′ β the above bi-inductioon definition avoids the duplication of common rules. α({σ@ | σ ∈ S }) then ∃σ ∈ F(S) : σ0 = a where S = β<δ X . Defining a =Z ⇒ σ , σ ∈ þSJaK, we can also write ω u = {é (σ0 b), ⊥ê | σ ∈ S } Hdef. α and @ I ⊆ ñ ω If a ∈ V then éa, ⊥ê Ó∈ gfp F . = {é (σ0 b), ⊥ê | é σ0, ⊥ê ∈ α(S)} Hdef. αI ñ ω ñ ω ñ ω a x v a b a ∞ ′ ⊆ ⊆ [ ← ] =Z ⇒ σ = {é ( ), ⊥ê | é , ⊥ê ∈ α(S)} HS ⊆ T so σ0 ∈ TI If a = ( λ x . a ) v, v ∈ V then éa, ⊥ê ∈ gfp F = F (gfp F ) so by (6), v v v V ⊑ v V ñ ω =Z ⇒ , ∈ , ∈ ′ ⊆ ′ ω ′ ′ λ x . a v λ x . a v ′ + ′ éa [x ← v], ⊥ê ∈ gfp F . By induction on δ, we have ∃σ ∈ T : σ0 = a [x ← ( ) =Z ⇒ ( ) • σ α σ b • v b • σ σ • v S v V v b • σ S ({( @ ) ( ) | ∈ ∧ ∈ ∧ ( ) ∈ }) ′ β . ′ ′ ′ β δ v]∧σ ∈ β<δ X so that, by (b), ( λ x a ) v • a [x ← v] •σ ∈ Fþ ( β<δ X ) = X . ′ b v b ′ v + v V v b ′ + b v b ′ u u a =Z ⇒ σ a =Z ⇒ σ • v, v b =Z ⇒ σ = α({(σ@ )•( )•σ | σ• ∈ S ∧ ∈ ∧( )•σ ∈ S })∪α({(σ@ )•( )•σ | ω + + ′ ω ⊑ ⊑ v V v v V v b ′ , σ ∈ T , ∈ , σ ∈ T σ • ∈ S ∧ ∈ ∧ ( ) • σ ∈ S }) If a = ( a b) then there are four subcases. ′ + ω a b =Z ⇒ σ@b a b =Z ⇒ (σ@b) • σ HS = S ∪ S and α preserves lubs I ⊆ ñ ω ′ + + ′ β b • v v V v b b • v If éa , ⊥ê ∈ gfp F ⊆ β<δ X then, by induction hypothesis on δ, we b =Z ⇒ σ b =Z ⇒ σ • v, a v =Z ⇒ σ = {é (σ0 ), r ê | σ ∈ S ∧ ∈ ∧ é ( ), r ê ∈ α(S) } ∪ {é (σ ), ⊥ê | σ ∈ ω + + ω ′ ω ′ ′ ′ u β ′ β ⊑ a V ⊑ a v V v V v b þ , ∈ , σ ∈ T , , ∈ , σ ∈ T .