By W. D Burnham

From the again cover:
"The fresh advertisement and academic good fortune of Prolog has come as no shock to those that have labored for a few years with the language. it's like no different laptop language since it permits the programmer to explain a proble to the pc approach in an immediate, logical and declarative demeanour. the obvious simplicity of the syntax conceals an exceptional strength and flexibility which permits the illustration of data, the processing of normal language, quick prototyping of purposes and entirely versatile facts buildings. In no different language do the layout of a process and its programming mix so closely."

Show description

Read Online or Download Prolog Programming and Applications PDF

Best languages & tools books

SOA for the Business Developer: Concepts, BPEL, and SCA

Service-Oriented structure (SOA) is a fashion of organizing software program. in case your company's improvement tasks adhere to the foundations of SOA, the end result can be a listing of modular devices referred to as "services," which permit for a fast reaction to alter. This booklet tells the SOA tale in an easy, uncomplicated demeanour that can assist you comprehend not just the buzzwords and advantages, but additionally the applied sciences that underlie SOA: XML, WSDL, cleaning soap, XPath, BPEL, SCA, and SDO.

Additional info for Prolog Programming and Applications

Example text

1- married son (em). son (X). child L _, X). C, elsie). yes 1- married LX). X= elsie X= doris X = tracy no 1- married L-,J. yes 1- ... (session ends) 24 Prolog Programming and Applications If you study the above example carefully, it will give you a good idea of how the blank variable is used. There will be plenty of further opportunities to examine this piece of syntax. 6 Search and pattern 1IUltching We have introduced the way in which Prolog generates solutions by proving the success of goals in numerous examples.

Ii) Write a Prolog program to calculate the average value of two numbers. 3 The "cut" symbol This is represented in Prolog by the exclamation mark! and is in fact like a predicate that is built into the language. It is unlike other predicates you have encountered in that it is represented by a symbol rather than a word or or expression and that it has no arguments. The effect of the cut is to restrict the working of the search mechanism in Prolog and its action is somewhat like passing through a one-way street in a car; you go through it one way to achieve a goal but you cannot return in the reverse direction.

3 Recursion in arithmetic It can be particularly useful to program recursive routines for arithmetic. As a simple example take the case of calculating the value of a factorial of a number. (If you are unfamiliar with the definition of the factorial of a number, it is the product of the number multiplied by all the numbers below it, and applies to positive integers only. ) Here is the routine to perform the calculation fac 0',1). fac (X, Xf) :- Y is X-I, fac (Y, Yf), Xfis Yf * X. The routine relies on the fact that the factorial of any number can be derived by multiplying that number by the factorial of the number immediately below it.

Download PDF sample

Rated 4.30 of 5 – based on 16 votes