neurolang.datalog.chase package¶
- class neurolang.datalog.chase.ChaseGeneral(datalog_program, rules=None)¶
Bases:
object
Chase implementation using the naive resolution algorithm.
Methods
aggregate_tuple_type_into_row_type
build_chase_solution
build_chase_tree
build_nodes_from_rules
chase_step
check_constraints
compose_all_subtitutions
compose_substitutions_ignoring_conflicts
compose_substitutions_no_conflict
compute_instance_update
compute_new_tuple_and_type
compute_result_set
eliminate_already_computed
evaluate_builtins
evaluate_builtins_predicates
extract_rule_predicates
extract_variable_arguments
get_args_to_project
infer_iterable_subtype
is_containment_of_symbol_in_constant
is_equality_between_constant_and_symbol
unify_builtin_substitution
unify_builtin_substitution_containment
unify_builtin_substitution_equality
- aggregate_tuple_type_into_row_type(row_type, tuple_type)¶
- build_chase_solution()¶
- build_chase_tree(chase_set=<function ChaseGeneral.chase_step>)¶
- build_nodes_from_rules(node, rule)¶
- chase_step(instance, rule, restriction_instance=None)¶
- check_constraints(instance_update)¶
- static compose_all_subtitutions(new_substitutions, subs_keys, substitution)¶
- static compose_substitutions_ignoring_conflicts(new_substitutions, subs_keys, substitution)¶
- static compose_substitutions_no_conflict(substitutions, new_substitutions)¶
- compute_instance_update(rule, new_tuples, instance, restriction_instance)¶
- compute_new_tuple_and_type(rule, substitution)¶
- compute_result_set(rule, substitutions, instance, restriction_instance=None)¶
- eliminate_already_computed(consequent, instance, substitutions)¶
- evaluate_builtins(builtin_predicates, substitutions)¶
- evaluate_builtins_predicates(predicates_to_evaluate, substitution)¶
- extract_rule_predicates(rule, instance, restriction_instance=None)¶
- static extract_variable_arguments(predicate)¶
- get_args_to_project(rule, builtin_predicates_)¶
- static infer_iterable_subtype(evaluated_predicate)¶
- static is_containment_of_symbol_in_constant(predicate)¶
- static is_equality_between_constant_and_symbol(predicate)¶
- unify_builtin_substitution(predicate, substitution)¶
- static unify_builtin_substitution_containment(evaluated_predicate)¶
- static unify_builtin_substitution_equality(evaluated_predicate)¶
- class neurolang.datalog.chase.ChaseMGUMixin¶
Bases:
object
Methods
obtain_substitutions
unify_substitution
- static obtain_substitutions(args_to_project, rule_predicates_iterator)¶
- static unify_substitution(predicate, substitution, representation)¶
- class neurolang.datalog.chase.ChaseNaive¶
Bases:
object
Chase implementation using the naive algorithm.
Methods
execute_chase
- execute_chase(rules, instance_update, instance)¶
- class neurolang.datalog.chase.ChaseNamedRelationalAlgebraMixin¶
Bases:
object
Conjunctive query solving using the algorithm 5.4.8 from Abiteboul et al [1]_ algorithm for named relational algebra.
- ..[1] S. Abiteboul, R. Hull, V. Vianu, Foundations of databases
(Addison Wesley, 1995), Addison-Wesley.
Methods
chase_step
compute_result_set
eliminate_already_computed
obtain_substitutions
rewrite_antecedent_equalities
rewrite_constants_in_consequent
rewrite_rule_consequent_constants_to_equalities
translate_conjunction_to_named_ra
- chase_step(instance, rule, restriction_instance=None)¶
- compute_result_set(rule, substitutions, instance, restriction_instance=None)¶
- eliminate_already_computed(consequent, instance, substitutions)¶
- obtain_substitutions(rule_predicates_iterator, instance, restriction_instance)¶
- rewrite_antecedent_equalities(rule)¶
- rewrite_constants_in_consequent(rule)¶
- static rewrite_rule_consequent_constants_to_equalities(rule, new_args, new_equalities)¶
- translate_conjunction_to_named_ra(conjunction)¶
- class neurolang.datalog.chase.ChaseNode(instance, children)¶
Bases:
tuple
- Attributes:
- children
Alias for field number 1
- instance
Alias for field number 0
Methods
count
(value, /)Return number of occurrences of value.
index
(value[, start, stop])Return first index of value.
- children¶
Alias for field number 1
- instance¶
Alias for field number 0
- class neurolang.datalog.chase.ChaseNonRecursive¶
Bases:
object
Chase class for non-recursive programs.
Methods
check_constraints
execute_chase
- check_constraints(instance_update)¶
- execute_chase(rules, instance_update, instance)¶
- class neurolang.datalog.chase.ChaseRelationalAlgebraPlusCeriMixin¶
Bases:
object
Conjunctive query solving using Ceri et al [1] algorithm for unnamed positive relational algebra.
[1]S. Ceri, G. Gottlob, L. Lavazza, in Proceedings of the 12th International Conference on Very Large Data Bases (Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 1986; http://dl.acm.org/citation.cfm?id=645913.671468), VLDB ’86, pp. 395–402.
Methods
compute_substitutions
obtain_substitutions
translate_predicate
translate_predicate_process_argument
translate_predicate_process_argument_symbol
translate_to_ra_plus
- compute_substitutions(result, projected_var_names)¶
- obtain_substitutions(args_to_project, rule_predicates_iterator)¶
- translate_predicate(pred_ra, column, args_to_project)¶
- translate_predicate_process_argument(arg, local_selections, local_column, global_column, args_to_project)¶
- translate_predicate_process_argument_symbol(arg, global_column, args_to_project)¶
- translate_to_ra_plus(args_to_project, rule_predicates_iterator)¶
- class neurolang.datalog.chase.ChaseSemiNaive¶
Bases:
object
Chase implementation using the semi-naive algorithm. This algorithm will not work if there are non-linear rules.
Methods
check_constraints
execute_chase
per_rule_update
- check_constraints(instance_update)¶
- execute_chase(rules, instance_update, instance)¶
- per_rule_update(rule, instance, instance_update)¶
- class neurolang.datalog.chase.ChaseStratified(datalog_program, chase_classes: List[Type[ChaseGeneral]], rules=None)¶
Bases:
ChaseGeneral
Methods
aggregate_tuple_type_into_row_type
build_chase_solution
build_chase_tree
build_nodes_from_rules
chase_step
check_constraints
compose_all_subtitutions
compose_substitutions_ignoring_conflicts
compose_substitutions_no_conflict
compute_instance_update
compute_new_tuple_and_type
compute_result_set
eliminate_already_computed
evaluate_builtins
evaluate_builtins_predicates
extract_rule_predicates
extract_variable_arguments
get_args_to_project
infer_iterable_subtype
is_containment_of_symbol_in_constant
is_equality_between_constant_and_symbol
pick_chase_instance_for_stratum
unify_builtin_substitution
unify_builtin_substitution_containment
unify_builtin_substitution_equality
- build_chase_solution()¶
- pick_chase_instance_for_stratum(stratum, instance_update)¶
- exception neurolang.datalog.chase.NeuroLangNonLinearProgramException¶
Bases:
NeuroLangException
- exception neurolang.datalog.chase.NeuroLangProgramHasLoopsException¶
Bases:
NeuroLangException
Submodules¶
- neurolang.datalog.chase.general module
ChaseGeneral
ChaseGeneral.aggregate_tuple_type_into_row_type()
ChaseGeneral.build_chase_solution()
ChaseGeneral.build_chase_tree()
ChaseGeneral.build_nodes_from_rules()
ChaseGeneral.chase_step()
ChaseGeneral.check_constraints()
ChaseGeneral.compose_all_subtitutions()
ChaseGeneral.compose_substitutions_ignoring_conflicts()
ChaseGeneral.compose_substitutions_no_conflict()
ChaseGeneral.compute_instance_update()
ChaseGeneral.compute_new_tuple_and_type()
ChaseGeneral.compute_result_set()
ChaseGeneral.eliminate_already_computed()
ChaseGeneral.evaluate_builtins()
ChaseGeneral.evaluate_builtins_predicates()
ChaseGeneral.extract_rule_predicates()
ChaseGeneral.extract_variable_arguments()
ChaseGeneral.get_args_to_project()
ChaseGeneral.infer_iterable_subtype()
ChaseGeneral.is_containment_of_symbol_in_constant()
ChaseGeneral.is_equality_between_constant_and_symbol()
ChaseGeneral.unify_builtin_substitution()
ChaseGeneral.unify_builtin_substitution_containment()
ChaseGeneral.unify_builtin_substitution_equality()
ChaseNaive
ChaseNode
ChaseNonRecursive
ChaseSemiNaive
ChaseStratified
NeuroLangNonLinearProgramException
NeuroLangProgramHasLoopsException
- neurolang.datalog.chase.mgu module
- neurolang.datalog.chase.negation module
DatalogChaseNegation
DatalogChaseNegationGeneral
DatalogChaseNegationGeneral.chase_step()
DatalogChaseNegationGeneral.check_non_linear()
DatalogChaseNegationGeneral.evaluate_negative_builtins()
DatalogChaseNegationGeneral.extract_rule_predicates()
DatalogChaseNegationGeneral.get_args_to_project()
DatalogChaseNegationGeneral.unify_negative_builtin_substitution()
DatalogChaseNegationMGUMixin
DatalogChaseNegationRelationalAlgebraMixin
NegativeFactConstraints
- neurolang.datalog.chase.relational_algebra module
ChaseNamedRelationalAlgebraMixin
ChaseNamedRelationalAlgebraMixin.chase_step()
ChaseNamedRelationalAlgebraMixin.compute_result_set()
ChaseNamedRelationalAlgebraMixin.eliminate_already_computed()
ChaseNamedRelationalAlgebraMixin.obtain_substitutions()
ChaseNamedRelationalAlgebraMixin.rewrite_antecedent_equalities()
ChaseNamedRelationalAlgebraMixin.rewrite_constants_in_consequent()
ChaseNamedRelationalAlgebraMixin.rewrite_rule_consequent_constants_to_equalities()
ChaseNamedRelationalAlgebraMixin.translate_conjunction_to_named_ra()
ChaseRelationalAlgebraPlusCeriMixin
ChaseRelationalAlgebraPlusCeriMixin.compute_substitutions()
ChaseRelationalAlgebraPlusCeriMixin.obtain_substitutions()
ChaseRelationalAlgebraPlusCeriMixin.translate_predicate()
ChaseRelationalAlgebraPlusCeriMixin.translate_predicate_process_argument()
ChaseRelationalAlgebraPlusCeriMixin.translate_predicate_process_argument_symbol()
ChaseRelationalAlgebraPlusCeriMixin.translate_to_ra_plus()
NamedRelationalAlgebraOptimiser