-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
172 lines (162 loc) · 4.35 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
---
layout: slides
title: Interactive lab examples
subtitle: Simply Logical
---
<section>
<section>
<h2>Fibonacci sequence</h2>
Demonstrates the use of accumulators, and the difference between interpreted and uninterpreted arithmetic expressions.
</section>
<section>
This implementation of the Fibonacci sequence is very inefficient -- the 30th number takes about 90 seconds!
{% include swish_box.html id="fib" %}
</section>
<section>
Variant of <code>fib/2</code> that returns an uninterpreted arithmetic expression showing the computation tree.
{% include swish_box.html id="fibt" %}
</section>
<section>
We can get an efficient version by solving a more general problem!
{% include swish_box.html id="fibn" %}
</section>
</section>
<section>
<section>
<h2>Second-order predicates</h2>
generate all solutions to a query.
{% include swish_box.html id="biglist" %}
</section>
<section>
Sorting, quick and dirty
{% include swish_box.html id="setof_sort" %}
</section>
<section>
Existential variables
{% include swish_box.html id="secondorder" %}
</section>
<section data-markdown>
<script type="text/template">
See also
- [`library(aggregate)`](http://www.swi-prolog.org/pldoc/man?section=aggregate)
- [`library(apply)`](http://www.swi-prolog.org/pldoc/man?section=apply)
- e.g. `maplist/3` example on [`fibn/2`](/#/1/3)
</script>
</section>
</section>
<section>
<section data-markdown>
<script type="text/template">
## Generate and test
This is a programming technique exploiting Prolog's non-determinism:
- a *generator* generates candidate solutions;
- a *tester* checks whether a candidate has the required properties.
It will be beneficial to make the generator as efficient as possible
</script>
</section>
<section>
An AI classic: N non-attacking queens
{% include swish_box.html id="nqueens" %}
</section>
<section>
Finding prime factors:
{% include swish_box.html id="factors" %}
</section>
<section>
How not to use generate and test:
{% include swish_box.html id="psort" %}
</section>
</section>
<section>
<section>
<h2>Meta-interpreters</h2>
{% include swish_box.html id="prove" %}
</section>
<section>
Keep conjunctive resolvent together
{% include swish_box.html id="prove_r" %}
</section>
<section>
Show (propositional) proof tree
{% include swish_box.html id="prove_p" %}
</section>
</section>
<section>
<section>
<h2>Depth-first search and variants</h2>
{% include swish_box.html id="search_df" %}
</section>
<section>
Depth-first search without agenda = transitive closure
{% include swish_box.html id="search_bt" %}
</section>
<section>
Backtracking DF search with depth bound
{% include swish_box.html id="search_d" %}
</section>
<section>
Iterative deepening
{% include swish_box.html id="search_id" %}
</section>
<section>
Don't use search if an analytic solution exists!
{% include swish_box.html id="hanoi" %}
</section>
</section>
<section>
<section>
<h2>Breadth-first search</h2>
{% include swish_box.html id="search_bf" %}
</section>
<section>
Breadth-first meta-interpreter
{% include swish_box.html id="prove_bf" %}
</section>
<section>
Meta-interpreter for full clausal logic
{% include swish_box.html id="refute_bf" %}
</section>
<section>
Forward chaining
{% include swish_box.html id="model" %}
</section>
<section>
Depth-bounded forward chaining for infinite domains
{% include swish_box.html id="model_d" %}
</section>
</section>
<section>
<section>
<h2>Informed search</h2>
</section>
<section>
Sliding tiles (best-first but not A* and with aggressive pruning)
{% include swish_box.html id="tiles" %}
</section>
<section>
Path finding (depth-first, breadth-first, A*, backtracking)
{% include swish_box.html id="path" %}
</section>
</section>
<section>
<section>
<h2>Definite Clause Grammars</h2>
</section>
<section>
Roman numerals
{% include swish_box.html id="roman" %}
</section>
</section>
<section>
<section>
<h2>Inductive reasoning</h2>
</section>
<section>
Bottom-up induction
{% include swish_box.html id="section92" %}
</section>
<section>
Top-down induction
{% include swish_box.html id="section93" %}
</section>
</section>