]> Repositorios git - scryer-prolog.git/commitdiff
modify rightmost_power/2 to ignore module qualification on (^)/2 (#794)
authorMark Thom <[email protected]>
Fri, 5 Feb 2021 03:51:55 +0000 (20:51 -0700)
committerMark Thom <[email protected]>
Fri, 5 Feb 2021 03:51:55 +0000 (20:51 -0700)
src/lib/builtins.pl

index fa3844cb62e2e7bf59666ce243a14e3efcc18e81..889977d290fcd7dacf371bd105714fae0729674a 100644 (file)
@@ -665,8 +665,11 @@ iterate_variants([V-Solution|GroupSolutions], V, Solution) :-
 iterate_variants([_|GroupSolutions], Ws, Solution) :-
     iterate_variants(GroupSolutions, Ws, Solution).
 
+
 rightmost_power(Term, FinalTerm, Xs) :-
-    (  Term = X ^ Y
+    (  (  Term = X ^ Y
+       ;  Term = _ : X ^ Y
+       )
     -> (  var(Y) -> FinalTerm = Y, Xs = [X]
        ;  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) :-
     (  nonvar(Goal),
-       Goal = _ ^ _ ->
+       (  Goal = _ ^ _
+       ;  Goal = _ : (_ ^ _)
+       )  ->
        rightmost_power(Goal, Goal1, ExistentialVars0),
        term_variables(ExistentialVars0, ExistentialVars),
        sort(Witnesses0, Witnesses1),