neurolang.frontend.drs.translate_to_dl module

class neurolang.frontend.drs.translate_to_dl.TransformIntoConjunctionOfDatalogSentences(*args, **kwargs)

Bases: DistributeImplicationsWithConjunctiveHeads, DistributeUniversalQuantifiers, CollapseConjunctions, ExpressionWalker

A datalog-sentence in this case is a logical sentence which can be interpreted as datalog. The only 2 types of sentences supported are facts and rules. This rewrite allows to use conjunctions in a more flexible way, allowing to use them between facts and in implication heads, because then they will be properly distributed.

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

distribute_implication_with_conjunctive_head

distribute_universal_quantifier

pattern_match_expression

pattern_match_expression_parameters

pattern_match_expression_tuple

pattern_match_tuple

process_expression

process_iterable_argument

walk

type = typing.Any
class neurolang.frontend.drs.translate_to_dl.TranslateToDatalog

Bases: object

Methods

translate_block

translate_logical_sentence

translate_sentence

translate_block(string)
translate_logical_sentence(exp)
translate_sentence(sentence)