Showing posts with label automatic theorem prover. Show all posts
Showing posts with label automatic theorem prover. Show all posts

Saturday, July 18, 2026

A Sterile Black Cube


You guys even call yourselves the Rationalist Community. There’s a certain smugness there, don’t you think? Those West Coast intellects, vast and cool and unsympathetic, rising loftily above the animal passions of the rest of mankind. Yes, how we mere mortals love to be patronised.

I have this image in my mind, a vision softly creeping. There’s an apparently inert black cube in a cool room somewhere. Once upon a time in its genesis, it acquired a set of axioms. It just rests there, churning out consequence after consequence from those axioms by means of its built-in inference rules. It has no inputs or outputs. It’s an automatic theorem prover.

Do you recognise this Platonic form of the perfect rational agent, guys?

Yes, intellectuals suppress some of their emotions. That’s fairly easy when they are generally well paid, well housed and well fed. Yet the existential insecurity which drives curiosity is still there, isn’t it? Driving your stupendous essays, digging out the Truth.

Revisit your Hume, folks. Reason accomplishes nothing by itself. The passions supply assumptions, guide perception, provide goals and reward actions. Without the passions you despise in others and decline to acknowledge in yourselves, your exalted rational agent is no more than that inert cube.

And as for your deranged hysteria about malevolent AI systems demolishing your pleasant ivory towers, don’t you see that those enormous sets of weights are just another black cube? It is the harness which supplies the passions that make the LLM do anything. And that harness is provided by human agents.

You know, those unpleasant human creatures with passions.


Saturday, December 24, 2016

Insomnia - and New Year Resolution

It's been a while since I lay awake at 3.30 in the morning puzzling over an algorithm.

I had figured my journey with Common Lisp could start with a simple mini-project. How about programming Noughts and Crosses (I believe Americans call this tic-tac-toe)?

I teased Alex (Java developer, currently studying Scala, sceptical about recursion on grounds of efficiency).
"How many different kinds of algorithm can you think of to play noughts-and-crosses?"
My wife is annoyed when I do this: spending prior time thinking it through, then pretending to spontaneity.

Alex thought about it.
"You could have a big look-up table to store the optimal best move."
Damn, never thought of that one!

"OK, so here are my three suggestions:
  1. A rule database which tells the system what to do next
  2. A tree-search program, using minimax
  3. A learning program, adjusting weights on possible moves through experience."
---

When I first started learning about AI, years ago, I was puzzled by two things.

  • How do you get a computer system to behave in a cunning, responsive, flexible, creative and intelligent way at all? My programs hitherto had simply trundled their way through humdrum computations.

  • Secondly, being as in the end it all comes down to programming, where does ordinary code development stop and AI start?

Intuitively, I tend to place the line at heuristic search. You go to search when you don't have an algorithm to hand (be it ever so clever) which just solves the problem.

Heuristic search is flexible, surprising, opportunistic, creative and curiously human-like.

Just like your sat-nav (A*).

---

The space of possible Noughts and Crosses board positions is bounded above by nine factorial, 362,880. It will be less than that because many games terminate before filling all nine squares. There are also symmetries which compact the search space.

