More ways to say 'program': why developers are exploiting C, Ada, Prolog and Lisp programming tools

Software Magazine, July, 1988 by Jerry Cashin

Ada's failure to support Lisp-type constructs needed in applications involving artificial intelligence concerns some observers. These features will be prevalent in future weapons control and related embedded systems.

Lisp code itself can be included in Ada programs using the latter's interface specification, but too much of this hybridization would violate the very uniformity Ada was intended to provide.

Whether Ada is ultimately accepted may depend on whether it is used for artificial intelligence, and what effect this will have on its future viability in military and commercial embedded systems.

Prolog isn't limited to artificial intelligence applications, although it is certainly strong in that arena. It is also a good, general purpose programming language that can be employed for many procedures, especially those involving data relationships in database applications.

"Prolog runs well on general purpose hardware. It also mixes well with other languages," says Peter Gabel, president of Arity Corp., Concord, Mass. "C syntax expressions can be embedded in Prolog. This marriage of the two languages further enhances Prolog."

From a conceptual standpoint, Prolog programs exist as an aggregation of logical premises or axioms. Upon execution, a program validates a result emanating from those logical premises. It differs from other conventional languages (Pascal, Fortran) not only syntactically, but in its very structure and intent.

Initially developed during the early 1970s, Prolog has now been designated as the language of choice for the Japanese Fifth-Generation architecture. Coupled with that kind of endorsement, Prolog's database capability and strength in pattern matching and backtracking make it even more relevant today.

A simple Prolog clause might look like this:

tag("Bob Jones", "CLC Comm")

tag("Al Smith", "CLS Comm VP")

tag("Bob Morgan", "CLS Comm Treas")

tag ("Henry Davis", "MBE-1 Corp")

tag("Tom Carter", "MBE-1 Corp")

locus("CLS Comm", "Berlin")

locus("MBE-1 Corp", "San Diego")

locus("MBE-1 Corp", "La Jolla")

The first entries, i.e. tag or locus, are called a functor. The items within the parentheses are referred to as arguments. Prolog will search for one or more items in a database using a pattern such as: tag ("Person", "MBE-1 Corp"). When finding a match, it leaves a backtracking marker in the database if there is another alternative. Then the next "MBE-1 Corp" argument receives the backtracking marker.

These markers are not an intrinsic part of the database, but applied automatically by Prolog. Many markers may be used during a search. The pattern matching which goes on during a search follows a precise set of rules involving variables and constants, which are exhaustively delineated in technical volumes dealing with Prolog.

The preceding example barely scratches the surface of Prolog's richness as a language. It is in reality a comprehensive programming tool that employs identical syntax for programs and data.

A Prolog program is integrated in the Prolog database and consists of a collection of axiomatic clauses. The combination of pattern matching, backtracking, control structures, and variables form the basis of the language's incredible power.


 

BNET TalkbackShare your ideas and expertise on this topic

Please add your comment:

  1. You are currently: a Guest |
  2.  

Basic HTML tags that work in comments are: bold (<b></b>), italic (<i></i>), underline (<u></u>), and hyperlink (<a href></a)

advertisement
CXO UnpluggedSmart Business interviews on BNET

See and hear how senior level executives across the Asia Pacific are developing smart business ideas across a variety of sectors. The focus is on the future, and on how businesses need to evolve.

advertisement
  • Click Here
  • Click Here
  • Click Here
  • Click Here
advertisement

Content provided in partnership with Thompson Gale