def analyze_exp_with_user_def_func_diff_sizes( self, template: Expression, template_conditions: List, expression: Expression, analysis: MatchAnalysisReport) -> MatchAnalysisReport: if template.children_amount() >= expression.children_amount(): return self.build_match_analysis_report(False, analysis, template, template_conditions, expression) possible_expression_children = expression.get_children_with_size( template.children_amount()) for children in possible_expression_children: if template.is_commutative(): new_analysis = self.analyze_commutative_children_eq_len( template.get_children(), template_conditions, children, analysis) else: new_analysis = self.analyze_children_non_commutative_eq_len( template.get_children(), template_conditions, children, analysis) if new_analysis.expression_match_template: return new_analysis return self.build_match_analysis_report(False, analysis, template, template_conditions, expression)
def analyze_exp_with_user_def_func_eq_sizes( self, template: Expression, template_conditions: List, expression: Expression, analysis: MatchAnalysisReport) -> MatchAnalysisReport: if template.compare_func(expression): if template.is_commutative(): return self.analyze_commutative_children_eq_len( template.get_children(), template_conditions, expression.get_children(), analysis) else: return self.analyze_children_non_commutative_eq_len( template, template_conditions, expression, analysis)