Questions tagged [iso-prolog]

ISO/IEC has standardized Prolog. The standard is maintained by ISO/IEC JTC1/SC22/WG17.

ISO/IEC has standardized Prolog. The standard is maintained by ISO/IEC JTC1/SC22/WG17.

The currently valid Prolog standard documents can be obtained from national member bodies like ANSI or directly from ISO. Overview of defined features.

Stack Overflow contributions about the standard documents:

143 questions
13
votes
1 answer

Test that term is a list of distinct variables

What is the most compact and canonical way in ISO Prolog to test for a list of distinct variables? Let's call this meta-logical predicate is_varset/1. So it should succeed if its argument is a list of variables that are all different. Note that a…
false
  • 10,264
  • 13
  • 101
  • 209
13
votes
1 answer

What are the best Prolog programming practices and style guidelines?

OK, I know that this is very general question and that there were written some papers on the subject, but I have a feeling that these publications cover very basic material and I'm looking for something more advanced which would improve style and…
Grzegorz Adam Kowalski
  • 5,243
  • 3
  • 29
  • 40
12
votes
4 answers

What is the Prolog operator `^` ("caret")?

What is the Prolog operator ^ ? Looking at The Prolog Built-in Directive op gives a list of the built-in operators. I see ** is exponentiation /\ is or but what is ^ ? Each of the three current answers are of value and I learned something: …
Guy Coder
  • 24,501
  • 8
  • 71
  • 136
11
votes
3 answers

Space-efficient reading of chars in canonical form

When using chars (lists of characters, thus atoms of length one) to represent text, we have the following options for writing them within terms: "First," the double quoted list notation (6.3.7) is the most efficient one, requiring at least n+2…
false
  • 10,264
  • 13
  • 101
  • 209
11
votes
1 answer

Which meanings of "type" are used in the standard?

In part one of the ISO standard for Prolog, ISO/IEC 13211-1:1995, the notion of "type" is used to refer to different things. This often leads to confusion. For example, a page called IsoErrata (archived version, source) states (note that this page…
false
  • 10,264
  • 13
  • 101
  • 209
9
votes
3 answers

What does [a|b|c] evaluate to in SWI-Prolog?

The pipe operator in prolog returns one or more atomic Heads and a Tail list. ?- [a,b,c] = [a,b|[c]]. true. Nesting multiple pipes in a single match can be done similar to this: ?- [a,b,c] = [a|[b|[c]]]. true. What does the statement [a|b|c] infer…
Ambrose
  • 1,220
  • 12
  • 18
9
votes
1 answer

A searchable Prolog language description online

Is there a description of Prolog language (syntax and semantics) available online? There are a lot of reference manuals for implementations. But neither of those is a language description. For example the SWI Prolog manual states This manual does…
Alexander Gorshenev
  • 2,769
  • 18
  • 33
8
votes
1 answer

Implementing cut in tracing meta interpreter prolog

I have this tracing meta interpreter, altered from previous question Prolog unbind bound variable. I don't understand how to interpret cut. Thanks to user @false who told me that the cut is badly implemented, my question is, how should I implement…
Đrakenus
  • 540
  • 3
  • 20
8
votes
3 answers

Is there a prolog language grammar/spec?

Is there a prolog language grammar, or something close to it that is generally used as a reference? I am using SWI-prolog, so one for that flavor would be nice to have, otherwise a general prolog language grammar/specification works as well.
Lance
  • 75,200
  • 93
  • 289
  • 503
8
votes
2 answers

Are HiLog terms still useful in modern Prolog?

Are Hilog terms (i.e. compounds having as functors arbitrary terms) still regarded as a powerful feature in XSB Prolog (or any other Prolog) ? Are there many XSB projects currently using this feature ? which of them for example ? I ask since as far…
Sergio
  • 8,532
  • 11
  • 52
  • 94
7
votes
2 answers

Space-efficient writing of functional notation

Writing functional notation is often quite costly in terms of auxiliary space consumption. This is particularly critical for canonical writing of lists. First consider the size of the output: Whereas the usual ignore_ops(false) writing requires at…
false
  • 10,264
  • 13
  • 101
  • 209
7
votes
3 answers

What is the difference between :- and ?- in Prolog?

This Prolog program prints Hello: main :- write('Hello'), nl. :- main. I changed (:-)/1 to (?-)/1: main :- write('Hello'), nl. ?- main. This produces exactly the same result. This also prints Hello. So what's the difference between…
Flux
  • 9,805
  • 5
  • 46
  • 92
7
votes
3 answers

Is this Prolog terminology correct? (fact, rule, procedure, predicate, ...)

Getting the terminology correct is part of the success to communicating a concept and when the wrong terminology is used here at SO with the Prolog tag the respondents nicely point out the mistake. In reading "Clause and Effect - Prolog Programming…
Guy Coder
  • 24,501
  • 8
  • 71
  • 136
7
votes
1 answer

Different results in swi-prolog and yap

The sample program enumerates and counts the number of 8-queen solutions. (sorry if the code is hard to read; this is machine-generated from an S-expression. The original code is…
7
votes
2 answers

Prolog DCG set_prolog_flag double_quotes source code directive location matters; documentation?

I learned the hard way that with SWI-Prolog the location for the Prolog directive set_prolog_flag matters in a source code file. The only documentation I found of value about loading source code files with directives was in Loading Prolog source…
Guy Coder
  • 24,501
  • 8
  • 71
  • 136
1
2
3
9 10