Questions tagged [yap]

YAP is a Prolog system developed since 1985 at the Universities of Porto and Rio de Janeiro

YAP is a Prolog system developed since 1985 at the Universities of Porto and Rio de Janeiro.

33 questions
17
votes
2 answers

Exception thrown when trying to use JPL and YAP Prolog in OS X

I am trying to use JPL for the interaction of Java programs and YAP Prolog. In my java file, this line is throwing an exception: Query query = new Query("consult", new Term[] { new Atom("test.pl") }); The exception is shown below: Exception in…
Sergio
  • 8,532
  • 11
  • 52
  • 94
9
votes
5 answers

Overflow handling in GMP pow

(I am only an indirect user of the GMP-library primarily through swi-prolog and yap. But I am very much interested in fixing this problem.) When performing exponentiations with ridiculously large values, the host-systems or GMP are no longer able to…
false
  • 10,264
  • 13
  • 101
  • 209
4
votes
3 answers

difference yap and swi-prolog reading canonical lists

I have the following test code trying to read file into a list open('raw250-split1.pl', read, Stream), read(Stream,train_xs(TrainXs)), length(TrainXs, MaxTrain). I will omit part of the output due to the file is quite large. It works well with…
Vimos
  • 691
  • 1
  • 9
  • 23
4
votes
2 answers

YAP Prolog random's lack of randomness

When executing the following Prolog program with YAP, the output is always the same, namely the integer 233. :- use_module(library(random)). x:- random(1,1000,X), writeln(X). For instance, if I execute the following bash script, the output is…
S0rin
  • 1,283
  • 1
  • 10
  • 22
4
votes
2 answers

Compatibility layer for different Prolog implementation

Which is the best way to handle the compatibility between two different Prolog interpreters? I've read this question and its answers but what I'm looking for is a methodology for coping with differently defined predicates (ie delete in SWI is not…
rano
  • 5,616
  • 4
  • 40
  • 66
3
votes
1 answer

YAP initialization file?

I am wondering if there is an equivalent of the SWI initialization file "~/.plrc" in YAP. I would like to define some directories with: file_search_path/2 before loading YAP, but I do not know where to do it. Any help will be highly appreciated!.
Sergio
  • 8,532
  • 11
  • 52
  • 94
3
votes
2 answers

YAP PROLOG timeout issue

Can anyone explain why the following YAP code does not result in the variable Result being unified with time_out? ?- time_out(sleep(3),1,Result). Result = success. ?- time_out(sleep(3),2,Result). Result = success. ?-…
S0rin
  • 1,283
  • 1
  • 10
  • 22
3
votes
1 answer

YQL in Yahoo! App [YAP]

We are using YQL to get the Profile Information in a Yahoo! App using YAP, however, we are facing an error while executing the YQL Query. We are using OpenSocial Gadget AJAX Functionality for making the call. Following is the error message we are…
Haseeb Khan
  • 795
  • 2
  • 11
  • 22
3
votes
1 answer

Prolog memory issues

I'd like to find a way to profile the memory usage of a predicate (a huge one) I've written in prolog. I'm currently running it with swi and yap and I can see from those processes memory consumption that a big chunk of memory gets allocated. The…
rano
  • 5,616
  • 4
  • 40
  • 66
3
votes
1 answer

Prolog difference lists: code works on SWI and GNU Prolog, but not Yap

This code correctly calculates the number of elements in a difference list when I run it on GNU Prolog and SWI Prolog. However, Yap enters an infinite loop. count(X-X1,0) :- unify_with_occurs_check(X,X1), !. count([H|T]-T1,N) :- count(T-T1,M), N is…
Jay
  • 9,585
  • 6
  • 49
  • 72
2
votes
1 answer

[YAP 6.2.2][Prolog] "mmap" error during compilation on Ubuntu 20.04

I have a problem with compiling YAP Prolog 6.2.2 on Ubuntu 20.04. As usual, following the README, I browse into the YAP folder and give the command ./configure which is successful. Next, I give the command make but it gives me this error: % % % YAP…
2
votes
1 answer

Yap Prolog - Translating an SQL Query

I'm trying to create a Prolog query for a database I translated from mySql to Prolog facts. The Prolog facts regard many tables, but the relevant ones for this query are just two: actor(ID,firstName,lastName) film_actor(actor_id,film_id) film(ID,…
0xfabiof
  • 41
  • 2
2
votes
1 answer

cmake and make unable to compile YAP in Fedora 23

This is kind of a specific question, but, I am unable to get cmake and make to compile Yet Another Prolog in Fedora 23. Cloned the latest repo on Github, YAP 6.3.4. My friend ran cmake and make successfully on the identical clone on his Funtoo…
safulop
  • 33
  • 2
2
votes
0 answers

Is there a clpfd library in YAP Prolog equivalent to the one in SWI-Prolog?

I wrote this code in SWI-Prolog using the clpfd module but when porting to YAP I found that the cumulative/2 predicate is unavailable according to the error message given in the shell. So, I tried to look online for clpfd documentation but found…
M.K
  • 179
  • 1
  • 2
  • 10
2
votes
1 answer

Compiling Yap on windows 8

I am trying to compile yap on my PC since it seems YAP default installers don't come with the Depth limit flag enabled. I need this to work on an ILP project on Aleph. The thing is, that I am forced to use a PC with windows 8 without enough memory…
1
2 3