3

I open a SWI-Prolog through terminal with Swipl -s prolog_file . However, each time I add new facts to the Prolog source file and save, I have to restart SWI-Prolog on terminal to make it notice the changes.

I thought using CTRL + s on the Prolog source file is enough to let SWI-Prolog notice the changes but it doesn't.

On windows there is a Prolog editor with compile button, when you compile the file, SWI-Prolog will notice the changes, but I'm using Kali Linux, so I'm writing on text editor.

How can I make SWI-Prolog notice the changes ?

peter.cyc
  • 1,763
  • 1
  • 12
  • 19
zyydoosh
  • 387
  • 2
  • 14
  • 2
    When you get the `?-` prompt, type `make.` – false Mar 08 '20 at 21:35
  • 1
    See also "[Reloading files, active code and threads](https://www.swi-prolog.org/pldoc/man?section=loadrunningcode)". Having lived for 15 years with pathetic Java Classloader problems, I find this amazing. It's also very non-logical and one immediately wonders whether predicates are re-versioned in transactions. – David Tonhofer Mar 09 '20 at 13:26
  • 1
    When someone post an answer that is acceptable it is polite to accept the answer by clicking on the check mark next to the up down triangles for the answer. – Guy Coder Mar 10 '20 at 15:35

1 Answers1

5

When you get the ?- prompt, type make.

This is a built-in in SWI, it can be simulated in SICStus.

For complex projects including a lot of preprocessing and modules this feature may not work.

false
  • 10,264
  • 13
  • 101
  • 209
  • 1
    ECliPSe and YAP also provide a `make/0` predicate. Logtalk provides a portable `make` tool that can be used with most Prolog systems. – Paulo Moura Mar 09 '20 at 18:56