ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
Loading...
Searching...
No Matches
gate_builders.h
Go to the documentation of this file.
1/**
2 * @file gate_builders.h
3 * @brief The gate builders of the query rewriter, for C/C++ callers.
4 *
5 * The same constructions, at the same addresses, as the SQL-callable
6 * @c provenance_times, @c provenance_plus, @c provenance_monus and
7 * @c provenance_delta, without the Datum marshalling: rebuilding a circuit
8 * with them gives the gates the rewriter would have built from the same
9 * operands (see the equation-system resolution of recursive queries).
10 */
11#ifndef GATE_BUILDERS_H
12#define GATE_BUILDERS_H
13
14#include "postgres.h"
15#include "utils/uuid.h"
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21/** @brief ⊗ of @p n tokens: 𝟙 dropped, none gives 𝟙, one is returned. */
22pg_uuid_t provsql_build_times(const pg_uuid_t *tokens, int n);
23/** @brief ⊕ of @p n tokens: 𝟘 dropped, none gives 𝟘, one is returned. */
24pg_uuid_t provsql_build_plus(const pg_uuid_t *tokens, int n);
25/** @brief @p token1 ⊖ @p token2, with X ⊖ X = 𝟘 ⊖ X = 𝟘 and X ⊖ 𝟘 = X. */
26pg_uuid_t provsql_build_monus(const pg_uuid_t *token1, const pg_uuid_t *token2);
27/** @brief δ(@p token), with δ(𝟘) = 𝟘 and δ(𝟙) = 𝟙. */
29
30#ifdef __cplusplus
31}
32#endif
33
34#endif /* GATE_BUILDERS_H */
pg_uuid_t provsql_build_delta(const pg_uuid_t *token)
δ(token), with δ(𝟘) = 𝟘 and δ(𝟙) = 𝟙.
pg_uuid_t provsql_build_monus(const pg_uuid_t *token1, const pg_uuid_t *token2)
token1 ⊖ token2, with X ⊖ X = 𝟘 ⊖ X = 𝟘 and X ⊖ 𝟘 = X.
pg_uuid_t provsql_build_plus(const pg_uuid_t *tokens, int n)
⊕ of n tokens: 𝟘 dropped, none gives 𝟘, one is returned.
pg_uuid_t provsql_build_times(const pg_uuid_t *tokens, int n)
⊗ of n tokens: 𝟙 dropped, none gives 𝟙, one is returned.