neurolang.probabilistic.cplogic package

neurolang.probabilistic.cplogic.build_always_true_provenance_relation(relation, prob_col=None)

Construct a provenance set from a relation with probabilities of 1 for all tuples in the relation.

The provenance column is named after the prob_col argument. If prob_col is already in the columns of the relation, it is removed before being re-added.

Parameters:
relationNamedRelationalAlgebraFrozenSet

The relation containing the tuples that will be in the resulting provenance set.

prob_colConstant[ColumnStr]

Name of the provenance column that will contain constant probabilities of 1.

Returns:
ProvenanceAlgebraSet
neurolang.probabilistic.cplogic.fresh_name_relation(ra_set)
neurolang.probabilistic.cplogic.rename_columns_for_args_to_match(relation, src_args, dst_args)

Rename the columns of a relation so that they match the targeted args.

Parameters:
relationProvenanceAlgebraSet or RelationalAlgebraOperation

The relation on which the renaming of the columns should happen.

src_argstuple of Symbols

The predicate’s arguments currently matching the columns.

dst_argstuple of Symbols

New args that the naming of the columns should match.

Returns:
RelationalAlgebraOperation

The unsolved nested operations that apply the renaming scheme.

Subpackages

Submodules