SlideShare a Scribd company logo
Domains        The Octagon Domain    Abstract Transfer Functions   Analysis Example   Conclusion




                                The Octagon Domain

                                    Bernhard Mallinger



                                    March 6-7th, 2013




Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain   Abstract Transfer Functions   Analysis Example   Conclusion




Outline


      1   Domains

      2   The Octagon Domain

      3   Abstract Transfer Functions

      4   Analysis Example

      5   Conclusion



Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain   Abstract Transfer Functions   Analysis Example   Conclusion




Outline


      1   Domains

      2   The Octagon Domain

      3   Abstract Transfer Functions

      4   Analysis Example

      5   Conclusion



Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain      Abstract Transfer Functions   Analysis Example   Conclusion




Recap: Abstract Domains


             Models states/properties in abstract interpretation of programs
             Manipulated by abstract transfer functions
             Can be composed of different kinds of elements
                     Properties (e.g. sign, is even)
                     Numeric values, intervals
                     Relations
             Examples
                     Sign Domain
                     Interval Domain
                     Polyhedra Domain



Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain   Abstract Transfer Functions   Analysis Example   Conclusion




Numerical Domains I




      Figure: • represent elements of the domain, spurious elements are marked
              by ×. Domains always overapproximate in order to be sound.
                 (figure from Miné (2006))


Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain        Abstract Transfer Functions   Analysis Example   Conclusion




Numerical Domains II



      Assumption: Numeric means R

      Interval Domain: Xi ∈ [ai , bi ]
      Polyhedra Domain:             i   aij Xi ≤ bj
      Zone Abstract Domain: ±Xi ≤ ci ,                     Xi − Xj ≤ cij     ∀i = j
      Octagon Domain: ±Xi ± Xj ≤ cij                    ∀i, j




Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain        Abstract Transfer Functions   Analysis Example   Conclusion




Numerical Domains II



      Assumption: Numeric means R

      Interval Domain: Xi ∈ [ai , bi ]
      Polyhedra Domain:             i   aij Xi ≤ bj
      Zone Abstract Domain: ±Xi ≤ ci ,                     Xi − Xj ≤ cij     ∀i = j
      Octagon Domain: ±Xi ± Xj ≤ cij                    ∀i, j




Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain        Abstract Transfer Functions   Analysis Example   Conclusion




Numerical Domains II



      Assumption: Numeric means R

      Interval Domain: Xi ∈ [ai , bi ]
      Polyhedra Domain:             i   aij Xi ≤ bj
      Zone Abstract Domain: ±Xi ≤ ci ,                     Xi − Xj ≤ cij     ∀i = j
      Octagon Domain: ±Xi ± Xj ≤ cij                    ∀i, j




Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain        Abstract Transfer Functions   Analysis Example   Conclusion




Numerical Domains II



      Assumption: Numeric means R

      Interval Domain: Xi ∈ [ai , bi ]
      Polyhedra Domain:             i   aij Xi ≤ bj
      Zone Abstract Domain: ±Xi ≤ ci ,                     Xi − Xj ≤ cij     ∀i = j
      Octagon Domain: ±Xi ± Xj ≤ cij                    ∀i, j




Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain   Abstract Transfer Functions   Analysis Example   Conclusion




Numerical Domains III



             In terms of precision: Interval < Octagon < Polyhedra
             Interval Domain is non-relational
             Polyhedra Domain has theoretically unbounded cost
             (exponentially in practise)
             Octagon domain limited to two variables per inequality and no
             coefficients
             ⇒ Quadratic memory/cubic time cost




Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain   Abstract Transfer Functions   Analysis Example   Conclusion




Motivation: Relational Domains




      Not only properties of variables are of interest,
      but also the relation among them:
        1 Y := X;
        2 Z := X - Y;
        3 Z := 4/Z;




Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain   Abstract Transfer Functions   Analysis Example   Conclusion




Outline


      1   Domains

      2   The Octagon Domain

      3   Abstract Transfer Functions

      4   Analysis Example

      5   Conclusion



Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain    Abstract Transfer Functions   Analysis Example   Conclusion




Representation: Difference bound matrices I


             Constraints: ±X ± Y ≤ c
             ⇒ 2n × 2n matrix m

             Concretisation function γ:
                             def
                     γ (m) = {(v1 , . . . , vn ) ∈ Rn | ∀i, j : vj − vi ≤ mij }

                     def
              γ(m) = {(v1 , . . . , vn ) ∈ Rn | (v1 , −v1 , . . . , vn , −vn ) ∈ γ (m)}




Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain    Abstract Transfer Functions   Analysis Example   Conclusion




Representation: Difference bound matrices I


             Constraints: ±X ± Y ≤ c
             ⇒ 2n × 2n matrix m

             Concretisation function γ:
                             def
                     γ (m) = {(v1 , . . . , vn ) ∈ Rn | ∀i, j : vj − vi ≤ mij }

                     def
              γ(m) = {(v1 , . . . , vn ) ∈ Rn | (v1 , −v1 , . . . , vn , −vn ) ∈ γ (m)}




Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain    Abstract Transfer Functions   Analysis Example   Conclusion




Representation: Difference bound matrices I


             Constraints: ±X ± Y ≤ c
             ⇒ 2n × 2n matrix m

             Concretisation function γ:
                             def
                     γ (m) = {(v1 , . . . , vn ) ∈ Rn | ∀i, j : vj − vi ≤ mij }

                     def
              γ(m) = {(v1 , . . . , vn ) ∈ Rn | (v1 , −v1 , . . . , vn , −vn ) ∈ γ (m)}




Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain    Abstract Transfer Functions   Analysis Example   Conclusion




                               Figure: Octagon representation
                                  (figure from Miné (2006))

Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain       Abstract Transfer Functions   Analysis Example   Conclusion




