A.9.17.5 Reification predicates
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • The SWI-Prolog library
        • library(clpfd): CLP(FD): Constraint Logic Programming over Finite Domains
          • CLP(FD) predicate index
            • Reification predicates
              • #\/1
              • #<==>/2
              • #==>/2
              • #<==/2
              • #/\/2
              • #\//2
              • #\/2
              • zcompare/3
    • Packages
?P #\/ ?Q
P or Q holds. See reification (section A.9.12).

For example, the sum of natural numbers below 1000 that are multiples of 3 or 5:

?- findall(N, (N mod 3 #= 0 #\/ N mod 5 #= 0, N in 0..999,
               indomain(N)),
           Ns),
   sum(Ns, #=, Sum).
Ns = [0, 3, 5, 6, 9, 10, 12, 15, 18|...],
Sum = 233168.