Skip to content

Tutorials

Tutorials are lessons: they take you, step by step, from nothing to a working program. Follow them in order if you are new to 2PPy.

  1. Getting started: install 2PPy, create a solver, and ask it your first queries from Python.
  2. Your first logic program: write a small knowledge base about a family, with facts, rules and recursion; query it, change it while it runs, and extend it with a predicate written in Python.

No previous knowledge of Prolog or of 2P-Kt is needed. If you want the concepts behind the code, read Logic programming in a nutshell alongside. Once you are comfortable, the how-to guides show how to accomplish specific tasks.

To learn by example, the example notebooks show 2PPy at work, from terms to probabilistic logic programming.