All Projects → triska → The Power Of Prolog

triska / The Power Of Prolog

Introduction to modern Prolog

Programming Languages

prolog
421 projects

Projects that are alternatives of or similar to The Power Of Prolog

Blockchain guide
Introduce blockchain related technologies, from theory to practice with bitcoin, ethereum and hyperledger.
Stars: ✭ 5,897 (+659.92%)
Mutual labels:  book
The Way To Go zh cn
《The Way to Go》中文译本,中文正式名《Go 入门指南》
Stars: ✭ 28,323 (+3549.87%)
Mutual labels:  book
Learn Vim
Learning Vim and Vimscript doesn't have to be hard. This is the guide that you're looking for.
Stars: ✭ 7,221 (+830.54%)
Mutual labels:  book
Ibooks
计算机图书,java,mysql,架构类,web
Stars: ✭ 666 (-14.18%)
Mutual labels:  book
Dsa.js Data Structures Algorithms Javascript
🥞Data Structures and Algorithms explained and implemented in JavaScript + eBook
Stars: ✭ 6,251 (+705.54%)
Mutual labels:  book
Progit
Pro Git Book Content, 1st Edition - This content is deprecated. See 2nd edition at [progit2](https://github.com/progit/progit2)
Stars: ✭ 5,972 (+669.59%)
Mutual labels:  book
Rein
Database constraints made easy for ActiveRecord.
Stars: ✭ 657 (-15.34%)
Mutual labels:  constraints
Go Internals
A book about the internals of the Go programming language.
Stars: ✭ 6,694 (+762.63%)
Mutual labels:  book
Dry Types
Flexible type system for Ruby with coercions and constraints
Stars: ✭ 678 (-12.63%)
Mutual labels:  constraints
Webrtc Book Cn
中文翻译 《 Real-Time Communication with WebRTC 》
Stars: ✭ 726 (-6.44%)
Mutual labels:  book
Html5 Animation
Foundation HTML5 Animation with JavaScript example code and book exercises.
Stars: ✭ 667 (-14.05%)
Mutual labels:  book
Interpy Zh
📘《Python进阶》(Intermediate Python 中文版)
Stars: ✭ 5,964 (+668.56%)
Mutual labels:  book
Buildfirst
🔨 JavaScript Application Design: A Build First Approach. Code Samples and Snippets
Stars: ✭ 715 (-7.86%)
Mutual labels:  book
Lcthw Zh
📖 【译】笨办法学C
Stars: ✭ 664 (-14.43%)
Mutual labels:  book
Easybook
Book publishing as easy as it should be (built with Symfony components)
Stars: ✭ 744 (-4.12%)
Mutual labels:  book
Clean Code Persian
ترجمه گروهی کتاب کدتمیز
Stars: ✭ 659 (-15.08%)
Mutual labels:  book
Pure Bash Bible
📖 A collection of pure bash alternatives to external processes.
Stars: ✭ 28,109 (+3522.29%)
Mutual labels:  book
Rust Learning
A bunch of links to blog posts, articles, videos, etc for learning Rust
Stars: ✭ 7,431 (+857.6%)
Mutual labels:  book
Ethereum Development With Go Book
📖 A little book on Ethereum Development with Go (golang)
Stars: ✭ 754 (-2.84%)
Mutual labels:  book
Example.v2
An example project for book 'Go Programming & Concurrency in Practice, 2nd edition' (《Go并发编程实战》第2版).
Stars: ✭ 722 (-6.96%)
Mutual labels:  book

The Power of Prolog

Introduction to modern Prolog

Prolog is a programming language that is rooted in formal logic. It supports search and unification as built-in features. Prolog allows us to elegantly solve many tasks with short and general programs.

The goal of this material is to bridge the gap between the great traditional Prolog textbooks of the past and the language as it currently is, several decades after these books were written. You will see that many limitations of the past are no longer relevant, while several new constructs are now of great importance even though they are not yet covered in any available Prolog book.

Reading this book

This book is self-hosting: It includes an HTTP server that lets you browse most of the content locally. When you access files that are not locally available, it redirects to their online versions.

You need Scryer Prolog to run it. For example, to spawn the server on port 6012, use:

$ scryer-prolog -g "server(6012)" server.pl

Then, direct your browser to:

http://localhost:6012/prolog

If you are new to Prolog, read the chapters in order for a self-contained exposition of many important language features. If you already have some experience with Prolog and would like to learn more about more recent aspects, I recommend you start with the chapter on integer arithmetic and proceed with the chapters it links to.

About this book

The latest version of this book is always available from:

https://www.metalevel.at/prolog

I will periodically synch this repository with new material as it becomes available.

I started writing this book in 2005, when I was a student of Ulrich Neumerkel in Vienna. A collection of Prolog meta-interpreters formed the first chapter.

To run the code examples, you can use every Prolog implementation that conforms to the Prolog ISO standard and provides the following conforming extensions:

  • Definite Clause Grammars (DCGs)
  • constraints like dif/2 and declarative integer arithmetic
  • alternative execution strategies such as SLG resolution.

A conforming extension is a language feature that would not cause any ambiguity or contradiction if it were added to the Prolog standard, ISO/IEC 13211. Notably, a conforming extension must not change the meaning of Prolog text which conforms to the standard. Each of the above features can be added to every Prolog system in a conforming manner, as exemplified by the following recommended Prolog systems:

  • SICStus Prolog A state-of-the-art, ISO standard compliant, Prolog system.
  • Scryer Prolog A modern Prolog implementation written mostly in Rust.
  • GNU Prolog A free Prolog compiler with constraint solving over finite domains.

In the example code, I assume that the Prolog flag double_quotes is set to the value chars so that strings in double-quotes are interpreted as lists of characters. This was the case in the original Prolog implementation, Marseille Prolog, and is already the default value in the three newest Prolog implementations, Scryer Prolog, Tau Prolog and Trealla Prolog. It is to be hoped that other Prolog systems will also adopt this setting to make string processing with Prolog more convenient.

In some cases, slight modifications to code snippets may be necessary to adjust for different libraries or small variations. See your Prolog system's manual, or ask on Stackoverflow and comp.lang.prolog for more information.

On teaching Prolog

Prolog is an interesting programming language: It has a pure monotonic core, and it also has features that are called impure. You, the programmer, must decide in which subset of the language you want to program.

In a sense, programming in Prolog is like writing a poem: You can achieve great effects by writing under stringent constraints. In Prolog, you often get the best results by restricting your work to the pure core of the language. As long as you do this, you can benefit from strong logical properties which let you reason about your programs in systematic ways that are not available in most other programming languages.

In the past decades, many pure features have become widely available in Prolog systems. This book explains many of these new features, and shows you how you can use them to achieve general and efficient Prolog programs.

Currently, new pioneers are arising: The first instructors who use this book in their courses! For example:

Le message dur:
Restez purs!
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].