File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,8 +100,8 @@ def _execute_expr(self, data: Rule) -> typing.Iterator[Rule]:
100100 query = data .conclusion
101101 for target in self .pairs :
102102 if unification := target @ query :
103- result = target .ground (unification , scope = "1" )
104- yield _build_term_to_rule (result )
103+ if result : = target .ground (unification , scope = "1" ):
104+ yield _build_term_to_rule (result )
105105
106106 def _execute_fact (self , data : Rule ) -> typing .Iterator [Rule ]:
107107 if len (data ) != 0 :
@@ -116,5 +116,7 @@ def _execute_fact(self, data: Rule) -> typing.Iterator[Rule]:
116116 query = _build_lhs_rhs_to_term (idea , fact )
117117 for target in self .pairs :
118118 if unification := target @ query :
119- result = target .ground (unification , scope = "1" )
120- yield _build_term_to_rule (result .term [2 ])
119+ if result := target .ground (unification , scope = "1" ):
120+ term = result .term
121+ if isinstance (term , Term ):
122+ yield _build_term_to_rule (term [2 ])
Original file line number Diff line number Diff line change 1- def str_rule_get_str_idea (data : str ) -> str :
1+ def str_rule_get_str_idea (data : str ) -> str | None :
22 if not data .startswith ("--" ):
33 return f"----\n { data .splitlines ()[0 ]} \n "
44 return None
You can’t perform that action at this time.
0 commit comments