From 561874f8fa0b0bb3fc04e1e16d8601e53fab1902 Mon Sep 17 00:00:00 2001 From: "B. Bergeron" Date: Tue, 25 Mar 2025 01:17:02 -0400 Subject: Initial commit --- README | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 README (limited to 'README') diff --git a/README b/README new file mode 100644 index 0000000..177543a --- /dev/null +++ b/README @@ -0,0 +1,42 @@ +uswipl - dumbed-Down SWI-Prolog REPL +==================================== +uswipl is a dumbed-down, IPC-friendly Prolog REPL built on top of SWI-Prolog. + +Requirements +------------ +To build uswipl, you need SWI-Prolog installed. + +Installation +------------ +Enter the following command to build uswipl: + + make uswipl + +Running uswipl +-------------- +uswipl takes the same arguments as `swipl(1)`, it's REPL only allows two types +of interactions: + +1. Assertions, which are done by entering an exclamation mark followed by a + term, e.g.: + + !a :- b + +2. Queries on unary predicates, which are done by entering a question mark + followed by a predicate name. uswipl will then proceed to print each result + for that predicate, one per line. e.g.: + + ?mypred + +uswipl will terminate on error, misinput, upon receiving a signal, or when +reading EOF from stdin. + +Ok, but why? +------------ +Because (SWI/GNU) Prolog is awesome but a pain to call from other languages. The C API is +what it is, and the REPL doesn't seem to have been built with IPC in mind. + +You can start uswipl from any other programming language, provide an init `-f` +or a state `-x` file containing your main Prolog logic, and, through a few +queries and assertions, be done with gluing your software together. + -- cgit v1.2.3