Not many posts for the next few days as we have a visitor: my 'study' reverts to its ur-status as bedroom.
I ordered Sean Carroll's book (which should be arriving tomorrow or Saturday) ..
.. on account that one reviewer (3 stars) complained it was 'too hard'. I'll try to let you know.
---
Strange how hard it is to predict another's taste in books. I really appreciated Scott Bakker's "The Disciple of the Dog" but all that inline philosophy slowed it down way too much for Clare.
It's been replaced - amazingly - by the famous "The Mote in God's Eye" which she is lapping up as I read it to her.
We haven't even reached the gripping alien lightsail contact event yet; still in the early chapters of Niven's and Pournelle's backstory building, usually condemned as 'boring'.
---
I remain a fan of Scott Bakker and have purchased (Kindle) this: (start of a mega-epic) ..
.. which seems awfully complicated. I have dipped my toe in.
---
My third ordered volume is "The Genome Factor: What the Social Genomics Revolution Reveals About Ourselves, Our History, and the Future" by Dalton Conley and Jason Fletcher.
I'm hyper-wary of the fluffy-bunny pleasantries of the Standard Social Science Model, but it seems well-regarded so I'm taking the risk. Should be out some time in late February.
---
Do you hear that hacking cough from the bedroom? Clare is much recovered today but the sub-zero windchill of our lunchtime shopping trip to Waitrose has sapped her energy .. and she has retired to bed. Still, direction of progress is positive.
---
Well, enough time here. I think it's time to re-acquaint myself with J. A Robinson's exemplary treatment of unification with those substitution subtleties ... .
Showing posts with label Unification. Show all posts
Showing posts with label Unification. Show all posts
Thursday, January 26, 2017
Diary: books + Clare's health
Labels:
Book,
Dalton Conley,
J. A. Robinson,
Jason Fletcher,
Jerry Pournelle,
Larry Niven,
Logic Form and Function,
Scott Bakker,
Sean Carroll,
The Genome Fac tor,
The Mote in God's Eye,
Unification
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).
Alex thought about it.
"OK, so here are my three suggestions:
When I first started learning about AI, years ago, I was puzzled by two things.
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:
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:
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.
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:
---
- A rule database which tells the system what to do next
- A tree-search program, using minimax
- 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.
Labels:
automatic theorem prover,
Berthold Horn,
Game Tree,
Hyper-Resolution,
hyperresolution,
J. A. Robinson,
Minimax,
Noughts and Crosses,
Patrick Winston,
Replika,
Scala,
tic-tac-toe,
Unification
Thursday, December 15, 2016
"Logic: Form and Function": J. A. Robinson
John Alan Robinson is a semi-forgotten hero of artificial intelligence (he died four months ago). He discovered the resolution rule (and rediscovered Herbrand's concept of unification) which made automated theorem-proving a computational reality. And he wrote a book which was a classic on how to implement a resolution theorem prover.
His 1979 book, Logic: Form and Function, is out of print and now only available second-hand. It's sunk into obscurity, as you can see from Amazon's terrible image above.
After some efforts, I have managed to order a copy and will do my best to write a review (Google reports no accessible reviews on the Internet). Here is some background on Robinson (Wikipedia).
Automated theorem proving (ATP) is the engine of classical AI in the way that neural nets are the engine of contemporary AI.
Deep Learning, which makes everything into a classification problem, has superseded brittle, classical AI not least because high-level features emerge from the weight-training process under some optimisation criteria, rather than being hand-crafted by the programmer.
Check this brilliant article from the NYT (via Steve Hsu).
But if your ambitions are somewhat modest, ATP takes you a long way .. and you can do it at home, kids.
---
Here is the table of contents from "Logic: Form and Function".
And finally, here is the text from Chapter 13 where Robinson documents his (very old-fashioned) Lisp code for the hyper-resolution theorem prover (PDF).
My apologies for the poor quality, but it is readable. To make sense out of how it works, I suspect you need to buy the book and to read the preceding chapters.
![]() |
| Amazon Link |
His 1979 book, Logic: Form and Function, is out of print and now only available second-hand. It's sunk into obscurity, as you can see from Amazon's terrible image above.
After some efforts, I have managed to order a copy and will do my best to write a review (Google reports no accessible reviews on the Internet). Here is some background on Robinson (Wikipedia).
"Robinson was born in Halifax, Yorkshire, England in 1930 and left for the United States in 1952 with a classics degree from Cambridge University. He studied philosophy at the University of Oregon before moving to Princeton University where he received his PhD in philosophy in 1956. He then worked at Du Pont as an operations research analyst, where he learned programming and taught himself mathematics.---
He moved to Rice University in 1961, spending his summers as a visiting researcher at the Argonne National Laboratory's Applied Mathematics Division. He moved to Syracuse University as Distinguished Professor of Logic and Computer Science in 1967 and became professor emeritus in 1993.
It was at Argonne that Robinson became interested in automated theorem proving and developed unification and the resolution principle. Resolution and unification have since been incorporated in many automated theorem-proving systems and are the basis for the inference mechanisms used in logic programming and the programming language Prolog.
Automated theorem proving (ATP) is the engine of classical AI in the way that neural nets are the engine of contemporary AI.
Deep Learning, which makes everything into a classification problem, has superseded brittle, classical AI not least because high-level features emerge from the weight-training process under some optimisation criteria, rather than being hand-crafted by the programmer.
Check this brilliant article from the NYT (via Steve Hsu).
But if your ambitions are somewhat modest, ATP takes you a long way .. and you can do it at home, kids.
---
Here is the table of contents from "Logic: Form and Function".
And finally, here is the text from Chapter 13 where Robinson documents his (very old-fashioned) Lisp code for the hyper-resolution theorem prover (PDF).
My apologies for the poor quality, but it is readable. To make sense out of how it works, I suspect you need to buy the book and to read the preceding chapters.
Subscribe to:
Posts (Atom)






