]> Repositorios git - scryer-prolog.git/commitdiff
DOC: Development environment recommendations.
authorMarkus Triska <[email protected]>
Thu, 1 Oct 2020 19:15:40 +0000 (21:15 +0200)
committerMarkus Triska <[email protected]>
Thu, 1 Oct 2020 19:15:40 +0000 (21:15 +0200)
README.md

index 12a4874f95b857baf3e7140e60261b7266afbded..cf7c729ef64691b76a0cfa2b2a9d1554368f7e14 100644 (file)
--- a/README.md
+++ b/README.md
@@ -516,3 +516,35 @@ For example, a sensible starting point for `~/.scryerrc` is:
 :- use_module(library(dcgs)).
 :- use_module(library(reif)).
 ```
+
+### Development environment
+
+To write and edit Prolog programs, we recommend
+[GNU&nbsp;Emacs](https://www.gnu.org/software/emacs/) with the
+[Prolog&nbsp;mode](https://bruda.ca/emacs/prolog_mode_for_emacs)
+maintained by Stefan Bruda.
+
+Use [ediprolog](https://www.metalevel.at/ediprolog/) to consult
+Prolog&nbsp;code and evaluate Prolog queries in arbitrary
+Emacs&nbsp;buffers.
+
+Emacs definitions that show Prolog terms as trees are currently being
+developed and discussed in
+issue&nbsp;[#697](https://github.com/mthom/scryer-prolog/issues/697),
+and we welcome your comments.
+
+To *debug* Prolog code, we recommend the predicates from
+[**`library(debug)`**](src/lib/debug.pl), most notably:
+
+- `(*)/1` to *"generalize&nbsp;away"* a Prolog goal. Use it to debug
+  unexpected failures by generalizing your definitions until they
+  succeed. Simply place&nbsp;`*` in front of a goal to generalize it away.
+- `($)/1` to emit a *trace* of the execution, showing when a goal
+  is invoked, and when it has succeeded. Place&nbsp;`$` in front of a goal
+  to emit this information for that goal.
+
+This way of debugging Prolog code has several major benefits, such as:
+It stays close to the actual Prolog code under consideration, it does
+not need additional tools and formalisms for its application, and
+further, it encourages declarative reasoning that can in principle
+also be performed automatically.