Representation: Difference bound matrices II

             Abstraction function α:
             Given concrete values, α computes all entries of m by taking
             the maximal differences for each pair of variables
             A lattice can be defined:
                                               def
                                    m     n ⇐⇒ ∀i, j : mij ≤ nij
                                                     def
                                    (m      n)ij = max(mij , nij )
                                                     def
                                    (m      n)ij = min(mij , nij )

             m       n ⇒ γ(m) ⊆ γ(n)
             (γ, α) form a Galois connection


Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain      Abstract Transfer Functions   Analysis Example   Conclusion




                      Figure: Problem: Representation is not unique
                                    (figure from Miné (2006))


Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain      Abstract Transfer Functions   Analysis Example   Conclusion




Shortest Path Closure



             Calculating all-pairs shortest paths yield smallest (closed) m∗

                                    m∗ = inf {n | γ(m) = γ(n)}

             All bounds are as tight as possible (Saturation)
             Cubic time complexity (e.g. Floyd-Warshall)
             Negative cost cycle in m ⇐⇒ γ(m) = ∅




Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain   Abstract Transfer Functions   Analysis Example   Conclusion




Outline


      1   Domains

      2   The Octagon Domain

      3   Abstract Transfer Functions

      4   Analysis Example

      5   Conclusion



Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain   Abstract Transfer Functions   Analysis Example   Conclusion




Abstract Transfer Functions


             Abstract transfer functions correspond to semantic operations
             Must be sound, therefore overapproximation
             Some require closed arguments, some return closed ones
      Different kinds:
             Set operations such as Union/Intersection
             Assignment
             Test
             Widening/Narrowing
             Conversions to other domains (e.g. Interval, Polyhedra)


Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain   Abstract Transfer Functions   Analysis Example   Conclusion




Union




             Take largest bounds elementwise:
                                                  def
                                       m∪n = m               n
             Union of two octagons isn’t an octagon in general
             ⇒ exact abstractions isn’t possible, only best abstraction
             Best abstraction is obtained if m and n are closed
Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain   Abstract Transfer Functions   Analysis Example   Conclusion




Intersection




             Definition similar to union, but result is always exact




Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain   Abstract Transfer Functions   Analysis Example   Conclusion




Forget-Operator




      Figure: Non-deterministic behaviour can be modeled
              by “forgetting” constraints, but closure is necessary
                 (figure from Miné (2006))


Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain   Abstract Transfer Functions   Analysis Example   Conclusion




Assignment I

             Handling of assignments depends on the type of the expression
             Directly handleable in the octagon domain:

                                           X ← ±[a, b]
                                    X ← ±Y ± [a, b]

             e.g. for X ← Y + [a, b], we get a ≤ X − Y ≤ b:

                        +X − −Y ≤ b                 − X − +Y ≤ −a
                        −Y − +X ≤ b                 + Y − −X ≤ −a

             Constraints for X w.r.t. other variables have to be discarded

Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain   Abstract Transfer Functions   Analysis Example   Conclusion




Assignment II



             In case the expression is too complex:
             ⇒ Transform everything to Interval or Polyhedra domain and
             do assignment there
             If using the Interval domain, new constraints can be derived by
             computing bounds of ±expr ± Y
             Using the Polyhedra domain is applicable to linear expressions
             and costly, but yields a best abstraction




Bernhard Mallinger
The Octagon Domain
Domains         The Octagon Domain   Abstract Transfer Functions   Analysis Example   Conclusion




Test


          1   X := [-100, 100]
          2   if X ≥ 0 then
          3       // X ∈ [0, 100]
          4   end if
              All tests can be simplified to expr ≤ 0
              Octagonally shaped tests can directly be applied
              (e.g. X + Y + [a, b] ≤ 0)
              More complex forms can be handled in the Interval or
              Polyhedra domain (cf. Assignment)



Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain   Abstract Transfer Functions   Analysis Example   Conclusion




Outline


      1   Domains

      2   The Octagon Domain

      3   Abstract Transfer Functions

      4   Analysis Example

      5   Conclusion



Bernhard Mallinger
The Octagon Domain
Domains         The Octagon Domain   Abstract Transfer Functions   Analysis Example   Conclusion




          1   X := [-100, 100]
          2   Y := X
          3   if Y ≤ 0 then
          4       1 Y := -Y 2
          5   else
          6       3
          7   end if
          8   4
        9     if Y ≤ 69 then 5
       10     end if

      1   −100 ≤ X ≤ 0 ∧ −100 ≤ Y ≤ 0 ∧ X − Y = 0 ∧ −200 ≤ X + Y ≤ 0
      2   −100 ≤ X ≤ 0 ∧ 0 ≤ Y ≤ 100 ∧ −200 ≤ X − Y ≤ 0 ∧ X + Y = 0
      3   0 ≤ X ≤ 100 ∧ 0 ≤ Y ≤ 100 ∧ X − Y = 0 ∧ 0 ≤ X + Y ≤ 200
      4   −100 ≤ X ≤ 100 ∧ 0 ≤ Y ≤ 100 ∧ −200 ≤ X − Y ≤ 0 ∧ 0 ≤ X + Y ≤ 200
      5   −69 ≤ X ≤ 69 ∧ 0 ≤ Y ≤ 69 ∧ −138 ≤ X − Y ≤ 0 ∧ 0 ≤ X + Y ≤ 138


Bernhard Mallinger
The Octagon Domain
Domains         The Octagon Domain   Abstract Transfer Functions   Analysis Example   Conclusion




          1   X := [-100, 100]
          2   Y := X
          3   if Y ≤ 0 then
          4       1 Y := -Y 2
          5   else
          6       3
          7   end if
          8   4
        9     if Y ≤ 69 then 5
       10     end if

      1   −100 ≤ X ≤ 0 ∧ −100 ≤ Y ≤ 0 ∧ X − Y = 0 ∧ −200 ≤ X + Y ≤ 0
      2   −100 ≤ X ≤ 0 ∧ 0 ≤ Y ≤ 100 ∧ −200 ≤ X − Y ≤ 0 ∧ X + Y = 0
      3   0 ≤ X ≤ 100 ∧ 0 ≤ Y ≤ 100 ∧ X − Y = 0 ∧ 0 ≤ X + Y ≤ 200
      4   −100 ≤ X ≤ 100 ∧ 0 ≤ Y ≤ 100 ∧ −200 ≤ X − Y ≤ 0 ∧ 0 ≤ X + Y ≤ 200
      5   −69 ≤ X ≤ 69 ∧ 0 ≤ Y ≤ 69 ∧ −138 ≤ X − Y ≤ 0 ∧ 0 ≤ X + Y ≤ 138


