private static Boolean canBeTrue( BooleanExpression b, Map m) { // base cases... (e evaluates to true or false (not null)) if (...) { } // recursive step... else { // for all possible choices... // for all possible truth values... // try that assignment (e.g. a=true) // recursively try the rest // undo that assignment if we failed to get an answer } } Solving a recursive backtracking problem: (1) What are the choices we need to make? choosing T or F for each variable (2) How do we make a choice? take v, assign x--> m.put(v, x); (3) How do we undo a choice? m.remove (4) When do we stop / what are our base cases? (4a) Success base case(s)? b evaluates to true (4b) Failure base case(s)? b evaluates to false Good examples: (a && !a), {} -> false (a||!a), {a=true} -> true (a||!b), {a=false} -> null