Avoid dif/1 attribute with empty list

Closes #1956
This commit is contained in:
bakaq
2023-09-21 14:00:37 -03:00
parent cac52c0537
commit cb79e83510
2 changed files with 11 additions and 1 deletions

View File

@@ -35,7 +35,10 @@ vars_remove_goal([], _).
vars_remove_goal([Var|Vars], Goal0) :-
get_atts(Var, +dif(Goals0)),
remove_goal(Goals0, Goal0, Goals),
put_atts(Var, +dif(Goals)),
( Goals = [] ->
put_atts(Var, -dif(_))
; put_atts(Var, +dif(Goals))
),
vars_remove_goal(Vars, Goal0).
reinforce_goal(Goal0, Goal) :-