For Programmers: Free Programming Magazines  


Home > Archive > Prolog > August 2005 > I now realize WHY my 'consistency check' was pointless: CLP.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author I now realize WHY my 'consistency check' was pointless: CLP.
Dirk Mittler

2005-08-24, 6:58 pm

I'm still very much a newbie at Prolog, but one of my first experiments was
to write some code which attempted to find contradictions in the constraints
or attributes of unbound variables, at a point in time before they could be
instantiated.

Since then I've learned that constraints in Prolog, even though they don't
have to be, are often mathematical ones. At which point I added some rules
to my database for finding obvious math contradictions. But it was only
after that, that I really learned what constraints are.

As I understand it now, a constraint differs in how it's used from general
Prolog, in that general Prolog predicates basically require at least one of
their arguments to be instantiated in order to succeed. Which can result in
the other variables becoming instantiated, or in the instruction succeeding
or failing depending on whether the relationship is true. But as I
understand it now, a constraint can be given only unbound variables and
still succeed. Then, this constraint can be called, if you will, two or
three more times, before it solves the system. Or it might solve after being
used *many* more times.

As I understand it now, calling the constraint puts attributes on the
variables which are tested whenever any code tries to instantiate them.
Further, it seems to me, that there exists non-constraint code to help
define the constraint, which tries to assign such values. I would have said
that this code belongs to the constraint and is layered 'under' the
constraint handling rules. But this code suggests solutions to the system.
Importantly, if no attempt is ever made to instantiate the variable, no
solutions are found, and a program might loop for a long time, just adding
more and more attributes to them.

However, general Prolog code which calls the constraint could be said to be
layered 'above' the constraint handling rules, and can be used to synthesize
functions. Or to define the problem.

It's clear to me today, that code which tries to call all the attributes
until either many unbound variables have been unified, or until an exception
is thrown due to uninstantiated ones leading to tentative success, is only
of very limited value. If the attributes contradict each other, this is hard
to determine, and attempts which must exist to instantiate the variable are
doomed to fail anyway. Meanwhile, the constrained variables do not in
general need a test to see if they can stand for something real. Only, the
Prolog interpreter could waste a lot of time when attempts are made to
assign a value to them, because ultimately the backtracking takes time.
Thus, if contradictions in the attributes could be found as early as
possible, it might speed up the program.

And to me this generalized test is probably not worth the effort for most
kinds of programming any more. On the other hand, I also did not put much
effort into writing it either.

Dirk


--
You can visit my CGI at:

http://www.cam.org/~mdirk/GallIndex.htm
(Spelled ... lower-case el - el - Capital Eye ... ndex.htm)


A.L.

2005-08-24, 6:58 pm

On Mon, 22 Aug 2005 09:13:44 -0400, "Dirk Mittler"
<mdirk@sympatico.ca> wrote:

>I'm still very much a newbie at Prolog, but one of my first experiments was
>to write some code which attempted to find contradictions in the constraints
>or attributes of unbound variables, at a point in time before they could be
>instantiated.

[...]
>
>And to me this generalized test is probably not worth the effort for most
>kinds of programming any more. On the other hand, I also did not put much
>effort into writing it either.
>


Could you please summarize in one SHORT paragraph what is your
point?...

A.L.
Dirk Mittler

2005-08-24, 6:58 pm


"A.L." <alewando_won_@kalabambuko.com> wrote in message
news:9v7pg1pr95s0q0dh6nl95fpqm70ra2fkpb@
4ax.com...
> On Mon, 22 Aug 2005 09:13:44 -0400, "Dirk Mittler"
> <mdirk@sympatico.ca> wrote:
>
> [...]
>
> Could you please summarize in one SHORT paragraph what is your
> point?...
>
> A.L.


Firstly, it was not an intention of mine to post this message twice, but my
ISP has been having trouble with their nntp servers. I apologize.

Secondly, the postings I made to this newsgroup, which involved specific
code and questions on my part at least a year ago, are being quoted on all
the major search engines. And I wanted to show that I understand the
language just slightly better now than I did then. Even though, as I started
out saying each time, I'm really a total novice at Prolog.

Thirdly, it occurs to me that there could be other beginners in Prolog who
have not found a suitable summary of what the difference between just Prolog
is, and Prolog with CLP, and who might find my own description helpful. My
book on Prolog, "PROLOG Programming For Artificial Intelligence," which I do
think is a good book, explains this difference in detail and with examples,
but not quite in the same way.

Dirk


Bart Demoen

2005-08-24, 6:58 pm

Dirk Mittler wrote:

> Even though, as I started
> out saying each time, I'm really a total novice at Prolog.

[...]
> My
> book on Prolog, "PROLOG Programming For Artificial Intelligence," which I do
> think is a good book


Difficult to grasp for me, this combination. Maybe you are too modest
about your Prolog "novicity" ? Or did you have a ghost-writer for the
book ?

Cheers

Bart Demoen
A.L.

2005-08-24, 9:56 pm

On Wed, 24 Aug 2005 13:04:30 -0400, "Dirk Mittler"
<mdirk@sympatico.ca> wrote:

>
>is, and Prolog with CLP, and who might find my own description helpful. My
>book on Prolog, "PROLOG Programming For Artificial Intelligence," which I do
>think is a good book, explains this difference in detail and with examples,
>but not quite in the same way.


I checked your name on Amazon, Borders and Barnes & Noble. Nothing.
Where and when you published this book?...

A.L.
student

2005-08-25, 3:57 am

A.L. wrote:
> On Wed, 24 Aug 2005 13:04:30 -0400, "Dirk Mittler"
> <mdirk@sympatico.ca> wrote:
>
>
>
>
> I checked your name on Amazon, Borders and Barnes & Noble. Nothing.
> Where and when you published this book?...
>
> A.L.


Possibly he is referring to a book by the name "PROLOG Programming
for Artificial Intelligence" that he did not write but which he is using
to study Prolog.
Duncan Patton

2005-08-25, 8:00 am

On Wed, 24 Aug 2005 22:15:56 +0200
Bart Demoen <bmd@cs.kuleuven.ac.be> wrote:

> Dirk Mittler wrote:
>=20
> [...]
I do=20[color=darkred]
>=20
> Difficult to grasp for me, this combination. Maybe you are too modest
> about your Prolog "novicity" ? Or did you have a ghost-writer for the
> book ?
>=20


Again, it seems your english is wanting. Possession and authorship may=20
be both possessively described as "My".

Dhu


> Cheers
>=20
> Bart Demoen



--=20
???????????????????????????????????????

Can't get good help? =20

Contact Fubar the Hack: fubar AT neotext.ca

Area code seven eight zero, Exchange four six six, Local zero one zero nine

Highland terms, Canadian workmanship.

All persons named herein are purely fictional victims
of the Canidian Bagle Breeder's Association.

Save the Bagle!=20

Sun =D0hu

???????????????????????????????????????


Mauro Di Nuzzo

2005-08-25, 8:00 am

i think that "my book" should be read "the book i have here in front of my
eyes"...
so "prolog programming 4 artificial intelligence" is from ivan bratko.
boh

"student" <not@anywhere.invalid> ha scritto nel messaggio
news:IUcPe.1575$FW1.552@newsread3.news.atl.earthlink.net...
> A.L. wrote:
My[color=darkred]
I do[color=darkred]
examples,[color=darkred]
>
> Possibly he is referring to a book by the name "PROLOG Programming
> for Artificial Intelligence" that he did not write but which he is using
> to study Prolog.



Bart Demoen

2005-08-26, 6:58 pm

Duncan Patton wrote:

> Again, it seems your english is wanting. Possession and authorship may
> be both possessively described as "My".


Oh Patton, you are so pathetic, and too eager to point at my wanting
english. So eager that you can't even wait until there is a really
good opportunity to make me look bad. Because this wasn't it: in the
handfull of languages that I master, the same dual meaning exists for
the equivalent of "my". But you probably can't imagine that with your
english-centric view of the world.

I can assure you: I will make a real fool of myself at lots of
occasions. Be patient and when the occasion presents itself, then try
to make me look real bad. That is, if you recognise the situation.
I don't expect you will.
Bart Demoen

2005-08-26, 6:58 pm

Dirk Mittler wrote:

> Thirdly, it occurs to me that there could be other beginners in Prolog who
> have not found a suitable summary of what the difference between just Prolog
> is, and Prolog with CLP, and who might find my own description helpful. My
> book on Prolog, "PROLOG Programming For Artificial Intelligence," which I do
> think is a good book, explains this difference in detail and with examples,
> but not quite in the same way.


Dirk, I seem to have misinterpreted the above as meaning that you wrote
the book you mentioned. Sorry about that.

Cheers

Bart Demoen
Duncan Patton

2005-08-26, 9:56 pm

On Fri, 26 Aug 2005 21:57:20 +0200
Bart Demoen <bmd@cs.kuleuven.ac.be> wrote:

> Duncan Patton wrote:
>=20
=20[color=darkred]
>=20
> Oh Patton, you are so pathetic, and too eager to point at my wanting
> english. So eager that you can't even wait until there is a really


My intent is not to make you the fool. You regularly trash on others
for their "poor english" and written skills, myself included. This
is considered the epitome of boorishness on the usenet, generally.

> good opportunity to make me look bad. Because this wasn't it: in the
> handfull of languages that I master, the same dual meaning exists for


In English, yer only a Jack, and no master, for sure. =20

> the equivalent of "my". But you probably can't imagine that with your
> english-centric view of the world.
>=20
> I can assure you: I will make a real fool of myself at lots of
> occasions. Be patient and when the occasion presents itself, then try
> to make me look real bad. That is, if you recognise the situation.
> I don't expect you will.


I won't be bothered waiting on it, for sure.

Dhu


--=20
???????????????????????????????????????

Can't get good help? =20

Contact Fubar the Hack: fubar AT neotext.ca

Area code seven eight zero, Exchange four six six, Local zero one zero nine

Highland terms, Canadian workmanship.