Bernhard Mallinger
The Octagon Domain
Domains         The Octagon Domain   Abstract Transfer Functions   Analysis Example   Conclusion




          1   X := [-100, 100]
          2   Y := X
          3   if Y ≤ 0 then
          4       1 Y := -Y 2
          5   else
          6       3
          7   end if
          8   4
        9     if Y ≤ 69 then 5
       10     end if

      1   −100 ≤ X ≤ 0 ∧ −100 ≤ Y ≤ 0 ∧ X − Y = 0 ∧ −200 ≤ X + Y ≤ 0
      2   −100 ≤ X ≤ 0 ∧ 0 ≤ Y ≤ 100 ∧ −200 ≤ X − Y ≤ 0 ∧ X + Y = 0
      3   0 ≤ X ≤ 100 ∧ 0 ≤ Y ≤ 100 ∧ X − Y = 0 ∧ 0 ≤ X + Y ≤ 200
      4   −100 ≤ X ≤ 100 ∧ 0 ≤ Y ≤ 100 ∧ −200 ≤ X − Y ≤ 0 ∧ 0 ≤ X + Y ≤ 200
      5   −69 ≤ X ≤ 69 ∧ 0 ≤ Y ≤ 69 ∧ −138 ≤ X − Y ≤ 0 ∧ 0 ≤ X + Y ≤ 138


Bernhard Mallinger
The Octagon Domain
Domains         The Octagon Domain   Abstract Transfer Functions   Analysis Example   Conclusion




          1   X := [-100, 100]
          2   Y := X
          3   if Y ≤ 0 then
          4       1 Y := -Y 2
          5   else
          6       3
          7   end if
          8   4
        9     if Y ≤ 69 then 5
       10     end if

      1   −100 ≤ X ≤ 0 ∧ −100 ≤ Y ≤ 0 ∧ X − Y = 0 ∧ −200 ≤ X + Y ≤ 0
      2   −100 ≤ X ≤ 0 ∧ 0 ≤ Y ≤ 100 ∧ −200 ≤ X − Y ≤ 0 ∧ X + Y = 0
      3   0 ≤ X ≤ 100 ∧ 0 ≤ Y ≤ 100 ∧ X − Y = 0 ∧ 0 ≤ X + Y ≤ 200
      4   −100 ≤ X ≤ 100 ∧ 0 ≤ Y ≤ 100 ∧ −200 ≤ X − Y ≤ 0 ∧ 0 ≤ X + Y ≤ 200
      5   −69 ≤ X ≤ 69 ∧ 0 ≤ Y ≤ 69 ∧ −138 ≤ X − Y ≤ 0 ∧ 0 ≤ X + Y ≤ 138


Bernhard Mallinger
The Octagon Domain
Domains         The Octagon Domain   Abstract Transfer Functions   Analysis Example   Conclusion




          1   X := [-100, 100]
          2   Y := X
          3   if Y ≤ 0 then
          4       1 Y := -Y 2
          5   else
          6       3
          7   end if
          8   4
        9     if Y ≤ 69 then 5
       10     end if

      1   −100 ≤ X ≤ 0 ∧ −100 ≤ Y ≤ 0 ∧ X − Y = 0 ∧ −200 ≤ X + Y ≤ 0
      2   −100 ≤ X ≤ 0 ∧ 0 ≤ Y ≤ 100 ∧ −200 ≤ X − Y ≤ 0 ∧ X + Y = 0
      3   0 ≤ X ≤ 100 ∧ 0 ≤ Y ≤ 100 ∧ X − Y = 0 ∧ 0 ≤ X + Y ≤ 200
      4   −100 ≤ X ≤ 100 ∧ 0 ≤ Y ≤ 100 ∧ −200 ≤ X − Y ≤ 0 ∧ 0 ≤ X + Y ≤ 200
      5   −69 ≤ X ≤ 69 ∧ 0 ≤ Y ≤ 69 ∧ −138 ≤ X − Y ≤ 0 ∧ 0 ≤ X + Y ≤ 138


Bernhard Mallinger
The Octagon Domain
Domains         The Octagon Domain   Abstract Transfer Functions   Analysis Example   Conclusion




          1   X := [-100, 100]
          2   Y := X
          3   if Y ≤ 0 then
          4       1 Y := -Y 2
          5   else
          6       3
          7   end if
          8   4
        9     if Y ≤ 69 then 5
       10     end if

      1   −100 ≤ X ≤ 0 ∧ −100 ≤ Y ≤ 0 ∧ X − Y = 0 ∧ −200 ≤ X + Y ≤ 0
      2   −100 ≤ X ≤ 0 ∧ 0 ≤ Y ≤ 100 ∧ −200 ≤ X − Y ≤ 0 ∧ X + Y = 0
      3   0 ≤ X ≤ 100 ∧ 0 ≤ Y ≤ 100 ∧ X − Y = 0 ∧ 0 ≤ X + Y ≤ 200
      4   −100 ≤ X ≤ 100 ∧ 0 ≤ Y ≤ 100 ∧ −200 ≤ X − Y ≤ 0 ∧ 0 ≤ X + Y ≤ 200
      5   −69 ≤ X ≤ 69 ∧ 0 ≤ Y ≤ 69 ∧ −138 ≤ X − Y ≤ 0 ∧ 0 ≤ X + Y ≤ 138


Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain   Abstract Transfer Functions   Analysis Example   Conclusion




Outline


      1   Domains

      2   The Octagon Domain

      3   Abstract Transfer Functions

      4   Analysis Example

      5   Conclusion



