2,574 karma · joined September 12, 2013
He built an interpreter for the original IPL-I pseudocode of the original Newell and Simon Logic Theorist, straight out of the 1956 RAND report (P-868), and then got it running!
(I'll call the version that David reanimated "LT1" or "LT56", and mine "LT5" or "LT63" because mine was rewritten for IPL-V and published in 1963.)
What makes David's work especially interesting, aside from pushing the RetroAI window back 8 more years (!), is that IPL-I was NEVER ACTUALLY IMPLEMENTED! It was hand-executed by Simon's students (and supposedly his kids!) simulating the imagined IPL-I machine. This actually makes the problem much simpler. (Not at all to diminish David's accomplishment!)
In the 1956 report Newell and Simon describe the process in something close to the cognitive operators they hypothesized underlay human theorem proving. This is essentially LT1: A (somewhat) high-level specification of the Newell and Simon theory of cognitive theorem proving. But because LT1 didn't have to actually run on a real computer, it could depend upon human intelligence and flexibility to handle the complexities of actual implementation that you need to do to make a real computer actually do the whole thing end-to-end. (Or, as in David's case, a pile of Python code, which, of course, Simon and Newell didn't have in the mid 1950s!) As a result, LT1 is a bit over 400 lines whereas LT5, which is what you get when Shaw had to actually nail down the complexities of actual implementation, is nearly 3000 lines!
Anyway, huge congratulations to David; well worth a look if you care about the prehistory of AI, Lisp, or theorem proving. His repo is here: https://github.com/dmoews/logic-theorist. The readme provides a lot of intersting and important detail that I've glossed over.
https://github.com/jeffshrager/IPL-V/blob/master/major_resul...
(Well, there's a minor printout issue, but the proofs are working correctly!)
(It does break at the end, and I haven't started to track that down -- it may actually be my own runaway limiters that tripped it.)
[note] Or at worst the second -- depending on whether you count Arthur Samuel's first checkers player. But certainly LT is the first cognitive model, and first explicitly symbol processing AI.
The files "compiler.py" and "virtual_hardware.py" are the primary irony modules. Irony supports recursion, including mutual recursion, but nothing fancy. There's no lexer, so you need to put spaces between tokens. (Being a native Lisper, I hate lexers!)
compiler.py takes Irony source to byte code, and has a byte-code interpreter. virtual_hardware.py take the same byte code, but emulates actual hardware.
These are designed to go with an exercise where the student add FOR LOOP capability. Given the well-designed base, this is extremely simple, but requires understanding each step of the stack. ("compiler_for" and "virtual_hardware_for" are the solutions; The idea, of course, is not to give these to the student!)
(You'd think that it ought be the other way round: Start with for loops and then ask the student to add recursion, but it's much harder to add recursion than loops, so I put recursion into the base, and then ask the student to add for loops.)
The files "pathos.py" (which imports "irony.py") is a simple OS whose goal is to create, edit, compile, and run programs written in Irony. ("irony.py" is a combined version of compiler.py and virtual_hardware.py, but leaves out the byte code interpreter.) The "comp" and "exec" commands in pathos compile (to byte code) and then execute the reuslting byte code (basically assembly) on the emulated hardware. (See "pathos_demo.log".)
Everything here was written in about 5 total hours using a combination of chatbots. This wasn't as easy as I'd hoped. As many folks who use LLMs to assist in coding discover, they are bad at keeping track of even marginally complex or large projects, and don't deal well with conceptually twisty programming concepts. They were basically incapable of implementing recursion correctly, or generalizing to the desired level, and they kept losing their place in the series of steps. Eventually they would just seemingly lose track entirely and be unable to fix what turned out to be trivial errors, at which point I had to clear the decks entirely, reload the latest versions of the code base we were working on, and then re-explain the project and what to do next. In the end I had to give them nearly step-by-step guidance to get it right, and the way I wanted it to be, to be understandable and teachable. That said, to their credit, once I had the compiler and hardware emulator the understandable and teachable way I wanted it, I could feed those to the LLM and it was able to understand the code and make reasonable changes. For example, the entire FOR LOOP extension was done completely by Claude. I get that "pros" don't do it this way, but it's slightly fun trying to talk a chatbot into doing one's bidding, and being emacs-based, I don't have a magical code assistant built into my code editor. (I haven't even looked -- has someone already done that?)
Operating systems being conceptually simpler than programming languages, PATHOS was easier for the LLMs, and was almost entirely written by Claude, although based on several paragraph of detailed spec. And Claude was able to plug Irony into PATHOS (that is, create comp and exec commands) first try!
However, I then asked it to create a help command that simply listed all the other commands, which was nearly a trivial task, and it failed over and over, until I did one of those resets described above, and then it worked. (The attention model is just the wrong model of working and short term memory! Mark my words! [Yes, I do get my own meta-joke.])
I also asked the LLMs to make presentations. Those are here essentially "as is" and you'll see that although these are a reasonable start, they definitely aren't complete teaching materials.
https://sites.google.com/view/elizagen-org/eliza-clones
Although IPL is a direct Lisp predecessor, it can't be easily mapped to Lisp. Indeed, Lisp and IPL-V were contemporaneous for about 5 years, but Lisp was so much simpler and more elegant that it rapidly supplanted IPL. As a result, Ed Feigenbaum and I are probably the only living person who know IPL (and I only barely know it as I just learned it in the past few months!), whereas Lisp has been essentially endemic for 60 years! (I'm hoping I'm wrong that Ed and I are the only folks who know IPL. If you know of a native IPL speaker who I could talk to, I'd love you to DM me!)Several reasons. First, we don't need it, we want it -- it's a nice-to-have not a need-to-have.
It's nice to have for many reasons, none of them huge, but together they vie towards having it if we can find it:
1. What we're after is running the old AIs, not having IPL-V. We don't intend to write any new IPL code. The old AIs just happen to be written in IPL.
2. We can run the code without having to reformat it. There are numerous annoying nuances when recreating a very old language, not the least of which is the importance of card columns, which is annoying to "wrap parens around".
3. If we bother to write an emulator anyway, we can test our emulator against the real thing.
4. IPL-V being Lisp's conceptual machine code (one version of it, anyway), it should be easy to do so, so there's that as an engineering experiment.
5. Writing anything in Lisp is fun so it's an excuse to take a break from ... well, from pretty much anything else on my agenda, most of which do not require Lisp programming (although I often manage to squeeze some in anyway. :-)
First, re "ironically":
Short answer: Lisp and IPL were competitors for the list&symbol-processing community of early AI. IPL invented a lot of what Lisp implemented in nicer syntax -- in effect, Lisp was an HLL for IPL. Lisp (obviously) won and now we're (ironically) emulating IPL in Lisp in order to emulate Lisp's underlying machine in the HLL that sits on top of that machine. (Actually - ironically^2 - SLIP won ... see below.)
Longer answer: This whole corner of language development was full of ironies. SLIP (Weizenbaum's approach to list processing) was a plug-in for Fortran (originally) and shortly thereafter, MAD. Just as Lisp wiped out IPL, it also wiped out SLIP. Ironically, today we do what Weizenbaum envisioned: Write in powerful general HLLs and add in specialized packages for things like list processing. So, in the end, SLIP won!
We (they) have this mostly under control, but for one single function, called "LETTER." that we cannot find the code for, and are having trouble divining the function of.
The code of concern is here:
https://drive.google.com/file/d/1zAJ2zX9WaeR7Ui8F88ZNFZtI5Q-Ow5sb
If you search for "LETTER." there is a single call to it on card 00386. (MAD functions all end with "."; There are several occurrences of LETTER as labels, but only one function call.) This is in the function(entry) LISTRD. (000096) [This was in the days when functions could have multiple entry points in order to conserve memory.] and is used to load an array called KNOW (indexed by I). LISTRD is an s-expression reader (but into SLIP not LISP -- see below for LISTRD documentation).Some potentially important factoids: The 7090 had 36 bit words and packed 6, 6-bit BCD characters into each. (You can see this in line 000356 where it appears to be packing 6 close parens (BCD 34k) into a word: CARD(I)=343434343434K (K for octal). Notice cards are (were) 84 characters in width and 84/6 is 14 -- the number 14 is used in multiple places as a loop limiter, so it's apparently scanning across cards (and the minimal comments and some variable names suggest this as well).
[Unfortunately, comments were used quite sparingly in those days because you had to punch them into cards!]
Again, the only function for which we don't have code is LETTER. So, okay, Sherlock Hackers...What exactly does LETTER. do and what exactly is it doing here?
Here's a SLIP manual:
https://drive.google.com/file/d/1XtF7EM1KhwMPKsp5t6F0gwN-8LsNDPOl
LISTRD is documented on pg. 24 of the above manual.(Possibly important is that lists had to start in column 1 with an open paren.)