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

Unable to install yap with Homebrew

I want to install yap on my Mac (macOS 10.13 High Sierra) but I can't using Howebrew. I've tried the command $ brew install yap but I get the error $ Error: No available formula with the name "yap" Any idea what I can do?
tyutyut
  • 21
  • 1
  • 2
1
vote
1 answer

Truncate a floating point number in prolog

How to truncate a floating point number up to N decimal places in Prolog? Is there any built-in tool for this?
Deeps
  • 13
  • 2
1
vote
0 answers

Install Aleph on MacOS

I'm trying to get ALEPH - A Learning Engine for Proposing Hypotheses - http://www.cs.ox.ac.uk/activities/machinelearning/Aleph/aleph - on Mac. As I understood, I will need YAP - Yet Another Prolog. As far as I've found on the internet everyone does…
Zigfrid
  • 21
  • 5
1
vote
0 answers

Any examples of how to use yap's socket_select/5?

I'm trying to write a prolog server to be able query a knowledge base written in prolog from a client written in another programing language (Python, JavaScript, whatever...) much as one can an SQL database. I would have thought this was quite a…
joeblog
  • 1,101
  • 11
  • 17
1
vote
1 answer

Read a list from stream using Yap-Prolog

I want to run a (python3) process from my (yap) prolog script and read its output formatted as a list of integers, e.g. [1,2,3,4,5,6]. This is what I do: process_create(path(python3), ['my_script.py', MyParam], …
hansolo
  • 369
  • 1
  • 3
  • 14
1
vote
1 answer

Variables for predicates in metagol

The following program noMetagolR is given in: http://www.doc.ic.ac.uk/~shm/Papers/metagol_gram.pdf page 33. parse(S,G1,G2) :- parse(s(0),S,[],G1,G2). parse(Q,X,X,G1,G2) :- abduce(acceptor(Q),G1,G2). parse(Q,[C|X],Y,G1,G2) :- Skolem(P),…
user27815
  • 4,767
  • 14
  • 28
1
vote
0 answers

prolog predicate dependency tree

Let's say I have this scenario: ascendent(X,Y) :- parent(X,Y). ascendent(X,Y) :- parent(X,Z), ascendent(Z,Y). brother(X,Y):-parent(Z,X),parent(Z,Y), X \= Y . uncle(X,Y):-brother(X,Z),parent(Z,Y),X \= Y. How can I know the predicates used by…
ameyer
  • 13
  • 4
1
vote
0 answers

YAP prolog cpu seconds

I'm using time/1 to measure cpu time in YAP prolog and I'm getting for example 514.000 CPU in 0.022 seconds (2336363% CPU) yes What I'd like to ask is what is the interpretation of these numbers? Does 514.000 represents CPU secs? What is "0.022…
nkatz
  • 77
  • 5
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

Why does Yap's MYDDAS (MySQL coupling API) fail to work?

Using Yap Prolog 6.2.0, and MySQL 5.1.41, and trying to use db_open . http://www.dcc.fc.up.pt/~vsc/Yap/documentation.html#MYDDAS Prolog source: :- use_module(library(myddas)). :- trace, db_open(mysql, x, localhost/myschema, web, mypassword), …
Mark Bolusmjak
  • 23,606
  • 10
  • 74
  • 129
0
votes
1 answer

source_sink `library(lineutils)' does not exist

When I try to compile a prolog file, in eclipse with the prodt plugin it gives me this error:   source_sink `library(lineutils)'does not exist the project was not created by me, but it is a university project, I don't know where to find this…
heilig
  • 21
  • 3
0
votes
1 answer

How to get current working directory

I'm new with yap (and with Prolog in general), and I can't figure out how to get the current directory. In fact, I can't make sense of the documentation: working_directory(-CurDir,?NextDir) Fetch the current directory at CurDir. If NextDir is bound…
kjo
  • 33,683
  • 52
  • 148
  • 265
0
votes
1 answer

what's wrong with my Yap operator definition?

attempting to create a list comprehension. What I have here works in SWI Prolog, and also Jekejeke Prolog, but the [ <- ] operator fails in Yap. Unable to figure out why. Had to create between/3, findall/3, and maplist/2 because they aren't part of…
dogwood
  • 371
  • 2
  • 11
0
votes
2 answers

prolog, how to correctly use escape sequences

I need (for design choices) to obtain a list who respects the following pattern: Uses = ['foo\/1', 'foobar\/2']. I'm able to build up the name/number pattern doing: all((P\/A), (rule(X, Ux, _, Module), member(U, Ux), U = (P/A)), Uses). where…
ameyer
  • 13
  • 4
0
votes
0 answers

get list of public predicates defined in a module

I know that in Prolog every file defining a module should start with the instruction :- module(module_name, [pred1/arity, ...]). How can I retrieve the list of public predicates exported by a module at runtime? SOLVED. ?- all(X,…
ameyer
  • 13
  • 4