clpfd.pl - SWI-Prolog
401 n_factorial(N, F) :- 402 N #> 0, 403 N1 #= N - 1, 404 n_factorial(N1, F1), 405 F #= N * F1. 406 == 407 408 This program uses CLP(FD) constraints _instead_ of low-level 409 arithmetic throughout, and everything that _would have worked_ with 410 low-level arithmetic _also_ works with CLP(FD) constraints, retaining 411 roughly the same ...