All persons named herein are purely fictional victims
of the Canidian Bagle Breeder's Association.

Save the Bagle!=20

Sun =D0hu

???????????????????????????????????????


student

2005-08-27, 9:58 pm

Bart Demoen wrote:
> Duncan Patton wrote:
>
>
>
> Oh Patton, you are so pathetic, and too eager to point at my wanting
> english. So eager that you can't even wait until there is a really
> good opportunity to make me look bad.


No so fast, mate.

It isn't your language skills that are wanting -- far from it.

But by your own account, you were faced with two hypotheses: (A) the
OR wrote the book whereof he spoke, which would lead any reasonable
person wonder how that could be, in light of the OR's self-assigned
status as a Prolog newbie, or (B) that the OR was simply referring to
the book about Prolog that he was using to teach himself something about
Prolog, which would tend to confirm the OR's self-assigned status as a
Prolog newbie.

Of these two hypotheses, which is least prejudicial?

That is, which of the two hypotheses requires me to assume more facts
that are not in evidence as givens?

To believe (A), I have to assume that the OR is a habitual imposter
or a not-so-bright con-artist or a rather troll or just a bit
daft or something even more exotic.

To believe (B), I need only give the OR the benefit of the doubt for
having committed no greater crime than writing an ambiguous sentence.

It seems clear to me that (B) is the least prejudicial of the two
hypotheses.

Yet you chose (A): the OR is a Prolog newbie who claims to have
written a book about Prolog (and Artificial Intelligence, no less). If
that were true it could explain why you couldn't find an ISBN number for
it -- who would publish such a book? -- but it is not, I think, the
alternative that the science-minded prejudice-minimizer (a la
E.T.Jaynes) should choose -- not, that is, if objectively demonstrable
truth is your goal.

"Nature is an open book: who reads it with an open mind will not be
led astray; whose mind is poisoned by prejudice /will/ be led into error."
(quoting from memory -- Francis Bacon, iirc -- my emphasis).

Follow the path of minimum prejudice and you maximize your chances of
success: that is an amazing fact about the universe.

I now wonder if it is also a search strategy that can be (or has been)
expressed/implemented/described/programmed in Prolog.

--
bill hogan
<logic4sure@yahoo.com>
<www.geocities.com/logic4sure>
A.L.

2005-08-27, 9:58 pm

On Sun, 28 Aug 2005 00:21:39 GMT, student <not@anywhere.invalid>
wrote:

>Bart Demoen wrote:
>
> No so fast, mate.
>
> It isn't your language skills that are wanting -- far from it.



Could you explain in one short paragraph what is your point?...

A.L.
Duncan Patton

2005-08-28, 6:57 pm

On Sat, 27 Aug 2005 20:53:32 -0500
A.L. <alewando@zazula.com> wrote:

> On Sun, 28 Aug 2005 00:21:39 GMT, student <not@anywhere.invalid>
> wrote:
>=20
> =20
>=20
> Could you explain in one short paragraph what is your point?...
>=20
> A.L.


"
Follow the path of minimum prejudice and you maximize your chances of=20
success: that is an amazing fact about the universe.
"

We should then hope that Mr. Middlebeard's skill with English will
keep apace with improvements in the sanitation department.

Dhu




--=20
???????????????????????????????????????

Can't get good help? =20

Contact Fubar the Hack: fubar AT neotext.ca

Area code seven eight zero, Exchange four six six, Local zero one zero nine

Highland terms, Canadian workmanship.

All persons named herein are purely fictional victims
of the Canidian Bagle Breeder's Association.

Save the Bagle!=20

Sun =D0hu

???????????????????????????????????????


Duncan Patton

2005-08-28, 9:56 pm

On Sun, 28 Aug 2005 09:28:26 -0500
A.L. <alewando@zazula.com> wrote:

> On Sun, 28 Aug 2005 14:00:53 GMT, Duncan Patton
> <campbell@neotext.ca> wrote:
>=20
>=20
>=20
> Surprisingly many people have fundamental problems with converting
> their thoughts into written text. Including Mr. D. P.=20
>=20
> A.L.


Even more surprisingly, many people choose to ignore the writing on the wall
because of inadequate grammar: "Oh, well, let them eat cake" ;-)

Dhu


--=20
???????????????????????????????????????

Can't get good help? =20

Contact Fubar the Hack: fubar AT neotext.ca

Area code seven eight zero, Exchange four six six, Local zero one zero nine

Highland terms, Canadian workmanship.

All persons named herein are purely fictional victims
of the Canidian Bagle Breeder's Association.

Save the Bagle!=20

Sun =D0hu

???????????????????????????????????????


Bart Demoen

2005-08-29, 7:00 pm

student wrote:

> It isn't your language skills that are wanting -- far from it.


Thanks for the support Bill.

Bart Demoen
student

2005-08-30, 9:56 pm

student wrote:
>
> Of these two hypotheses, which is least prejudicial?
>


<DELETE>
> That is, which of the two hypotheses requires me to assume more facts
> that are not in evidence as givens?
>

</DELETE>


--
logic4sure AT yahoo DOT com
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com