Logic with numbers

73 Views Asked by At

In SWI-Prolog, I can write that

:- use_module(library(clpfd)).

and(A,B):- A , B.

And I get:

?- and((X #= 4), (X #> 3)).
X = 4.

?- and((X #= 4), (X #< 3)).
false.

?- and((X #< 4), (X #> 3)).
false.

?- and((X #< 5), (X #> 3)).
X = 4.

?- and((X #< 5), (X #< 3)).
X in inf..2.

Is it possible to write that in Rust using std::cmp ? For now, I'll settle for the answer true, false, without instantiating the X variable. Thank you for any tip.

0

There are 0 best solutions below