neurolang.datalog.chase.general module

class neurolang.datalog.chase.general.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.general.ChaseNaive

Bases: object

Chase implementation using the naive algorithm.

Methods

execute_chase

execute_chase(rules, instance_update, instance)
class neurolang.datalog.chase.general.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.general.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.general.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.general.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.general.NeuroLangNonLinearProgramException

Bases: NeuroLangException

exception neurolang.datalog.chase.general.NeuroLangProgramHasLoopsException

Bases: NeuroLangException