15#ifndef SAFE_QUERY_CERT_H
16#define SAFE_QUERY_CERT_H
61#define SAFE_CERT_EXTRA_PREFIX_RECIPE 'C'
62#define SAFE_CERT_EXTRA_PREFIX_KEY 'K'
96#define SAFE_CERT_GUARD_FACTOR (-1)
116 const char *sec,
size_t sec_len,
SafeCertKind
Kind of tractability certificate carried on the provenance root.
@ CERT_NONE
No certificate.
@ CERT_INVERSION_FREE
Inversion-free UCQ(OBDD) over TID inputs.
char * safe_cert_key_serialise(const char *root, size_t root_len, const char *sec, size_t sec_len, int factor)
Serialise a per-input order key to a compact K-prefixed string (palloc'd).
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.
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.