390 likes | 516 Views
Compiling with Decomposition. By Paul Elliott. Outline. Implicant Generator Using Dependency Information Decomposition Algorithm. Implicant Generator. Two components solution generator Iterative deepening Enumerates all solutions from shortest to longest
E N D
Compiling with Decomposition By Paul Elliott
Outline • Implicant Generator • Using Dependency Information • Decomposition Algorithm
Implicant Generator • Two components • solution generator • Iterative deepening • Enumerates all solutions from shortest to longest • Solutions come from search groups • Prunes supersets of solutions • Satisfies conflicts generated • solution tester • Tests for Valid, Satisfiable, Unsatisfiable • Valid testing is clause directed • Domain aware • Aware of search groups
Thruster Model • All variables have 2 element domains • Propellant Tank: F1 • Three Valves: V1, V2, V3 • A Thruster: R1 • Pressure measured at P1 and P3
Tester (Continued) • Propagate(Assignment, Parity) • Reduce Domain of Variable • If Domain is empty, unsatisfiable, done • Satisfy or reduce clauses naming V • If Empty clause created, unsatisfiable, done • Propagate Unit Clauses
Outline • Implicant Generator • Using Dependency Information • Decomposition Algorithm
Using Dependency Information • Goal Function • Observation Function • Transition Function
Example • Compile the goal (P3 = High)
Example (2) • Two decomposition sets • {F1, V1, V2, V3, P3} • {P3, R1} • All sets mention P3, so reduce all sets • {F1, V1, V2, V3} • {R1} • Two solutions • (F1=Full) and (V1=Open) and (V2=Open) • (F1=Full) and (V1=Open) and (V3=Open)
Example Part 2 • Added Twist • Assume (V2=Open) and (V3=Open) conflict • Creates new goal table • (F1=Full) and (V1=Open) and (V2=Open) and (V3=Closed) • (F1=Full) and (V1=Open) and (V3=Open) and (V2=Closed)
Observation Example • Decomposition • {F1, P1}, {P1, V1, V2, V3, P3}, {P3, R1, T1} • Dissents • First Set • (F1=Filled) and (P1=Low) • (F1=Empty) and (P1=High) • Third Set • (P3=Low) and (T1=Thrust) • (R1=Off) and (T1=Thrust) • (P3=High) and (R1=On) and (T1=NoThrust)
Transition Example • Compile the transition R1:(On->Off) • Gather nodes connected to the guard • {R1, CR1, R1’} • Remove R1 and R1’ • {CR1} • Unsatisfy and get the same compiled guard • (CR1=TurnOff)
Outline • Implicant Generator • Using Dependency Information • Decomposition Algorithm
Partitioning • Each compilation step involves unsatisfying the model over some set of variables and extra constraints • Partition the model by the settable variables • Finds bounded regions of the constraints space • Solution cannot be formed from variables that do not connect directly • Abstract away the indirect connection as the settable variable in-between the two variables
A Concept B C • Constraints • (A = B) • (C != B) • A and C are independent when B is set • Conflicts: • (A != B) • (C = B)
Generating Partitioning Algorithm • Three Functions • Gather Partition Space • Gather Reachable Variables • Remove Redundant Sets
Total Running Time • Generate Partition Space • O(E2 * V+ E * V log V) • Gather Reachable • O(E * V log V + E * V) = O(E * V log V) • Remove Redundant Sets • O(E2 * V)
Partition Variables Vp = {So, Ss} = {F1, V1, V2, V3, R1, P1, P3, T1} Partitioning Example
Trace of the Decomposition • Gather all groups of connected variables • 6 groups (Edges 1, 2, 15, 16,17, and the rest) • {F1, P1} • {F1, P1} • {P3, R1, T1} • {P3, R1, T1} • {R1, T1} • {P1, V1, V2, V3, P3}
Removing Redundant Sets • 3 Unique overlapping sets exist • {F1, P1} • {P3, R1, T1} • {P1, V1, V2, V3, P3}