Bernhard Mallinger
The Octagon Domain
Domains        The Octagon Domain     Abstract Transfer Functions   Analysis Example   Conclusion




Conclusion


             The Octagon domain adds limited relational information to the
             Interval Domain
             As opposed to the Polyhedra domain (exponential worst case),
             its operations are still in P
             A normal form can be computed using Shortest Path Closure
             ⇒ necessary for emptiness testing and comparison
             Has been employed successfully in ASTRÉE to analyse a large
             C-program (airplane control software)
                     Reduction of false alarms with reasonable overhead
                     Only relevant relations are considered (“packs” of variables)



Bernhard Mallinger
The Octagon Domain

More Related Content

What's hot

Optimization Techniques
Optimization TechniquesOptimization Techniques
Optimization TechniquesAjay Bidyarthy
 
An Introduction to Model Order Reduction
An Introduction to Model Order ReductionAn Introduction to Model Order Reduction
An Introduction to Model Order ReductionMohammad Umar Rehman
 
A note on word embedding
A note on word embeddingA note on word embedding
A note on word embeddingKhang Pham
 
Parallel Evaluation of Multi-Semi-Joins
Parallel Evaluation of Multi-Semi-JoinsParallel Evaluation of Multi-Semi-Joins
Parallel Evaluation of Multi-Semi-JoinsJonny Daenen
 
Applying Model Checking Approach with Floating Point Arithmetic for Verificat...
Applying Model Checking Approach with Floating Point Arithmetic for Verificat...Applying Model Checking Approach with Floating Point Arithmetic for Verificat...
Applying Model Checking Approach with Floating Point Arithmetic for Verificat...Sergey Staroletov
 
Programacion Cuadratica
Programacion CuadraticaProgramacion Cuadratica
Programacion Cuadraticapaquitootd
 
Functional analysis in mechanics 2e
Functional analysis in mechanics  2eFunctional analysis in mechanics  2e
Functional analysis in mechanics 2eSpringer
 
Functional analysis in mechanics
Functional analysis in mechanicsFunctional analysis in mechanics
Functional analysis in mechanicsSpringer
 
Time and space complexity
Time and space complexityTime and space complexity
Time and space complexityAnkit Katiyar
 
hankel_norm approximation_fir_ ijc
hankel_norm approximation_fir_ ijchankel_norm approximation_fir_ ijc
hankel_norm approximation_fir_ ijcVasilis Tsoulkas
 
Sampling and Markov Chain Monte Carlo Techniques
Sampling and Markov Chain Monte Carlo TechniquesSampling and Markov Chain Monte Carlo Techniques
Sampling and Markov Chain Monte Carlo TechniquesTomasz Kusmierczyk
 
Design and analysis of algorithm
Design and analysis of algorithmDesign and analysis of algorithm
Design and analysis of algorithmVarun Ojha
 
Symbolic Execution as DPLL Modulo Theories
Symbolic Execution as DPLL Modulo TheoriesSymbolic Execution as DPLL Modulo Theories
Symbolic Execution as DPLL Modulo TheoriesQuoc-Sang Phan
 
Modification of a heuristic method
Modification of a heuristic methodModification of a heuristic method
Modification of a heuristic methodorajjournal
 
how to calclute time complexity of algortihm
how to calclute time complexity of algortihmhow to calclute time complexity of algortihm
how to calclute time complexity of algortihmSajid Marwat
 
FURTHER RESULTS ON THE DIRAC DELTA APPROXIMATION AND THE MOMENT GENERATING FU...
FURTHER RESULTS ON THE DIRAC DELTA APPROXIMATION AND THE MOMENT GENERATING FU...FURTHER RESULTS ON THE DIRAC DELTA APPROXIMATION AND THE MOMENT GENERATING FU...
FURTHER RESULTS ON THE DIRAC DELTA APPROXIMATION AND THE MOMENT GENERATING FU...IJCNC
 

What's hot (20)

Optimization Techniques
Optimization TechniquesOptimization Techniques
Optimization Techniques
 
An Introduction to Model Order Reduction
An Introduction to Model Order ReductionAn Introduction to Model Order Reduction
An Introduction to Model Order Reduction
 
PMF BPMF and BPTF
PMF BPMF and BPTFPMF BPMF and BPTF
PMF BPMF and BPTF
 
A note on word embedding
A note on word embeddingA note on word embedding
A note on word embedding
 
Parallel Evaluation of Multi-Semi-Joins
Parallel Evaluation of Multi-Semi-JoinsParallel Evaluation of Multi-Semi-Joins
Parallel Evaluation of Multi-Semi-Joins
 
Applying Model Checking Approach with Floating Point Arithmetic for Verificat...
Applying Model Checking Approach with Floating Point Arithmetic for Verificat...Applying Model Checking Approach with Floating Point Arithmetic for Verificat...
Applying Model Checking Approach with Floating Point Arithmetic for Verificat...
 
Programacion Cuadratica
Programacion CuadraticaProgramacion Cuadratica
Programacion Cuadratica
 
Functional analysis in mechanics 2e
Functional analysis in mechanics  2eFunctional analysis in mechanics  2e
Functional analysis in mechanics 2e
 
Functional analysis in mechanics
Functional analysis in mechanicsFunctional analysis in mechanics
Functional analysis in mechanics
 
Dk32696699
Dk32696699Dk32696699
Dk32696699
 
Time and space complexity
Time and space complexityTime and space complexity
Time and space complexity
 
hankel_norm approximation_fir_ ijc
hankel_norm approximation_fir_ ijchankel_norm approximation_fir_ ijc
hankel_norm approximation_fir_ ijc
 
Sampling and Markov Chain Monte Carlo Techniques
Sampling and Markov Chain Monte Carlo TechniquesSampling and Markov Chain Monte Carlo Techniques
Sampling and Markov Chain Monte Carlo Techniques
 
