A.10 library(clpqr): Constraint Logic Programming over Rationals and Reals
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • The SWI-Prolog library
        • library(clpqr): Constraint Logic Programming over Rationals and Reals
          • Solver predicates
          • Syntax of the predicate arguments
          • Use of unification
          • Non-linear constraints
          • Status and known problems
    • Packages

A.10.3 Use of unification

Instead of using the {}/1 predicate, you can also use the standard unification mechanism to store constraints. The following code samples are equivalent:

  • Unification with a variable
    {X =:= Y}
    {X = Y}
    X = Y

  • Unification with a number
    {X =:= 5.0}
    {X = 5.0}
    X = 5.0