CS 603: Programming Languages - PowerPoint PPT Presentation

1 / 5
About This Presentation
Title:

CS 603: Programming Languages

Description:

if pred is satisfied, try to satisfy predT, otherwise try to satisfy predF ... Load file by doing: ['MP3.pl']. Use up arrow to retrieve previous commands ... – PowerPoint PPT presentation

Number of Views:37
Avg rating:3.0/5.0
Slides: 6
Provided by: csUa
Category:

less

Transcript and Presenter's Notes

Title: CS 603: Programming Languages


1
CS 603 Programming Languages
  • Lecture 30
  • Spring 2004
  • Department of Computer Science
  • University of Alabama
  • Joel Jones

2
Overview
  • More about Prolog
  • Using SWI-Prolog
  • Using Horn Clauses as a semantics

3
More Prolog
  • if statements
  • pred -gt predT predF
  • if pred is satisfied, try to satisfy predT,
    otherwise try to satisfy predF
  • Managing the fact base
  • assert(pred) adds pred to fact base
  • retractall(pred) removes all matching preds
    from fact base.

4
Using SWI-Prolog
  • Run from Start menu
  • Put facts and rules in a file, like MP3.pl
  • Load file by doing
  • MP3.pl.
  • Use up arrow to retrieve previous commands
  • Do queries, ending with .
  • Add trace to do tracing
  • Enter key steps, n stops tracing

5
Using Prolog to Implement Languages
  • See Handout
Write a Comment
User Comments (0)
About PowerShow.com