|
|
Up |
|
|
  |
Author: Frank RaiserFrank Raiser
Date: Jan 29, 2008 06:06
Apologies if you receive multiple copies
________________________________________
Call for Papers
------------------------------------------------------------
Fifth Workshop on Constraint Handling Rules
CHR 2008
July 14, 2008
Hagenberg, Austria
Co-located with the International Conference on
Rewriting Techniques and Applications (RTA 2008)
------------------------------------------------------------
http://www.uni-ulm.de/in/pm/research/events/chr2008
Introduction
------------
|
| Show full article (4.27Kb) |
|
| |
no comments
|
|
  |
Author: A.L.A.L.
Date: Jan 28, 2008 19:02
On 26 Jan 2008 16:44:35 GMT, Jan Wielemaker
wrote:
>On 2008-01-26, A.L fala2005.com> wrote:
>> Well, we know that memory leaks are everyday business when programming
>> in C++.
>>
>> There was a myth than languages with garbage collector are free of
>> this problem. Of course, until someone leaves forgotten reference to
>> 10 MB of stuff..
>>
>> How is in Prolog?... Are memory leaks possible?
>
>There is no easy answer, and definitely not if you want it to be
>`generic'.
Thanks for comments. I wrote longer response to Bart's post. Your
recommendations are exactly as his recommendations, therefore I
comment his post only.
A.L.
|
| |
|
| |
no comments
|
|
  |
Author: bart demoenbart demoen
Date: Jan 28, 2008 14:41
On Sat, 26 Jan 2008 09:19:20 -0600, A.L wrote:
> How is in Prolog?... Are memory leaks possible?
It depends on what you mean by a memory leak.
Of course the programmer can "mess up" - here is an example that
causes a memory leak in some Prolog systems:
a(N,_) :- N > 0, M is N - 1, a(M,foo(1,2,3,4,5)).
a(N,_) :- N =< 0.
Try the query ?- a(,[]).
with equal to 10000000 in SICStus, Yap, SWI and you will see.
Did the programmer mess up, or the implementation ?
In B-Prolog (and hProlog) this query runs in a flash.
Let's remember what went "wrong" as (1).
|
| Show full article (5.40Kb) |
|
17 Comments |
|
  |
Author: John ThingstadJohn Thingstad
Date: Jan 24, 2008 06:07
I am reading "Learn Prolog Now!" as a form of self study to learn some of
the basics of Prolog.
The spesification of the problem is in the comment. Maybe I am dense, but
I can't seem to wrap my mind around this problem. Any hints?
/*
There is a street with three neighboring houses that all have a different
color.
They are red, blue, and green.
People of different nationalities live in the different houses and they all
have a different pet. Here are some more facts about them:
The Englishman lives in the red house.
The jaguar is the pet of the Spanish family.
The Japanese lives to the right of the snail keeper.
The snail keeper lives to the left of the blue house.
Who keeps the zebra?
*/
member(X, [H | T]) :- X = H; member(X, T).
|
| Show full article (1.20Kb) |
|
no comments
|
|
  |
Author: John ThingstadJohn Thingstad
Date: Jan 22, 2008 15:10
PÃ¥ Sun, 20 Jan 2008 15:50:33 +0100, skrev Slobodan Blazeski
gmail.com>:
> Hi group
>
> I'm common lisp programmer that started learning prolog this thursday.
> I'm using book learn prolog now, nice book but lacks solutions for
> selfstudy, and everything was going smooth untill...
|
| Show full article (1.62Kb) |
|
no comments
|
|
  |
Author: Nick WeddNick Wedd
Date: Jan 22, 2008 02:32
>Hi group
>
>I'm common lisp programmer that started learning prolog this thursday.
>I'm using book learn prolog now, nice book but lacks solutions for
>selfstudy, and everything was going smooth untill I got stuck at
>Exercise 4.2. I really can not think of any way how to make the
>translation and that frustrates me. Any help for this task or show me
>something simigliar like how to use translating fact into unification
>will be highly appreciated?
To translate a list, you need to
translate the head of the list, and
translate the rest of the list.
Except of course when the list is empty, and then you need to terminate
your recursion with translate( [], [] ).
So you need to write a clause that starts
translate( [HeadGerman|TailGerman], [HeadEnglish|TailEnglish] ) :-
|
| Show full article (1.91Kb) |
|
no comments
|
|
  |
Author: AlessandroAlessandro
Date: Jan 21, 2008 04:06
Hello,
I study the possibility of parsing context-free languages with Prolog.
Head -> Body
I found the DCG (definite clause grammar).
I think that is possible with Prolog to handle context-sensitive construct :
before Head after -> before Body after
but I seek a *good* exemple in Prolog, perhaps with the langage { a^n
b^n c^n } that is known to be context-sensitive (and not context-free).
Thanks :-)
|
| |
|
8 Comments |
|
  |
Author: Dave RobertsDave Roberts
Date: Jan 20, 2008 21:37
I'm a Prolog newbie, just playing around with the system. I can't understand
the answer Prolog is giving me in the following simple little database. I
decided I would play around with a simple database describing nodes being
connected or not. Just three nodes for now, with two connections, and a rule
the defines transitive connectivity.
connected(node1, node2).
connected(node2, node3).
path(X, Y) :- connected(X,Y).
path(X, Y) :- connected(X, Z), path(Z, Y).
But when I query, Prolog immediately responds with "More?". When I hit ";",
it responds with "No":
44 ?- path(node1, node2).
More? ;
No
|
| Show full article (1.50Kb) |
|
11 Comments |
|
  |
Author: Maciej KatafiaszMaciej Katafiasz
Date: Jan 17, 2008 11:11
Den Thu, 17 Jan 2008 07:29:11 -0800 skrev Chip Eastham:
[snip long quote]
>
> Another "simplification" to try is removing the inequality test, (> ?y
> 1), between the two equality tests. It's conceivable that the
> inequality test, by forcing "evaluation" of its expressions, has an
> unintended side-effect on variable ?y.
>
> regards, chip
|
| Show full article (0.80Kb) |
|
no comments
|
|
  |
|
|
  |
Author: Ken TiltonKen Tilton
Date: Jan 17, 2008 10:54
Chip Eastham wrote:
> On Jan 16, 1:20 pm, Ken Tilton optonline.net> wrote:
>
>>Chip Eastham wrote:
>>
>>>On Jan 16, 12:39 pm, Ken Tilton optonline.net> wrote:
>>
>>>>Total noob, here, using a Lisp implementation of Prolog (AllegroCL's, to
>>>>be precise) in case anything looks odd.
>>
>>>>Given:
>>
>>>>(<-- (gcf ?x ?y ?f)
>>>> (is ?f (gcd ?x ?y))) ;; is/2 let's me use Lisp in the second arg
>>
>>>>(<-- (> ?x ?y)
>>>> (lispp (> ?x ?y))) ;; some more embedded Lisp
>>
>>>>Applying the above, we test a hardcoded pair (12 1nd 15) to see if they
>>>>have gcf > 1: ...
|
| Show full article (2.58Kb) |
|
no comments
|
|
|
|
|
|
|