|
|
Up |
|
|
  |
|
|
  |
Author: naznadinaznadi
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 |
|
  |
Author: j0hndoe.12435j0hndoe.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 |
|
  |
|
|
  |
Author: alleyalley
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 |
|
  |
Author: jimcaanjimcaan
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
|
|
  |
Author: jitender001001jitender001001
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 |
|
  |
Author: mynamemyname
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 |
|
  |
Author: NamelessNameless
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 |
|
  |
|
|
  |
Author: ajpowerrangerajpowerranger
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 |
|
|
|
|
|
|