|
6 | 6 |
|
7 | 7 | from pydantic import Field, StrictInt, StringConstraints, model_validator |
8 | 8 |
|
9 | | -from jacobian.contracts.common import ArtifactUri, Sha256Digest |
10 | 9 | from jacobian.contracts.results import ContractModel |
11 | | -from jacobian.contracts.sat import CanonicalCnf |
12 | 10 |
|
13 | 11 | GraphVertex = Annotated[ |
14 | 12 | str, |
@@ -41,71 +39,6 @@ def require_simple_graph(self) -> Self: |
41 | 39 | return self |
42 | 40 |
|
43 | 41 |
|
44 | | -class GraphColoringEncodingRequest(ContractModel): |
45 | | - """Materialize the exact CNF semantics of k-colorability.""" |
46 | | - |
47 | | - graph: ChromaticGraph |
48 | | - colors: StrictInt = Field(ge=1, le=32) |
49 | | - |
50 | | - |
51 | | -class GraphColoringEncodingClaim(ContractModel): |
52 | | - """Claim that one graph/color-count pair has a canonical encoding.""" |
53 | | - |
54 | | - claim_schema_version: Literal["1"] = "1" |
55 | | - predicate: Literal["GRAPH_K_COLORABILITY_ENCODING"] = ( |
56 | | - "GRAPH_K_COLORABILITY_ENCODING" |
57 | | - ) |
58 | | - graph: ChromaticGraph |
59 | | - colors: StrictInt = Field(ge=1, le=32) |
60 | | - |
61 | | - |
62 | | -class GraphColoringEncodingScope(ContractModel): |
63 | | - """Graph-owned scope binding the encoding to the SAT CNF artifact.""" |
64 | | - |
65 | | - scope_schema_version: Literal["1"] = "1" |
66 | | - graph: ChromaticGraph |
67 | | - colors: StrictInt = Field(ge=1, le=32) |
68 | | - cnf_uri: ArtifactUri |
69 | | - cnf_object_digest: Sha256Digest |
70 | | - cnf: CanonicalCnf |
71 | | - |
72 | | - |
73 | | -class GraphColoringEncodingCandidate(ContractModel): |
74 | | - """Pointer candidate checked against the graph-owned encoding scope.""" |
75 | | - |
76 | | - candidate_schema_version: Literal["1"] = "1" |
77 | | - cnf_uri: ArtifactUri |
78 | | - scope_uri: ArtifactUri |
79 | | - |
80 | | - |
81 | | -class GraphColoringEncodingReplay(ContractModel): |
82 | | - """Certificate payload for independent graph-to-CNF replay.""" |
83 | | - |
84 | | - method: Literal["INDEPENDENT_GRAPH_COLORING_CNF_REPLAY"] = ( |
85 | | - "INDEPENDENT_GRAPH_COLORING_CNF_REPLAY" |
86 | | - ) |
87 | | - claim_uri: ArtifactUri |
88 | | - candidate_uri: ArtifactUri |
89 | | - scope_uri: ArtifactUri |
90 | | - |
91 | | - |
92 | | -class GraphColoringEncodingOutput(ContractModel): |
93 | | - """Materialized encoding and its replay certificate.""" |
94 | | - |
95 | | - graph: ChromaticGraph |
96 | | - colors: StrictInt = Field(ge=1, le=32) |
97 | | - cnf_uri: ArtifactUri |
98 | | - scope_uri: ArtifactUri |
99 | | - claim_uri: ArtifactUri |
100 | | - candidate_uri: ArtifactUri |
101 | | - certificate_uri: ArtifactUri |
102 | | - variable_count: StrictInt = Field(ge=0, le=1_000_000) |
103 | | - clause_count: StrictInt = Field(ge=0, le=1_000_000) |
104 | | - encoding_version: Literal["exactly-one-and-edge-separation/v1"] = ( |
105 | | - "exactly-one-and-edge-separation/v1" |
106 | | - ) |
107 | | - |
108 | | - |
109 | 42 | class ChromaticNumberBudget(ContractModel): |
110 | 43 | """Total wall-clock budget for the bounded coloring search.""" |
111 | 44 |
|
|
0 commit comments