comp.lang.prolog
  Home FAQ Contact Sign in
comp.lang.prolog only
 
Advanced search
March 2008
motuwethfrsasuw
     12 9
3456789 10
10111213141516 11
17181920212223 12
24252627282930 13
31       14
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.lang.prolog Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  swi prolog macbook bus error         


Author: oopjosh
Date: Mar 30, 2008 07:41

hello,
I just installed swi and i get a bus error when i try to run /opt/
local/lib/swipl-5.6.52/bin/i386-darwin9.2.0/xpce or swipl. Am I doing
something wrong?
thank you
2 Comments
  please make the following prolog program         


Author: naznadi
Date: Mar 30, 2008 04:17

please make the following prolog program

i hav try .but require result not come
my predicatelike this
plz find out mistake from it.

listtran([],[]).
listtran([Ha/Ta],[Hb/Tb]):-tran(Ha,Hb),listtran(Ta,Tb).

the given question is this:

Suppose we are given a knowledge base with the following facts:
tran(eins,one).
tran(zwei,two).
tran(drei,three).
tran(vier,four).
tran(fuenf,five).
tran(sechs,six).
tran(sieben,seven).
tran(acht,eight...
Show full article (1.08Kb)
1 Comment
  printing the steps of a derivation         


Author: j0hndoe.12435
Date: Mar 29, 2008 22:29

I'm trying to write a program that prints formatted text for the
various steps in a derivation. The output of the program is used as
the input of another (non-Prolog) program that uses the derivation for
other purposes.

Here's a simplified example:

-------------------
happy(alice).
friend(carol, alice).
enemy(bob, carol).
enemy(bob, dan).

happy(X) :- friend(X,Y), happy(Y),
write(happy(Y)), write(' => '), writeln(X).
happy(X) :- enemy(X,Y), not(happy(Y)), enemy(X,Y),
write(unhappy(Y)), write(' => '), writeln(X).
-------------------

If I query:
?- happy(bob).

it outputs:
Show full article (0.92Kb)
2 Comments
  fyi Computer Language Benchmarks Game         


Author: Isaac Gouy
Date: Mar 29, 2008 15:53

It's nearly 3 years since the last time I posted an fyi to this list,
so long that we've changed the name of the website!

We have SWI-Prolog and YAP installed, the problem with Prolog on the
benchmarks game has always been finding competent Prolog programmers
willing to spend a little time writing such uninteresting ill-suited
programs.

Here are the programs contributed for SWI-Prolog

http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=all&lang=swiprolog&lang2...

I've transliterated just one of those to check that YAP was working

http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=all&lang=yap&lang2...

If anyone is interested in contributing Prolog programs then the FAQ
provides plenty of information:

http://shootout.alioth.debian.org/gp4sandbox/faq.php
10 Comments
  Prolog list question         


Author: alley
Date: Mar 29, 2008 10:55

Hello,

I have created a predicate that takes a list and a character, and
returns the elements beginning with that character:

begin_with([H|T],X) :- sub_string(H,0,1,_,X), !, write(H), nl,
begin_with(T,X).
begin_with([H|T],X) :- begin_with(T,X).

Because of the 'write(H)' clause, Prolog just outputs the elements.
How can I save the returned elements in a list like for example:

begin_with([my,name,is,martin],m,List).

and Prolog returns: List = [my,martin]
true.

Thanks for your help!
6 Comments
  4GB USB flash drives for only $14.49         


Author: jimcaan
Date: Mar 26, 2008 21:08

Hey there,
www.dealsusb.com has 4GB USB flash drives for only $14.49
Free Shipping with warranty . No rebates. Now we can store large
amounts of data into this Massive 4gb portable flash drive

Jimmy
no comments
  eclipse clp prolog C code generation query         


Author: jitender001001
Date: Mar 25, 2008 01:01

Hi Everyone
I am using eclipse clp version 5.10 on fedora core 6.
I want to know that is there any way to see the C code generated by
tkeclipse after compiling prolog file.
5 Comments
  Prolog syntax         


Author: myname
Date: Mar 23, 2008 08:37

Hello,

there are two elements of Prolog syntax that I do not understand:

a) =.. and []

What are "=.." and "[]" used for here ?

vp(vt,VS,Form) :-
mappend(V,SS,VS),
word(vt,V,S,Form),
member(Type,S),
Type =.. [TYPE],
Cat =.. [TYPE,SS],
Cat.

2) Var-Var

What does "G0-G" (and others) mean in this example ?

vp(Vform,G0-G)
-->
v(obj_equi,Vform),
np(G0-G1),
vp(inf,G1-G).

Thanks for your help !
2 Comments
  EASTER NUT         


Author: Nameless
Date: Mar 23, 2008 03:38

In some countries (particularly the Scandinavian ones) it
is traditional to solve puzzles/problems (= nuts) at Easter
time. Here's one which might be of interest to some readers.

The earliest possible (Gregorian) Easter Sunday falls this
year (2008). In what next 10 years does this recur again?
Please feel free to display the code/link of the Prolog
program used to compute these years. ;-)

--
Mail sent to this email address is deleted unread
on the server. Please send replies to the newsgroup.
3 Comments
  Help with a breadth first search in prolog.         


Author: ajpowerranger
Date: Mar 17, 2008 17:30

I am trying to do a task I found on breadth first searchs but am
stuck! The task is a maze, at each node is a sound level the higher
the sound the closer the the exit you are. I have written a lot of
code for this task so far which I will post if anyone actually replys
to this message (prolog seems to be a hard area to get help for
online!)

Would anyone be able to help me get the solution to the task?
11 Comments
1 2 3