neurolang.datalog.negation module

class neurolang.datalog.negation.DatalogProgramNegation(*args, **kwargs)

Bases: DatalogProgramNegationMixin, DatalogProgram

Attributes:
included_constants
included_functions
patterns

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

Methods

constant_equals

infer_iterable_type(iterable)

Infer the type of iterable elements without modifying the iterable.

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

union_of_cq(expression)

This pattern is here to avoid processing the full program when one rule is rewritten.

add_extensional_predicate_from_tuples

add_included_constants_and_functions_to_symbol_table

builtins

extensional_database

fact

intensional_database

negation_constant

negative_fact

new_set

pattern_match_expression

pattern_match_expression_parameters

pattern_match_expression_tuple

pattern_match_tuple

pop_scope

predicate_terms

process_expression

process_iterable_argument

push_scope

statement_intensional

symbol

walk

protected_keywords = {}
type = typing.Any
class neurolang.datalog.negation.DatalogProgramNegationMixin(*args, **kwargs)

Bases: PatternWalker

Datalog solver that implements negation. Adds the possibility of inverted terms when checking that expressions are in conjunctive normal form.

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

negation_constant

negative_fact

pattern_match_expression

pattern_match_expression_parameters

pattern_match_expression_tuple

pattern_match_tuple

statement_intensional

walk

negation_constant(expression)
negative_fact(expression)
statement_intensional(expression)
type = typing.Any
class neurolang.datalog.negation.NegativeFact(antecedent)

Bases: Implication

This class defines negative facts. They are composed of an inverted antecedent and False in the consequent. It is not necessary that the initialization parameter is inverted.

Attributes:
fact

Methods

__call__(*args, **kwargs)

Call self as a function.

apply(*args)

Builds a new expression using a tuple of its parameters

type

unapply()

Returns a tuple of parameters used to build the expression.

cast

change_type

get_wrapped_attribute

property fact
type = typing.Any
neurolang.datalog.negation.is_conjunctive_negation(expression)