DrNLA: Extending Verification to Non-linear Programs through Dual Re-writing

06/27/2023
by   Yuandong Cyrus Liu, et al.
0

For many decades, advances in static verification have focused on linear integer arithmetic (LIA) programs. Many real-world programs are, however, written with non-linear integer arithmetic (NLA) expressions, such as programs that model physical events, control systems, or nonlinear activation functions in neural networks. While there are some approaches to reasoning about such NLA programs, still many verification tools fall short when trying to analyze them. To expand the scope of existing tools, we introduce a new method of converting programs with NLA expressions into semantically equivalent LIA programs via a technique we call dual rewriting. Dual rewriting discovers a linear replacement for an NLA Boolean expression (e.g. as found in conditional branching), simultaneously exploring both the positive and negative side of the condition, and using a combination of static validation and dynamic generalization of counterexamples. While perhaps surprising at first, this is often possible because the truth value of a Boolean NLA expression can be characterized in terms of a Boolean combination of linearly-described regions/intervals where the expression is true and those where it is false. The upshot is that rewriting NLA expressions to LIA expressions beforehand enables off-the-shelf LIA tools to be applied to the wider class of NLA programs. We built a new tool DrNLA and show it can discover LIA replacements for a variety of NLA programs. We then applied our work to branching-time verification of NLA programs, creating the first set of such benchmarks (92 in total) and showing that DrNLA's rewriting enable tools such as FuncTion and T2 to verify CTL properties of 42 programs that previously could not be verified. We also show a potential use of DrNLA assisting Frama-C in program slicing, and report that execution speed is not impacted much by rewriting.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
11/04/2021

Source-Level Bitwise Branching for Temporal Verification

There is increasing interest in applying verification tools to programs ...
research
05/11/2021

Proving LTL Properties of Bitvector Programs and Decompiled Binaries (Extended)

There is increasing interest in applying verification tools to programs ...
research
08/11/2022

SSLEM: A Simplifier for MBA Expressions based on Semi-linear MBA Expressions and Program Synthesis

MBA (mixed boolean and arithmetic) expressions are hard to simplify, so ...
research
07/13/2023

Targeting Completeness: Using Closed Forms for Size Bounds of Integer Programs

We present a new procedure to infer size bounds for integer programs aut...
research
06/08/2023

Boosting-based Construction of BDDs for Linear Threshold Functions and Its Application to Verification of Neural Networks

Understanding the characteristics of neural networks is important but di...
research
05/16/2019

Extending OCaml's 'open'

We propose a harmonious extension of OCaml's 'open' construct. OCaml's...
research
05/11/2023

Simplification of General Mixed Boolean-Arithmetic Expressions: GAMBA

Malware code often resorts to various self-protection techniques to comp...

Please sign up or login with your details

Forgot password? Click here to reset