# Predicate

**URL:** https://swi-prolog.discourse.group/c/help/predicate-choice/20.md?page=3

[Latest](https://swi-prolog.discourse.group/latest.md) · [Categories](https://swi-prolog.discourse.group/categories.md) · [Tags](https://swi-prolog.discourse.group/tags.md)

**Page:** 4

---

## ["Steadfast" comparison of terms?](https://swi-prolog.discourse.group/t/steadfast-comparison-of-terms/4560)

<div class="topic-metadata">

**Author:** [@peter.ludemann](https://swi-prolog.discourse.group/u/peter.ludemann)\
**Replies:** 0\
**Last updated:** [October 14, 2021, 11:42pm UTC](https://swi-prolog.discourse.group/t/steadfast-comparison-of-terms/4560 "2021-10-14T23:42:08Z")

</div>

Is there a way of comparing terms that is “steadfast”, in the sense that there doesn’t exist an instantiation of any of the variables that will change the result. For example: X @\< Y % not steadfast if X=2,Y=1 p(…

---

## [Assertz in SWISH](https://swi-prolog.discourse.group/t/assertz-in-swish/4542)

<div class="topic-metadata">

**Author:** [@albangabillon](https://swi-prolog.discourse.group/u/albangabillon)\
**Replies:** 25\
**Last updated:** [October 14, 2021, 9:54am UTC](https://swi-prolog.discourse.group/t/assertz-in-swish/4542 "2021-10-14T09:54:21Z")

</div>

I am using swish assertz/1 does not seem to work. Could you confirm? :- dynamic p/1. ?- assertz(p(a)). true ?- p(a). false

---

## [Rbtrees:rb\_partial\_map/4 definition](https://swi-prolog.discourse.group/t/rbtrees-rb-partial-map-4-definition/4538)

<div class="topic-metadata">

**Author:** [@peter.ludemann](https://swi-prolog.discourse.group/u/peter.ludemann)\
**Replies:** 1\
**Last updated:** [October 10, 2021, 9:00am UTC](https://swi-prolog.discourse.group/t/rbtrees-rb-partial-map-4-definition/4538 "2021-10-10T09:00:34Z")

</div>

The description of rb\_partial\_map/4 is missing something in the sentence " Fails if or if call(G,Val0,ValF) is not satisfiable for all Val0." (Also, I presume this should be “for all Val0 in Keys”) Also, rb\_partial\_map/…

---

## [User defined predicate properties](https://swi-prolog.discourse.group/t/user-defined-predicate-properties/4537)

<div class="topic-metadata">

**Author:** [@swi](https://swi-prolog.discourse.group/u/swi)\
**Replies:** 3\
**Last updated:** [October 10, 2021, 7:19am UTC](https://swi-prolog.discourse.group/t/user-defined-predicate-properties/4537 "2021-10-10T07:19:15Z")

</div>

Is there a way to set a user-defined predicate property? My use case is having a large (and changing) human knowledge base that is expressed using prolog predicates. I would like to be able to attach ‘properties’ to th…

---

## [No permission to call sandboxed from Pengines / NodeRed / Thea](https://swi-prolog.discourse.group/t/no-permission-to-call-sandboxed-from-pengines-nodered-thea/4523)

<div class="topic-metadata">

**Author:** [@ACayley](https://swi-prolog.discourse.group/u/ACayley)\
**Replies:** 0\
**Last updated:** [October 5, 2021, 2:58pm UTC](https://swi-prolog.discourse.group/t/no-permission-to-call-sandboxed-from-pengines-nodered-thea/4523 "2021-10-05T14:58:04Z")

</div>

I am trying to use Pengines in NodeRed to receive a .owl file over MQTT and to load the axioms in Prolog. Ideally, I’d like to have Prolog process the sent file without saving it to the file system, but I don’t see a way…

---

## [Question about assertz](https://swi-prolog.discourse.group/t/question-about-assertz/4452)

<div class="topic-metadata">

**Author:** [@Christophe\_Rey](https://swi-prolog.discourse.group/u/Christophe_Rey)\
**Replies:** 5\
**Last updated:** [September 20, 2021, 7:11am UTC](https://swi-prolog.discourse.group/t/question-about-assertz/4452 "2021-09-20T07:11:59Z")

</div>

Hi Jan, Hi all, I am using SWI version 8.3.29-29-g584873769. My code is the following :- table q/1 as incremental. :- dynamic q2/1 as incremental. :- dynamic q3/1 as incremental. q3(1) :- assertz(q2(1)). q(X) :- q2(X…

---

## [What am I doing wrong with message\_hook/3?](https://swi-prolog.discourse.group/t/what-am-i-doing-wrong-with-message-hook-3/4414)

<div class="topic-metadata">

**Author:** [@avh](https://swi-prolog.discourse.group/u/avh)\
**Replies:** 3\
**Last updated:** [September 13, 2021, 8:19am UTC](https://swi-prolog.discourse.group/t/what-am-i-doing-wrong-with-message-hook-3/4414 "2021-09-13T08:19:56Z")

</div>

message\_hook/3 is supposed to intercept calls to print\_message/2, thus making it possible to do something before executing print\_message. That is how I understand it. But this did not work with me. I have defined a mess…

---

## [Listing/1 predicate](https://swi-prolog.discourse.group/t/listing-1-predicate/4416)

<div class="topic-metadata">

**Author:** [@albangabillon](https://swi-prolog.discourse.group/u/albangabillon)\
**Replies:** 4\
**Last updated:** [September 12, 2021, 9:09pm UTC](https://swi-prolog.discourse.group/t/listing-1-predicate/4416 "2021-09-12T21:09:09Z")

</div>

Hi all, The listing/1 predicate that I regularly use with swi-prolog does not seem to work with swish, neither in program nor in notebook mode: procedure homme’ does not exist (DWIM could not correct goal)\` where homm…

---

## [Byte ordering/conversion predicates?](https://swi-prolog.discourse.group/t/byte-ordering-conversion-predicates/4243)

<div class="topic-metadata">

**Author:** [@dmchurch](https://swi-prolog.discourse.group/u/dmchurch)\
**Replies:** 10\
**Last updated:** [September 5, 2021, 5:36pm UTC](https://swi-prolog.discourse.group/t/byte-ordering-conversion-predicates/4243 "2021-09-05T17:36:45Z")

</div>

Is there any sort of builtin SWI-Prolog functionality for doing bit representation conversion (uint32 ↔ int32, i.e. taking the two’s complement) and or byte-order fixing, like libc’s ntohl and friends? More generally, is…

---

## [Sorry .I am new in prolog one week](https://swi-prolog.discourse.group/t/sorry-i-am-new-in-prolog-one-week/4386)

<div class="topic-metadata">

**Author:** [@gtachta](https://swi-prolog.discourse.group/u/gtachta)\
**Replies:** 1\
**Last updated:** [September 5, 2021, 10:23am UTC](https://swi-prolog.discourse.group/t/sorry-i-am-new-in-prolog-one-week/4386 "2021-09-05T10:23:00Z")

</div>

Sorry.I don’t know here point , must post for this. From documentatiom prolog A.9.7 Example: problem with command distinc of modulo clp(fd) Help I want one example Rows\[Rs1|\],all\_distinct(Rs1), …

---

## [Using prolog\_trace\_interception/4](https://swi-prolog.discourse.group/t/using-prolog-trace-interception-4/4376)

<div class="topic-metadata">

**Author:** [@ridgeworks](https://swi-prolog.discourse.group/u/ridgeworks)\
**Replies:** 5\
**Last updated:** [September 3, 2021, 6:14pm UTC](https://swi-prolog.discourse.group/t/using-prolog-trace-interception-4/4376 "2021-09-03T18:14:45Z")

</div>

I’d like to use prolog\_trace\_interception/4 to construct a custom tracing facility within a module. The documentation suggests this was a dynamic predicate so I was expecting it to work much like the exception/3 hook (mu…

---

## [clpBNR: bug in boolean constraints](https://swi-prolog.discourse.group/t/clpbnr-bug-in-boolean-constraints/4346)

<div class="topic-metadata">

**Author:** [@swi](https://swi-prolog.discourse.group/u/swi)\
**Replies:** 6\
**Last updated:** [August 30, 2021, 8:36pm UTC](https://swi-prolog.discourse.group/t/clpbnr-bug-in-boolean-constraints/4346 "2021-08-30T20:36:46Z")

</div>

Putting this in a new thread to make it easier to find, but please see below for a new bug in the ‘implies’ (-\>) operator. Bug in ~ operator (from other thread) Bug in → operator? 25 ?- { (A == 1) -\> (B == 2, C == 3)…

---

## [clpBNR: integer division](https://swi-prolog.discourse.group/t/clpbnr-integer-division/4330)

<div class="topic-metadata">

**Author:** [@swi](https://swi-prolog.discourse.group/u/swi)\
**Replies:** 16\
**Last updated:** [August 26, 2021, 1:33pm UTC](https://swi-prolog.discourse.group/t/clpbnr-integer-division/4330 "2021-08-26T13:33:14Z")

</div>

@ridgeworks, I’ve searched the documentation to find the operator for integer division (and modulo) in constraints, first I supposed // would work, but it doesn’t: 64 ?- \[A,B,C\]::integer, { A == B // C }. % Add {\_3184{…

---

## ['Resetting' consulted files with JPL](https://swi-prolog.discourse.group/t/resetting-consulted-files-with-jpl/4320)

<div class="topic-metadata">

**Author:** [@CobraJD](https://swi-prolog.discourse.group/u/CobraJD)\
**Replies:** 2\
**Last updated:** [August 20, 2021, 1:05pm UTC](https://swi-prolog.discourse.group/t/resetting-consulted-files-with-jpl/4320 "2021-08-20T13:05:38Z")

</div>

Hey there. This is my very first experience using Prolog, and I’m doing so through JPL. To summarize what I’m trying to achieve, I want to be able to swap between using different source files with regularity due to the n…

---

## [Either misunderstanding or bug. When load\_files/2 with no imports used with load\_test\_files/1](https://swi-prolog.discourse.group/t/either-misunderstanding-or-bug-when-load-files-2-with-no-imports-used-with-load-test-files-1/4293)

<div class="topic-metadata">

**Author:** [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Replies:** 0\
**Last updated:** [August 15, 2021, 3:13pm UTC](https://swi-prolog.discourse.group/t/either-misunderstanding-or-bug-when-load-files-2-with-no-imports-used-with-load-test-files-1/4293 "2021-08-15T15:13:01Z")

</div>

Currently running SWI-Prolog (threaded, 64 bits, version 8.3.28-20-g6f8a68f2b) Problem: Using load\_files/2 with the option imports(\[\]) and directive :- load\_test\_files(\[\]). and predicate of same name in loaded file. w…

---

## [How to use the get/2 dictionary function?](https://swi-prolog.discourse.group/t/how-to-use-the-get-2-dictionary-function/4274)

<div class="topic-metadata">

**Author:** [@Ataraxia](https://swi-prolog.discourse.group/u/Ataraxia)\
**Replies:** 10\
**Last updated:** [August 10, 2021, 5:23pm UTC](https://swi-prolog.discourse.group/t/how-to-use-the-get-2-dictionary-function/4274 "2021-08-10T17:23:47Z")

</div>

Greetings, and while there are quite a threads from users asking about dicts already, it’d be nice to get a neat answer to this very specific question for anyone who turns up here from Google. I’m sure I can’t be the onl…

---

## [How can I calculate execution time of program in milliseconds in prolog?](https://swi-prolog.discourse.group/t/how-can-i-calculate-execution-time-of-program-in-milliseconds-in-prolog/4270)

<div class="topic-metadata">

**Author:** [@rohamfarahani](https://swi-prolog.discourse.group/u/rohamfarahani)\
**Replies:** 8\
**Last updated:** [August 10, 2021, 1:55pm UTC](https://swi-prolog.discourse.group/t/how-can-i-calculate-execution-time-of-program-in-milliseconds-in-prolog/4270 "2021-08-10T13:55:04Z")

</div>

I need to calculate the execution time of pro log program, because I searching in 4500 rules in a knowledge base. I found the following source code but I don’t know , what can set the input parameters for example TimeSi…

---

## [Any way to get listing/1 to show just the predicates in a given module?](https://swi-prolog.discourse.group/t/any-way-to-get-listing-1-to-show-just-the-predicates-in-a-given-module/4250)

<div class="topic-metadata">

**Author:** [@dmchurch](https://swi-prolog.discourse.group/u/dmchurch)\
**Replies:** 2\
**Last updated:** [August 5, 2021, 1:57am UTC](https://swi-prolog.discourse.group/t/any-way-to-get-listing-1-to-show-just-the-predicates-in-a-given-module/4250 "2021-08-05T01:57:24Z")

</div>

If I issue a ?- listing(mymodule:\_). it will give me a listing of all predicates accessible from that module’s context, including imports, not just those that actually belong to that module. Is there a way to just list…

---

## [Regression with concurrent\_maplist/3 in 8.3.27?](https://swi-prolog.discourse.group/t/regression-with-concurrent-maplist-3-in-8-3-27/4218)

<div class="topic-metadata">

**Author:** [@remy.s](https://swi-prolog.discourse.group/u/remy.s)\
**Replies:** 3\
**Last updated:** [August 1, 2021, 11:24am UTC](https://swi-prolog.discourse.group/t/regression-with-concurrent-maplist-3-in-8-3-27/4218 "2021-08-01T11:24:50Z")

</div>

On my mac (10.15.7 - Catalina) running Swi-Prolog (8.3.27), I have a problem with concurrent\_maplist/3 not terminating even after 12 hours of processing cache(Cache, U):- phrase(inventory, L) % , maplist(file\_index, L…

---

## [Copy\_term but without maintaining variable relationships?](https://swi-prolog.discourse.group/t/copy-term-but-without-maintaining-variable-relationships/4204)

<div class="topic-metadata">

**Author:** [@dmchurch](https://swi-prolog.discourse.group/u/dmchurch)\
**Replies:** 10\
**Last updated:** [July 28, 2021, 1:53pm UTC](https://swi-prolog.discourse.group/t/copy-term-but-without-maintaining-variable-relationships/4204 "2021-07-28T13:53:11Z")

</div>

Is there any predicate for making a copy of a compound term and un-unifying any unified variables, so that the resulting term has only singletons? In other words, is there something like a copy\_to\_singletons/2 that woul…

---

## [Why no if-but-not-else construct?](https://swi-prolog.discourse.group/t/why-no-if-but-not-else-construct/4149)

<div class="topic-metadata">

**Author:** [@dmchurch](https://swi-prolog.discourse.group/u/dmchurch)\
**Replies:** 7\
**Last updated:** [July 14, 2021, 3:16pm UTC](https://swi-prolog.discourse.group/t/why-no-if-but-not-else-construct/4149 "2021-07-14T15:16:35Z")

</div>

I often find myself using the (P -\> Q; true) formulation, when I need to do an extra check or take an extra action but only when a certain precondition is true; when it isn’t, the clause can proceed as it would otherwise…

---

## [Term\_attvars/2 vs call\_residue\_vars/2](https://swi-prolog.discourse.group/t/term-attvars-2-vs-call-residue-vars-2/4125)

<div class="topic-metadata">

**Author:** [@peter.ludemann](https://swi-prolog.discourse.group/u/peter.ludemann)\
**Replies:** 6\
**Last updated:** [July 10, 2021, 7:18pm UTC](https://swi-prolog.discourse.group/t/term-attvars-2-vs-call-residue-vars-2/4125 "2021-07-10T19:18:20Z")

</div>

I have some code that uses when/2 to allow “bi-directional” predicates. When the computation is finished, there shouldn’t be an “frozen” goals, so I do something like this (the actual code is more complex, but I think th…

---

## [Del\_dict/4 behaviour and dict iteration](https://swi-prolog.discourse.group/t/del-dict-4-behaviour-and-dict-iteration/4135)

<div class="topic-metadata">

**Author:** [@oskardrums](https://swi-prolog.discourse.group/u/oskardrums)\
**Replies:** 5\
**Last updated:** [July 3, 2021, 10:22pm UTC](https://swi-prolog.discourse.group/t/del-dict-4-behaviour-and-dict-iteration/4135 "2021-07-03T22:22:17Z")

</div>

Hey all, I want to iterate over a possibly nested dict and apply some transformation on it’s atomic members, so I tried something along these lines: transformed(D0, D) :- del\_dict(Key, D0, Value0, D1), ( atomic…

---

## [SWI-Prolog (snap version) connecting to sqlite3 database via ODBC DSN](https://swi-prolog.discourse.group/t/swi-prolog-snap-version-connecting-to-sqlite3-database-via-odbc-dsn/4108)

<div class="topic-metadata">

**Author:** [@SteveMoyle](https://swi-prolog.discourse.group/u/SteveMoyle)\
**Replies:** 8\
**Last updated:** [June 27, 2021, 4:03pm UTC](https://swi-prolog.discourse.group/t/swi-prolog-snap-version-connecting-to-sqlite3-database-via-odbc-dsn/4108 "2021-06-27T16:03:06Z")

</div>

I am working to connect to a database hosted by a cloud provider in SWI-Prolog. The cloud database can be accessed over ODBC. Having worked with databases and ODBC connections for decades I was not expecting it to be a…

---

## [Reverse/2 why related to a reverse/4 in spite of a reverse/3?](https://swi-prolog.discourse.group/t/reverse-2-why-related-to-a-reverse-4-in-spite-of-a-reverse-3/4085)

<div class="topic-metadata">

**Author:** [@Wisermans](https://swi-prolog.discourse.group/u/Wisermans)\
**Replies:** 2\
**Last updated:** [June 17, 2021, 6:34am UTC](https://swi-prolog.discourse.group/t/reverse-2-why-related-to-a-reverse-4-in-spite-of-a-reverse-3/4085 "2021-06-17T06:34:27Z")

</div>

Looking at reverse/2 and its related predicates, i was wondering why it is reverse/4 in the SWI Prolog library in spite of reverse/3 in Learning Prolog Now … anybody to explain it ?

---

## [Grabbing data from a web page](https://swi-prolog.discourse.group/t/grabbing-data-from-a-web-page/4062)

<div class="topic-metadata">

**Author:** [@Wisermans](https://swi-prolog.discourse.group/u/Wisermans)\
**Replies:** 7\
**Last updated:** [June 14, 2021, 7:49pm UTC](https://swi-prolog.discourse.group/t/grabbing-data-from-a-web-page/4062 "2021-06-14T19:49:00Z")

</div>

Hello i’m playing with xpath/3 which works fine for example on data.un.org but it seems that what i see with F12 on Edge can’t be grabbed the same way on a page like ACCOR € 34.94 (euronext.com). How can i get for exampl…

---

## [Windows DDE is dead so what's next ? which solutions?](https://swi-prolog.discourse.group/t/windows-dde-is-dead-so-whats-next-which-solutions/4065)

<div class="topic-metadata">

**Author:** [@Wisermans](https://swi-prolog.discourse.group/u/Wisermans)\
**Replies:** 0\
**Last updated:** [June 12, 2021, 6:04pm UTC](https://swi-prolog.discourse.group/t/windows-dde-is-dead-so-whats-next-which-solutions/4065 "2021-06-12T18:04:47Z")

</div>

There is (was) a great easy way to request Excel or so with DDE, simple and useful but DDE has been closed (disabled by default) by Microsoft because it had been for years the open door to viruses injection … Once said 2…

---

## [Need Help UnderStanding the Code](https://swi-prolog.discourse.group/t/need-help-understanding-the-code/2941)

<div class="topic-metadata">

**Author:** [@usama](https://swi-prolog.discourse.group/u/usama)\
**Replies:** 6\
**Last updated:** [June 7, 2021, 6:16pm UTC](https://swi-prolog.discourse.group/t/need-help-understanding-the-code/2941 "2021-06-07T18:16:53Z")

</div>

who(\[H|T\], B) :- member(H, B), !, who(T, B). who(\[\_|\_\], \_). I want to understand this code I am new to learn Prolog

---

## [Http\_post/3 - How do I avoid sending current cookies during a request?](https://swi-prolog.discourse.group/t/http-post-3-how-do-i-avoid-sending-current-cookies-during-a-request/3968)

<div class="topic-metadata">

**Author:** [@logicmoo](https://swi-prolog.discourse.group/u/logicmoo)\
**Replies:** 4\
**Last updated:** [May 22, 2021, 12:24am UTC](https://swi-prolog.discourse.group/t/http-post-3-how-do-i-avoid-sending-current-cookies-during-a-request/3968 "2021-05-22T00:24:31Z")

</div>

I need help using the http\_post/3 in SWI 8.3.24 I am talking to a httpd server who didnt seem to acct for multiple post variables wget --post-data 'The quick brown fox jumped over the lazy dog.' 'localhost:9000/?prope…

---

## [Merge two predicates in one](https://swi-prolog.discourse.group/t/merge-two-predicates-in-one/3971)

<div class="topic-metadata">

**Author:** [@kh007i](https://swi-prolog.discourse.group/u/kh007i)\
**Replies:** 3\
**Last updated:** [May 20, 2021, 1:58pm UTC](https://swi-prolog.discourse.group/t/merge-two-predicates-in-one/3971 "2021-05-20T13:58:49Z")

</div>

I am a beginner at prolog and required to write a predicate path(Start, Dest, Path) for metro stations application using backtracking. Given some facts: connected(x,y) describing the connected stations, I managed to do t…

[Previous page](https://swi-prolog.discourse.group/c/help/predicate-choice/20.md?page=2)

[Next page](https://swi-prolog.discourse.group/c/help/predicate-choice/20.md?page=4)
