Questions tagged [gnu-prolog]

GNU Prolog is an ISO compliant Prolog dialect developed by Daniel Diaz. GNU Prolog features constraints over finite domains, produces native binaries, and provides a bidirectional interface with C.

GNU Prolog is an ISO compliant Prolog dialect developed by Daniel Diaz.

In addition to traditional Prolog functionality GNU Prolog supports constraints solving over finite domains. Furthermore, GNU Prolog produces native binaries and provides a powerful bidirectional interface with C.

It spots a very clean WAM based architecture, giving access to the intermediate language at both bytecode and C levels.

103 questions
0
votes
0 answers

GNU Prolog does not recognize *between* predicate

I am learning Prolog, using GNU Prolog on Mac OS X. I am getting the following error from interactive mode: GNU Prolog 1.3.1 By Daniel Diaz Copyright (C) 1999-2009 Daniel Diaz | ?- between(0,5,X). uncaught exception:…
Amittai Aviram
  • 2,270
  • 3
  • 25
  • 32
0
votes
3 answers

How to run gprolog on macOS Sierra

I have just installed gnu-prolog using brew install gnu-prolog. When I try to run gprolog in the terminal I get gprolog: command not found. I tried doing the same to my other machine that is running ElCapitan and all worked perfectly. Is there a way…
iSebbeYT
  • 1,441
  • 2
  • 18
  • 29
0
votes
1 answer

How can i change size of sudoku

I have a script to solve a Sudoku with size= 9*9 i have 81 variables and i define the rules for them, How can change this code to solve a sudoku with any size? for example for a sudoku 16*16, the rules will be for subsquares 4*4. go(L) :- …
parik
  • 2,313
  • 12
  • 39
  • 67
0
votes
1 answer

Is it possible to get these memory addresses in gnu prolog?

Basically I am trying to simulate C pointer dereference using gnu-prolog. Here is the code: Prolog :-foreign(fun(+integer,-integer)). % p = &b; testfun(Var, Val) :- fun(Val, Var). main :- A is 1, testfun(A, P), write(P), C: #include…
lllllllllllll
  • 8,519
  • 9
  • 45
  • 80
0
votes
1 answer

Prolog : Comparing a range of times

Quick rundown, basically, the idea of the prolog program (GNU Prolog) is to search a database containing people with available time slots to a set of times (beginning time, end time) and return the first person who can meet in that time. The input…
Jason McKindly
  • 463
  • 1
  • 8
  • 15
0
votes
1 answer

Error in GNU Prolog

I have this code : :- public queens / 1. :- mode forbidden(+, +, +, +), least_room_to_move(+, -, -, -), lr2m(+, +, +, -, -, -), make_initial_table(+, -), make_initial_table(+, +, -), number_list(+, -), …
jason
  • 6,962
  • 36
  • 117
  • 198
0
votes
2 answers

Select Redoing Until Failure, Why?

I have the following function: fillNonDrivers(Car, Pmd, Plo, ListOfPassengers) :- select(Passenger, Pmd, Plo1), Passenger = [_,n,_], /* etc */ I invoke it with trace on in the following way: fillNonDrivers([hello, 2], [[david, n, punk]],…
davidhwang
  • 1,343
  • 1
  • 12
  • 19
0
votes
1 answer

Why doesnot absolute_file_name work

The following code works in swi-prolog: :- asserta(user:file_search_path(money, '/media/D/db')). dataFile(F) :- absolute_file_name(money('test.dat'), F, []). It seems there is no module in gprolog. How can i make it work under gprolog ? Sincerely!
0
votes
1 answer

error handling in gprolog?

In order to run a group of queries in a simple query, I have tagged these queries and use forall/2 to call them: query_all :- forall(query(Q), (Q -> format('yes: ~w~n',[Q]) ; format('no : ~w~n',[Q]))). so if I define something…
Javran
  • 3,394
  • 2
  • 23
  • 40
0
votes
1 answer

appending strings to lists in prolog

i'm a new on Prolog, and i'm already having some problems to understand, the thing is, i was making a test on appending some strings introduced by console: append_str([],Adder,Adder). append_str([Head|Tail],Adder,Result):- …
Diego Jimeno
  • 312
  • 4
  • 15
0
votes
1 answer

Reading a line from a file in GNU Prolog

I feel like I'm bashing my head against a wall with something that I assume should be easy. Perhaps my approach is incorrect. I definitely don't feel like I understand the concept behind I/O in Prolog. (Such as: what is the difference between a…
Michael Schuller
  • 494
  • 4
  • 14
-1
votes
1 answer

i am implementing logic gates in prolog but having this error

and(A,B) :- A, B. or(A,_) :- A. or(_,B) :- B. error that i am getting is this compiling C:/Users/firoz/OneDrive/Desktop/neww codes/tt.pl for byte code... C:/Users/firoz/OneDrive/Desktop/neww codes/tt.pl:10: warning: singleton variables [Expr]…
-2
votes
1 answer

Why this Prolog+C code failed?

So basically I want to call some C code from Prolog, and here is the code: Prolog: :-foreign(ptraddr_wrapper(+integer,-integer)). :-foreign(ptrlval_wrapper(+integer,-integer)). :-foreign(ptre_wrapper(+integer,-integer)). % p = &b; babelTPtr(Var,…
lllllllllllll
  • 8,519
  • 9
  • 45
  • 80
1 2 3 4 5 6
7