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
1
vote
1 answer

create_mutable/2 in SICStus Prolog

The SICStus Prolog manual page on mutable terms states that: [...] the effect of unifying two mutables is undefined. Then, why does create_mutable(data,x) fail? Shouldn't that rather raise an uninstantiation_error? I cannot think of a situation…
repeat
  • 18,496
  • 4
  • 54
  • 166
1
vote
0 answers

Layouting Prolog terms

One of my art projects is about visual aspects of Prolog terms. My current focus is on alignment / padding—not on syntactic variations1. Let's assume I have something like write_tokens.... Between which tokens may I insert additional whitespace…
repeat
  • 18,496
  • 4
  • 54
  • 166
1
vote
1 answer

Space / time requirements for ISO-Prolog processor compliance

All implementations of the functional programming language scheme are required to perform tail-call-optimization whenever it is applicable. Does iso-prolog have this one and / or similar requirements? It's clear to me that Prolog processor features…
repeat
  • 18,496
  • 4
  • 54
  • 166
1
vote
1 answer

precedence of negation in SWI prolog

Here is quote from from Blackburn and Bos book "Representation and Inference for Natural Language". :- op(900,yfx,>). % implication :- op(850,yfx,v). % disjunction :- op(800,yfx,&). % conjunction :- op(750, fy,-). % negation As expected negation…
user1700890
  • 7,144
  • 18
  • 87
  • 183
1
vote
0 answers

Semantic difference between one rule where conditions are seperated with ';' (or) and rules written down seperatly

Let b, c and d be facts or rules x(A) :- b(A);c(A);d(A) vs x(A) :- b(A) x(A) :- c(A) x(A) :- d(A) Is there a difference in semantics between the two definition of the rule x ? In my opinion I believe they are the same, because every rule of x can…
1
vote
3 answers

Escaped Characters Outside the Basic Multilingual Plane (BMP) in Prolog

For reference, I'm using Prolog v7.4.2 on Windows 10, 64-bit Entering the following code in the REPL: write("\U0001D7F6"). % Mathematical Monospace Digit Zero gives me this error in the output: ERROR: Syntax error: Illegal character code ERROR:…
junius
  • 570
  • 3
  • 14
1
vote
1 answer

ISO error classification for multiple definition in Prolog DSL

I'm building a DSL that uses names for procedures (essentially) that must be unique. It's unclear what sort of error term to use to represent a second definition. existence_error sorta kinda fits, but I'm uncomfortable with it. It seems to imply…
Anniepoo
  • 2,152
  • 17
  • 17
1
vote
1 answer

How can I write key-value pairs in Prolog?

Imagine I have the following predicate, which states that the ID loc1 designates a location. isLocation('loc1', 'Location 1'). I want to provide translations for the second text (Location 1), i. e. key-value pairs such as en='Location 1', de='Ort…
Glory to Russia
  • 17,289
  • 56
  • 182
  • 325
1
vote
1 answer

Why was the ISO module standard for prolog a failure?

In the introduction here, it states that the ISO module standard for Prolog was a failure. Can anyone elaborate on this?
SDG
  • 2,260
  • 8
  • 35
  • 77
1
vote
3 answers

Limiting variable scope in prolog

I want to declare a list of lists, like so: %% example 1 Xs = [ [[A],[[A]]], [[A],[[A],[A]]], [[A],[[A],[A],[A]]] ]. Here, the symbol A refers to the same variable in each list. Executing maplist(writeln,xs) results in the following…
S0rin
  • 1,283
  • 1
  • 10
  • 22
1
vote
2 answers

Prolog - How do I catch an error of incorrect arity?

Not sure if the question is worded correctly or not, my apologies. Basically what I want to do is create some kind of error handling in Prolog. For example: fruit(apple, pear). Now if the user were to query: ?- fruit(X). How would I inform the…
1
vote
1 answer

SICStus Prolog atom to string

I need to convert a Prolog atom to an integer. For example: ?- convert('123', X). X = 123 yes I have seen some SO answers about that, but they rely on SWI-Prolog, and I am forced to use SICStus Prolog. Casting to string will also do the job, as I…
sygi
  • 4,557
  • 2
  • 32
  • 54
1
vote
1 answer

prolog program to check whether a given input is digit or uppercase or lowercase

I have used the following logic for above program but it gives error showing >=/2: Arithmetic: 'a/0' is not a function. What should i do to correct the program? digit(X):- X>=0,X<10,write('input is digit'). uppercase(X):- X>='A',X<'[',write('input…
raj
  • 57
  • 11
1
vote
3 answers

Recursive Function with If-Else Statements in Prolog

I'm trying to write a recursive function in prolog that computes R = (2*X + Y)^N without using the exponent operator. I've written a recursive function with if-else statements and I get the error: ) or operator expected. It looks to me like I have…
aclark
  • 219
  • 1
  • 4
  • 13
0
votes
2 answers

What is the meaning of predicate "simple/1" in Prolog (SWI-Prolog)

I run into problem while reading a book. I see a program use predicate "simple" ( I guess simple/1 ). I don't know what is the meaning of this predicate, I can't find it with ?-help(simple) in the console. But when I tried with some queries in…
toantran
  • 1,789
  • 17
  • 25
1 2 3
9
10