The base graph, as an algorithm sees it #
The constraint graph of a 3CNF formula has three edges per clause, a vertex per variable and a vertex per clause. This module computes those numbers and those endpoints from the formula's encoding, in polynomial time.
The vertex numbering puts variables first, so a clause vertex sits at
maxVar + 1 + j; both quantities are read off the encoding by the loops of
MaxLoop and the parser.
Main definitions #
Complexity.baseEdgesU— the edge count, in unaryComplexity.baseMaxU— the largest variable index, in unary
Main results #
Complexity.baseEdgesU_eq,Complexity.baseMaxU_eq— what they computeComplexity.baseTailU_eq,Complexity.baseHeadU_eq— the two endpointsComplexity.baseKey_mem_FP,Complexity.length_baseKey_le— the constraint's bounded keyComplexity.baseOk_mem_P— the constraint is polynomial-time decidableComplexity.baseAlg— the base graph as anAlgCSPComplexity.baseAlg_numEdges_eq,Complexity.baseAlg_tail_eq,Complexity.baseAlg_head_eq— it agrees withbaseCSPComplexity.card_gapAlpha— the alphabet fits in23bitsComplexity.litSignFn_encode— the sign flag is the literal's signComplexity.baseAlg_models— the base graph is modelled faithfully
The number of edges, in unary: three per clause.
Equations
- Complexity.baseEdgesU E z = Complexity.clauseCountFn (E z) ++ Complexity.clauseCountFn (E z) ++ Complexity.clauseCountFn (E z)
Instances For
The largest variable index, in unary.
Equations
- Complexity.baseMaxU E z = Complexity.maxFn Complexity.slotVar (Complexity.pair (Complexity.baseEdgesU E z) (E z))
Instances For
The unary form of the first endpoint: the clause vertex.
Equations
Instances For
The unary form of the second endpoint: the variable vertex.
Equations
- Complexity.baseHeadU E w = Complexity.slotVar (Complexity.pair (E (Complexity.pairFst w)) (Complexity.pairSnd w))
Instances For
What the endpoints compute #
The key the constraint looks at #
Everything the constraint depends on: the clause's signs, the position inside the clause, and the two symbol blocks.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The constraint #
What the constraint says, as a predicate of the key alone: the two blocks name symbols in the image of the alphabet embedding whose preimages satisfy the clause and agree on the checked position.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The constraint, as a language on the verifier's verdict argument.
Equations
- Complexity.baseOk E w = {z : List Bool | Complexity.baseOkKey w (Complexity.baseKey E w z)}