- Page 1 and 2: AI 08226 1 Prolog (PROgramming in L
- Page 3 and 4: Introduction 3 Prolog is a declara
- Page 5 and 6: Predicates and Functors 5 Prolog p
- Page 7 and 8: Terms and variables 7 NO such thin
- Page 9 and 10: Hints 9 Which prolog available for
- Page 11 and 12: Use Comments in Code 11 Use Commen
- Page 13: Prolog Syntax Constant Integer: 0,
- Page 17 and 18: Example Facts - greek.pl 17 male(c
- Page 19 and 20: More on the use of not 19 female(a
- Page 21 and 22: Prolog and logic (in later lectures
- Page 23 and 24: The use of the Semi-colon - or 23
- Page 25 and 26: Prolog programs 25 Consist of clau
- Page 27 and 28: Querying the program in swi-prolog
- Page 29 and 30: Program Execution 29 Prolog tries
- Page 31 and 32: Example Prolog Execution I 31 - ru
- Page 33 and 34: Example Prolog Execution III 33 Loo
- Page 35 and 36: Example Prolog Execution V 35 Look
- Page 37 and 38: On Prolog Execution 37 Prolog expl
- Page 39 and 40: Tree1 39 rule(A) fact(X, , Color),
- Page 41 and 42: Tree3 - first of the succeeds rule(
- Page 43 and 44: Modelling Automata 43 A Finite Sta
- Page 45 and 46: FSM as prolog - state change functi
- Page 47 and 48: THE Full FSM in prolog : fsm1.pl 47
- Page 49 and 50: Matching 49 General rules for matc
- Page 51 and 52: Matching of Variables 51 Order of
- Page 53 and 54: Matching 53 Matching in prolog alw
- Page 55 and 56: Unification & The occurs check 55
- Page 57 and 58: Testing data 57 valid(day, Day):-
- Page 59 and 60: Example :Month Conversion program 5
- Page 61 and 62: Arithmetic Program 61 run:-
- Page 63 and 64: Unacceptable Prolog! The following
- Page 65 and 66:
Programming Techniques : Recursion
- Page 67 and 68:
Prolog So Far L1 - Prolog basics a
- Page 69 and 70:
Example of Recursion* 69 factorial
- Page 71 and 72:
Lists in Prolog* 71 List: an order
- Page 73 and 74:
Lists, characters and “strings”
- Page 75 and 76:
Handling Lists* 75 The [Head | Tai
- Page 77 and 78:
Building a List from Input* 77 bui
- Page 79 and 80:
Testing for a list - is_list/1 (bui
- Page 81 and 82:
Useful List Predicates* 81 Testing
- Page 83 and 84:
Useful List Predicates 83 Appendin
- Page 85 and 86:
Deleting the elements of a list 85
- Page 87 and 88:
- trace, permutation([a, b, c], L).
- Page 89 and 90:
More Built-in List Predicates* 89
- Page 91 and 92:
Asserting Predicates 91 assert/1 -
- Page 93 and 94:
Static and Dynamic Clauses 93 Cann
- Page 95 and 96:
Retracting Predicates 95 retract/1
- Page 97 and 98:
Retracting Predicates 97 Can use r
- Page 99 and 100:
Does a clause exist - listing. 99
- Page 101 and 102:
Combining clause and retract - list
- Page 103 and 104:
More on Findall 103 - assert( fish(
- Page 105 and 106:
Compound Terms via Findall 105 fish
- Page 107 and 108:
Prolog for Senses for FSM-Agent 107
- Page 109 and 110:
When is a thing a block 109 % block
- Page 111 and 112:
How is an agent run 111 % run_agent
- Page 113 and 114:
Compound Terms 113 Can use simple
- Page 115 and 116:
Alternative is to use compound term
- Page 117 and 118:
Alternative: Structure it yourself
- Page 119 and 120:
Tracing Frequency 119 trace, freque
- Page 121 and 122:
Variation 2 on Frequency with Cut (
- Page 123 and 124:
Goals and Cut Suppose rule p with
- Page 125 and 126:
Running the two versions - input1.
- Page 127 and 128:
So what happens 127 - same_rule(X,Y
- Page 129 and 130:
Run Time 129 member1 will succeed f
- Page 131 and 132:
The use of cut in negation - versio
- Page 133 and 134:
Negation as failure 133 - animal(X)
- Page 135 and 136:
Principles of Good Programming 135
- Page 137 and 138:
Thinking about prolog programs 137
- Page 139 and 140:
Consider intersection of sets probl
- Page 141 and 142:
Test cases: Set UNION without not 1
- Page 143 and 144:
Testing setunion with The CUT - set
- Page 145 and 146:
Set Intersection using not 145 Set
- Page 147 and 148:
Generalisation 147 The idea is to
- Page 149 and 150:
Example of structuralisation 149 C
- Page 151 and 152:
Some rules of good Prolog style 151
- Page 153 and 154:
merge - better style 153 merge2([ ]
- Page 155 and 156:
- trace, merge2([1,2],[1],L). Call
- Page 157 and 158:
Bubble Sort 157 bubblesort(List, ,
- Page 159 and 160:
Running swap.pl - with time/1 159
- Page 161 and 162:
Manipulating Characters atom_chars
- Page 163 and 164:
Manipulating Characters 163 name/2
- Page 165 and 166:
Manipulating Characters 165 Input
- Page 167 and 168:
- var(X), X = 2. - nonvar(X), X = 2
- Page 169 and 170:
What does the following code do 169
- Page 171 and 172:
Getting a listing 171 listing/0 li