Abstract

Synthesizable Negation Normal Form (SynNNF) is a highly compact “normal form” for Boolean formulas, which guarantees that boolean functional synthesis (BFSn) can be solved efficiently (in polynomial time). It first appears in Akshay et al. (2019).

Introduction

The paper addresses the Boolean Functional Synthesis (BFnS) problem: given a relational specification over output variables and input variables , find a vector of Skolem functions such that satisfies the specification. This is a core problem in areas like certified QBF solving, program repair, and reactive synthesis.

Prior work (Akshay et al., 2018) showed that if the specification is represented in wDNNF, synthesis can be done in polynomial time using GACKS Algorithm. However, experiments showed that GACKS Algorithm could often solve specifications that were not in wDNNF, suggesting wDNNF was too restrictive. Subsequently Akshay et al. (2019) proposed SynNNF, an super polynomially more succinct (w.r.t wDNNF) normal form that can solve specifications in polynomial time with GACKS Algorithm.

SynNNF (Synthesizable NNF)

SynNNF is a subclass of NNF (Negation Normal Form) whose definition is relative to a specific sequence (or ordering) of the output variables . Its definition relies on the following properties:

  1. Positive Form : Take and replace all occurrences of (for outputs ) with a fresh variable ”.
  2. -Reduct : This is the positive form where all and for are replaced by 1 [True]”. This step is inherently sequential and its result depends entirely on the chosen order of .
  3. -unrealizability: A formula is in SynNNF w.r.t. the sequence if, for every output (tested sequentially from to ), its -reduct has this property”. This property means that there is no assignment to the remaining variables ( and ) that makes the reduct semantically equivalent to .

A much simpler sufficient condition (which is syntactic, not semantic) is that for each in the sequence, in the DAG for its -reduct , there is no pair of paths starting from and that meet for the first time at an (AND) node.

  • Example 1: . This formula is in SynNNF w.r.t. the order .
  • Example 2: . This formula is not in SynNNF w.r.t. the order , because its -reduct is not -unrealizable. (It does, however, pass the test for as its -reduct is vacuously -unrealizable ”).

graph TD
    subgraph K [K is in SynNNF]
        K_root(("$$ \wedge $$")) --- C1(("$$ \vee $$"))
        K_root --- C2(("$$ \vee $$"))
        K_root --- C3(("$$ \vee $$"))
        C1 --- x1(("$$ x_1 $$"))
        C1 --- x2(("$$ x_2 $$"))
        C2 --- not_x2(("$$ \neg x_2 $$"))
        C2 --- y1(("$$ y_1 $$"))
        C3 --- not_y1(("$$ \neg y_1 $$"))
        C3 --- y2(("$$ y_2 $$"))
    end

    linkStyle 0,1,3,4,5 stroke:green,stroke-width:4px
graph TD
subgraph H [H is not in SynNNF]
H_root(("$$ \wedge $$")) --- H_C1(("$$ \vee $$"))
H_root --- H_C2(("$$ \vee $$"))
H_C1 --- H_x1(("$$ x_1 $$"))
H_C1 --- H_x2(("$$ x_2 $$"))
H_C1 --- H_y1(("$$ y_1 $$"))
H_C2 --- H_not_x1(("$$ \neg x_1 $$"))
H_C2 --- H_C3(("$$ \wedge $$"))
H_C3 --- H_not_x2(("$$ \neg x_2 $$"))
H_C3 --- H_y2(("$$ y_2 $$"))
end
linkStyle 0,1,2,5 stroke:red,stroke-width:4px

Key Properties

Akshay et al. (2019) highlights the following properties:

  1. Efficient Synthesis: Theorem 1 states that if is in SynNNF (w.r.t. ), the Skolem function vector can be computed in time and space. The synthesis algorithm itself is sequential, computing functions for down to based on this order.
  2. Succinctness: Theorem 2 states SynNNF can be super-polynomially more succinct than wDNNF and dDNNF, and exponentially more succinct than FBDDs. This succinctness is possible because SynNNF only needs to support efficient operations (like synthesis) for a single, fixed variable ordering, whereas forms like DNNF are more restrictive because they must support all orderings.

Note

There are some more cases where GACKS Algorithm works but the formula is not in SynNNF form. In Theorem 3(ii) of Akshay et al. (2019) it has been defined as weak -unrealizability, but for the purposes of this note, it has been excluded.

Formula Refinement

Compilation into SynNNF can be exponentially hard. Akshay et al. (2019) use refinement to transform into a new simpler formula that is sufficient for synthesis. A specification refines () if the following hold:

  • Preserve Solvability: is satisfied for all inputs that can satisfy.
  • Guarantees Correctness: Any solution for is also a solution for .

Therefore, any Skolem function for is also a correct Skolem function for . The converse of this does not hold, not all Skolem functions are correct for .

How to Refine a Formula