Design and analysis of algorithm
Design and analysis of algorithmDesign and analysis of algorithm
Design and analysis of algorithm
 
Symbolic Execution as DPLL Modulo Theories
Symbolic Execution as DPLL Modulo TheoriesSymbolic Execution as DPLL Modulo Theories
Symbolic Execution as DPLL Modulo Theories
 
Modification of a heuristic method
Modification of a heuristic methodModification of a heuristic method
Modification of a heuristic method
 
Sm421 rg
Sm421 rgSm421 rg
Sm421 rg
 
how to calclute time complexity of algortihm
how to calclute time complexity of algortihmhow to calclute time complexity of algortihm
how to calclute time complexity of algortihm
 
15
1515
15
 
FURTHER RESULTS ON THE DIRAC DELTA APPROXIMATION AND THE MOMENT GENERATING FU...
FURTHER RESULTS ON THE DIRAC DELTA APPROXIMATION AND THE MOMENT GENERATING FU...FURTHER RESULTS ON THE DIRAC DELTA APPROXIMATION AND THE MOMENT GENERATING FU...
FURTHER RESULTS ON THE DIRAC DELTA APPROXIMATION AND THE MOMENT GENERATING FU...
 

Similar to The Octagon Abstract Domain

Elementary Landscape Decomposition of the Hamiltonian Path Optimization Problem
Elementary Landscape Decomposition of the Hamiltonian Path Optimization ProblemElementary Landscape Decomposition of the Hamiltonian Path Optimization Problem
Elementary Landscape Decomposition of the Hamiltonian Path Optimization Problemjfrchicanog
 
Convex optmization in communications
Convex optmization in communicationsConvex optmization in communications
Convex optmization in communicationsDeepshika Reddy
 
Mesh simplification notes
Mesh simplification notesMesh simplification notes
Mesh simplification notesManchor Ko
 
HOME ASSIGNMENT omar ali.pptx
HOME ASSIGNMENT omar ali.pptxHOME ASSIGNMENT omar ali.pptx
HOME ASSIGNMENT omar ali.pptxSayedulHassan1
 
HOME ASSIGNMENT (0).pptx
HOME ASSIGNMENT (0).pptxHOME ASSIGNMENT (0).pptx
HOME ASSIGNMENT (0).pptxSayedulHassan1
 
Module-5-1_230523_171754 (1).pdf
Module-5-1_230523_171754 (1).pdfModule-5-1_230523_171754 (1).pdf
Module-5-1_230523_171754 (1).pdfvikasmittal92
 
香港六合彩
香港六合彩香港六合彩
香港六合彩baoyin
 
Lecture 02 internet video search
Lecture 02 internet video searchLecture 02 internet video search
Lecture 02 internet video searchzukun
 
4optmizationtechniques-150308051251-conversion-gate01.pdf
4optmizationtechniques-150308051251-conversion-gate01.pdf4optmizationtechniques-150308051251-conversion-gate01.pdf
4optmizationtechniques-150308051251-conversion-gate01.pdfBechanYadav4
 
7_Intro_to_Functions
7_Intro_to_Functions7_Intro_to_Functions
7_Intro_to_Functionsnechamkin
 

Similar to The Octagon Abstract Domain (20)

Elementary Landscape Decomposition of the Hamiltonian Path Optimization Problem
Elementary Landscape Decomposition of the Hamiltonian Path Optimization ProblemElementary Landscape Decomposition of the Hamiltonian Path Optimization Problem
Elementary Landscape Decomposition of the Hamiltonian Path Optimization Problem
 
Convex optmization in communications
Convex optmization in communicationsConvex optmization in communications
Convex optmization in communications
 
Subquad multi ff
Subquad multi ffSubquad multi ff
Subquad multi ff
 
Integration
IntegrationIntegration
Integration
 
Mesh simplification notes
Mesh simplification notesMesh simplification notes
Mesh simplification notes
 
HOME ASSIGNMENT omar ali.pptx
HOME ASSIGNMENT omar ali.pptxHOME ASSIGNMENT omar ali.pptx
HOME ASSIGNMENT omar ali.pptx
 
HOME ASSIGNMENT (0).pptx
HOME ASSIGNMENT (0).pptxHOME ASSIGNMENT (0).pptx
HOME ASSIGNMENT (0).pptx
 
MUMS: Bayesian, Fiducial, and Frequentist Conference - Model Selection in the...
MUMS: Bayesian, Fiducial, and Frequentist Conference - Model Selection in the...MUMS: Bayesian, Fiducial, and Frequentist Conference - Model Selection in the...
MUMS: Bayesian, Fiducial, and Frequentist Conference - Model Selection in the...
 
Ba26343346
Ba26343346Ba26343346
Ba26343346
 
Module-5-1_230523_171754 (1).pdf
Module-5-1_230523_171754 (1).pdfModule-5-1_230523_171754 (1).pdf
Module-5-1_230523_171754 (1).pdf
 
Reginf pldi3
Reginf pldi3Reginf pldi3
Reginf pldi3
 
香港六合彩
香港六合彩香港六合彩
香港六合彩
 
Chapter 4 Integration
Chapter 4  IntegrationChapter 4  Integration
Chapter 4 Integration
 
Lecture 02 internet video search
Lecture 02 internet video searchLecture 02 internet video search
Lecture 02 internet video search
 
4optmizationtechniques-150308051251-conversion-gate01.pdf
4optmizationtechniques-150308051251-conversion-gate01.pdf4optmizationtechniques-150308051251-conversion-gate01.pdf
4optmizationtechniques-150308051251-conversion-gate01.pdf
 
Optmization techniques
Optmization techniquesOptmization techniques
Optmization techniques
 
optmizationtechniques.pdf
optmizationtechniques.pdfoptmizationtechniques.pdf
optmizationtechniques.pdf
 
bv_cvxslides (1).pdf
bv_cvxslides (1).pdfbv_cvxslides (1).pdf
bv_cvxslides (1).pdf
 
www.ijerd.com
www.ijerd.comwww.ijerd.com
www.ijerd.com
 
