neurolang.datalog.chase.relational_algebra module

class neurolang.datalog.chase.relational_algebra.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.relational_algebra.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.relational_algebra.NamedRelationalAlgebraOptimiser(*args, **kwargs)

Bases: PushInSelections, ExpressionWalker

Attributes:
patterns

Property holding an iterator of triplets (pattern, guard, action).

Methods

match(expression)

Find the action for a given expression by going through the patterns.

pattern_match(pattern, expression)

Return True if pattern matches expression.

type

pattern_match_expression

pattern_match_expression_parameters

pattern_match_expression_tuple

pattern_match_tuple

process_expression

process_iterable_argument

push_and_rename_in_naturaljoin

push_selection_in_extended_projection

push_selection_in_groupby

push_selection_in_left

push_selection_in_leftnaturaljoin_left

push_selection_in_leftnaturaljoin_right

push_selection_in_outernaturaljoin_left

push_selection_in_outernaturaljoin_right

push_selection_in_projection

push_selection_in_replace_null

push_selection_in_right

walk

type = typing.Any