[05a128]: doc / source / overview / knowledge_bases / index.txt Maximize Restore History

Download this file

index.txt    75 lines (64 with data), 3.0 kB

 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
.. $Id$
..
.. Copyright Š 2007 Bruce Frederiksen
..
.. Permission is hereby granted, free of charge, to any person obtaining a copy
.. of this software and associated documentation files (the "Software"), to deal
.. in the Software without restriction, including without limitation the rights
.. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
.. copies of the Software, and to permit persons to whom the Software is
.. furnished to do so, subject to the following conditions:
..
.. The above copyright notice and this permission notice shall be included in
.. all copies or substantial portions of the Software.
..
.. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
.. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
.. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
.. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
.. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
.. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
.. THE SOFTWARE.
restindex
crumb: Knowledge Bases
page-description:
Knowledge is made up of both *facts* and *rules*. These are gathered
into named repositories called *knowledge bases*.
/description
section-pages: , fact_bases, rule_bases, special
format: rest
encoding: utf8
output-encoding: utf8
include: yes
/restindex
====================
Knowledge Bases
====================
Knowledge is made up of both *facts* and *rules*. These are organized
into named repositories called *knowledge bases*. A knowledge base is like
a directory for files on disk, except that knowledge bases may not be
nested. Therefore, facts and goals always have a two-level name.
Here are some examples of facts you might see in a web server application::
header.cookie('session=123456789;remember=the_alamo')
cookie.session(123456789)
cookie.remember(the_alamo)
header.accept_encoding(gzip)
header.accept_encoding(deflate)
request.path('/my/site.html')
request.path_segment(0, my)
request.path_segment(1, 'site.html')
request.path_segment(-2, my)
request.path_segment(-1, 'site.html')
Note that three different knowledge bases (all `fact bases`_) are shown here
named ``header``, ``cookie``, and ``request``; each with multiple facts.
There are different types of knowledge bases.
- Those that contain facts are called `fact bases`_.
- Those that contain rules are called `rule bases`_.
- It is also possible to create other kinds of knowledge bases that lookup
facts and prove goals in different ways. The only one of these in pyke
is the special_ knowledge base.
All knowledge bases share the same name space; so that no two of them,
regardless of their type, may have the same name.
.. _fact bases: fact_bases.html
.. _special: special.html
.. _rule bases: rule_bases.html