Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Anniepoo/prolog-examples
Some simple examples for new Prolog programmers
https://github.com/Anniepoo/prolog-examples
family-tree prolog
Last synced: about 1 month ago
JSON representation
Some simple examples for new Prolog programmers
- Host: GitHub
- URL: https://github.com/Anniepoo/prolog-examples
- Owner: Anniepoo
- Created: 2012-10-18T17:49:32.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2022-11-04T13:05:51.000Z (about 2 years ago)
- Last Synced: 2024-08-01T13:34:58.686Z (4 months ago)
- Topics: family-tree, prolog
- Language: Prolog
- Size: 85 KB
- Stars: 564
- Watchers: 24
- Forks: 175
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-ccamel - Anniepoo/prolog-examples - Some simple examples for new Prolog programmers (Prolog)
README
prolog-examples
===============Some simple examples for new Prolog programmers.
Varying degrees of polish. Have fun.## finished examples
### detective problem
These are two approaches to solving a detective's problem.
She's interrogated three witnesses to a murder, all of whom are also suspects.
The problem is to determine which of the suspect's testimony is
inconsistent with the others.* detectivepuzzle.pl - My original solution, written when I was new to Prolog.
It now feels very 'imperative'
* newdetective.pl - I recently rewrote it
* adriandetective.pl - Adrian King's solution### talespin2.pl
Implementation of a classic story generator
(note that a far better implementation is at https://github.com/SWI-Prolog-Education/talespin-annie)### tictactoe.pl
Implementation of tic tac toe
### birds.pl
The birds example from the 'expert systems in Prolog' tutorial
by Amzi (on the web)### cannibals2.pl
A well commented example of the cannibals/missionaries problem
This was used as an example for a talk whose notes are in may15version.txt
cannibals2nocomments.pl has fewer comments, but has some additional capabilities
### cuttutorial.pl
A little story analogy to help understand cut and cut, fail
### emoticons.pl
A joke. I'm known for my happy array of 'smiley' emoticons. Sometimes others
have trouble understanding my smileys. This program purports to help.### familytree.pl
The classic familytree example. This one has two separate families in it.
(left as exercise for the reader to find the two disconnected groups).### socketdemo.pl
Demonstration of reading from a socket
## Constraint examples
Examples of CLPFD
### addlists.pl
Constrains two lists to pairwise add to a third.
### children.pl
A fully worked problem involving seating children in a classroom
### constraintolist.pl
A fully worked problem, constraining a variable to be a member of a list.
### sudoku.pl
Solves a Sudoku puzzle by CLPFD
### loops.pl
Demo of various ways to do in Prolog what you'd do with loops in
an imperative language.### nqueens.pl
Implementation of the generalized version of the classic 8-queens problem.### techtree2.pl
solve game 'tech tree' problems using CHR.