By William F. Clocksin, Christopher S. Mellish

Originally released in 1981, this was once the 1st textbook on programming within the Prolog language and continues to be the definitive introductory textual content on Prolog. although many Prolog textbooks were released considering the fact that, this one has withstood the try out of time as a result of its comprehensiveness, instructional strategy, and emphasis on common programming applications.

Prolog has persisted to draw loads of curiosity within the computing device technology neighborhood, and has grew to become out to be a foundation for a major new new release of programming languages and platforms for synthetic Intelligence. because the prior variation of Programming in Prolog, the language has been standardised by way of the foreign association for Standardization (ISO) and this booklet has been up to date for that reason. The authors have additionally brought a few new fabric, clarified a few factors, corrected a few minor blunders, and got rid of appendices approximately Prolog platforms which are now obsolete.

Show description

Read Online or Download Programming in Prolog PDF

Best compilers books

The Definitive Guide to SugarCRM: Better Business Applications (Books for Professionals by Professionals)

SugarCRM is one in all if now not the major Open resource CRM answer on the market at five. five million downloads and transforming into and with approximately 17,000 registered builders and plenty extra clients. this may be the respectable, definitive ebook written by way of SugarCRM and counseled by way of SugarCRM. additionally, this e-book will be additionally the one SugarCRM developer publication in order to deal with the platform comparable beneficial properties on account that SugarCRM five.

Methodologies and Software Engineering for Agent Systems: The Agent-Oriented Software Engineering Handbook

As details applied sciences develop into more and more allotted and available to bigger variety of humans and as advertisement and executive organisations are challenged to scale their functions and companies to greater industry stocks, whereas decreasing expenditures, there's call for for software program methodologies and appli- tions to supply the subsequent beneficial properties: Richer program end-to-end performance; aid of human involvement within the layout and deployment of the software program; Flexibility of software program behaviour; and Reuse and composition of present software program functions and structures in novel or adaptive methods.

Numeric Computation and Statistical Data Analysis on the Java Platform

Numerical computation, wisdom discovery and statistical facts research built-in with strong second and 3D pix for visualisation are the major subject matters of this e-book. The Python code examples powered by way of the Java platform can simply be remodeled to different programming languages, similar to Java, Groovy, Ruby and BeanShell.

Additional info for Programming in Prolog

Example text

Density(china, X). - density(turkey, X). no In the first question, the X=200 is Prolog's answer, meaning 200 people per square mile. The second question failed, because the population of Turkey could not be found in our example database. Depending on what computer you use, various arithmetic operators can be used on the right-hand side of the "is" operator. All Standard Prolog systems, however, will have the following, as well as many more: X X X X X X +Y -Y *Y / Y // Y mod Y the sum of X and Y the difference of X and Y the product of X and Y the quotient of X divided by Y the integer quotient of X divided by Y the remainder of X divided by Y This list together with the above list of comparison operators should tell you nearly all you need for doing simple arithmetic problems.

This corresponds roughly to the use of a pronoun in English. In the example Prolog clauses we have seen so far, we have used variables with names such as X, Y, and Z. However, the names can be as long as you like, for example: Answer Input Gross_Pay _3_blind_mice A_very_long_variable_name Sometimes one needs to use a variable, but its name will never be used. For example, if we want tofind out if anyone likes John, but we do not need to know just who it is, we can use the anonymous variable. The anonymous variable is written as a single underline character.

Suppose someone has already written Prolog clauses that define the following relationships: father(X, Y) mother(X, Y) male(X) female(X) parent(X, Y) diff(X, Y) /* X is the father of Y */ /* X is the mother of Y */ /* X is male */ /* X is female */ /* X is a parent of Y */ /* X and Y are different */ The exercise is to write Prolog clauses to define the following relationships: is_mother(X) is_father(X) is_son(X) sister_of(X, Y) grandpa_of(X, Y) sibling(X, Y) /* X is a mother */ /* X is a father */ /* X is a son */ /*X is a sister ofY*/ /* X is a grandfather ofY */ /* X is a sibling ofY*/ For example, we could write a rule for aunt, provided we were supplied with (or wrote) rules for female, sibling, and parent.

Download PDF sample

Rated 4.62 of 5 – based on 23 votes