Artificial Intelligence Expert Systems Prolog - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

Artificial Intelligence Expert Systems Prolog

Description:

First developed in 1975 to facilitate natural-language processing ... Rules describe relationships for current application. Building with blueprints not bricks ... – PowerPoint PPT presentation

Number of Views:261
Avg rating:3.0/5.0
Slides: 13
Provided by: justin79
Category:

less

Transcript and Presenter's Notes

Title: Artificial Intelligence Expert Systems Prolog


1
Artificial Intelligence / Expert SystemsProlog
  • Justin Gaudry
  • June 8, 2007

2
Prolog
  • PROgramming in LOGic
  • First developed in 1975 to facilitate
    natural-language processing
  • Based on relationships and logical inference

3
Declarative Paradigm
  • Does not describe how to compute a solution
  • Program consists of a database
  • Facts
  • Logical rules
  • Rules describe relationships for current
    application
  • Building with blueprints not bricks

4
Declarative Paradigm
  • User does not run a program to obtain a solution
  • A database is loaded into Prolog interpreter
  • User asks a question
  • Inference engine determines the answer by logical
    deduction

5
Features
  • Logical variables
  • Behave like mathematical variables
  • Unification
  • Backtracking
  • Uniform data structures
  • Predicates and lists

6
  • Facts
  • dog(fido).
  • worksFor(hal, mary).
  • Rules
  • dog(X) - barks(X).
  • worksFor(X,Y) - getsCoffee(Y,X).
  • Queries (user questions)

7
Elements of Prolog
  • Variables
  • Must begin with uppercase
  • Weakly typed
  • Constants
  • Numbers
  • Items starting with lowercase
  • Items enclosed in single quotes ( )

8
Simple Data Types
  • boolean
  • true, fail
  • integer
  • Integers
  • real
  • Floating point numbers
  • variable
  • Variables
  • atom
  • Character sequences

9
Builtin Predicates
  • var(V)
  • V is a variable
  • nonvar(NV)
  • NV is not a variable
  • atom(A)
  • A is an atom
  • integer(I)
  • I is an integer
  • real(R)
  • R is a floating point number
  • number(N)
  • N is an integer or real
  • atomic(A)
  • A is an atom or a number

10
Operators
  • is assignment
  • addition
  • - subtraction
  • multiplication
  • / real division
  • // integer division
  • mod modulus
  • power

11
Command-Line Interface
  • On osprey, sicstus
  • Queries end with . (no quotes)
  • file. Loads the file from current directory
  • halt. Exits sicstus

12
Recursion
  • Basic control structure
  • Inductive definitions
  • Base case(s)
  • Inductive case(s)
Write a Comment
User Comments (0)
About PowerShow.com