An MCSAT treatment of Bit-Vectors (work-in-progress) Stéphane Graham-Lengrand and Dejan Jovanović CNRS - SRI International SMT workshop, 23rd July 2017 1/19
The model-constructing approach to SMT-solving MCSAT introduced in [dMJ13, JBdM13, Jov17], following work on specific decision procedures for theories such as non-linear arithmetic [JdM12]. 2/19
The model-constructing approach to SMT-solving MCSAT introduced in [dMJ13, JBdM13, Jov17], following work on specific decision procedures for theories such as non-linear arithmetic [JdM12]. MCSAT offers: ◮ a template for decision procedures ◮ an integration of such procedures with Boolean reasoning ◮ new possibilities for combining procedures [JBdM13, BGLS17] 2/19
The model-constructing approach to SMT-solving MCSAT introduced in [dMJ13, JBdM13, Jov17], following work on specific decision procedures for theories such as non-linear arithmetic [JdM12]. MCSAT offers: ◮ a template for decision procedures ◮ an integration of such procedures with Boolean reasoning ◮ new possibilities for combining procedures [JBdM13, BGLS17] The template is a generalisation of how CDCL works. Run = alternation of search phases and conflict analysis phases Boolean theory can be given the same status as other theories. 2/19
The model-constructing approach to SMT-solving MCSAT introduced in [dMJ13, JBdM13, Jov17], following work on specific decision procedures for theories such as non-linear arithmetic [JdM12]. MCSAT offers: ◮ a template for decision procedures ◮ an integration of such procedures with Boolean reasoning ◮ new possibilities for combining procedures [JBdM13, BGLS17] The template is a generalisation of how CDCL works. Run = alternation of search phases and conflict analysis phases Boolean theory can be given the same status as other theories. Terms and literals are created that do not belong to the input problem. 2/19
Search phase 1. For each variable awaiting a value, track the set of feasible values (those not yet ruled out by the current constraints) 3/19
Search phase 1. For each variable awaiting a value, track the set of feasible values (those not yet ruled out by the current constraints) 2. For one of the variables, pick a value out of that set. 3/19
Search phase 1. For each variable awaiting a value, track the set of feasible values (those not yet ruled out by the current constraints) 2. For one of the variables, pick a value out of that set. 3. With that choice, some of the constraints may become unit : all of their free variables are assigned a value but one. 3/19
Search phase 1. For each variable awaiting a value, track the set of feasible values (those not yet ruled out by the current constraints) 2. For one of the variables, pick a value out of that set. 3. With that choice, some of the constraints may become unit : all of their free variables are assigned a value but one. 4. See whether and how those new constraints unit in y restrict the feasible values for y , and update that set 3/19
Search phase 1. For each variable awaiting a value, track the set of feasible values (those not yet ruled out by the current constraints) 2. For one of the variables, pick a value out of that set. 3. With that choice, some of the constraints may become unit : all of their free variables are assigned a value but one. 4. See whether and how those new constraints unit in y restrict the feasible values for y , and update that set 5. Repeat until all variables are assigned values & all constraints are satisfied or one of these sets becomes empty: there is a conflict 3/19
Search phase 1. For each variable awaiting a value, track the set of feasible values (those not yet ruled out by the current constraints) 2. For one of the variables, pick a value out of that set. 3. With that choice, some of the constraints may become unit : all of their free variables are assigned a value but one. 4. See whether and how those new constraints unit in y restrict the feasible values for y , and update that set 5. Repeat until all variables are assigned values & all constraints are satisfied or one of these sets becomes empty: there is a conflict Simple process: we only look at what the constraints say once they become unit. Until then, we simply maintain for each constraint a watch list of variables, to detect when they become unit (as in CDCL). 3/19
Search phase (satisfiable case) Free var within Constraints (unit ones in red) Feasible set Var C 1 1 , . . . , C 1 { x 1 } x 1 j , . . . C 2 1 , C 2 2 , . . . , C 2 { x 1 , x 2 } x 2 j , . . . C 3 1 , C 3 2 , . . . , C 3 { x 1 , x 2 , x 3 } x 3 j , . . . . . . C i 1 , C i 2 , . . . , C i 42 , . . . , C i { x 1 , . . . , x i } j , . . . x i 4/19
Search phase (satisfiable case) Free var within Constraints (unit ones in red) Feasible set Var C 1 1 , . . . , C 1 { x 1 } x 1 j , . . . C 2 1 , C 2 2 , . . . , C 2 { x 1 , x 2 } x 2 j , . . . C 3 1 , C 3 2 , . . . , C 3 { x 1 , x 2 , x 3 } x 3 j , . . . . . . C i 1 , C i 2 , . . . , C i 42 , . . . , C i { x 1 , . . . , x i } j , . . . x i 4/19
Search phase (satisfiable case) Free var within Constraints (unit ones in red) Feasible set Var C 1 1 , . . . , C 1 { x 1 } x 1 j , . . . C 2 1 , C 2 2 , . . . , C 2 { x 1 , x 2 } x 2 j , . . . C 3 1 , C 3 2 , . . . , C 3 { x 1 , x 2 , x 3 } x 3 j , . . . . . . C i 1 , C i 2 , . . . , C i 42 , . . . , C i { x 1 , . . . , x i } j , . . . x i 4/19
Search phase (satisfiable case) Free var within Constraints (unit ones in red) Feasible set Var C 1 1 , . . . , C 1 { x 1 } x 1 j , . . . C 2 1 , C 2 2 , . . . , C 2 { x 1 , x 2 } x 2 j , . . . C 3 1 , C 3 2 , . . . , C 3 { x 1 , x 2 , x 3 } x 3 j , . . . . . . C i 1 , C i 2 , . . . , C i 42 , . . . , C i { x 1 , . . . , x i } j , . . . x i 4/19
Search phase (satisfiable case) Free var within Constraints (unit ones in red) Feasible set Var C 1 1 , . . . , C 1 { x 1 } x 1 j , . . . C 2 1 , C 2 2 , . . . , C 2 { x 1 , x 2 } x 2 j , . . . C 3 1 , C 3 2 , . . . , C 3 { x 1 , x 2 , x 3 } x 3 j , . . . . . . C i 1 , C i 2 , . . . , C i 42 , . . . , C i { x 1 , . . . , x i } j , . . . x i 4/19
Search phase (satisfiable case) Free var within Constraints (unit ones in red) Feasible set Var C 1 1 , . . . , C 1 { x 1 } x 1 j , . . . C 2 1 , C 2 2 , . . . , C 2 { x 1 , x 2 } x 2 j , . . . C 3 1 , C 3 2 , . . . , C 3 { x 1 , x 2 , x 3 } x 3 j , . . . . . . C i 1 , C i 2 , . . . , C i 42 , . . . , C i { x 1 , . . . , x i } j , . . . x i SAT 4/19
Search phase (conflict case) Free var within Constraints (unit ones in red) Feasible set Var C 1 1 , . . . , C 1 { x 1 } x 1 j , . . . C 2 1 , C 2 2 , . . . , C 2 { x 1 , x 2 } x 2 j , . . . C 3 1 , C 3 2 , . . . , C 3 { x 1 , x 2 , x 3 } x 3 j , . . . . . . C i 1 , C i 2 , . . . , C i 42 , . . . , C i { x 1 , . . . , x i } j , . . . x i 5/19
Search phase (conflict case) Free var within Constraints (unit ones in red) Feasible set Var C 1 1 , . . . , C 1 { x 1 } x 1 j , . . . C 2 1 , C 2 2 , . . . , C 2 { x 1 , x 2 } x 2 j , . . . C 3 1 , C 3 2 , . . . , C 3 { x 1 , x 2 , x 3 } x 3 j , . . . . . . C i 1 , C i 2 , . . . , C i 42 , . . . , C i { x 1 , . . . , x i } j , . . . x i 5/19
Search phase (conflict case) Free var within Constraints (unit ones in red) Feasible set Var C 1 1 , . . . , C 1 { x 1 } x 1 j , . . . C 2 1 , C 2 2 , . . . , C 2 { x 1 , x 2 } x 2 j , . . . C 3 1 , C 3 2 , . . . , C 3 { x 1 , x 2 , x 3 } x 3 j , . . . . . . C i 1 , C i 2 , . . . , C i 42 , . . . , C i { x 1 , . . . , x i } j , . . . x i 5/19
Search phase (conflict case) Free var within Constraints (unit ones in red) Feasible set Var C 1 1 , . . . , C 1 { x 1 } x 1 j , . . . C 2 1 , C 2 2 , . . . , C 2 { x 1 , x 2 } x 2 j , . . . C 3 1 , C 3 2 , . . . , C 3 { x 1 , x 2 , x 3 } x 3 j , . . . . . . C i 1 , C i 2 , . . . , C i 42 , . . . , C i { x 1 , . . . , x i } j , . . . x i 5/19
Search phase (conflict case) Free var within Constraints (unit ones in red) Feasible set Var C 1 1 , . . . , C 1 { x 1 } x 1 j , . . . C 2 1 , C 2 2 , . . . , C 2 { x 1 , x 2 } x 2 j , . . . C 3 1 , C 3 2 , . . . , C 3 { x 1 , x 2 , x 3 } x 3 j , . . . . . . C i 1 , C i 2 , . . . , C i 42 , . . . , C i { x 1 , . . . , x i } j , . . . x i Conflict 5/19
Implementing the set of feasible values for y This has to be a data-structure with operations for 1. updating the set whenever a new constraint becomes unit in y , 2. detecting when the set becomes empty, and 3. proposing a value from the feasible set. 6/19
Implementing the set of feasible values for y This has to be a data-structure with operations for 1. updating the set whenever a new constraint becomes unit in y , 2. detecting when the set becomes empty, and 3. proposing a value from the feasible set. This is theory-dependent: ◮ For LRA, this can be an interval 6/19
Implementing the set of feasible values for y This has to be a data-structure with operations for 1. updating the set whenever a new constraint becomes unit in y , 2. detecting when the set becomes empty, and 3. proposing a value from the feasible set. This is theory-dependent: ◮ For LRA, this can be an interval ◮ For bit-vectors, [ZWR16] use the combination of ◮ an interval, e.g. [0000 , 0010] (understanding bitvectors in arithmetic modulo) ◮ and a pattern imposing the value of some of the bits, e.g. ???1 6/19
Alternative proposition: Use a Binary Decision Diagram (BDD) over the bits of y . 7/19
Recommend
More recommend