Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword or section
Like this
5Activity

Table Of Contents

0 of .
Results for:
No results containing your search query
P. 1
Prolog Lab Manual

Prolog Lab Manual

Ratings: (0)|Views: 2,395 |Likes:
Published by elfrich

More info:

Published by: elfrich on Jun 09, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

12/24/2012

pdf

text

original

 
Copyright © 2005 by James L. Hein. All rights reserved.
Prolog Experiments inDiscrete Mathematics,Logic, and Computability
James L. Hein
Portland State University 
January 2005
 
2
Contents
Preface
.............................................................................................................................4
1Introduction to Prolog
.....................................................................................71.1Getting Started...........................................................................................71.2An Introductory Example........................................................................81.3Some Programming Tools......................................................................11
2Beginning Experiments
................................................................................142.1Variables, Predicates, and Clauses......................................................142.2Equality, Unification, and Computation............................................182.3Numeric Computations..........................................................................212.4Type Checking..........................................................................................222.5Family Trees.............................................................................................232.6Interactive Reading and Writing.........................................................252.7Adding New Clauses...............................................................................272.8Modifying Clauses...................................................................................282.9Deleting Clauses......................................................................................30
3Recursive Techniques
....................................................................................333.1The Ancestor Problem.............................................................................333.2Writing and Summing............................................................................353.3Switching Pays.........................................................................................383.4Inductively Defined Sets........................................................................40
4Logic
......................................................................................................................444.1Negation and Inference Rules...............................................................444.2The Blocks World.....................................................................................464.3Verifying Arguments in First-Order Logic........................................484.4Equality Axioms.......................................................................................504.5SLD-Resolution........................................................................................514.6The Cut Operation...................................................................................53
5List Structures
..................................................................................................565.1List and String Notation........................................................................565.2Sets and Bags of Solutions to a Query................................................585.3List Membership and Set Operations.................................................625.4List Operations.........................................................................................66
 
Contents 
3
6List Applications
..............................................................................................706.1Binary Trees..............................................................................................706.2Arranging Objects....................................................................................726.3Simple Ciphers.........................................................................................756.4The Birthday Problem............................................................................786.5Predicates as Variables..........................................................................796.6Mapping Numeric Functions................................................................816.7Mapping Predicates.................................................................................826.8Comparing Numeric Functions............................................................846.9Comparing Predicates.............................................................................86
7Languages and Expressions
........................................................................887.1Grammar and Parsing............................................................................887.2A Parsing Macro.......................................................................................897.3Programming Language Parsing.........................................................917.4Arithmetic Expression Evaluation......................................................92
8Computability
....................................................................................................968.1Deterministic Finite Automata............................................................968.2Nondeterministic Finite Automata......................................................988.3Mealy Machines.....................................................................................1018.4Moore Machines.....................................................................................1048.5Pushdown Automata.............................................................................1068.6Turing Machines....................................................................................1088.7Markov Algorithms................................................................................1128.8Post Algorithms......................................................................................114
9Problems and Projects
.................................................................................1189.1Lambda Closure.....................................................................................1189.2Transforming an NFA into a DFA.....................................................1209.3Minimum-State DFA............................................................................1269.4Defining Operations..............................................................................1309.5Tautology Tester....................................................................................1329.6CNF Generator.......................................................................................1369.7Resolution Theorem Prover for Propositions...................................137
10Logic Programming Theory
......................................................................14210.1The Immediate Consequence Operator............................................14210.2Negation as Failure...............................................................................14310.3SLDNF-Resolution................................................................................145
 Answers to Selected Experiments
...................................................................147
Index
.............................................................................................................................158

Activity (5)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Asfaw Woldie liked this
Sam Djjs Nilesh liked this
Poonam Kadu liked this

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->