Computational Logic Abstract Interpretation of Logic Programs
1
Computational Logic Abstract Interpretation of Logic Programs 1 - - PowerPoint PPT Presentation
Computational Logic Abstract Interpretation of Logic Programs 1 Introduction [Material partly from Cousot, Nielson, Gallagher, Sondergaard, Bruynooghe, and others] Many CS problems related to program analysis / synthesis Prove that some
1
2
3
4
5
α → Dα defined by
6
α = {[−], [0], [+]}
α → D′ α defined by
7
α = {[−], [0], [+]} because we wouldn’t know how to represent
α → D′′α defined by:
8
9
10
11
P : ℘(D) → ℘(D)
P(S) = {FP(x)|x ∈ S}
P if
P(S)
P
12
P(S))
P(Sa)
P(Sa))
P does not work on abstract values Sa)
P is monotonic:
P(Sa) ⊇ F ∗ P(S)
P(S))
13
14
★ ✧ ✥ ✦ ★ ✧ ✥ ✦ ✛ ✲
15
P(γ(λ))
❤ ❤ ❤ ❤ ❤ ❄ ✲ ✲ ❄ ✧ ✧ ✧ ✧ ✧ ◗ ◗ ◗ ◗ ◗ ❦
P
16
17
18
19
✦✦✦✦✦✦✦✦✦ ✦ ❛❛❛❛❛❛❛❛❛ ❛ ❛❛❛❛❛❛❛❛❛ ❛ ✦ ✦ ✦ ✦ ✦ ✦ ✦ ✦ ✦ ✦
20
✧✧✧✧ ✧❜❜❜❜ ❜ ✧✧✧✧ ✧❜❜❜❜ ❜✧✧✧✧ ✧❜❜❜❜ ❜ ✦✦✦✦✦✦✦✦✦ ✦ ❛❛❛❛❛❛❛❛❛ ❛ ✧ ✧ ✧ ✧ ✧ ✧ ✧ ✧ ❜ ❜ ❜ ❜ ❜ ❜ ❜ ❜
21
22
23
✚ ✚❩ ❩ ★★ ★❝ ❝ ❝ ❝ ❝ ❝ ❜❜❜❜ ❜✑✑✑✑ ✑
✦ ✦ ✦ ✦ ✦ ✦ ✦ ✦ ✦ ✦ ✦ ✟ ✟ ✟ ✟ ✟ ✟ ✟ ✟ ✟ ✑ ✑ ✑ ✑ ✑ ✑ ✑ ✡ ✡ ✡ ✡ ✡ ◗◗◗◗◗◗ ◗ PPPPPPPPPPPP P ❛❛❛❛❛❛❛❛❛❛ ❛ ❙ ❙ ❙ ✓ ✓ ✓
✑ ✦✦✦✦✦✦✦✦✦✦ ✦ ✟✟✟✟✟✟✟✟ ✟ ✏✏✏✏✏✏✏✏✏✏✏✏✏ ❏ ❏ ❏ ❏ ❏ ✓ ✓ ✓ ❙ ❙ ❙ ✁ ✁ ✁ ❅ ❅ ❅ ❅ ❅ ◗ ◗ ◗ ◗ ◗ ◗ ◗ ❛ ❛ ❛ ❛ ❛ ❛ ❛ ❛ ❛ ❛ ❛ P P P P P P P P P P P P P
24
25
“a process which combines the operators and operands of the source text in the manner in which an actual evaluation would have to do it, but which operates on descriptions of the operands, not on their values”
26
27
28
29
P : Iα → Iα
P safe approximation of TP, i.e. ∀d, d ∈ Iα, γ(T α P (d)) ⊇ TP(γ(d))
P monotonic.
P ) = T α P ↑n will be obtained in a finite number of steps n
30
✬ ✫ ✩ ✪ ✬ ✫ ✩ ✪ ✬ ✫ ✩ ✪ ✛ ✻ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✏ ✮ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✂ ✏✏✏✏✏✏✏✏ ✏ ✶ ❄ ✲
P ↑n
P
31
32
P : S∗ → S∗
P (D) = { p ∈ S | ∃C ∈ P,
P monotonic
P ↑n approximates H.
33
P ↑0 = T α P (∅) = {p/1, q/1}
P ↑1 = T α P ({p/1, q/1}) = {p/1, q/1} = T α P ↑0 = Hα
34
35
36
37
38
39
40
41
42
43
λ λ′ λ λ′
δ q δ′ δ q δ′ λ p λ′
44
45
46
47
48
49
50