neurolang.logic.transformations module¶
- class neurolang.logic.transformations.CheckConjunctiveQueryWithNegation(*args, **kwargs)¶
Bases:
LogicExpressionWalker
- 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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
LogicExpressionWalker
Replaces each quantified variale to a fresh one.
- 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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
LogicExpressionWalker
Removes the implication ocurrences of an expression.
- 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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
LogicExpressionWalker
Walk a logic expression verifying that it is only in FO Neg Existential.
- 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
ifpattern
matchesexpression
.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:
PatternWalker
Factor quantifiers up on conjunctions and disjunctions.
- 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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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
,FONegELogicExpression
Moves 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:
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
ifpattern
matchesexpression
.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
,PatternWalker
Moves the negations the furthest possible to the atoms. Assumes that there are no implications in the expression.
- 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
ifpattern
matchesexpression
.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:
PatternWalker
Moves the negations the furthest possible to the atoms. On conjunction, disjunction, and negation operations.
- 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
ifpattern
matchesexpression
.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
,LogicExpressionWalker
Moves 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:
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
ifpattern
matchesexpression
.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
,FONegELogicExpression
Moves 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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
LogicExpressionWalker
Changes the universal predicates by equivalent expressions using existential quantifiers.
- 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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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:
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
ifpattern
matchesexpression
.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)¶