neurolang.datalog.expressions module

Expressions for the intermediate representation of a Datalog program.

class neurolang.datalog.expressions.Conjunction(formulas)

Bases: NaryLogicOperator

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

type = typing.Any
class neurolang.datalog.expressions.Fact(consequent)

Bases: Implication

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
class neurolang.datalog.expressions.Implication(consequent, antecedent)

Bases: LogicOperator

Expression of the form P(x) ← Q(x)

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

type = typing.Any
class neurolang.datalog.expressions.Negation(formula)

Bases: UnaryLogicOperator

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

type = typing.Any
class neurolang.datalog.expressions.TranslateToLogic(*args, **kwargs)

Bases: TranslateToLogic

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

build_conjunction

build_conjunction_from_expression_block

build_disjunction

build_negation

pattern_match_expression

pattern_match_expression_parameters

pattern_match_expression_tuple

pattern_match_tuple

translate_logic_operator

translate_true_implication

walk

build_conjunction_from_expression_block(expression_block)
translate_true_implication(implication)
type = typing.Any
class neurolang.datalog.expressions.UnaryLogicOperator(*args, **kwargs)

Bases: LogicOperator

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

type = typing.Any
class neurolang.datalog.expressions.Union(formulas)

Bases: NaryLogicOperator

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

type = typing.Any