modify rightmost_power/2 to ignore module qualification on (^)/2 (#794)
This commit is contained in:
@@ -665,8 +665,11 @@ iterate_variants([V-Solution|GroupSolutions], V, Solution) :-
|
|||||||
iterate_variants([_|GroupSolutions], Ws, Solution) :-
|
iterate_variants([_|GroupSolutions], Ws, Solution) :-
|
||||||
iterate_variants(GroupSolutions, Ws, Solution).
|
iterate_variants(GroupSolutions, Ws, Solution).
|
||||||
|
|
||||||
|
|
||||||
rightmost_power(Term, FinalTerm, Xs) :-
|
rightmost_power(Term, FinalTerm, Xs) :-
|
||||||
( Term = X ^ Y
|
( ( Term = X ^ Y
|
||||||
|
; Term = _ : X ^ Y
|
||||||
|
)
|
||||||
-> ( var(Y) -> FinalTerm = Y, Xs = [X]
|
-> ( var(Y) -> FinalTerm = Y, Xs = [X]
|
||||||
; Xs = [X | Xss], rightmost_power(Y, FinalTerm, Xss)
|
; Xs = [X | Xss], rightmost_power(Y, FinalTerm, Xss)
|
||||||
)
|
)
|
||||||
@@ -674,11 +677,11 @@ rightmost_power(Term, FinalTerm, Xs) :-
|
|||||||
).
|
).
|
||||||
|
|
||||||
|
|
||||||
% :- meta_predicate findall_with_existential(?, 0, ?, ?, ?).
|
|
||||||
|
|
||||||
findall_with_existential(Template, Goal, PairedSolutions, Witnesses0, Witnesses) :-
|
findall_with_existential(Template, Goal, PairedSolutions, Witnesses0, Witnesses) :-
|
||||||
( nonvar(Goal),
|
( nonvar(Goal),
|
||||||
Goal = _ ^ _ ->
|
( Goal = _ ^ _
|
||||||
|
; Goal = _ : (_ ^ _)
|
||||||
|
) ->
|
||||||
rightmost_power(Goal, Goal1, ExistentialVars0),
|
rightmost_power(Goal, Goal1, ExistentialVars0),
|
||||||
term_variables(ExistentialVars0, ExistentialVars),
|
term_variables(ExistentialVars0, ExistentialVars),
|
||||||
sort(Witnesses0, Witnesses1),
|
sort(Witnesses0, Witnesses1),
|
||||||
|
|||||||
Reference in New Issue
Block a user