Introduction to Logic Programming with Clojure
summary
Hands-on introduction to Clojure's logic engine core.logic showing how relations use backtracking, substitutions and unification (the run/fresh/unify primitives) to generate zero or more answers. Builds a Peano-style natural number generator that yields six values when queried and a small simply-typed lambda calculus type-determiner that can produce four distinct expressions of type integer; demonstrates a cheeky bug where an environment entry is returned as a valid solution. Works live and explains why search strategy and choice points matter.
AI-written summary · about
chapters (22)
- 0:00Intro
- 2:02Introduction to Logic Programming
- 2:48Pure Functions
- 4:14Relations
- 5:49Converting a Function to a Relation
- 9:12Logic Language Implementation
- 9:38Execution Strategy - Branches
- 10:20Execution Strategy - Failure
- 11:00Execution Strategy - Leaf Nodes
- 11:37Encapsulated Search
- 13:13Functional Approach
- 16:17Fundamental Goals
- 17:47Unification
- 18:58Initialising Logic Variables
- 19:56Choice points
- 22:54Relational Arithmetic
- 24:45Numbers
- 28:43Tracing Execution
- 30:48Type Checker..
- 32:08Type Inferencer...
- 33:09Code Generator..
- 35:51Resources
related talks
41mChallenges for Logic Programming
39mFrom Greek to Clojure!
31mDon't Stop Now
01h 02mSolving Problems the Clojure Way
40mFun with Functional Programming in Clojure
38mFun with Functional Programming in Clojure
49mA whirlwind tour of functional programming in Clojure
34mIntro to Probabilistic Programming and Clojure’s Anglican
