4 ms·
Simply Logical: Intelligent Reasoning by Example (1994)
- ghosthamlet 8y agoAnother Free Simply book for great programming paradigm and language, Simply Scheme: Introducing Computer Science (https://people.eecs.berkeley.edu/~bh/ss-toc2.html https://people.eecs.berkeley.edu/~bh/ss-toc2.html)
- joe_the_user 8y agoHmm, A group of tasks with prolog programs to accomplish them. Without detracting from the value of this book, the name of book made me imagine an entirely different book and topic. A list of intelligent actions accomplished by humans. Some that resist programming efforts and all organized to a picture of the difficulty of defining intelligence.
- 314 8y agoAt the time the book was written the later chapters on models of induction and abduction were describing one of the better models of human thought. There is a strong emphasis on meta-interpretation as it was believed that exploration of these models by implementing them in more specific languages would be a path towards intelligence. Peter’s new book (from 2012) shifts more heavily towards statistical methods. This reflects the unreasonable effectiveness of scruffy methods against the neater approaches. A more modern versn of this logical approach would be something like answer-set programming or other constraint based models of logic.
- deleted 8y ago[deleted]
- galaxyLogic 8y agohttps://www.metalevel.at/prolog/future https://www.metalevel.at/prolog/future
- pacala 8y agoThanks for the link. I dug a bit into the site, and failed to fully grok the "why" behind even the first example. From https://www.metalevel.at/prolog/facets#declarative https://www.metalevel.at/prolog/facets#declarative: list_length([], 0). list_length([_|Ls], N) :- N #> 0, N #= N0 + 1, list_length(Ls, N0). All makes sense, except for the subclause "N #> 0". Why is this necessary, is there any way to generate a negative N?!
- pacala 8y agoI ran the program through swish, https://swish.swi-prolog.org/p/aNiMdQgL.pl https://swish.swi-prolog.org/p/aNiMdQgL.pl. Turns out that the version without N #> 0 enters a nontermination loop when asked to produce the 2nd result for list_length2(X, 3) and fails with "Stack limit (0.2Gb) exceeded". Presumably because it unifies the first clause for the 1st result, then for 2nd result it unifies the second clause to enter negative N domain, and it's all downhill from there. Somewhat scary that one has to run programs forwards and backwards to ensure there are no hidden corner cases, but perhaps it becomes second nature for more experienced Prolog coders.
- RichardLake 8y agoYes, just ask for one. Consider list_length(A, -1) this is asking if any list A has a length of -1. If the guard is not there the second rule is valid, and a infinite recursion can result.
- zephyrfalcon 8y agoA bit further on it says: > For example, given a specific length, we can ask whether there are lists of that length: ?- list_length(Ls, 3). Ls = [_G1007, _G1087, _G1167] ; false. In the current situation, if you ask for `list_length(Ls, -1)`, this will fail, obviously because there are no lists with length -1. But if you remove the `N #> 0` clause, the code will happily try to find such a list, by checking for lists with length -2, -3, ... ad infinitum. Another way to look at this is that if you have a list `[_|Ls]` with length N, its length must be an integer greater than 0.
- djpilot 8y agoWhy is this promotion about a book published in 1994 interesting and worthy of my attention? Not news, more like nonsense.
- samwalrus 8y agoOne of the interesting things about this take on Prolog vs the Power of Prolog (https://www.metalevel.at/prolog https://www.metalevel.at/prolog), is that it attempts non-monotonic reasoning. There is still a lot of value in the ideas of abductive and inductive logic programming that have not been fully exploited in the current machine learning trends.
- ghosthamlet 8y agoA interesting modern logic programming language: https://github.com/mcsoto/cosmos https://github.com/mcsoto/cosmos