neurolang.probabilistic.dalvi_suciu_lift module

neurolang.probabilistic.dalvi_suciu_lift.dalvi_suciu_lift(rule, symbol_table)

Translation from a datalog rule which allows disjunctions in the body to a safe plan according to [1]. Non-liftable segments are identified by the NonLiftable expression. [1] Dalvi, N. & Suciu, D. The dichotomy of probabilistic inference for unions of conjunctive queries. J. ACM 59, 1–87 (2012).

neurolang.probabilistic.dalvi_suciu_lift.solve_marg_query(rule, cpl)
neurolang.probabilistic.dalvi_suciu_lift.solve_succ_query(query, cpl_program, run_relational_algebra_solver=True)

Solve a SUCC query on a CP-Logic program.

Parameters:
queryImplication

SUCC query of the form ans(x) :- P(x).

cpl_programCPLogicProgram

CP-Logic program on which the query should be solved.

run_relational_algebra_solver: bool

When true the result’s relation attribute is a NamedRelationalAlgebraFrozenSet, when false the attribute is the relational algebra expression that produces the such set.

Returns:
ProvenanceAlgebraSet

Provenance set labelled with probabilities for each tuple in the result set.