This is Chapter 8 of the book PAIP. It still uses pattern-match and rules to design several simple algorithms to do symbolic math simplification. I just go through the ideas in the book, and design my own program to pass all the cases in the book. The code is in https://github.com/kainwen/paip/tree/master/sym_math2/.
Continue readingCategory Archives: paip
Eliza in Erlang
Introduction
This is Chapter 5 of the book PAIP. It implemented an early-day algorithm to dialog with a machine. It had the appearance of AI, but actually it was just another interpreter: programmer designs some rules at first, and then eval the user’s input. The main topic is pattern-match programming.
Pattern-match is really my favorite language feature. Erlang and many functional programming languages (Oz, ML, …) support it quite well. C language offers switch statement which can only match constant expression in each clause. Different languages may have different scopes for pattern variables.
GPS in Erlang
The book PAIP
GPS is the acronym for General Problem Solver. The book Norvig, Peter. Paradigms of artificial intelligence programming: case studies in Common LISP. Morgan Kaufmann, 1992 spent the whole Chapter 4 to show how you can program a GPS using common lisp and pointed out several “bugs” that you should pay attention to. This is a great book that I highly recommend it.
Since EOPL, I am convinced that Erlang is a very good language to implement other language or write AI paradigm program. My several projects are:
- finish EOPL’s several language model and exercises: https://github.com/kainwen/eopl
- Jack_{vm, assembler, compiler}:
More details on Common Lisp implementation can be found in the open-source repo: https://github.com/norvig/paip-lisp.
Continue reading