neurolang.datalog.ontologies_rewriter module

class neurolang.datalog.ontologies_rewriter.ExtractFreeVariablesRightImplicationWalker(*args, **kwargs)

Bases: ExtractFreeVariablesWalker

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

conjunction

disjunction

extract_variables_fa

extract_variables_q

extract_variables_s

extract_variables_symbol

logic_operator

negation

pattern_match_expression

pattern_match_expression_parameters

pattern_match_expression_tuple

pattern_match_tuple

quantifier

union

walk

walk_binary_logic_expression

walk_nary

extract_variables_s(expression)
type = typing.Any
class neurolang.datalog.ontologies_rewriter.OntologyRewriter(query, union_of_constraints)

Bases: object

Methods

Xrewrite()

Algorithm based on the one proposed in G.

factorization_step

rewriting_step

Xrewrite()

Algorithm based on the one proposed in G. Gottlob, G. Orsi, and A. Pieris, “Query Rewriting and Optimization for Ontological Databases,” ACM Transactions on Database Systems, vol. 39, May 2014.

factorization_step(q0, sigma)
rewriting_step(q0, sigma, rename_count)