good chemistry is complicated,and a little bit messy -LW PerlMonks

### Comment on

 Need Help??

My very first posting on the internet was on the subject of prolog programming (I just couldn't bear reading one person mislead another).

I usually only speak up when I have a criticism, so people tend to hate me.
Yet, we should always help each other progress, so....

It looks to me like your conception of the word 'append' is backwards.

"X is qw/b c/. Y is qw/d e f/. Z is qw/b c d e f/"
and..
"But how do we know if X appended to Y forms Z?"

It's my understanding that when you append something, you place it at the end.
Typically, we append items to a list or queue.
As an example:
q3 appended to q1 q2 would yield q1 q2 q3 .
"But how do we know if Y appended to X forms Z?"

One of the things I love about computer science is how definite terms can be. It's important to keep it that way. I don't mean to knock you, but it is very important that we don't mislead one another. Most people do this all day long with sloppy speech (sloppy speech == sloppy thinking).

The only other thing I have to say is that I don't think your choice of appending lists is a very convincing example of using prolog for people who know nothing of the subject.
It's a lot of explaining for something a person could do in one line of Perl:
push @A, \$B; # - append B to the array A

You do show the power of Prolog when you wrote:
"Given Y and Z, we can infer X."
"..given Z, we can infer all X and Y.."

Those are two additional things you get from a Prolog "append" clause which you don't get in any other non-logic programming language.

You understated the biggest point as a note:
"Note that you get all of that from one definition of how to append two lists. You also don't have to tell the program how to do it. It just figures it out for you."

That is the real power of Prolog.

I'm a fan of using an example of sibling relationships to show how prolog can infer answers using a small number of rules. The only two Prolog books I own use this type of example in their first chapters.

All said and done. Kudos for pushing Prolog.
I'm using your code and appreciate it. Thanks.

BTW Have you heard of Prolog++ ? It's an object oriented prolog.
I bought the book. (No. I'm not affiliated in any way).
(1994, Addison-Wesley published "Prolog++: The Power of Object-Oriented and Logic Programming" by Chris Moss)
I think you can implement the object oriented language in prolog (a prolog meta-interpreter).
Too much for me to chew right now.

Thanks again.
-RocketInABog

In reply to Kudos. Yet.. Misconception. by RocketInABog
in thread Bringing Logic Programming to Perl by Ovid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

• Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
• Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
• Read Where should I post X? if you're not absolutely sure you're posting in the right place.
• Posts may use any of the Perl Monks Approved HTML tags:
a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
• You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
 For: Use: & & < < > > [ [ ] ]
• Link using PerlMonks shortcuts! What shortcuts can I use for linking?

Create A New User
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (10)
As of 2018-03-22 14:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
When I think of a mole I think of:

Results (276 votes). Check out past polls.

Notices?