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. Ifprob_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¶
- neurolang.probabilistic.cplogic.cplogic_to_gm module
AndPlateNode
BernoulliPlateNode
CPLogicGroundingToGraphicalModelTranslator
CPLogicGroundingToGraphicalModelTranslator.add_plate_node()
CPLogicGroundingToGraphicalModelTranslator.block_of_groundings()
CPLogicGroundingToGraphicalModelTranslator.extensional_set_grounding()
CPLogicGroundingToGraphicalModelTranslator.intensional_rule_grounding()
CPLogicGroundingToGraphicalModelTranslator.probabilistic_choice_grounding()
CPLogicGroundingToGraphicalModelTranslator.probfact_set_grounding()
CPLogicGroundingToGraphicalModelTranslator.type
GraphicalModel
NaryChoicePlateNode
NaryChoiceResultPlateNode
PlateNode
ProbabilisticPlateNode
is_extensional_grounding()
- neurolang.probabilistic.cplogic.gm_provenance_solver module
- neurolang.probabilistic.cplogic.grounding module
Chase
Datalog
build_extensional_grounding()
build_grounding()
build_pchoice_grounding()
build_pfact_grounding_from_set()
build_probabilistic_grounding()
build_rule_grounding()
cplogic_to_datalog()
get_grounding_dependencies()
get_grounding_pred_symb()
get_grounding_predicate()
ground_cplogic_program()
remove_probability_column()
topological_sort_groundings()
topological_sort_groundings_util()
- neurolang.probabilistic.cplogic.problog_solver module
- neurolang.probabilistic.cplogic.program module
CPLogicMixin
CPLogicMixin.add_probabilistic_choice_from_tuples()
CPLogicMixin.add_probabilistic_facts_from_tuples()
CPLogicMixin.extensional_database()
CPLogicMixin.marg_implication()
CPLogicMixin.pchoice_pred_symb_set_symb
CPLogicMixin.pchoice_pred_symbs
CPLogicMixin.pfact_pred_symb_set_symb
CPLogicMixin.pfact_pred_symbs
CPLogicMixin.predicate_symbols
CPLogicMixin.probabilistic_choices()
CPLogicMixin.probabilistic_fact()
CPLogicMixin.probabilistic_facts()
CPLogicMixin.probabilistic_predicate_symbols
CPLogicMixin.protected_keywords
CPLogicMixin.query_based_probabilistic_choice()
CPLogicMixin.query_based_probabilistic_fact()
CPLogicMixin.query_based_probabilistic_predicate()
CPLogicMixin.type
CPLogicMixin.union_with_probabilistic_facts()
CPLogicMixin.within_language_marg_query()
CPLogicMixin.within_language_prob_queries()
CPLogicMixin.within_language_succ_query()
CPLogicProgram
- neurolang.probabilistic.cplogic.testing module