News for hackers. Stuff that matters.
Re:Prolog at Work by yakubin on Saturday December 31, 2022 @10:31AM (#34197254)
As a newbie, I don't know how to enable arithmetic (e.g. #=). gprolog has it enabled by default, so it's easier to get started.
Re:Prolog at Work by Avshalom on Saturday December 31, 2022 @11:17AM (#34197779)
You need to import the constraint logic module.

  :- use_module(library(clpfd)).
Goes at the top of the file (leave off the :- if you're in the repl).

The arithmetic built in to prolog is traditionally of the form

  A is 1+2,
  B is A+3,
  ... etc.
Re:Prolog at Work by rabbits77 on Sunday January 01, 2023 @09:35PM (#34213578)
GNU Prolog is an excellent choice for everybody. I once considered switching back and forth to SWI if I ever needed some convenient module GNU lacks. The need never really arose!