24#include "lib/stringinfo.h"
25#include "utils/palloc.h"
42 appendStringInfo(&s,
"%d %d %d %d %d",
47 for (i = 0; i < cert->
natoms; i++)
50 for (i = 0; i < ncol; i++)
70#define READ_INT(dst) \
72 v = strtol(p, &end, 10); \
73 if (end == p) { pfree(cert); return NULL; } \
98 for (i = 0; i < cert->
natoms; i++)
102 cert->
atom_col_class = (
int *) palloc(
sizeof(
int) * (ncol > 0 ? ncol : 1));
103 for (i = 0; i < ncol; i++)
113 const char *p, *limit;
122 limit = p + strlen(p);
125 k.
factor = (int) strtol(p, &end, 10);
126 if (end == p || *end !=
' ')
return false;
130 n = strtol(p, &end, 10);
131 if (end == p || n < 0 || *end !=
':')
return false;
133 if ((
size_t)(limit - p) < (
size_t) n)
return false;
139 n = strtol(p, &end, 10);
140 if (end == p || n < 0 || *end !=
':')
return false;
142 if ((
size_t)(limit - p) < (
size_t) n)
return false;
SafeCert * safe_cert_parse(const char *str)
Parse a C-prefixed recipe string (as produced by safe_cert_serialise and read back from an annotation...
char * safe_cert_serialise(const SafeCert *cert)
Serialise a SafeCert recipe to a compact, C-prefixed string (palloc'd in the current memory context).
bool safe_cert_key_parse(const char *str, SafeCertKey *out)
Parse a K-prefixed order-key string into out.
Tractability certificate for the inversion-free UCQ(OBDD) path.
SafeCertKind
Kind of tractability certificate carried on the provenance root.
#define SAFE_CERT_EXTRA_PREFIX_KEY
Input: per-variable order key.
#define SAFE_CERT_EXTRA_PREFIX_RECIPE
Discriminator prefixes for the annotation gate's extra payload.
Query-derived order recipe for the structured-d-DNNF builder.
int nclasses
Number of (compacted) equivalence classes.
int * atom_col_class
Flattened [natoms][maxarity]: compacted class anchored at (atom, column), or -1.
int root_class
Compacted id of the root class (touches every atom).
int natoms
Number of atoms (range-table entries).
int maxarity
Stride of atom_col_class (max columns per atom seen).
int * class_topo_order
Length nclasses: classes in G_prec topological order, root first.
int * atom_relation_rank
Length natoms: relation-symbol tie-break rank per atom.