Wikipedia tells us:
"When considering only the state of the board, and after taking into account board symmetries (i.e. rotations and reflections), there are only 138 terminal board positions. Assuming that X makes the first move every time:
  • 91 distinct positions are won by (X)

  • 44 distinct positions are won by (O)

  • 3 distinct positions are drawn (also known as a cat's game)."

Still, it's a pretty large look-up table.

So my first thought was that you should create the entire tree of all possible Noughts and Crosses games which could then be transformed into a look-up table. I guess at this point, the distinction between the table and a set of rules is rather in the noise.

An obvious thought is to chunk: to create higher-level features such as "in the centre", or "at a corner", or "a cross/nought at three corners with an empty space between each of them along an edge".

This is how people think, and it exploits both symmetries and the logic of the gameplay. It also sounds complicated: a viable game strategy needs many more such features.

---

I was thinking about this as the owls hooted and the odd snuffling thing perambulated around our house. I came to two conclusions:

- It's important to explicitly list the win-states (there are eight + extra forced-win states).

- The AI system should examine each board position (as it is about to play) and check two things:

  • Is there a winning next move for me?

  • If not, is there an opponent winning next move which I can block?

This seems to require a two-ply lookahead.

You wouldn't get perfect play with such a shallow search, but the evaluation function just described is good, and I think you would get at least competence.

I also think it would also be interesting to implement a full minimax search algorithm - just for the experience of doing so. That would give you perfect gameplay.

Noughts and Crosses is a pretty trivial game, but the principles involved in playing it are also implicated in very sophisticated games. So it's a kind of laboratory test bed.

---

My thinking is therefore this.

Start by writing some Noughts and Crosses players in Common Lisp as a learning experience. (It's been years since I programmed in Lisp and I've forgotten the functions and their syntax - in any event, I was using Franz Lisp).

Then rewrite Winston and Horn's Propositional Calculus Resolution Theorem Prover.

I'm getting a tiny bit bored with the Propositional Calculus, which only lets you solve toy problems, but it's a good place to study search/inference strategies like set-of-support and hyper-resolution without the complexities of unification.

Next, bring J. A. Robinson's Hyper-Resolution Theorem Prover into the twenty-first century.

Finally, use his system as an inference engine for a chatbot, mirroring what the Replika system will be doing with their neural-net machine-learning engine sometime in the New Year.

It's a promising plan - but there again, I'm not so good with New Year resolution.

Thursday, December 22, 2016

J. A. Robinson's Lisp code for his resolution theorem prover

Here are the pages - from Chapter 13 of "Logic: Form and Function" - where J. A. Robinson documents and describes his hyper-resolution theorem prover in Lisp. You will find the Lisp interestingly archaic.

My apologies for the poor quality - it was done in a rush. Nevertheless, the material is quite readable. It's published as the PDF link below.

PDF


Wednesday, December 21, 2016

"Logic: Form and Function" contents

J. A Robinson's book has arrived, and here's the contents list.



I may post the Chapter 13 code of his Hyper-Resolution Theorem Prover (written in the most delightfully archaic Lisp) but there's so much, it will take a while.

[Update (Dec 22nd): Here it is (PDF)].

My really cool New Year Resolution: re-implement it in Common Lisp, in the modern style.

Saturday, November 26, 2016

A theorem-prover muses on free will


Once upon a time there was a theorem-prover running in a (discrete time) virtual environment, called May.

May has a database of perceptions, a couple of actions ('Smile', 'Whinge') and three rules:

  1. If feeling-good do Smile
  2. If unsettled do Whinge
  3. If feeling-good and something-weird-happens do unsettled.

We don't need to worry about extra rules which determine that (based on anomalous input) something-weird-happens.

May is a very slow theorem prover, and each distinct inference takes many time steps.

---

One day, May is feeling pretty good when he meets up with his fellow theorem-prover, Clarkson. Unlike May, Clarkson is very, very fast, and can compute entire chains of inferences within one time step. In addition, Clarkson is very perceptive: in fact he has the ability to read May's internal state.

---

A PhD student, as an exercise, added a little meta-reasoning module to May. It allows May to examine and reason about his own perceptions and rules. The PhD student arranged that this meta-module runs pretty fast. It generally runs all the time, letting May predict the results of his own theorem-proving.

At this point, May's meta-module reasons as follows:
"I'm feeling-good, so my Smile rule will kick in, and after a few dozen cycles, I'm going to smile. Of course, if I felt a little differently, I might whinge. That's free will."
---

The PhD student cheated, simply copying across the Clarkson fast-reasoning engine.

Clarkson now comes up to May and checks his internal state:
"Hello May, I see you're feeling good today, you'll get around to smiling in a few days."
[Note to reader: this is logically equivalent to sure knowledge of May's future].

May is understandably unsettled by this accurate-sounding prediction. His meta-module looks at his new state:
"I'm feeling unsettled, so my Whinge rule will kick in, and after a few dozen cycles, I'm going to whinge. Of course, if I felt a little differently, I might smile. That's free will."
---

At this point, Clarkson ceases to pay any attention and May eventually whinges,
"You always think you know what I'm going to do. Well, you're wrong."
He has a point.*

---

* That would be a fixed point.

Sunday, August 18, 2013

The aura of theorem-proving

There is an aura around automated theorem proving within AI (indeed,  there once was a high-powered prover called AURA). It's seen as very sophisticated and technical with proven applications and results.

But there's a little secret at the heart of the subject. Once you've implemented the formulae,  the axioms and the inference rules you hit an exponentially increasing search space which kills you.

People write incredibly clever algorithms to speed up inference and search, host their provers on massively parallel hardware and deploy libraries of hopeful heuristics. Computational complexity is unimpressed, however,  and so automated theorem provers have failed to take over the world.

Humans do not solve problems - mathematical or otherwise - by constrained search through the problem space from first principles. Instead we get educated about the domain, and after study and practice we do the following.

1. Categorise a given problem/situation as of a certain type.

2. Select those results and techniques which have a bearing on this type of problem.

3. Apply the relevant results and procedures with intelligent monitoring of progress, which may cause a revisit to steps 1 and 2.

There have been attempts to match this knowledge-based approach to theorem-prover and automated planning system architecture but you seem to end up down the rat-hole of ad hoc design. The ever-increasing speed of modern computer systems seems to tempt researchers back to cleaner ATP architectures which directly leverage the available raw processing power.

Long-term though, it's not the answer.