Counting violated edges of an executable constraint graph #
The edge list counts occurrences, including loops and parallel edges. These identities connect
its executable Boolean tests to the finite-edge semantics used by ConstraintGraph.unsatVal.
Main results #
Cslib.PCP.Encoded.Graph.card_unsatEdges_toGraph: the number of violations as a list count.Cslib.PCP.Encoded.Graph.unsatFrac_toGraph: the proportion of violations as a list count.
theorem Cslib.PCP.Encoded.Graph.card_unsatEdges_toGraph {C α : Type} (g : Graph C) (eval : C → α → α → Bool) (σ : ℕ → α) :
((g.toGraph eval).unsatEdges σ).card = List.countP (fun (d : Edge C) => !eval d.constraint (σ d.src) (σ d.dst)) g.edges
Violated edge occurrences counted along the stored edge list.
theorem Cslib.PCP.Encoded.Graph.unsatFrac_toGraph {C α : Type} (g : Graph C) (eval : C → α → α → Bool) (σ : ℕ → α) :
The semantic violated fraction is the executable count divided by the edge-list length.