Using Simplex Method in Verifying Software Safety
|
|
|
- Joleen Reed
- 10 years ago
- Views:
Transcription
1 Using Simplex Method in Verifying Software Safety Milena Vujošević-Janičić Filip Marić Dušan Tošić Faculty of Mathematics, University of Belgrade, Studentski trg 16,11000 Belgrade, Serbia Abstract In this paper we discuss an application of the Simplex method in checking software safety the application in automated detection of buffer overflows in C programs. This problem is important because buffer overflows are suitable targets for hackers security attacks and sources of serious programs misbehavior. We also describe our implementation, including a system for generating software correctness conditions and a Simplex -based theorem prover that resolves these conditions. 1 Introduction The Simplex method is considered to be one of the most significant algorithms of the last century. 1 It is a method for solving the linear optimization problem [4] and its worst case complexity is exponential in the number of variables [11]. However, it is very efficient in practice and converges in polynomial time for many input problems, including certain classes of randomly generated problems ([17], [9]). Apart from the basic Simplex method for the optimization problem, there are many other variants, including a decision variant that decides if a set of linear constraints is satisfiable or not. The Simplex method has a wide range of applications, in different sorts of optimization problems, but also in software and hardware verification. In this paper, we describe how a decision version of the Simplex method can be used in automated detection of buffer overflows in programming language C. Buffer overflow (or buffer overrun) is a programming flaw which enables storing more This work was partially supported by Serbian Ministry of Science grant For instance, the journal Computing in Science and Engineering listed it as one of the top 10 algorithms of the century. 1
2 data in a data storage area (buffer) than it was intended to hold. This shortcoming can produce many problems. Namely, buffer overflows are suitable targets for breaking security of programs and sources of serious programs misbehavior. Further in this paper, in Section 2 we give background information, in Section 3 we describe one decision variant of the Simplex method and our implementation, and in Section 4 we present our technique for automated detection of buffer overflows, that uses the mentioned implementation. In Section 5 we briefly discuss related work and in Section 6 we draw final conclusions and discuss the future work. 2 Background Linear programming. Linear programming, sometimes known as linear optimization, is the problem of maximizing or minimizing a linear function over a convex polyhedron specified by linear and non-negativity constraints. A linear programming problem consists of a collection of linear inequalities on a number of real variables and a given linear function (on these real variables) to be maximized or minimized. A linear programming problem, in its standard form, is to maximize function given by c t x with regards to constraints of the type Ax b where b 0, x 0, x, b and c are vectors from R n, and A is a real m n matrix. Linear Arithmetic. Linear arithmetic (over rationals (LRA) or integers (LIA)) is a fragment of arithmetic (over rationals or integers) involving addition, but not multiplication, except multiplication by constants. A quantifier-free linear arithmetic formula is a first-order formula whose atoms are equalities, disequalities, or inequalities of the form a 1 x a n x n b, where a 1,..., a n and b are rational numbers, x 1,..., x n are (rational or integer) variables, and is one of the operators =,, <, >,, or. Linear arithmetic (both over rationals and integers) is decidable (i.e., there is a decision procedure, returning true if and only if an input linear arithmetic sentence Φ is a theorem, and returning false otherwise)). Two most popular methods for deciding satisfiability of linear arithmetic formulae are Fourier- Motzkin procedure [14] and the Simplex method [7]. Linear arithmetic is widely used in software verification, especially its quantifier-free fragment, because it can model many types of constraints, and it is decidable. Decision procedures for LRA are much faster then decision procedures for LIA. Simplex method. The Simplex method is originally constructed to solve linear programming optimization problem, but its variants can be used to solve the decision problem for quantifier-free fragment of linear arithmetic. The method iteratively finds feasible solutions satisfying all the given constraints, while greedily tries to maximize the objective function. In geometric terms, a series of linear inequalities defines a closed convex polytope (called simplex), defined by intersecting a number of half-spaces in 2
3 n-dimensional Euclidean space; each half-space is an area which lies on one side of a hyperplane. The Simplex algorithm begins at a starting vertex and moves along the edges of the polytope until it reaches the vertex of the optimum solution. At every iteration an adjacent vertex is chosen such that the value of the objective function does not decrease. If no such vertex exists, a solution to the problem is found. Usually, such an adjacent vertex is not unique, and a pivot rule must be specified to determine which vertex to pick. There are various pivot rules used in practice. The decision problem for linear arithmetic reduces to finding a single feasible solution. The basic Simplex method can be modified to cover some other, different types of constraints than those used in standard linear programming optimization problem (e.g., some variables x i might be unconstrained, some coefficients b i might be negative, a minimal solution instead of maximal one might be requested). The dual Simplex algorithm [15] is quite effective when constraints are added incrementally. This algorithm is particularly useful for reoptimizing the problem after a constraint has been added or some parameters have been changed so that the previously optimal solution is no longer feasible. SMT. Satisfiability Modulo Theories (SMT) solvers check satisfiability of Boolean combination of constraints formulated in some first-order theory or combination of several such theories. SMT solving has many industrial applications, especially in software and hardware verification. Some of the interesting background theories for different applications are linear arithmetic, theory of uninterpreted functions, and theories of program structures like arrays and recursive structures. Most state-of-the-art SMT solvers have support for linear arithmetic and can deal with extremely complex conjectures coming from industry. In these cases the decision procedures are usually based on the Simplex method. The SMT-lib initiative 2 is aimed at producing a library of SMT benchmarks and all required standards and notational conventions [18], linking a range of SMT solvers and research groups. In SMT-lib, the underlying logic is classical first order logic with equality. Buffer Overflow Bug Buffer overflow, i.e., writing outside the bounds of a block of allocated memory, can lead to different sorts of bugs and can provide possibility to an execution of malicious code. According to some estimates, buffer overflows account for up to 50% of software vulnerabilities, and this percent seems to be increasing over time [22]. In particular, buffer overflow is probably the best known form of software security vulnerability. Attackers have managed to identify and exploit buffer overflows in a large number of products and components [21, 3]. Buffer overflows are very frequent because programming language C is inherently unsafe. Namely, array and pointer references are not automatically bounds-checked. In addition, many of the string functions from the standard C 2 3
4 library (such as strcpy(), strcat(), sprintf(), gets()) are unsafe. Programmers often assume that calls to these functions are safe, or do the inadequate checks. The consequence is that there are many applications using the string functions unsafely. In handling and avoiding possible buffer overflows, standard testing is not sufficient, and more involved techniques are required. The problem of automated detection of buffer overflows attracted a lot of attention and several techniques for handling this problem were proposed, most of them over the last ten years. Modern techniques can help in detecting bugs missed by hand audits. The approaches for detecting buffer overruns are divided into dynamic and static techniques. Dynamic techniques examine the program during its execution. Methods based on static program analysis aim at detecting potential buffer overflows before run-time and their major advantage is that bugs can be found and eliminated before code is deployed. 3 Simplex-based SMT Solving In this section we will describe basics of a DPLL(T) framework for SMT, and then present a Simplex-based decision procedure for Linear Arithmetic (over rationals) designed to fit within the DPLL(T) framework. ArgoLib is an SMT solver based on DPLL(T) framework and developed by the Automatic Reasoning GrOup at Faculty of Mathematics in Belgrade. 3 Among several supported theories, ArgoLib contains a solver for the theory of Linear Arithmetic over rationals (LRA), based on the Simplex method implementation described in Section DPLL(T) Amongst a plethora of recent research on satisfiability modulo theory, the DPLL(T) framework [16] has proven to be very successful. Within this framework, an SMT solver consists of two separated components: 1. DP LL(X) a Boolean satisfiability solver based on a slightly modified variant of Davis-Putnam-Logeman-Loveland (DPLL) algorithm [5]. 2. Solver T a solver for the given theory T capable to check the consistency of conjunctions of atomic formulae from T. These two components have to cooperate during the solving process. DP LL(X) is parameterized with Solver T, giving a DP LL(T ) solver. A given formula Φ of the theory T is transformed into a Boolean formula Φ bool by replacing its atoms φ 1,..., φ k with fresh propositional variables p 1,..., p k. The role of the DP LL(X) component is to find and enumerate propositional models of the formula Φ bool. Each propositional model M induces a conjunction of atoms Φ M T = M i=1 ψ i, such that ψ i = φ i if p i M or ψ i = φ i if p i M. The 3 ArgoLib is being developed by the second author of this paper. 4
5 role of the Solver T component is to check consistency of conjunctions Φ M T, with respect to the background theory T. The formula Φ is satisfiable if and only if there is a propositional model M satisfying Φ bool such that its corresponding formula Φ M T is consistent with the theory T. Example 1 Let us consider the formula Φ (x + y > 0 x < 0) y < 0 (implicitly existentially quantified) with respect to the theory of linear arithmetic over rationals. The atoms φ 1 x + y > 0, φ 2 x < 0 and φ 3 y < 0, are abstracted with propositional variables p 1, p 2 and p 3 respectively and the corresponding Boolean formula Φ bool is (p 1 p 2 ) p 3. The model M 1 = {p 1, p 2, p 3 } for Φ bool induces the formula Φ M1 LRA x + y > 0 x < 0 y < 0, which is inconsistent in linear arithmetic. On the other hand, the model M 2 = {p 1, p 2, p 3 } for Φ bool induces the formula Φ M2 LRA x + y > 0 x < 0 y 0 which is consistent in linear arithmetic and, therefore, the formula Φ is satisfiable. The DPLL(X) component based on DPLL search algorithm builds propositional models incrementally, starting from an empty valuation, and asserting literals one-by-one until all variables become assigned, or until it shows that formula has no propositional models. In order to obtain better efficiency, propositional models are not only checked against theory T a posteriori i.e., when they are completely constructed, but also, partial propositional models are checked during the Boolean search process. Therefore, Solver T should be incremental, i.e., once it has found a conjunction of atoms consistent, it has to be able to check the consistency of that conjunction extended with additional atom(s), without having to redo all the previous work. In order to achieve this, Solver T maintains a state consisting of atoms corresponding to propositions asserted so far by DP LL(X). As the search progresses, new literals are asserted and their corresponding atoms are given to Solver T which then checks the consistency of its state. When inconsistency is detected, the DP LL(X) module is notified about it.then, it backtracks and removes some asserted literals and their corresponding atoms until a consistent state is restored. Literals and their corresponding atoms are asserted and backtracked in LIFO fashion. When inconsistency of Φ M T is detected, it usually comes from a subset of atoms that have been asserted. Solver T should be able to generate a (preferably small) inconsistent subset of Φ M T. This set is called the explanation for inconsistency of Φ M T and it helps the Boolean search engine DP LL(X) to reject some Boolean models that could induce the same inconsistent core again. Solver T should be able also to infer which atoms (and their corresponding propositions) have to hold as a consequence of its current state. This is called the theory propagation and it can significantly speed up the search, since the information from the background theory T is used to guide the Boolean search process. 5
6 3.2 Simplex-based Solver for LRA We now describe a Solver LRA based on specific variant of dual Simplex method developed by Duterte and de Moura and used in their SMT solver yices [8]. This procedure consists of a preprocessing phase and a solving phase. Preprocessing. The first step of the procedure is to rewrite the formula Φ into an equisatisfiable formula Φ = Φ, where Φ = is a conjunction of linear equalities and Φ is an arbitrary Boolean formula in which all atoms occurring in Φ are elementary atoms of the form x i b, where x i is a variable and b is a rational constant. This transformation is straightforward, and it introduces a new variable s i for every linear term t i that is not a variable and that occurs as a left-hand side of an atom t i b of Φ. Example 2 If Φ is x 0 x+y < 0 2x+3y > 1, Φ is x 0 s 1 < 0 s 2 > 1, and Φ = is s 1 = x + y s 2 = 2x + 3y. In the next preprocessing step, all disequalities of the form x b are rewritten to x < b x > b. Then, each strict inequality of the form x < b is replaced by x b δ, where δ has a role of a sufficiently small rational number. Similarly, each x > b is replaced with x b + δ. This enables us to assume that there are no strict inequalities in Φ. Example 3 After the second preprocessing step, the formula Φ from Example 2 becomes x 0 s 1 δ s δ. The number δ is not computed in advance, it is treated symbolically, and its effective computation is done only when a concrete, rational model of the formula that is found to be satisfiable over Q is requested. This means that after the preprocessing phase, all computations are performed in the field Q δ, where Q δ is the set {a + b δ a, b Q}. While addition and multiplication of elements of Q δ is trivial, comparison of Q δ elements is defined in the following way: a 1 + b 1 δ a 2 + b 2 δ if and only if a 1 a 2 (a 1 = a 2 b 1 b 2 ), where {, }. It can be shown that the original formula is satisfiable over Q if and only if the transformed formula is satisfiable over Q δ. For more details of this subject see [8]. Incremental Simplex Algorithm The formula Φ = is a conjunction of equalities and it does not change during the search process, so it can be given to Simplex solver before the model search begins. Let x 1,..., x n be all variables occurring in Φ = Φ (that is, all variables from Φ and m additional variables s 1,..., s m ). If all variables are put on the left hand sides, the formula Φ = can be represented in matrix form as Ax = 0, where A is a matrix m n, m n, and x is a vector of n variables. Instead of that, we will keep this system of equations in a form solved for m variables, i.e., in a tableau derived from the matrix A, written in the form: x i = a ij x j, x i B. x j N 6
7 The variables on the left hand side will be called basic variables, and variables on the right hand side will be called non-basic variables. We will denote the current set of basic variables by B and the current set of non-basic variables by N. Basic variables do not occur on the right hand side of the tableau. Initially, only the additional variables will be the basic variables. On the other hand, formula Φ is an arbitrary Boolean combination of elementary atoms of the form x i b, where b Q δ. As said in Section 3.1, the Boolean structure is handled by a separate DP LL(X) component, so the Simplex solver needs to be able to check consistency only of conjunctions of elementary atoms of Φ (where elementary atoms are asserted and backtracked one by one). Because of their special structure (x u or x l), the conjunction of asserted elementary atoms determines lower and upper bounds for variables. Therefore, Φ is consistent if there is x Q n δ satisfying Ax = 0 and l j x j u j for j = 1,..., n, where l j is an element of Q δ or and u j is an element of Q δ or +. The solver state includes: 1. A tableau derived from the formula Φ =, written in the form: x i = a ij x j, x i B. x j N 2. The known upper and lower bounds l i and u i for every variable x i, derived from asserted atoms of Φ. 3. The current valuation, i.e., a mapping β assigning a value β(x i ) Q δ to every variable x i. Initially, all lower bounds are set to, all upper bounds are set to +, and β assigns zero to each variable x i. The main invariant of the algorithm (the property that holds after each step) is that β always satisfies the tableau i.e., Aβ(x) = 0 and β always satisfies the bounds i.e., x j B N, l j β(x j ) u j. When a new elementary atom is asserted, the solver state is updated. Since disequalities and strict inequalities are removed in the preprocessing phase, only equalities and non-strict inequalities are asserted. Instead of equality x i = b, two inequalities x i b and x i b are asserted. After asserting inequality x i b (assertion of inequality of x i b is handled in a similar way), the value b is compared with the current bounds for x i and bounds are updated: If b is greater then u i, the inequality x i b does not introduce any new information and state is not changed. If b is less then l i, then the state becomes inconsistent and unsatisfiability is detected. 7
8 In other cases, the upper bound u i for the variable x i is decreased and set to b. If x i is non-basic variable (i.e., when x i N ), and when its value β(x i ) does not satisfy the updated bounds l i or u i, its value has to be updated. If it holds that β(x i ) > u i (the case β(x i ) < l i is handled in a similar way), the value β(x i ) is decreased and set to u i. With every change of the value of a non-basic variable, the values of basic variables need to be updated in order to keep the tableau satisfied. The problem arises if x i is a basic variable (i.e., when x i B), and when its value β(x i ) does not satisfy its bounds l i or u i. If it holds that β(x i ) > u i (the case β(x i ) < l i is handled in a similar way), the value β(x i ) has to be decreased and set to u i. In order for the tableau equation x i = x a j N ijx j to remain valid, there must exist a non-basic variable x j such that its value β(x j ) can be decreased (if for its corresponding coefficient a ij it holds that a ij > 0) or increased (if for its corresponding coefficient a ij it holds that a ij < 0). If there is no non-basic variable x j allowing this kind of change (because all values are already set to their lower/upper bounds), the state is inconsistent and unsatisfiability is detected. If a non-basic variable x j that allows this kind of change is found, the pivoting operation is performed. The equation x i = x a j N ijx j is solved for x j and the variable x j is then substituted in every other equation of the tableau. Therefore, x j becomes a basic variable, and x i becomes a non-basic variable so its value can be set to u i. Still, this can cause bound violation for some other basic variables, and the process should be iteratively performed until all variables satisfy their bounds, or until inconsistency is detected. A variant of Bland s rule [2] which relies on a fixed variable ordering can be used to ensure termination of this process. In this variant of the Simplex method, during backtracking, only the bounds have to be changed, while the valuation and tableau can remain the same and no pivoting is requested. This feature is very important. Explanations for inconsistencies are generated from the bounds of variables occurring in the equation that has become violated. For more details about generating explanations and performing theory propagation see [8]. Implementation of the described algorithm is given in Figure 1. The procedure assert is invoked by the DP LL(X) component whenever an atom x i b is asserted. This procedure automatically checks and updates bounds and values for non-basic variables, since this operation is cheap and does not require pivoting. The procedure check is used to check bounds and update values for all basic variables. It loops in an infinite loop and iteratively changes the valuation using pivoting until all bounds are satisfied, or an inconsistency is detected. Changing the value of a basic variable can be quite expensive, and the procedure check should be invoked only from time to time. This could delay the detection of inconsistency, but usually gives better overall performance. Procedures update and pivotandupdate are auxiliary. 8
9 procedure assert(x i b) if ( is =) then assert(x i b) assert(x i b) else if ( is ) then if (b u i ) then return satisfiable if (b < l i ) then return unsatisfiable u i := b if (x i N and β(x i ) > b) then update(x i, b) else if ( is ) then if (b l i ) then return satisfiable if (b > u i ) then return unsatisfiable l i := b if (x i N and β(x i ) < b) update(x i, b) procedure check() loop select the smallest x i B such that β(x i ) < l i or beta(x i ) > u i if there is no such x i then return satisfiable if β(x i ) < l i then select the smallest x j N such that (a ij > 0 and β(x j ) < u j ) or (a ij < 0 and β(x j ) > l j ) if there is no such x j then return unsatisfiable pivotandupdate(x i, l i, x j ) if β(x i ) > u i then select the smallest x j N such that (a ij < 0 and β(x j ) < u j ) or (a ij > 0 and β(x j ) > l j ) if there is no such x j then return unsatisfiable pivotandupdate(x i, u i, x j ) end loop procedure update(x i, v) for each x j B β(x j ) := β(x j ) + a ji (v β(x i )) β(x i ) := v procedure pivotandupdate(x i, v, x j ) θ := v β(x i) a ij β(x i ) := v β(x j ) := β(x j ) + θ for each x k B \ {x i } β(x k ) := β(x k ) + a kj θ pivot(x i, x j ) Figure 1: Implementation of a decision variant of the Simplex method. 9
10 Example 4 Let us check the satisfiability of the conjunction x 1 y 1 x + y 0 y x 0. After the initial transformation, the tableau becomes: s 1 = x + y s 2 = x + y and B = {s 1, s 2 }, N = {x, y}. The formula Φ is x 1 y 1 s 1 0 s 2 0. The initial valuation is β(x) = 0, β(y) = 0, β(s 1 ) = 0, β(s 2 ) = 0, and the initial bounds are x +, y +, s 1 +, s 2 +. When x 1 is asserted, the bounds for x become 1 x +, and the valuation becomes β(x) = 1, β(y) = 0, β(s 1 ) = 1, β(s 2 ) = 1. No pivoting is performed. When y 1 is asserted, the bounds for y become y 1, and the valuation is not changed since y satisfies new bounds. No pivoting is performed. When s 1 0 is asserted, the bounds for s 1 become s 1 0. The value β(s 1 ) = 1 violates this bound, and β(s 1 ) has to be decreased to 0. Since s 1 is a basic variable, pivoting has to be performed. The value of x is already on its lower bound so it cannot get decreased. The value of y can be decreased, so y is chosen to be the pivot variable. After pivoting, the tableau becomes: y = s 1 x s 2 = 2x + s 1 and y becomes a basic, and s 1 becomes a non-basic variable. The updated valuation becomes β(x) = 1, β(y) = 1, β(s 1 ) = 0, β(s 2 ) = 2. Finally, when s 2 0 is asserted, the bounds for s 2 become 0 s 2 +. The current value β(s 2 ) = 2 violates this bound, and β(s 2 ) has to be increased to 0. Since s 2 is a basic variable, pivoting has to be performed. Consider the equation s 2 = 2x + s 1. The value of s 2 can be increased only if x is decreased, or s 1 is increased. Since the value of x 1 is already set to its lower bound, and the value of s 1 is already set to its upper bound, the inconsistency is detected. The explanation for the detected inconsistency is the formula x 1 x+y 0 y x 0. It is itself inconsistent, and minimal in the sense that its every subset is consistent. It is inferred from the bounds of the violated equation. 4 New Approach for Automated Detection of Buffer Overflows In this section we describe our new, static, flow-sensitive and inter-procedural system for detecting buffer overflows, with modular architecture. We also describe our prototype implementation, called Fado (from Flexible Automated 10
11 Detection of Buffer Overflows). 4 The system is built from the following building blocks that can be easily changed or updated. Parser, Intermediate Code Generator, and Code Transformer The parser 5 reads code from the source files, parses it, and builds a parse tree. The parse tree is then exported to a specific intermediate code simpler for processing. The code transformer reads the intermediate code and performs a range of steps (e.g., eliminating multiple declarations, eliminating all compound conjunctions and disjunctions, etc.), yielding a program in a subset of C, that is equivalent to the original program, i.e., it preserves its semantics. This transformation significantly simplifies and speeds-up further processing stages. Our motivation, transformation and the target language are similar to the ones described in [26]. Modelling Semantics of Programs, Database and Conditions Generator For modelling the data-flow and semantics of programs, in formulation of the constraints, we use the following functions: value gives a value of a given variable, size gives a number of elements allocated for the given buffer, and used, relevant only for string buffers gives a number of bytes used by the given buffer (i.e., the number of used bytes including the terminating zero). All these functions have an additional (integer) argument called state or timestamp, capturing data-flow, i.e., the temporal nature of variables and memory space. So, value(k, 0) gives a value of k in state 0, used(s, 1) gives a number of bytes used by s in state 1, etc. When processing a sequence of commands, states for value, size, and used, are updated, with respect to previous commands and states, in order to take into account the wider context. The values size(s, i) and used(s, i) are always non-negative. The database is used for generating preconditions and postconditions for single commands. The database stores triples (precondition, command, postcondition). The semantics of a database entry (φ, F, ψ) is as follows: in order F to be safe, the condition φ must hold; in order F to be flawed, the condition φ must hold; after F, the condition ψ holds. The database is external and can be changed by the user. Initially, the database stores information about standard C operators and functions from standard C library. Preconditions and postconditions for the user-defined functions are generated automatically in some simpler cases, while in remaining cases, the user can add them to the database (but the system can also work if the user fails to do that). So, while processing a C program, the 4 FADO is being developed by the first author of this paper. 5 The Fado tool uses the parser JSCPP, written by Jörg Schön, available from 11
12 database may temporarily expand with entries corresponding to functions from the program being processed. Like some other tools, our system tests only the first iteration of a loop (which is reasonable and sufficient in some cases), covers function calls with constant arguments, and applies several other simple heuristics for dealing with commands within loops. Generator and Optimizer for Correctness and Incorrectness Conditions For a command K, let Φ be conjunction of postconditions for all commands that precede K (within its function). The command K is: safe (it never causes an error during execution) if Φ precond(k) (universal closure is assumed) is valid; flawed (when encountered, it always causes an error during execution) if Φ precond(k) (universal closure is assumed) is valid; unsafe, if neither of above (when encountered, it can cause an error during execution). Notice that our system can prove that some commands are unsafe, but can also prove that some commands are safe. This feature limits the number of false alarms one of the main concerns for most approaches. Additionally, in some cases, a command can be proved to be both safe and flawed (when the preconditions that precede the command are inconsistent), meaning that the command is not reachable. So, our system can be used for detecting non-reachable code, too. Before sending conditions to the prover, conjectures are preprocessed. All references to preconditions and postconditions of functions are resolved, all irrelevant conjuncts are eliminated, ground expressions are evaluated, certain expressions are simplified, and terms that do not belong to linear arithmetic are abstracted, i.e., replaced by new variables. This transformation is not complete, but it is sound: if abstracted formula is valid, then the original formula is valid too. The generated correctness conditions are checked for validity by an automated theorem prover. A theorem prover for linear fragment of arithmetic is suitable for this task as many (or most) of conditions belong to linear arithmetic (namely, pointer arithmetic is based on addition and subtraction only, so it can be well modelled by linear arithmetic). Example 5 For illustration of the described approach, let us consider the following fragment of code: char src[200]; fgets(src,200,stdin); Let the database have the following entries: 12
13 precondition command postcondition char x[n] size(x, 1) = value(n, 0) size(x, 0) value(y, 0) fgets(x,y,z) used(x, 1) value(y, 0) For instance, used(x, 1) value(y, 0) says that space used by x after execution of the command fgets(x,y,z) is less or equal to the value of y before execution of this command. After the initial analysis of the code, it is transformed to an intermediate code (the same code in this example) and then preconditions and postconditions are generated based on the database: precondition command postcondition char src[200] size(src, 1) = value(200, 0) size(src, 0) value(200, 0) fgets(src,200,stdin) used(src, 1) value(200, 0) After updating states in functions size and used, and after evaluation (in this case, value(200, 0) is rewritten to 200), we get: precondition command postcondition char src[200]; size(src, 1) = 200 size(src, 1) 200 fgets(src,200,stdin); used(src, 1) 200 The correctness and incorrectness conditions are abstracted (so they fall in linear arithmetic). For instance, the command fgets(src,200,stdin) is safe if (0 size src 1) (size src 1 = 200) (size src 1 200) is valid. This can be proved by a theorem prover covering linear arithmetic. Invoking Automated Theorem Prover Formulae produced by conditions generator are translated to smt-lib format and passed to the ArgoLib prover. Since external files are used for communication, it is possible to use any theorem prover that can parse smt-lib format. The system could be made faster if the ArgoLib API was used for communication instead of using external smt-lib files, but this would reduce the flexibility of the system because theorem prover could not be changed. Rather than testing the validity of a quantifier-free formula F (implicitly universally quantified) obtained by conditions generator, SMT provers equivalently test the satisfiability of the formula F (implicitly existentially quantified). 6 The prover can check whether or not the given formula is unsatisfiable (unless the time limit was exceeded), yielding an information whether a corresponding command is safe/flawed. If a command was proved to be flawed or unsafe (i.e., it was not proved to be safe), the theorem prover can, in some cases, generate a counterexample for the corresponding correctness conjecture. This counterexample can be used for building a concrete illustration of a buffer overflow, which could be very helpful to the user. 6 The formula F is valid if and only if F is unsatisfiable. 13
14 Presentation of Results Each command carries a line number in the original source file and the prover s results are associated to these line numbers and reported to the user. The commands that are marked flawed cause errors in any run of the program and they must be changed (these errors are often trivial, and usually trivial to detect by simple program testing). The commands that are marked unsafe are possible causes of errors and they also must be checked by human programmers. It is impossible to build a complete and sound static system (a system that detects all possible buffer overflows and has no false alarms) for detecting buffer overflow errors. One of the reasons for this is undecidability of the halting problem. Our system has the following restrictions: it deals with loops in a limited manner; for computing preconditions and postconditions of user-defined functions, our system may require human s assistance; the generated conjectures belong to linear arithmetic, so the other involved theories are not considered. The system uses the ArgoLib prover for linear arithmetic over rational numbers, which is sound but not complete for integers (i. e., some valid conditions may not be proved). Despite the above restrictions, our system can detect many buffer overflows. The power of our system is also determined by the contents of the database. We deliberately leave the database to be external and open so its contents can be extended by the user. 5 Related work Several state-of-the-art SMT solvers support linear arithmetic. Although several decision procedures for linear arithmetic have been developed (based on both Simplex and Fourier-Motzkin elimination), the variant of the Simplex method used in yices and described in this paper is adopted by more solvers (e.g., MathSat, Barselogic, Z3, CVC). Concerning the static techniques for detecting buffer overflows, over the last several years, there have been several tools developed. There cannot be a complete and sound static system (a system that detect all possible buffer overflows and nothing more). Systems that perform static analysis of code try to maximize the number of detected bugs and to minimize the number of false alarms. These systems can be divided into two classes, first that performs only lexical analysis of code and second that takes into account semantics of the code being analyzed. Systems based on lexical analysis of code, like ITS4 [20], RATS [19] and Flawfinder [23], scan the source code and try to match its fragments with critical calls stored in a special-purpose library. Systems that perform deeper analysis of code, like ARCHER [25], BOON [22], UNO [10], CSSV [6] and Splint [13], usually generate different sorts of constraints over integer variables. These constraints correspond to the safety critical commands and represent correctness conditions that have to be satisfied for the commands to be safe. To generate and check constraints different approaches and algorithms are used. For example, ARCHER [25] uses a custom built integer constraint solver (that is not 14
15 sound nor complete), BOON [22] uses a complete custom built range solver, etc. For an empirical comparison between different static analysis tools see, for instance, [27, 24, 12]. 6 Conclusions and Future Work We presented an application of the Simplex method for automated detection of buffer overflows in programs written in C. Our system for automated detection of buffer overflows performs flow-sensitive and inter-procedural static analysis. The system generates correctness and incorrectness conditions for individual commands, and then tests them for validity by a variant of the Simplex method. Some of the novelties introduced by our system are: its very flexible architecture (so its building blocks can be easily changed), buffer overflow correctness conditions given in terms of Hoare logic (with a clear logical meaning), using external theorem provers (that can also provide formal correctness proofs), etc. The presented system is a subject of further improvements and development. For instance, despite the fact that heuristics for dealing with loops are very efficient and can have a wide range, for the next stage of development, we are planning to extend our system to preform full analysis of loops (in a similar manner as proposed in some modern systems [6]). We are also planning to improve analysis of user-defined functions so the system would be sound and fully automatic. In the theorem proving part of our system, we are planning to modify it to use stronger background theories. The current version of our system checks the satisfiability of linear arithmetic constraints over rationals. The Simplex method could be modified to determine the satisfiability of linear arithmetic constraints over integers i.e., to check if there is an integer valuation of the variables satisfying the given constraints. Although this is more natural approach for checking buffer overflows, it could significantly slow down the whole system. The current version of the system simply abstracts all function calls with variables. So, for the following snippet of code a = b; x = f(a); y = f(b); 7 it holds that x = y, but the system cannot deduce that. This could be improved by using Ackermans reduction [1] which statically adds constraints a = b = f(a) = f(b), for all function calls, or by replacing the theory LRA with the combination of theories EUF (Equality with Uninterpreted Functions) and LRA. References [1] W. Ackerman. Solvable cases of the decision problem. Studies in Logic and the Foundations of Mathematics, [2] R. G. Bland. New finite pivoting rules for the simplex method. Mathematics of Operations Research, 2(2): , May It is assumed that f has no side-effects. 15
16 [3] C. Cowan, P. Wagle, C. Pu, S. Beattie, and J. Walpole. Buffer overflows: Attacks and defenses for the vulnerability of the decade. In Proceedings of the DARPA Information Survivability Conference and Expo, [4] G. B. Dantzig. Linear Programming and Extensions. Princeton University Press, Princeton, NJ, [5] M. Davis, G. Logemann, and D. Loveland. A machine program for theoremproving. Commun. ACM, 5(7): , [6] N. Dor, M. Rodeh, and M. Sagiv. Cssv: Towards a realistic tool for statically detecting all buffer overflows in c. In Proceedings of the ACM SIG- PLAN 2003 conference on Programming language design and implementation, pages ACM Press, New York, NY, USA, [7] B. Dutertre and L. De Moura. A fast linear-arithmetic solver for dpll(t). In CAV 2006, volume 4144 of LNCS. Springer, [8] B. Dutertre and L De Moura. Integrating Simplex with DPLL(T). Technical Report SRI-CSL-06-01, SRI International, [9] A. Forsgren, P. E. Gill, and M. H. Wright. Interior methods for nonlinear optimization. SIAM Rev, 44: , [10] G. Holzmann. Static source code checking for user-defined properties. In Proceedings of 6th World Conference on Integrated Design and Process Technology, Pasadena, CA, June [11] V. Klee, G. J. Minty, and O. Shisha. How good is the simplex algorithm? (Eds.) In Inequalities 3, pages , [12] K. Kratkiewicz and R. Lippmann. Using a diagnostic corpus of c programs to evaluate buffer overflow detection by static analysis tools. In Workshop on the Evaluation of Software Defect Detection Tools, Chicago, June [13] D. Larochelle and D. Evans. Statically detecting likely buffer overflow vulnerabilities. In USENIX Security Symposium, Washington D.C., August [14] J.-L. Lassez and M.J. Maher. On Fourier s algorithm for linear arithmetic constraints. Journal of Automated Reasoning, 9: , [15] C. E. Lemke. The dual method of solving the linear programming problem. Naval Research Logistics Quarterly, pages 36 47, [16] R. Nieuwenhuis, A. Oliveras, and C. Tinelli. Solving SAT and SAT Modulo Theories: from an Abstract Davis-Putnam-Logemann-Loveland Procedure to DPLL(T). Journal of the ACM, 53(6): , November [17] J. Nocedal and S. J. Wright. Numerical Optimization. Springer-Verlag, New York,
17 [18] S. Ranise and C. Tinelli. The SMT-LIB Format: An Initial Proposal on-line at: [19] Secure software solutions. Rats, the rough auditing tool for security. September on-line at: [20] J. Viega, J.T. Bloch, Y. Kohno, and G. McGraw. Its4: A static vulnerability scanner for c and c++ code. In 16th Annual Computer Security Applications Conference (ACSAC 00), [21] J. Viega and G. McGraw. Building Secure Software. Addison-Wesley, [22] D. Wagner, J. Foster, E. Brewer, and A. Aiken. A first step towards automated detection of buffer overrun vulnerabilities. In Symposium on Network and Distributed System Security, pages 3 17, San Diego, CA, February [23] D. A. Wheeler. Flawfinder. May on-line at: [24] J. Wilander and M. Kamkar. A comparison of publicly available tools for static intrusion prevention. In Proceedings of the 7th Nordic Workshop on Secure IT Systems (Nordsec 2002), pages 68 84, Karlstad, Sweden, November [25] Y. Xie, A. Chou, and D. Engler. Archer: using symbolic, path-sensitive analysis to detect memory access errors. In Proceedings of the 9th European software engineering conference held jointly with 10th ACM SIGSOFT international symposium on Foundations of software engineering, pages ACM Press, [26] G. Yorsh and N. Dor. The Design of CoreC on-line at: gretay/gfc.htm. [27] M. Zitser, R. Lippmann, and T. Leek. Testing static analysis tools using exploitable buffer overflows from open source code. In Proceedings of the 12th ACM SIGSOFT international symposium on Foundations of software engineering table of contents, pages , Newport Beach, CA, USA, ACM. 17
Linear Programming I
Linear Programming I November 30, 2003 1 Introduction In the VCR/guns/nuclear bombs/napkins/star wars/professors/butter/mice problem, the benevolent dictator, Bigus Piguinus, of south Antarctica penguins
InvGen: An Efficient Invariant Generator
InvGen: An Efficient Invariant Generator Ashutosh Gupta and Andrey Rybalchenko Max Planck Institute for Software Systems (MPI-SWS) Abstract. In this paper we present InvGen, an automatic linear arithmetic
Securing Network Software using Static Analysis
Securing Network Software using Static Analysis Lauri Kolmonen Helsinki University of Technology [email protected] Abstract Writing network software is not easy and developing secure network software
Rigorous Software Development CSCI-GA 3033-009
Rigorous Software Development CSCI-GA 3033-009 Instructor: Thomas Wies Spring 2013 Lecture 11 Semantics of Programming Languages Denotational Semantics Meaning of a program is defined as the mathematical
Linear Programming. March 14, 2014
Linear Programming March 1, 01 Parts of this introduction to linear programming were adapted from Chapter 9 of Introduction to Algorithms, Second Edition, by Cormen, Leiserson, Rivest and Stein [1]. 1
Static Techniques for Vulnerability Detection
Static Techniques for Vulnerability Detection Kamran Zafar Asad Ali /LQN SLQJVXQLYHUVLW\6ZHGHQ (PDLO^NDP]DDVDDO`#VWXGHQWOLXVH $EVWUDFW )RU WKH ODVW \HDUV WKH LPSRUWDQFH RI EXLOGLQJ VHFXUH VRIWZDUH LV EHFRPLQJ
Secure Software Programming and Vulnerability Analysis
Secure Software Programming and Vulnerability Analysis Christopher Kruegel [email protected] http://www.auto.tuwien.ac.at/~chris Testing and Source Code Auditing Secure Software Programming 2 Overview
Software Testing & Analysis (F22ST3): Static Analysis Techniques 2. Andrew Ireland
Software Testing & Analysis (F22ST3) Static Analysis Techniques Andrew Ireland School of Mathematical and Computer Science Heriot-Watt University Edinburgh Software Testing & Analysis (F22ST3): Static
4.1 Learning algorithms for neural networks
4 Perceptron Learning 4.1 Learning algorithms for neural networks In the two preceding chapters we discussed two closely related models, McCulloch Pitts units and perceptrons, but the question of how to
µz An Efficient Engine for Fixed points with Constraints
µz An Efficient Engine for Fixed points with Constraints Kryštof Hoder, Nikolaj Bjørner, and Leonardo de Moura Manchester University and Microsoft Research Abstract. The µz tool is a scalable, efficient
ML for the Working Programmer
ML for the Working Programmer 2nd edition Lawrence C. Paulson University of Cambridge CAMBRIDGE UNIVERSITY PRESS CONTENTS Preface to the Second Edition Preface xiii xv 1 Standard ML 1 Functional Programming
What is Linear Programming?
Chapter 1 What is Linear Programming? An optimization problem usually has three essential ingredients: a variable vector x consisting of a set of unknowns to be determined, an objective function of x to
Automated Program Behavior Analysis
Automated Program Behavior Analysis Stacy Prowell [email protected] March 2005 SQRL / SEI Motivation: Semantics Development: Most engineering designs are subjected to extensive analysis; software is
Linear Programming for Optimization. Mark A. Schulze, Ph.D. Perceptive Scientific Instruments, Inc.
1. Introduction Linear Programming for Optimization Mark A. Schulze, Ph.D. Perceptive Scientific Instruments, Inc. 1.1 Definition Linear programming is the name of a branch of applied mathematics that
Practical Guide to the Simplex Method of Linear Programming
Practical Guide to the Simplex Method of Linear Programming Marcel Oliver Revised: April, 0 The basic steps of the simplex algorithm Step : Write the linear programming problem in standard form Linear
Idea: Measuring the Effect of Code Complexity on Static Analysis Results
Idea: Measuring the Effect of Code Complexity on Static Analysis Results James Walden, Adam Messer, and Alex Kuhl Department of Computer Science Northern Kentucky University Highland Heights, KY 41099
Linear Programming. Widget Factory Example. Linear Programming: Standard Form. Widget Factory Example: Continued.
Linear Programming Widget Factory Example Learning Goals. Introduce Linear Programming Problems. Widget Example, Graphical Solution. Basic Theory:, Vertices, Existence of Solutions. Equivalent formulations.
Lecture Notes on Linear Search
Lecture Notes on Linear Search 15-122: Principles of Imperative Computation Frank Pfenning Lecture 5 January 29, 2013 1 Introduction One of the fundamental and recurring problems in computer science is
Automated Theorem Proving - summary of lecture 1
Automated Theorem Proving - summary of lecture 1 1 Introduction Automated Theorem Proving (ATP) deals with the development of computer programs that show that some statement is a logical consequence of
WESTMORELAND COUNTY PUBLIC SCHOOLS 2011 2012 Integrated Instructional Pacing Guide and Checklist Computer Math
Textbook Correlation WESTMORELAND COUNTY PUBLIC SCHOOLS 2011 2012 Integrated Instructional Pacing Guide and Checklist Computer Math Following Directions Unit FIRST QUARTER AND SECOND QUARTER Logic Unit
1 Introduction. Linear Programming. Questions. A general optimization problem is of the form: choose x to. max f(x) subject to x S. where.
Introduction Linear Programming Neil Laws TT 00 A general optimization problem is of the form: choose x to maximise f(x) subject to x S where x = (x,..., x n ) T, f : R n R is the objective function, S
Rigorous Software Engineering Hoare Logic and Design by Contracts
Rigorous Software Engineering Hoare Logic and Design by Contracts Simão Melo de Sousa RELEASE (UBI), LIACC (Porto) Computer Science Department University of Beira Interior, Portugal 2010-2011 S. Melo de
5.1 Bipartite Matching
CS787: Advanced Algorithms Lecture 5: Applications of Network Flow In the last lecture, we looked at the problem of finding the maximum flow in a graph, and how it can be efficiently solved using the Ford-Fulkerson
Chair of Software Engineering. Software Verification. Assertion Inference. Carlo A. Furia
Chair of Software Engineering Software Verification Assertion Inference Carlo A. Furia Proving Programs Automatically The Program Verification problem: Given: a program P and a specification S = [Pre,
Introduction to Static Analysis for Assurance
Introduction to Static Analysis for Assurance John Rushby Computer Science Laboratory SRI International Menlo Park CA USA John Rushby Static Analysis for Assurance: 1 Overview What is static analysis?
Regression Verification: Status Report
Regression Verification: Status Report Presentation by Dennis Felsing within the Projektgruppe Formale Methoden der Softwareentwicklung 2013-12-11 1/22 Introduction How to prevent regressions in software
Algebra Unpacked Content For the new Common Core standards that will be effective in all North Carolina schools in the 2012-13 school year.
This document is designed to help North Carolina educators teach the Common Core (Standard Course of Study). NCDPI staff are continually updating and improving these tools to better serve teachers. Algebra
This exposition of linear programming
Linear Programming and the Simplex Method David Gale This exposition of linear programming and the simplex method is intended as a companion piece to the article in this issue on the life and work of George
Solution of Linear Systems
Chapter 3 Solution of Linear Systems In this chapter we study algorithms for possibly the most commonly occurring problem in scientific computing, the solution of linear systems of equations. We start
Discrete Optimization
Discrete Optimization [Chen, Batson, Dang: Applied integer Programming] Chapter 3 and 4.1-4.3 by Johan Högdahl and Victoria Svedberg Seminar 2, 2015-03-31 Todays presentation Chapter 3 Transforms using
1 Solving LPs: The Simplex Algorithm of George Dantzig
Solving LPs: The Simplex Algorithm of George Dantzig. Simplex Pivoting: Dictionary Format We illustrate a general solution procedure, called the simplex algorithm, by implementing it on a very simple example.
Static Program Transformations for Efficient Software Model Checking
Static Program Transformations for Efficient Software Model Checking Shobha Vasudevan Jacob Abraham The University of Texas at Austin Dependable Systems Large and complex systems Software faults are major
Linear Programming Notes V Problem Transformations
Linear Programming Notes V Problem Transformations 1 Introduction Any linear programming problem can be rewritten in either of two standard forms. In the first form, the objective is to maximize, the material
WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT?
WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT? introduction Many students seem to have trouble with the notion of a mathematical proof. People that come to a course like Math 216, who certainly
Random vs. Structure-Based Testing of Answer-Set Programs: An Experimental Comparison
Random vs. Structure-Based Testing of Answer-Set Programs: An Experimental Comparison Tomi Janhunen 1, Ilkka Niemelä 1, Johannes Oetsch 2, Jörg Pührer 2, and Hans Tompits 2 1 Aalto University, Department
a 11 x 1 + a 12 x 2 + + a 1n x n = b 1 a 21 x 1 + a 22 x 2 + + a 2n x n = b 2.
Chapter 1 LINEAR EQUATIONS 1.1 Introduction to linear equations A linear equation in n unknowns x 1, x,, x n is an equation of the form a 1 x 1 + a x + + a n x n = b, where a 1, a,..., a n, b are given
Scalable Automated Symbolic Analysis of Administrative Role-Based Access Control Policies by SMT solving
Scalable Automated Symbolic Analysis of Administrative Role-Based Access Control Policies by SMT solving Alessandro Armando 1,2 and Silvio Ranise 2, 1 DIST, Università degli Studi di Genova, Italia 2 Security
Lecture 3: Finding integer solutions to systems of linear equations
Lecture 3: Finding integer solutions to systems of linear equations Algorithmic Number Theory (Fall 2014) Rutgers University Swastik Kopparty Scribe: Abhishek Bhrushundi 1 Overview The goal of this lecture
Optimizing Description Logic Subsumption
Topics in Knowledge Representation and Reasoning Optimizing Description Logic Subsumption Maryam Fazel-Zarandi Company Department of Computer Science University of Toronto Outline Introduction Optimization
No: 10 04. Bilkent University. Monotonic Extension. Farhad Husseinov. Discussion Papers. Department of Economics
No: 10 04 Bilkent University Monotonic Extension Farhad Husseinov Discussion Papers Department of Economics The Discussion Papers of the Department of Economics are intended to make the initial results
! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. #-approximation algorithm.
Approximation Algorithms 11 Approximation Algorithms Q Suppose I need to solve an NP-hard problem What should I do? A Theory says you're unlikely to find a poly-time algorithm Must sacrifice one of three
Why? A central concept in Computer Science. Algorithms are ubiquitous.
Analysis of Algorithms: A Brief Introduction Why? A central concept in Computer Science. Algorithms are ubiquitous. Using the Internet (sending email, transferring files, use of search engines, online
24. The Branch and Bound Method
24. The Branch and Bound Method It has serious practical consequences if it is known that a combinatorial problem is NP-complete. Then one can conclude according to the present state of science that no
3. Linear Programming and Polyhedral Combinatorics
Massachusetts Institute of Technology Handout 6 18.433: Combinatorial Optimization February 20th, 2009 Michel X. Goemans 3. Linear Programming and Polyhedral Combinatorics Summary of what was seen in the
Linear Programming. April 12, 2005
Linear Programming April 1, 005 Parts of this were adapted from Chapter 9 of i Introduction to Algorithms (Second Edition) /i by Cormen, Leiserson, Rivest and Stein. 1 What is linear programming? The first
CHAPTER 7 GENERAL PROOF SYSTEMS
CHAPTER 7 GENERAL PROOF SYSTEMS 1 Introduction Proof systems are built to prove statements. They can be thought as an inference machine with special statements, called provable statements, or sometimes
Systems of Linear Equations
Systems of Linear Equations Beifang Chen Systems of linear equations Linear systems A linear equation in variables x, x,, x n is an equation of the form a x + a x + + a n x n = b, where a, a,, a n and
Testing LTL Formula Translation into Büchi Automata
Testing LTL Formula Translation into Büchi Automata Heikki Tauriainen and Keijo Heljanko Helsinki University of Technology, Laboratory for Theoretical Computer Science, P. O. Box 5400, FIN-02015 HUT, Finland
Applied Algorithm Design Lecture 5
Applied Algorithm Design Lecture 5 Pietro Michiardi Eurecom Pietro Michiardi (Eurecom) Applied Algorithm Design Lecture 5 1 / 86 Approximation Algorithms Pietro Michiardi (Eurecom) Applied Algorithm Design
Chapter 11. 11.1 Load Balancing. Approximation Algorithms. Load Balancing. Load Balancing on 2 Machines. Load Balancing: Greedy Scheduling
Approximation Algorithms Chapter Approximation Algorithms Q. Suppose I need to solve an NP-hard problem. What should I do? A. Theory says you're unlikely to find a poly-time algorithm. Must sacrifice one
(LMCS, p. 317) V.1. First Order Logic. This is the most powerful, most expressive logic that we will examine.
(LMCS, p. 317) V.1 First Order Logic This is the most powerful, most expressive logic that we will examine. Our version of first-order logic will use the following symbols: variables connectives (,,,,
PROPERTECHNIQUEOFSOFTWARE INSPECTIONUSING GUARDED COMMANDLANGUAGE
International Journal of Computer ScienceandCommunication Vol. 2, No. 1, January-June2011, pp. 153-157 PROPERTECHNIQUEOFSOFTWARE INSPECTIONUSING GUARDED COMMANDLANGUAGE Neeraj Kumar Singhania University,
FACTORING POLYNOMIALS IN THE RING OF FORMAL POWER SERIES OVER Z
FACTORING POLYNOMIALS IN THE RING OF FORMAL POWER SERIES OVER Z DANIEL BIRMAJER, JUAN B GIL, AND MICHAEL WEINER Abstract We consider polynomials with integer coefficients and discuss their factorization
AUTOMATED TEST GENERATION FOR SOFTWARE COMPONENTS
TKK Reports in Information and Computer Science Espoo 2009 TKK-ICS-R26 AUTOMATED TEST GENERATION FOR SOFTWARE COMPONENTS Kari Kähkönen ABTEKNILLINEN KORKEAKOULU TEKNISKA HÖGSKOLAN HELSINKI UNIVERSITY OF
Formal Verification Coverage: Computing the Coverage Gap between Temporal Specifications
Formal Verification Coverage: Computing the Coverage Gap between Temporal Specifications Sayantan Das Prasenjit Basu Ansuman Banerjee Pallab Dasgupta P.P. Chakrabarti Department of Computer Science & Engineering
Introduction to Logic in Computer Science: Autumn 2006
Introduction to Logic in Computer Science: Autumn 2006 Ulle Endriss Institute for Logic, Language and Computation University of Amsterdam Ulle Endriss 1 Plan for Today Now that we have a basic understanding
Monitoring Metric First-order Temporal Properties
Monitoring Metric First-order Temporal Properties DAVID BASIN, FELIX KLAEDTKE, SAMUEL MÜLLER, and EUGEN ZĂLINESCU, ETH Zurich Runtime monitoring is a general approach to verifying system properties at
An example of a computable
An example of a computable absolutely normal number Verónica Becher Santiago Figueira Abstract The first example of an absolutely normal number was given by Sierpinski in 96, twenty years before the concept
! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. !-approximation algorithm.
Approximation Algorithms Chapter Approximation Algorithms Q Suppose I need to solve an NP-hard problem What should I do? A Theory says you're unlikely to find a poly-time algorithm Must sacrifice one of
Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson
Mathematics for Computer Science/Software Engineering Notes for the course MSM1F3 Dr. R. A. Wilson October 1996 Chapter 1 Logic Lecture no. 1. We introduce the concept of a proposition, which is a statement
The Advantages and Disadvantages of Online Linear Optimization
LINEAR PROGRAMMING WITH ONLINE LEARNING TATSIANA LEVINA, YURI LEVIN, JEFF MCGILL, AND MIKHAIL NEDIAK SCHOOL OF BUSINESS, QUEEN S UNIVERSITY, 143 UNION ST., KINGSTON, ON, K7L 3N6, CANADA E-MAIL:{TLEVIN,YLEVIN,JMCGILL,MNEDIAK}@BUSINESS.QUEENSU.CA
Lecture 2: August 29. Linear Programming (part I)
10-725: Convex Optimization Fall 2013 Lecture 2: August 29 Lecturer: Barnabás Póczos Scribes: Samrachana Adhikari, Mattia Ciollaro, Fabrizio Lecci Note: LaTeX template courtesy of UC Berkeley EECS dept.
Continued Fractions and the Euclidean Algorithm
Continued Fractions and the Euclidean Algorithm Lecture notes prepared for MATH 326, Spring 997 Department of Mathematics and Statistics University at Albany William F Hammond Table of Contents Introduction
How To Write A Program Verification And Programming Book
Jose Bacelar Almeida Maria Joao Frade Jorge Sousa Pinto Simao Melo de Sousa Rigorous Software Development An Introduction to Program Verification & Springer Contents 1 Introduction 1 1.1 A Formal Approach
Simplex method summary
Simplex method summary Problem: optimize a linear objective, subject to linear constraints 1. Step 1: Convert to standard form: variables on right-hand side, positive constant on left slack variables for
Lecture 3. Linear Programming. 3B1B Optimization Michaelmas 2015 A. Zisserman. Extreme solutions. Simplex method. Interior point method
Lecture 3 3B1B Optimization Michaelmas 2015 A. Zisserman Linear Programming Extreme solutions Simplex method Interior point method Integer programming and relaxation The Optimization Tree Linear Programming
Logic in general. Inference rules and theorem proving
Logical Agents Knowledge-based agents Logic in general Propositional logic Inference rules and theorem proving First order logic Knowledge-based agents Inference engine Knowledge base Domain-independent
Approximation Algorithms
Approximation Algorithms or: How I Learned to Stop Worrying and Deal with NP-Completeness Ong Jit Sheng, Jonathan (A0073924B) March, 2012 Overview Key Results (I) General techniques: Greedy algorithms
Special Situations in the Simplex Algorithm
Special Situations in the Simplex Algorithm Degeneracy Consider the linear program: Maximize 2x 1 +x 2 Subject to: 4x 1 +3x 2 12 (1) 4x 1 +x 2 8 (2) 4x 1 +2x 2 8 (3) x 1, x 2 0. We will first apply the
Chapter 6: Sensitivity Analysis
Chapter 6: Sensitivity Analysis Suppose that you have just completed a linear programming solution which will have a major impact on your company, such as determining how much to increase the overall production
P NP for the Reals with various Analytic Functions
P NP for the Reals with various Analytic Functions Mihai Prunescu Abstract We show that non-deterministic machines in the sense of [BSS] defined over wide classes of real analytic structures are more powerful
Minimum Satisfying Assignments for SMT
Minimum Satisfying Assignments for SMT Isil Dillig 1, Thomas Dillig 1, Kenneth L. McMillan 2, and Alex Aiken 3 1 College of William & Mary 2 Microsoft Research 3 Stanford University Abstract. A minimum
Constructing Contracts: Making Discrete Mathematics Relevant to Beginning Programmers
Constructing Contracts: Making Discrete Mathematics Relevant to Beginning Programmers TIMOTHY S. GEGG-HARRISON Winona State University Although computer scientists understand the importance of discrete
How To Detect A Buffer Overflow Vulnerability In Binary Code
Buffer Overflow Vulnerability Detection in the Binary Code Shehab Gamal El-Dien, Reda Salama, Ahmed Eshak [email protected], [email protected], [email protected] Al-Azhar University, Faculty of
Transportation Polytopes: a Twenty year Update
Transportation Polytopes: a Twenty year Update Jesús Antonio De Loera University of California, Davis Based on various papers joint with R. Hemmecke, E.Kim, F. Liu, U. Rothblum, F. Santos, S. Onn, R. Yoshida,
Satisfiability Checking
Satisfiability Checking SAT-Solving Prof. Dr. Erika Ábrahám Theory of Hybrid Systems Informatik 2 WS 10/11 Prof. Dr. Erika Ábrahám - Satisfiability Checking 1 / 40 A basic SAT algorithm Assume the CNF
Reducing Clocks in Timed Automata while Preserving Bisimulation
Reducing Clocks in Timed Automata while Preserving Bisimulation Shibashis Guha Chinmay Narayan S. Arun-Kumar Indian Institute of Technology Delhi {shibashis, chinmay, sak}@cse.iitd.ac.in arxiv:1404.6613v2
Discuss the size of the instance for the minimum spanning tree problem.
3.1 Algorithm complexity The algorithms A, B are given. The former has complexity O(n 2 ), the latter O(2 n ), where n is the size of the instance. Let n A 0 be the size of the largest instance that can
Largest Fixed-Aspect, Axis-Aligned Rectangle
Largest Fixed-Aspect, Axis-Aligned Rectangle David Eberly Geometric Tools, LLC http://www.geometrictools.com/ Copyright c 1998-2016. All Rights Reserved. Created: February 21, 2004 Last Modified: February
Cassandra. References:
Cassandra References: Becker, Moritz; Sewell, Peter. Cassandra: Flexible Trust Management, Applied to Electronic Health Records. 2004. Li, Ninghui; Mitchell, John. Datalog with Constraints: A Foundation
2.3 Convex Constrained Optimization Problems
42 CHAPTER 2. FUNDAMENTAL CONCEPTS IN CONVEX OPTIMIZATION Theorem 15 Let f : R n R and h : R R. Consider g(x) = h(f(x)) for all x R n. The function g is convex if either of the following two conditions
Reasoning About the Unknown in Static Analysis
Reasoning About the Unknown in Static Analysis Isil Dillig Thomas Dillig Alex Aiken {isil, tdillig, aiken}@cs.stanford.edu Computer Science Department Stanford University ABSTRACT Static program analysis
npsolver A SAT Based Solver for Optimization Problems
npsolver A SAT Based Solver for Optimization Problems Norbert Manthey and Peter Steinke Knowledge Representation and Reasoning Group Technische Universität Dresden, 01062 Dresden, Germany [email protected]
Mathematics Course 111: Algebra I Part IV: Vector Spaces
Mathematics Course 111: Algebra I Part IV: Vector Spaces D. R. Wilkins Academic Year 1996-7 9 Vector Spaces A vector space over some field K is an algebraic structure consisting of a set V on which are
Adaptive Linear Programming Decoding
Adaptive Linear Programming Decoding Mohammad H. Taghavi and Paul H. Siegel ECE Department, University of California, San Diego Email: (mtaghavi, psiegel)@ucsd.edu ISIT 2006, Seattle, USA, July 9 14, 2006
Model Checking: An Introduction
Announcements Model Checking: An Introduction Meeting 2 Office hours M 1:30pm-2:30pm W 5:30pm-6:30pm (after class) and by appointment ECOT 621 Moodle problems? Fundamentals of Programming Languages CSCI
Disjunction of Non-Binary and Numeric Constraint Satisfaction Problems
Disjunction of Non-Binary and Numeric Constraint Satisfaction Problems Miguel A. Salido, Federico Barber Departamento de Sistemas Informáticos y Computación, Universidad Politécnica de Valencia Camino
A Static Analyzer for Large Safety-Critical Software. Considered Programs and Semantics. Automatic Program Verification by Abstract Interpretation
PLDI 03 A Static Analyzer for Large Safety-Critical Software B. Blanchet, P. Cousot, R. Cousot, J. Feret L. Mauborgne, A. Miné, D. Monniaux,. Rival CNRS École normale supérieure École polytechnique Paris
International Doctoral School Algorithmic Decision Theory: MCDA and MOO
International Doctoral School Algorithmic Decision Theory: MCDA and MOO Lecture 2: Multiobjective Linear Programming Department of Engineering Science, The University of Auckland, New Zealand Laboratoire
Classification - Examples
Lecture 2 Scheduling 1 Classification - Examples 1 r j C max given: n jobs with processing times p 1,...,p n and release dates r 1,...,r n jobs have to be scheduled without preemption on one machine taking
Specification and Analysis of Contracts Lecture 1 Introduction
Specification and Analysis of Contracts Lecture 1 Introduction Gerardo Schneider [email protected] http://folk.uio.no/gerardo/ Department of Informatics, University of Oslo SEFM School, Oct. 27 - Nov.
Measuring the Effect of Code Complexity on Static Analysis Results
Measuring the Effect of Code Complexity on Static Analysis Results James Walden, Adam Messer, and Alex Kuhl Department of Computer Science Northern Kentucky University Highland Heights, KY 41099 Abstract.
Exponential time algorithms for graph coloring
Exponential time algorithms for graph coloring Uriel Feige Lecture notes, March 14, 2011 1 Introduction Let [n] denote the set {1,..., k}. A k-labeling of vertices of a graph G(V, E) is a function V [k].
[Refer Slide Time: 05:10]
Principles of Programming Languages Prof: S. Arun Kumar Department of Computer Science and Engineering Indian Institute of Technology Delhi Lecture no 7 Lecture Title: Syntactic Classes Welcome to lecture