7_Intro_to_Functions
7_Intro_to_Functions7_Intro_to_Functions
7_Intro_to_Functions
 

Recently uploaded

The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform EngineeringJemma Hussein Allen
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsPaul Groth
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...Elena Simperl
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backElena Simperl
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance
 
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»QADay
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...Sri Ambati
 
КАТЕРИНА АБЗЯТОВА «Ефективне планування тестування ключові аспекти та практ...
КАТЕРИНА АБЗЯТОВА  «Ефективне планування тестування  ключові аспекти та практ...КАТЕРИНА АБЗЯТОВА  «Ефективне планування тестування  ключові аспекти та практ...
КАТЕРИНА АБЗЯТОВА «Ефективне планування тестування ключові аспекти та практ...QADay
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...Product School
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...Product School
 

Recently uploaded (20)

The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
КАТЕРИНА АБЗЯТОВА «Ефективне планування тестування ключові аспекти та практ...
КАТЕРИНА АБЗЯТОВА  «Ефективне планування тестування  ключові аспекти та практ...КАТЕРИНА АБЗЯТОВА  «Ефективне планування тестування  ключові аспекти та практ...
КАТЕРИНА АБЗЯТОВА «Ефективне планування тестування ключові аспекти та практ...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Ransomware Mallox [EN].pdf
Ransomware         Mallox       [EN].pdfRansomware         Mallox       [EN].pdf
Ransomware Mallox [EN].pdf
 

