Re: Explain difference lists



On Aug 1, 5:36 am, Chip Eastham <hardm...@xxxxxxxxx> wrote:

Thanks for asking about an interesting topic that
I certainly have yet to master.

I played with the difference list append (1-liner) for quite a while:

append_dl(List1-Hole1,Hole1-Hole2,List1-Hole2).

% ?- append_dl([1,2,3|H1]-H1, [4,5]-H2, X).
% H1 = [4, 5],
% X = [1, 2, 3, 4, 5]-H2.

Upon first look (and even second and third) it appears to work by
"magic."

What none of these explanations tell you in all these books and web
pages is, the entire thing is done by "trick" and "sleight of hand."
The "trick" is that you are passing an argument in with an unbound
variable, and that exact unbound variable is "marked" within the hard-
coded predicate. Unification does all the "magic."

My first observation is, I believe the minus signs get in the way of
explaining what is going on, as does the word "difference."

My second observation is, they should throw the entire mathematical/
theoretical basis for this whole thing out the window when teaching
this in computer science, and teach it as the "trick" that it is. As
usual, the entire approach for describing and teaching this is utterly
wrong.

I recently was hired to make sense of a set of instructions for doing
a particular task. The instructions were several pages in length.
Nobody knew how to use them or make sense of them. After careful
study, I didn't either. I took the whole thing to an "expert" who
told me the real deal. I then threw the instructions into the
garbage, and wrote new ones for the people who hired me. My
instructions were just a couple of lines long, easily followed and
understood by all who looked at them.
.



Relevant Pages

  • Re: Squir-Ming
    ... Some of the tec manuals were all in pictures, like Lego instructions: apparantly a large number of ground crew had less than rudimentary reading abilities. ... The picture manuals these guys were using had been developed to address the literacy issues within the enlisted forces. ... Taught me a great deal about the practical aspects of teaching, ...
    (uk.rec.sheds)
  • Re: Jack & Jill
    ... Richard Heathfield's attempt at a trick (the trick identified by the ... "the "trick" is that the instructions ... Submit the phrase 'What a great puzzle!'."), ... This would-be trick fails. ...
    (rec.puzzles)
  • Re: On becoming a Quilt Teacher
    ... can follow my instructions and picture what I am on about, ... Depending on what I am teaching I will have "dismembered" samples in various ... I found a great local shop that is willing to ... > to make the shop sample for the weekly class. ...
    (rec.crafts.textiles.quilting)
  • Re: Hex edit word documents password
    ... The problem is that to do this trick, you have to be able to first open the document, which is exactly the problem i am trying to fix - i cant open it becuase i dont have the password.In other words, The trick is supposed to let you change or remove a password that is needed to open a word document, but the trick requires that you already know the password so that you can open it. ... instructions seem to be exactly what you want to recover your document. ... But why the hell would you be hacking into a protected document to change the password if you can already open it to begin with?? ...
    (microsoft.public.word.application.errors)
  • Re: Error 0x80072EE7
    ... Holy Cow! ... I applied your instructions for wireless connection ... & ran fixwareout.exe - and it did the trick! ...
    (microsoft.public.windowsupdate)