neurolang.probabilistic.ppdl module

class neurolang.probabilistic.ppdl.PPDL(symbol_table=None)

Bases: PPDLMixin, DatalogProgram, ExpressionWalker

Class implementing a Probabilistic Programming DataLog (PPDL) program

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

new_set

pattern_match_expression

pattern_match_expression_parameters

pattern_match_expression_tuple

pattern_match_tuple

pop_scope

ppdl_rule

predicate_terms

process_expression

process_iterable_argument

push_scope

statement_intensional

symbol

walk

protected_keywords = {}
type = typing.Any
class neurolang.probabilistic.ppdl.PPDLDeltaSymbol(dist_name, n_terms)

Bases: Symbol

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

fresh

get_wrapped_attribute

type = typing.Any
class neurolang.probabilistic.ppdl.PPDLDeltaTerm(functor, args, kwargs=None, validate_arguments=False, verify_type=True)

Bases: FunctionApplication

Attributes:
function

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.probabilistic.ppdl.PPDLMixin(*args, **kwargs)

Bases: PatternWalker

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

ppdl_rule

walk

ppdl_rule(rule)
type = typing.Any
neurolang.probabilistic.ppdl.get_dterm(datom)
neurolang.probabilistic.ppdl.get_dterm_index(datom)
neurolang.probabilistic.ppdl.is_ppdl_rule(exp)