The Octagon Abstract Domain

  • 1. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion The Octagon Domain Bernhard Mallinger March 6-7th, 2013 Bernhard Mallinger The Octagon Domain
  • 2. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Outline 1 Domains 2 The Octagon Domain 3 Abstract Transfer Functions 4 Analysis Example 5 Conclusion Bernhard Mallinger The Octagon Domain
  • 3. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Outline 1 Domains 2 The Octagon Domain 3 Abstract Transfer Functions 4 Analysis Example 5 Conclusion Bernhard Mallinger The Octagon Domain
  • 4. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Recap: Abstract Domains Models states/properties in abstract interpretation of programs Manipulated by abstract transfer functions Can be composed of different kinds of elements Properties (e.g. sign, is even) Numeric values, intervals Relations Examples Sign Domain Interval Domain Polyhedra Domain Bernhard Mallinger The Octagon Domain
  • 5. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Numerical Domains I Figure: • represent elements of the domain, spurious elements are marked by ×. Domains always overapproximate in order to be sound. (figure from Miné (2006)) Bernhard Mallinger The Octagon Domain
  • 6. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Numerical Domains II Assumption: Numeric means R Interval Domain: Xi ∈ [ai , bi ] Polyhedra Domain: i aij Xi ≤ bj Zone Abstract Domain: ±Xi ≤ ci , Xi − Xj ≤ cij ∀i = j Octagon Domain: ±Xi ± Xj ≤ cij ∀i, j Bernhard Mallinger The Octagon Domain
  • 7. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Numerical Domains II Assumption: Numeric means R Interval Domain: Xi ∈ [ai , bi ] Polyhedra Domain: i aij Xi ≤ bj Zone Abstract Domain: ±Xi ≤ ci , Xi − Xj ≤ cij ∀i = j Octagon Domain: ±Xi ± Xj ≤ cij ∀i, j Bernhard Mallinger The Octagon Domain
  • 8. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Numerical Domains II Assumption: Numeric means R Interval Domain: Xi ∈ [ai , bi ] Polyhedra Domain: i aij Xi ≤ bj Zone Abstract Domain: ±Xi ≤ ci , Xi − Xj ≤ cij ∀i = j Octagon Domain: ±Xi ± Xj ≤ cij ∀i, j Bernhard Mallinger The Octagon Domain
  • 9. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Numerical Domains II Assumption: Numeric means R Interval Domain: Xi ∈ [ai , bi ] Polyhedra Domain: i aij Xi ≤ bj Zone Abstract Domain: ±Xi ≤ ci , Xi − Xj ≤ cij ∀i = j Octagon Domain: ±Xi ± Xj ≤ cij ∀i, j Bernhard Mallinger The Octagon Domain
  • 10. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Numerical Domains III In terms of precision: Interval < Octagon < Polyhedra Interval Domain is non-relational Polyhedra Domain has theoretically unbounded cost (exponentially in practise) Octagon domain limited to two variables per inequality and no coefficients ⇒ Quadratic memory/cubic time cost Bernhard Mallinger The Octagon Domain
  • 11. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Motivation: Relational Domains Not only properties of variables are of interest, but also the relation among them: 1 Y := X; 2 Z := X - Y; 3 Z := 4/Z; Bernhard Mallinger The Octagon Domain
  • 12. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Outline 1 Domains 2 The Octagon Domain 3 Abstract Transfer Functions 4 Analysis Example 5 Conclusion Bernhard Mallinger The Octagon Domain
  • 13. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Representation: Difference bound matrices I Constraints: ±X ± Y ≤ c ⇒ 2n × 2n matrix m Concretisation function γ: def γ (m) = {(v1 , . . . , vn ) ∈ Rn | ∀i, j : vj − vi ≤ mij } def γ(m) = {(v1 , . . . , vn ) ∈ Rn | (v1 , −v1 , . . . , vn , −vn ) ∈ γ (m)} Bernhard Mallinger The Octagon Domain
  • 14. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Representation: Difference bound matrices I Constraints: ±X ± Y ≤ c ⇒ 2n × 2n matrix m Concretisation function γ: def γ (m) = {(v1 , . . . , vn ) ∈ Rn | ∀i, j : vj − vi ≤ mij } def γ(m) = {(v1 , . . . , vn ) ∈ Rn | (v1 , −v1 , . . . , vn , −vn ) ∈ γ (m)} Bernhard Mallinger The Octagon Domain
  • 15. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Representation: Difference bound matrices I Constraints: ±X ± Y ≤ c ⇒ 2n × 2n matrix m Concretisation function γ: def γ (m) = {(v1 , . . . , vn ) ∈ Rn | ∀i, j : vj − vi ≤ mij } def γ(m) = {(v1 , . . . , vn ) ∈ Rn | (v1 , −v1 , . . . , vn , −vn ) ∈ γ (m)} Bernhard Mallinger The Octagon Domain
  • 16. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Figure: Octagon representation (figure from Miné (2006)) Bernhard Mallinger The Octagon Domain
  • 17. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Representation: Difference bound matrices II Abstraction function α: Given concrete values, α computes all entries of m by taking the maximal differences for each pair of variables A lattice can be defined: def m n ⇐⇒ ∀i, j : mij ≤ nij def (m n)ij = max(mij , nij ) def (m n)ij = min(mij , nij ) m n ⇒ γ(m) ⊆ γ(n) (γ, α) form a Galois connection Bernhard Mallinger The Octagon Domain
  • 18. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Figure: Problem: Representation is not unique (figure from Miné (2006)) Bernhard Mallinger The Octagon Domain
  • 19. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Shortest Path Closure Calculating all-pairs shortest paths yield smallest (closed) m∗ m∗ = inf {n | γ(m) = γ(n)} All bounds are as tight as possible (Saturation) Cubic time complexity (e.g. Floyd-Warshall) Negative cost cycle in m ⇐⇒ γ(m) = ∅ Bernhard Mallinger The Octagon Domain
  • 20. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Outline 1 Domains 2 The Octagon Domain 3 Abstract Transfer Functions 4 Analysis Example 5 Conclusion Bernhard Mallinger The Octagon Domain
  • 21. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Abstract Transfer Functions Abstract transfer functions correspond to semantic operations Must be sound, therefore overapproximation Some require closed arguments, some return closed ones Different kinds: Set operations such as Union/Intersection Assignment Test Widening/Narrowing Conversions to other domains (e.g. Interval, Polyhedra) Bernhard Mallinger The Octagon Domain
  • 22. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Union Take largest bounds elementwise: def m∪n = m n Union of two octagons isn’t an octagon in general ⇒ exact abstractions isn’t possible, only best abstraction Best abstraction is obtained if m and n are closed Bernhard Mallinger The Octagon Domain
  • 23. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Intersection Definition similar to union, but result is always exact Bernhard Mallinger The Octagon Domain
  • 24. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Forget-Operator Figure: Non-deterministic behaviour can be modeled by “forgetting” constraints, but closure is necessary (figure from Miné (2006)) Bernhard Mallinger The Octagon Domain
  • 25. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Assignment I Handling of assignments depends on the type of the expression Directly handleable in the octagon domain: X ← ±[a, b] X ← ±Y ± [a, b] e.g. for X ← Y + [a, b], we get a ≤ X − Y ≤ b: +X − −Y ≤ b − X − +Y ≤ −a −Y − +X ≤ b + Y − −X ≤ −a Constraints for X w.r.t. other variables have to be discarded Bernhard Mallinger The Octagon Domain
  • 26. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Assignment II In case the expression is too complex: ⇒ Transform everything to Interval or Polyhedra domain and do assignment there If using the Interval domain, new constraints can be derived by computing bounds of ±expr ± Y Using the Polyhedra domain is applicable to linear expressions and costly, but yields a best abstraction Bernhard Mallinger The Octagon Domain
  • 27. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Test 1 X := [-100, 100] 2 if X ≥ 0 then 3 // X ∈ [0, 100] 4 end if All tests can be simplified to expr ≤ 0 Octagonally shaped tests can directly be applied (e.g. X + Y + [a, b] ≤ 0) More complex forms can be handled in the Interval or Polyhedra domain (cf. Assignment) Bernhard Mallinger The Octagon Domain
  • 28. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Outline 1 Domains 2 The Octagon Domain 3 Abstract Transfer Functions 4 Analysis Example 5 Conclusion Bernhard Mallinger The Octagon Domain
  • 29. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion 1 X := [-100, 100] 2 Y := X 3 if Y ≤ 0 then 4 1 Y := -Y 2 5 else 6 3 7 end if 8 4 9 if Y ≤ 69 then 5 10 end if 1 −100 ≤ X ≤ 0 ∧ −100 ≤ Y ≤ 0 ∧ X − Y = 0 ∧ −200 ≤ X + Y ≤ 0 2 −100 ≤ X ≤ 0 ∧ 0 ≤ Y ≤ 100 ∧ −200 ≤ X − Y ≤ 0 ∧ X + Y = 0 3 0 ≤ X ≤ 100 ∧ 0 ≤ Y ≤ 100 ∧ X − Y = 0 ∧ 0 ≤ X + Y ≤ 200 4 −100 ≤ X ≤ 100 ∧ 0 ≤ Y ≤ 100 ∧ −200 ≤ X − Y ≤ 0 ∧ 0 ≤ X + Y ≤ 200 5 −69 ≤ X ≤ 69 ∧ 0 ≤ Y ≤ 69 ∧ −138 ≤ X − Y ≤ 0 ∧ 0 ≤ X + Y ≤ 138 Bernhard Mallinger The Octagon Domain
  • 30. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion 1 X := [-100, 100] 2 Y := X 3 if Y ≤ 0 then 4 1 Y := -Y 2 5 else 6 3 7 end if 8 4 9 if Y ≤ 69 then 5 10 end if 1 −100 ≤ X ≤ 0 ∧ −100 ≤ Y ≤ 0 ∧ X − Y = 0 ∧ −200 ≤ X + Y ≤ 0 2 −100 ≤ X ≤ 0 ∧ 0 ≤ Y ≤ 100 ∧ −200 ≤ X − Y ≤ 0 ∧ X + Y = 0 3 0 ≤ X ≤ 100 ∧ 0 ≤ Y ≤ 100 ∧ X − Y = 0 ∧ 0 ≤ X + Y ≤ 200 4 −100 ≤ X ≤ 100 ∧ 0 ≤ Y ≤ 100 ∧ −200 ≤ X − Y ≤ 0 ∧ 0 ≤ X + Y ≤ 200 5 −69 ≤ X ≤ 69 ∧ 0 ≤ Y ≤ 69 ∧ −138 ≤ X − Y ≤ 0 ∧ 0 ≤ X + Y ≤ 138 Bernhard Mallinger The Octagon Domain
  • 31. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion 1 X := [-100, 100] 2 Y := X 3 if Y ≤ 0 then 4 1 Y := -Y 2 5 else 6 3 7 end if 8 4 9 if Y ≤ 69 then 5 10 end if 1 −100 ≤ X ≤ 0 ∧ −100 ≤ Y ≤ 0 ∧ X − Y = 0 ∧ −200 ≤ X + Y ≤ 0 2 −100 ≤ X ≤ 0 ∧ 0 ≤ Y ≤ 100 ∧ −200 ≤ X − Y ≤ 0 ∧ X + Y = 0 3 0 ≤ X ≤ 100 ∧ 0 ≤ Y ≤ 100 ∧ X − Y = 0 ∧ 0 ≤ X + Y ≤ 200 4 −100 ≤ X ≤ 100 ∧ 0 ≤ Y ≤ 100 ∧ −200 ≤ X − Y ≤ 0 ∧ 0 ≤ X + Y ≤ 200 5 −69 ≤ X ≤ 69 ∧ 0 ≤ Y ≤ 69 ∧ −138 ≤ X − Y ≤ 0 ∧ 0 ≤ X + Y ≤ 138 Bernhard Mallinger The Octagon Domain
  • 32. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion 1 X := [-100, 100] 2 Y := X 3 if Y ≤ 0 then 4 1 Y := -Y 2 5 else 6 3 7 end if 8 4 9 if Y ≤ 69 then 5 10 end if 1 −100 ≤ X ≤ 0 ∧ −100 ≤ Y ≤ 0 ∧ X − Y = 0 ∧ −200 ≤ X + Y ≤ 0 2 −100 ≤ X ≤ 0 ∧ 0 ≤ Y ≤ 100 ∧ −200 ≤ X − Y ≤ 0 ∧ X + Y = 0 3 0 ≤ X ≤ 100 ∧ 0 ≤ Y ≤ 100 ∧ X − Y = 0 ∧ 0 ≤ X + Y ≤ 200 4 −100 ≤ X ≤ 100 ∧ 0 ≤ Y ≤ 100 ∧ −200 ≤ X − Y ≤ 0 ∧ 0 ≤ X + Y ≤ 200 5 −69 ≤ X ≤ 69 ∧ 0 ≤ Y ≤ 69 ∧ −138 ≤ X − Y ≤ 0 ∧ 0 ≤ X + Y ≤ 138 Bernhard Mallinger The Octagon Domain
  • 33. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion 1 X := [-100, 100] 2 Y := X 3 if Y ≤ 0 then 4 1 Y := -Y 2 5 else 6 3 7 end if 8 4 9 if Y ≤ 69 then 5 10 end if 1 −100 ≤ X ≤ 0 ∧ −100 ≤ Y ≤ 0 ∧ X − Y = 0 ∧ −200 ≤ X + Y ≤ 0 2 −100 ≤ X ≤ 0 ∧ 0 ≤ Y ≤ 100 ∧ −200 ≤ X − Y ≤ 0 ∧ X + Y = 0 3 0 ≤ X ≤ 100 ∧ 0 ≤ Y ≤ 100 ∧ X − Y = 0 ∧ 0 ≤ X + Y ≤ 200 4 −100 ≤ X ≤ 100 ∧ 0 ≤ Y ≤ 100 ∧ −200 ≤ X − Y ≤ 0 ∧ 0 ≤ X + Y ≤ 200 5 −69 ≤ X ≤ 69 ∧ 0 ≤ Y ≤ 69 ∧ −138 ≤ X − Y ≤ 0 ∧ 0 ≤ X + Y ≤ 138 Bernhard Mallinger The Octagon Domain
  • 34. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion 1 X := [-100, 100] 2 Y := X 3 if Y ≤ 0 then 4 1 Y := -Y 2 5 else 6 3 7 end if 8 4 9 if Y ≤ 69 then 5 10 end if 1 −100 ≤ X ≤ 0 ∧ −100 ≤ Y ≤ 0 ∧ X − Y = 0 ∧ −200 ≤ X + Y ≤ 0 2 −100 ≤ X ≤ 0 ∧ 0 ≤ Y ≤ 100 ∧ −200 ≤ X − Y ≤ 0 ∧ X + Y = 0 3 0 ≤ X ≤ 100 ∧ 0 ≤ Y ≤ 100 ∧ X − Y = 0 ∧ 0 ≤ X + Y ≤ 200 4 −100 ≤ X ≤ 100 ∧ 0 ≤ Y ≤ 100 ∧ −200 ≤ X − Y ≤ 0 ∧ 0 ≤ X + Y ≤ 200 5 −69 ≤ X ≤ 69 ∧ 0 ≤ Y ≤ 69 ∧ −138 ≤ X − Y ≤ 0 ∧ 0 ≤ X + Y ≤ 138 Bernhard Mallinger The Octagon Domain
  • 35. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Outline 1 Domains 2 The Octagon Domain 3 Abstract Transfer Functions 4 Analysis Example 5 Conclusion Bernhard Mallinger The Octagon Domain
  • 36. Domains The Octagon Domain Abstract Transfer Functions Analysis Example Conclusion Conclusion The Octagon domain adds limited relational information to the Interval Domain As opposed to the Polyhedra domain (exponential worst case), its operations are still in P A normal form can be computed using Shortest Path Closure ⇒ necessary for emptiness testing and comparison Has been employed successfully in ASTRÉE to analyse a large C-program (airplane control software) Reduction of false alarms with reasonable overhead Only relevant relations are considered (“packs” of variables) Bernhard Mallinger The Octagon Domain