neurolang.logic.transformations module¶
- class neurolang.logic.transformations.CheckConjunctiveQueryWithNegation(*args, **kwargs)¶
Bases:
LogicExpressionWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.conjunction
default
existential_predicate
f_app
negation
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
walk
walk_constant
walk_function
walk_implication
walk_nary
walk_negation
walk_quantifier
walk_symbol
- conjunction(expression)¶
- default(expression)¶
- existential_predicate(expression)¶
- f_app(expression)¶
- negation(expression)¶
- type = typing.Any¶
- class neurolang.logic.transformations.CollapseConjunctions(*args, **kwargs)¶
Bases:
CollapseConjunctionsMixin,ExpressionWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.conjunction
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.logic.transformations.CollapseConjunctionsMixin(*args, **kwargs)¶
Bases:
PatternWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.conjunction
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
walk
- conjunction(e)¶
- type = typing.Any¶
- class neurolang.logic.transformations.CollapseDisjunctions(*args, **kwargs)¶
Bases:
CollapseDisjunctionsMixin,ExpressionWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.disjunction
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.logic.transformations.CollapseDisjunctionsMixin(*args, **kwargs)¶
Bases:
PatternWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.disjunction
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
walk
- disjunction(e)¶
- type = typing.Any¶
- class neurolang.logic.transformations.DesambiguateQuantifiedVariables(*args, **kwargs)¶
Bases:
LogicExpressionWalkerReplaces each quantified variale to a fresh one.
- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.implication
nary_logic_operator
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
quantifier
walk
walk_constant
walk_function
walk_implication
walk_nary
walk_negation
walk_quantifier
walk_symbol
- implication(expression)¶
- nary_logic_operator(expression)¶
- quantifier(expression)¶
- type = typing.Any¶
- class neurolang.logic.transformations.DistributeConjunctions(*args, **kwargs)¶
Bases:
LogicExpressionWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.distribute
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
rotate
split
walk
walk_constant
walk_function
walk_implication
walk_nary
walk_negation
walk_quantifier
walk_symbol
- distribute(expression)¶
- rotate(expression)¶
- split(expression)¶
- type = typing.Any¶
- class neurolang.logic.transformations.DistributeDisjunctions(*args, **kwargs)¶
Bases:
LogicExpressionWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.distribute
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
rotate
split
walk
walk_constant
walk_function
walk_implication
walk_nary
walk_negation
walk_quantifier
walk_symbol
- distribute(expression)¶
- rotate(expression)¶
- split(expression)¶
- type = typing.Any¶
- class neurolang.logic.transformations.DistributeImplicationsWithConjunctiveHeads(*args, **kwargs)¶
Bases:
PatternWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.distribute_implication_with_conjunctive_head
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
walk
- distribute_implication_with_conjunctive_head(impl)¶
- type = typing.Any¶
- class neurolang.logic.transformations.DistributeUniversalQuantifiers(*args, **kwargs)¶
Bases:
PatternWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.distribute_universal_quantifier
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
walk
- distribute_universal_quantifier(uq)¶
- type = typing.Any¶
- class neurolang.logic.transformations.EliminateImplications(*args, **kwargs)¶
Bases:
LogicExpressionWalkerRemoves the implication ocurrences of an expression.
- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
remove_implication
walk
walk_constant
walk_function
walk_implication
walk_nary
walk_negation
walk_quantifier
walk_symbol
- remove_implication(implication)¶
- type = typing.Any¶
- class neurolang.logic.transformations.ExtractBoundVariables(*args, **kwargs)¶
Bases:
WalkLogicProgramAggregatingSets- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.conjunction
disjunction
logic_operator
negation
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
process_function_application
process_symbol
quantifier
union
walk
walk_binary_logic_expression
walk_nary
- process_function_application(expression)¶
- process_symbol(expression)¶
- quantifier(expression)¶
- type = typing.Any¶
- class neurolang.logic.transformations.ExtractConjunctiveQueryWithNegation(*args, **kwargs)¶
Bases:
WalkLogicProgramAggregatingSets- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.conjunction
disjunction
existential_predicate
f_app
logic_operator
neg
negation
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
pure_conjunction
quantifier
union
walk
walk_binary_logic_expression
walk_nary
- conjunction(expression)¶
- existential_predicate(expression)¶
- f_app(expression)¶
- neg(expression)¶
- pure_conjunction(expression)¶
- type = typing.Any¶
- class neurolang.logic.transformations.ExtractFOLFreeVariables(*args, **kwargs)¶
Bases:
ExtractFreeVariablesWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.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(exp)¶
- type = typing.Any¶
- class neurolang.logic.transformations.FONegELogicExpression(*args, **kwargs)¶
Bases:
LogicExpressionWalkerWalk a logic expression verifying that it is only in FO Neg Existential.
- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.abort_implication
abort_universal_predicate
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
walk
walk_constant
walk_function
walk_implication
walk_nary
walk_negation
walk_quantifier
walk_symbol
- abort_implication(expression)¶
- abort_universal_predicate(expression)¶
- type = typing.Any¶
- class neurolang.logic.transformations.FactorQuantifiersMixin(*args, **kwargs)¶
Bases:
PatternWalkerFactor quantifiers up on conjunctions and disjunctions.
- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.conjunction_with_quantifiers
disjunction_with_quantifiers
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
walk
- conjunction_with_quantifiers(expression)¶
- disjunction_with_quantifiers(expression)¶
- type = typing.Any¶
- class neurolang.logic.transformations.FreshenVariablesWhenQuantified(free_variables)¶
Bases:
LogicExpressionWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
replace_variable_in_quantifier
walk
walk_constant
walk_function
walk_implication
walk_nary
walk_negation
walk_quantifier
walk_symbol
walk_through_implication
- replace_variable_in_quantifier(expression)¶
- type = typing.Any¶
- walk_through_implication(expression)¶
- class neurolang.logic.transformations.GuaranteeConjunction(*args, **kwargs)¶
Bases:
IdentityWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.guarantee_conjunction
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
walk
- guarantee_conjunction(expression)¶
- type = typing.Any¶
- class neurolang.logic.transformations.GuaranteeDisjunction(*args, **kwargs)¶
Bases:
IdentityWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.guarantee_conjunction
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
walk
- guarantee_conjunction(expression)¶
- type = typing.Any¶
- class neurolang.logic.transformations.LogicExpressionWalker(*args, **kwargs)¶
Bases:
PatternWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
walk
walk_constant
walk_function
walk_implication
walk_nary
walk_negation
walk_quantifier
walk_symbol
- type = typing.Any¶
- walk_constant(expression)¶
- walk_function(expression)¶
- walk_implication(expression)¶
- walk_nary(expression)¶
- walk_negation(expression)¶
- walk_quantifier(expression)¶
- walk_symbol(expression)¶
- class neurolang.logic.transformations.MakeExistentialsImplicit(*args, **kwargs)¶
Bases:
LogicExpressionWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.existential
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
walk
walk_constant
walk_function
walk_implication
walk_nary
walk_negation
walk_quantifier
walk_symbol
- existential(expression)¶
- type = typing.Any¶
- class neurolang.logic.transformations.MakeUniversalsImplicit(*args, **kwargs)¶
Bases:
LogicExpressionWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
universal
walk
walk_constant
walk_function
walk_implication
walk_nary
walk_negation
walk_quantifier
walk_symbol
- type = typing.Any¶
- universal(expression)¶
- class neurolang.logic.transformations.MoveNegationsToAtoms(*args, **kwargs)¶
Bases:
MoveNegationsToAtomsMixin,LogicExpressionWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.negated_conjunction
negated_disjunction
negated_existential
negated_universal
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
remove_double_negation
remove_single
walk
walk_constant
walk_function
walk_implication
walk_nary
walk_negation
walk_quantifier
walk_symbol
- type = typing.Any¶
- class neurolang.logic.transformations.MoveNegationsToAtomsInFONegE(*args, **kwargs)¶
Bases:
MoveNegationsToAtomsSimpleOperationsMixin,PullUniversalUpFromNegation,FONegELogicExpressionMoves the negations the furthest possible to the atoms. Assumes that there are no implications in the expression. Expressions assumed to be in FO with existential and negation only.
- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.abort_implication
abort_universal_predicate
negated_conjunction
negated_disjunction
negated_universal
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
walk
walk_constant
walk_function
walk_implication
walk_nary
walk_negation
walk_quantifier
walk_symbol
- type = typing.Any¶
- class neurolang.logic.transformations.MoveNegationsToAtomsMixin(*args, **kwargs)¶
Bases:
RemoveTrivialOperationsMixin,PullExistentialUpFromNegation,PullUniversalUpFromNegation,MoveNegationsToAtomsSimpleOperationsMixin,PatternWalkerMoves the negations the furthest possible to the atoms. Assumes that there are no implications in the expression.
- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.negated_conjunction
negated_disjunction
negated_existential
negated_universal
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
remove_double_negation
remove_single
walk
- type = typing.Any¶
- class neurolang.logic.transformations.MoveNegationsToAtomsSimpleOperationsMixin(*args, **kwargs)¶
Bases:
PatternWalkerMoves the negations the furthest possible to the atoms. On conjunction, disjunction, and negation operations.
- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.negated_conjunction
negated_disjunction
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
walk
- negated_conjunction(negation)¶
- negated_disjunction(negation)¶
- type = typing.Any¶
- class neurolang.logic.transformations.MoveQuantifiersUp(*args, **kwargs)¶
Bases:
FactorQuantifiersMixin,PullUniversalUpFromNegation,PullExistentialUpFromNegation,LogicExpressionWalkerMoves the quantifiers up in order to format the expression in prenex normal form. Assumes the expression contains no implications and the variables of the quantifiers are not repeated.
- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.conjunction_with_quantifiers
disjunction_with_quantifiers
negated_existential
negated_universal
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
walk
walk_constant
walk_function
walk_implication
walk_nary
walk_negation
walk_quantifier
walk_symbol
- type = typing.Any¶
- class neurolang.logic.transformations.MoveQuantifiersUpFONegE(*args, **kwargs)¶
Bases:
FactorQuantifiersMixin,FONegELogicExpressionMoves the quantifiers up in order to format the expression in prenex normal form. Assumes the expression contains no implications, that the variables of the quantifiers are not repeated, and that the query is in FO with Negation Existential as only quantifier.
- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.abort_implication
abort_universal_predicate
conjunction_with_quantifiers
disjunction_with_quantifiers
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
walk
walk_constant
walk_function
walk_implication
walk_nary
walk_negation
walk_quantifier
walk_symbol
- type = typing.Any¶
- class neurolang.logic.transformations.PullExistentialUpFromNegation(*args, **kwargs)¶
Bases:
PatternWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.negated_existential
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
walk
- negated_existential(negation)¶
- type = typing.Any¶
- class neurolang.logic.transformations.PullUniversalUpFromNegation(*args, **kwargs)¶
Bases:
PatternWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.negated_universal
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
walk
- negated_universal(negation)¶
- type = typing.Any¶
- class neurolang.logic.transformations.PushExistentialsDown(*args, **kwargs)¶
Bases:
PushExistentialsDownMixin,LogicExpressionWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.conjunction
disjunction
dont_push_when_it_can_be_unsafe
nested_existential
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
push_eliminate_trivial_operation
push_existential_down
push_existential_down_disjunction
remove_trivial_existential
walk
walk_constant
walk_function
walk_implication
walk_nary
walk_negation
walk_quantifier
walk_symbol
- type = typing.Any¶
- class neurolang.logic.transformations.PushExistentialsDownMixin(*args, **kwargs)¶
Bases:
CollapseConjunctionsMixin,CollapseDisjunctionsMixin,PatternWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.conjunction
disjunction
dont_push_when_it_can_be_unsafe
nested_existential
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
push_eliminate_trivial_operation
push_existential_down
push_existential_down_disjunction
remove_trivial_existential
walk
- dont_push_when_it_can_be_unsafe(expression)¶
- nested_existential(expression)¶
- push_eliminate_trivial_operation(expression)¶
- push_existential_down(expression)¶
- push_existential_down_disjunction(expression)¶
- remove_trivial_existential(expression)¶
- type = typing.Any¶
- class neurolang.logic.transformations.PushQuantifiersDown(*args, **kwargs)¶
Bases:
RemoveTrivialOperationsMixin,PushExistentialsDownMixin,PushUniversalsDownMixin,LogicExpressionWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.conjunction
disjunction
dont_push_when_it_can_be_unsafe
nested_existential
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
push_eliminate_trivial_operation
push_existential_down
push_existential_down_disjunction
push_universal_down_conjunction
push_universal_down_disjunction
remove_double_negation
remove_single
remove_trivial_existential
remove_trivial_universal
walk
walk_constant
walk_function
walk_implication
walk_nary
walk_negation
walk_quantifier
walk_symbol
- type = typing.Any¶
- class neurolang.logic.transformations.PushUniversalsDown(*args, **kwargs)¶
Bases:
PushUniversalsDownMixin,LogicExpressionWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.conjunction
disjunction
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
push_eliminate_trivial_operation
push_universal_down_conjunction
push_universal_down_disjunction
remove_trivial_universal
walk
walk_constant
walk_function
walk_implication
walk_nary
walk_negation
walk_quantifier
walk_symbol
- type = typing.Any¶
- class neurolang.logic.transformations.PushUniversalsDownMixin(*args, **kwargs)¶
Bases:
CollapseConjunctionsMixin,CollapseDisjunctionsMixin,PatternWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.conjunction
disjunction
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
push_eliminate_trivial_operation
push_universal_down_conjunction
push_universal_down_disjunction
remove_trivial_universal
walk
- push_eliminate_trivial_operation(expression)¶
- push_universal_down_conjunction(expression)¶
- push_universal_down_disjunction(expression)¶
- remove_trivial_universal(expression)¶
- type = typing.Any¶
- class neurolang.logic.transformations.RemoveDuplicatedConjunctsDisjuncts(*args, **kwargs)¶
Bases:
LogicExpressionWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.conjunction
disjunction
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
walk
walk_constant
walk_function
walk_implication
walk_nary
walk_negation
walk_quantifier
walk_symbol
- conjunction(conjunction: Conjunction) Conjunction¶
- disjunction(disjunction: Disjunction) Disjunction¶
- type = typing.Any¶
- class neurolang.logic.transformations.RemoveExistentialOnVariables(variables_to_eliminate)¶
Bases:
LogicExpressionWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.existential
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
walk
walk_constant
walk_function
walk_implication
walk_nary
walk_negation
walk_quantifier
walk_symbol
- existential(expression)¶
- type = typing.Any¶
- class neurolang.logic.transformations.RemoveExistentialPredicates(*args, **kwargs)¶
Bases:
LogicExpressionWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.existential_predicate
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
walk
walk_constant
walk_function
walk_implication
walk_nary
walk_negation
walk_quantifier
walk_symbol
- existential_predicate(existential_predicate)¶
- type = typing.Any¶
- class neurolang.logic.transformations.RemoveTrivialOperations(*args, **kwargs)¶
Bases:
RemoveTrivialOperationsMixin,LogicExpressionWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
remove_double_negation
remove_single
walk
walk_constant
walk_function
walk_implication
walk_nary
walk_negation
walk_quantifier
walk_symbol
- type = typing.Any¶
- class neurolang.logic.transformations.RemoveTrivialOperationsMixin(*args, **kwargs)¶
Bases:
PatternWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
remove_double_negation
remove_single
walk
- remove_double_negation(expression)¶
- remove_single(expression)¶
- type = typing.Any¶
- class neurolang.logic.transformations.RemoveUniversalPredicates(*args, **kwargs)¶
Bases:
LogicExpressionWalkerChanges the universal predicates by equivalent expressions using existential quantifiers.
- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
universal
walk
walk_constant
walk_function
walk_implication
walk_nary
walk_negation
walk_quantifier
walk_symbol
- type = typing.Any¶
- universal(expression)¶
- class neurolang.logic.transformations.ReplaceFreeSymbolWalker(symbol_replacements)¶
Bases:
ReplaceSymbolWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
process_expression
process_iterable_argument
replace_free_variable
stop_if_bound
walk
- stop_if_bound(expression)¶
- type = typing.Any¶
- class neurolang.logic.transformations.UsedQuantifiers(*args, **kwargs)¶
Bases:
PatternWalker- Attributes:
patternsProperty 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
Trueifpatternmatchesexpression.conjunction
disjunction
function
implication
negation
pattern_match_expression
pattern_match_expression_parameters
pattern_match_expression_tuple
pattern_match_tuple
quantifier
symbol
walk
- conjunction(exp)¶
- disjunction(exp)¶
- function(exp)¶
- implication(exp)¶
- negation(exp)¶
- quantifier(exp)¶
- symbol(exp)¶
- type = typing.Any¶
- neurolang.logic.transformations.convert_to_pnf_with_cnf_matrix(expression)¶
- neurolang.logic.transformations.convert_to_pnf_with_dnf_matrix(expression)¶