lec18 Logic Programming

lec18 Logic Programming -...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
http://www.cs.ucsd.edu/classes/fa06/cse130/lectures/prolog1.txt Logic Programming ========================================================================= (adapted from lecture notes by Henri Casanova and Todd Millstein) =============================== lecture 1 =============================== ------------------------------ introduction ----------------------------- We now turn to a brand new paradigm, called "Logic Programming Languages" -- our vehicle for studying this paradigm is Prolog, whose roots are in logic and on automated theorem proving. Prolog was developed in the 1970s for AI applications. Some such applications have a knowledge base (or database) of facts, from which you'd like to ask queries and deduce other facts. For example, given facts in the knowledge base like "Carnitas is Mexican" and "Mexican food is delicious", then we can deduce "Carnitas is delicious". Prolog probably looks nothing like any language you've seen before. Fundamental difference between Prolog and most other languages: You don't run a Prolog Program Instead, you ask questions and the system attempts to answer them using the rules and facts that it has been given. Logic programs are "declarative": the specification of the desired results are written, rather than how to obtain them. This approach is very good at expressing problems that involve searching a large space of possibilities. For example, given a list of cities and distances between them, find me the shortest route that passes through each one once (the travelling salesman problem). The philosophy of this approach is that it is often hard to specify a search algorithm -- and in such cases, it is easier to specify the characteristics of the solution. To do so, you specify *facts* and *rules* for deducing new facts from old facts, and then a *query*. So you just state what is true and then ask what (else) is true. The language implementation figures out how to actually compute appropriate solutions. Use the travelling salesman problem as an illustration: I say the constraints, not how to search the space of possible solutions. Of course, as we will see, this is a simplification, and often for reasons of efficiency, one has to impose constraints on the search. The original and principal applications for Prolog are in various AI settings such as (expert databases). Examples include using prolog-based databases to determine when credit card fraud has occurred (prolog is used to specify rules that indicate when a fraud occurs), and there are http://www.cs.ucsd.edu/classes/fa06/cse130/lectures/prolog1.txt (1 of 23) [2/13/2008 5:16:44 PM]
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
http://www.cs.ucsd.edu/classes/fa06/cse130/lectures/prolog1.txt projects afoot to use ideas from prolog to determine suspicious people from phone/communication patterns. Note that currently AI researchers devise statistical techniques to
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/14/2008 for the course CSE 130 taught by Professor Jhala during the Fall '06 term at UCSD.

Page1 / 23

lec18 Logic Programming -...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online