module Types: sig
.. end
Types used during the analysis
type
name_var = string
Name of variables, functions and labels
type
loc =
| |
Loc_c of int |
| |
Loc_a of int |
Locations of statements in programs
type
type_c =
Type of C variables
type
boolOpBoolBin =
Binary operators which are of type bool -> bool -> bool
type
boolOpArithBin =
| |
Eq |
| |
Neq |
| |
Lt |
| |
Gt |
| |
Le |
| |
Ge |
Binary operators which are of type int -> int -> bool
type
arithOpArithBin =
| |
Plus |
| |
Minus |
| |
Times |
| |
Div |
Binary operators which are of type int -> int -> int
type
boolOpBoolUna =
Unary operators which are of type bool -> bool
type
arithOpArithUna =
Unary operators which are of type int -> bool
type
reg32 =
Registers actually implemented in the analyser
type
asm_expr =
ASM expression aka operands of ASM statements
type
ptr_var =
| |
PtrVar of ptr_var |
| |
LastPtrVar of string |
Pointer induction to a variable name
type
stat_c =
C statements
type
stat_a =
ASM statements
type
loc_stat_c = loc * (stat_c * loc) list
Located C block
type
loc_stat_a = loc * (stat_a * loc) list
Located ASM block
type
arith_expr =
C arithmetic expression
type
bool_expr =
C boolean expressions
type
arguments = (type_c * name_var) list
Definition of the arguments of C functions
type
global_statement =
Statements which are globals. So far, functions.
type
program = loc * (global_statement * loc) list
C program with inline assembly
type
generic_stat_loc =
Statement with its location associated
module IdSet: Set.Make
(
sig
type
t = int
val compare : 'a -> 'a -> int
end
)
Set wich contains ids of variables, used to represent abstact domain of pointers
type
abstrD =
| |
AbstrD of (Z.t * Z.t) |
| |
AbstrPtr of IdSet.t |
| |
AbstrLoc of loc |
| |
AbstrBot |
Abstract domain
type
realD =
| |
RealD of Z.t list |
| |
RealBot |
Real domain
val abstrMin : Z.t
Minimum number
val abstrMax : Z.t
Maximum number
val abstrTop : abstrD
Top element of the abstract domains
module Context: Map.Make
(
String
)
Map with variable names as key
type
abstrContext =
| |
AbstrContext of int Context.t |
| |
GoForward of loc * abstrContext |
| |
AbstrContextBot |
Context
type
memoryStack = abstrD list
Memory stack
module Environment: Map.Make
(
sig
type
t = int
val compare : 'a -> 'a -> int
end
)
Map with id as keys
type
abstrEnvironment = abstrD Environment.t
Environment
module LocMap: Map.Make
(
sig
type
t = Types.loc
val compare : 'a -> 'a -> int
end
)
type
functionContext = (global_statement * abstrContext) LocMap.t
Map which associates locations to their C functions (and contexts) associated
type
callStack = (bool * abstrD * abstrEnvironment Pervasives.ref *
abstrContext * memoryStack)
Stack.t
Call stack (which is really a stack)
exception ReturnRaised of abstrD * abstrEnvironment Pervasives.ref * abstrContext
* memoryStack
A return/ret instruction has been encountered and the function/block of statements is returned with the abstract domain of the value returned, the context and the memory stack associated
exception GoBackward
Do we have to go back in the past to start again a branch with more anticipation of a jump
val labels : loc Context.t Pervasives.ref
Map which associates all the labels which have been encountered with their locations