To find a refined formula, Akshay et al. (2019) depend on Functional Dependencies (FD).

  1. Functionally Determined (FD) Variables: Many specifications, especially those from Tseitin encoding, contain implied functional definitions (f-defs) like Here, is an FD variable.
  2. Acyclic System of f-defs: An algorithm can find a set of these FD variables and their definitions , ensuring there are no cyclic dependencies (e.g., depends on and depends on ).

The “Pivoting” Lemma

  • We identify a “pivot” on a non-FD output variable () and force it to a specific value, thus simplifying the formula. The algorithm checks the following formula:

  • If is TRUE, it means that if a solution exists with , then a solution also exists with . Therefore, we can safely always set without losing solvability.

Refinement

The algorithm refines to the much simpler formula (or , whatever satisfies more clauses). This process is called “refining by pivoting on ”.

C2Syn Algorithm

C2Syn is a recursive, “divide-and-conquer” compiler for converting a Boolean specification in CNF (as a set of clauses ) and produces a DAG representation of a refined specification that is guaranteed to be in SynNNF and correct for synthesis.

  • Inputs:
    • :
      • The set of clauses of the original CNF specification.
      • In the first call this would contain all input clauses.
    • :
      • The set of functionally determined variables.
      • In the first call this would be the empty set as we haven’t found variables functionally dependent yet.
    • :
      • The conjunction of all the functional definitions.
      • In the first call this is 1/True this its an empty set of conjunctions.
    • :
      • This is the recursion depth.
      • In the first call this is 0.

The algorithm is defined recursively. The initial call is , where is the full set of clauses and the set of functional definitions is empty.

C2Syn has 5 main phases:

  1. Base case to check for termination.
  2. FDREFINE: Refine the specification with functional definitions.
  3. Run GACKS Algorithm.
  4. Recursively branch.

Base case to check for termination

The algorithm first checks for trivial cases to terminate the recursion:

  • If is valid (True): Returns a DAG for the constant.
  • If is inconsistent (False): This happens if contains a contradiction (e.g., the empty clause). It returns a DAG for the constant.
  • If is semantically independent of inputs : The problem is trivial. Any satisfying assignment for the outputs is a valid (constant) Skolem function. The algorithm finds one and returns the DAG for the assignment .
  • If is semantically independent of outputs : The outputs don’t matter, so as long as the problem is satisfiable at all, the answer is “True”. It returns a DAG for 1/True.

FDREFINE: Refine the specification with functional definitions

In this phase, the algorithm searches for 2 things:

  1. Functional Dependencies (FDs): It scans the clauses for syntactic patterns (like Tseitin encodings for AND/OR gates) to find “dumb” (functionally determined) variables to add to the set .
  2. Pivoting Opportunities: For all “free” variables (those in ), it checks . If the check passes, it “pivots” on that variable (e.g., forces or ), adds it to the set and updates the functional definitions .

This process repeats until no more FDs or pivots can be found.

The algorithm now checks if , meaning all output variables are functionally determined. If so, it constructs and returns the DAG for the conjunction of all functional definitions in .

Run (Fast) GACKS Algorithm

For the remaining cases, the algorithm runs the GACKS Algorithm algorithm on the current formula .

  1. It calculates the GACKS Algorithm Skolem function vector for the current simplified formula .
  2. It builds the formal “error formula” and checks if it is unsatisfiable (UNSAT).
    • If UNSAT: The Skolem functions are correct for the current formula. It returns the DAG for .

Recursively branch

If all previous optimizations fail, the algorithm must perform a “slow” full recursive divide-and-conquer approach.

  1. Choose Variable: It selects a “free” variable (from Var(S’) \ T’) to branch on. It uses a VSIDS-based heuristic, similar to SAT solvers, to pick an “important” variable.

  2. Partition Clauses: Instead of just splitting into and , it partitions into three disjoint sets based on their Maximally Connected Components (MCCs). MCCs are graphs of clauses connected by shared output variables.

    • : All clauses in MCCs that contain the literal .
    • : All clauses in MCCs that contain the literal .
    • : All remaining clauses (i.e., those in MCCs that don’t involve at all).
  3. Recurse: The algorithm makes three independent recursive calls on these smaller sub-problems.

    • (The part)
    • (The part)
    • (The independent part)
  4. Combine & Return: It receives the three result DAGs () and combines them. The final DAG represents the formula:

  5. It returns this combined DAG.

References

Akshay, S., Arora, J., Chakraborty, S., Krishna, S., Raghunathan, D., & Shah, S. (2019). Knowledge Compilation for Boolean Functional Synthesis. arXiv. https://doi.org/10.48550/arXiv.1908.06275
Akshay, S., Chakraborty, S., Goel, S., Kulal, S., & Shah, S. (2018). What’s Hard About Boolean Functional Synthesis? In H. Chockler & G. Weissenbacher (Eds.), Computer Aided Verification (Vol. 10981, pp. 251–269). Springer International Publishing. https://doi.org/10.1007/978-3-319-96145-3_14