Prolog Samples

These samples illustrate some of the possibilities and unique features of Amzi! Prolog.

Babel - Babel is a simple machine translation demo that recognizes the input language of a sentence and translates it into all of the other supported languages. It uses Unicode to represent the characters in the languages.

misc_one_file/birds.pro - A sample expert system for identifying birds. The ideas in this system can be used for any identification type expert system, including identifying problems based on symptoms.

misc_one_file/catch.pro - A sample that illustrates the use of catch/3 and throw/1 for implementing code that processes error exceptions.

Configuration - A prototype of a configuration system that separates the reasoning engine, user interface, and actual product knowledge. The knowledge is stored in a subset of Prolog stylized for configuration.

misc_one_file/custord.pro - A small sample customer-order-entry system written entirely in Prolog. It shows how Prolog can be used for both the database as well as the transaction processing parts of a business application and encode rules for valid orders and inventory management.

misc_one_file/dcgxpand.pro - Source code for the DCG -> Prolog translator. This is the predicate that converts DCG syntax into the equivalent Prolog, inserting difference lists as appropriate. A compiled version of this code is included in the base system.

misc_one_file/dospath.pro - A DCG program that reads DOS path names, verifies that they are correct, and splits them into directory and path.

Duckworld - The Ducks adventure game example used in the Prolog programmer's guide short tutorial.

misc_one_file/eliza_uga.pro - A version of the famous Eliza program, developed at the University of Georgia.

misc_one_file/gene.pro - A collection of rules for family relationships, as well as rules for saving family data checking semantic integrity of updates. See ENGLAND.FAM as a sample data file for a specific family.

misc_one_file/logicW.pro - Clocksin & Mellish's classic program for translating formal logic to Prolog clauses, using Unicode characters for the logic symbols. Requires a wide-character enabled editor/environment to see the characters, such as wideW.exe, with a font such as Lucida sans Unicode.

misc_one_file/money.pro - A program that solves word arithmentic problems, such as the famous S E N D + M O R E = M O N E Y.

mlist/mlist.pro - A sample DCG program that parses address labels into fields that can be entered in a database. For example, the label line 'STOW MA 01775' is parsed into city, state, and zipcode fields. See source code for documentation.

misc_one_file/nanisrch.pro - The sample adventure game used with Adventure in Prolog.

misc_one_file/pi.pro - Computes digits of pi.

misc_one_file/preprocessor_trace.pro - An example of using the preprocessor to define trace and error checking predicates that are only included in the program when a debugging flag is turned on.

ProXS - A general expert system shell with loadable rules for identification.

Rubik - The Rubik's Cube solver runs by itself in the IDE, or from the console, using a text based representation of the cube as its solved. Simple choose build/run and select rubik.xpl to see it run.

Ship - A sample program for presenting various shipping options for a package or letter. The various options and costs are computed with a combination of rules, tables and formulas.

SSched - A program that schedules teams for a tournament or season.

taxes/tax.pro - A sample program for filling out tax forms, plus an article, originally published in PCAI, describing how the program works.

misc_one_file/traffic1.pro - A very simple application illustrating how to implement a custom rule language and inference engine for it. The example uses a goal-driven engine.

misc_one_file/traffic2.pro - The same rules as in TRAFFIC1.PRO, and another simple inference engine, but this time a data-driven one.

misc_one_file/traffic3.pro - The same traffic rules, but with more readable syntax and loaded from a separate file.

Tutorial Tests - A tutorial testing application that implements a simple prototype of a tool for building tests that are designed to evaluate and teach as the student takes the test. The sample is also an illustration of a knowledgebase architecture.

warplan/WarPlan - David Warren's classic planning program, with a number of sample problems.

misc_one_file/wordlist.pro - A version of Clocksin and Mellish's program to read free form input from the user and parse it into lists of words.

Copyright ©1987-2004 Amzi! inc. All Rights Reserved. Amzi! is a registered trademark and Logic Server and e-Prolog are trademarks of Amzi! inc.