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
0
votes
3 answers

Parsing from char to digit Prolog

I have the following: is_digit(X):-char_type(X,digit). When I call it like this: is_digit(X). I get the folloring results: X='0'; X='1'; ... ; X='9' I need to get those same results but without the quotes. Excuse me if it is a simple…
Soph
  • 2,895
  • 5
  • 37
  • 68
0
votes
1 answer

How to emulate ulp/1 evaluable function in Prolog

I find myself using the Java function Math.ulp() from time to time. It has an implementation based on unpacking a float number, and doing some bit shuffling. How would one bootstrap ulp() from ISO core standard arithmetic functions only in Prolog?…
Rúben Dias
  • 336
  • 2
  • 9
0
votes
1 answer

prolog atom concat swi and yap prolog

input : run([p(X,Y,Z),h(Z,P,Q)],Out). code: :- ensure_loaded(library(lists)). run([X|Y],Out) :- X =.. [Fct|Args], X =..Total, length(Args,L), concat(abs_,L,Fct_A), Out =.. [Fct_A|Total]. on swi prolog i get the right answer: A =…
FrankTan
  • 1,626
  • 6
  • 28
  • 63
0
votes
1 answer

Get index of a Term's argument in Prolog

I need to get the index of a term's argument in Prolog. Predicate arg/3 seems to do the opposite of what I need: arg(Index, Term, Value). arg/3 fails if Index is a variable, so it's not possible to get the index of a given value and term. You guys…
0
votes
0 answers

WARNING: The predicate =/2 is unknown

I'm trying to transfer a file written for SICStus Prolog into TuProlog. I get the error message: WARNING: The predicate =/2 is unknown. (The code works in SICStus, but not in TuProlog). What should I use instead of =/2 for TuProlog? What is the…
hassapikos
  • 59
  • 1
  • 2
  • 10
0
votes
3 answers

The result of Sum is floor(Col + Row + 1) is never an integer and I don't know why

I have to write a piece of prolog where I have to calculate which position in an array is used to store a value. However the result of these calculations should return an integer, so I use the floor/1 predicate to get myself the integer of the value…
Delko
  • 25
  • 4
0
votes
3 answers

strange arithmetic with swi-prolog

I find the result very strange. Why not 0.3? Can somebody tell me why this result? Is it possible to fix this. ?- X is 5.3-5. X = 0.2999999999999998. ?- My second question is how would I transform from 'hour' notation '13.45'…
vincent
  • 101
  • 1
  • 9
0
votes
3 answers

Swi prolog Error: Showing true but not false

Just installed SWI-Prolog on my W8 machine and it's throwing an error. Here's the error: ERROR: toplevel: Undefined procedure: mark/0 (DWIM could not correct goal) Let's say my prolog source file contains one fact: Prolog source... …
Lee Brindley
  • 6,242
  • 5
  • 41
  • 62
1 2 3
9
10