-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes
48 lines (38 loc) · 898 Bytes
/
notes
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
#!/usr/bin/env python2
#-*- coding: utf-8 -*-
#lol bootstrap, © koo5
import pyke
from pyke import knowledge_engine
e = knowledge_engine.engine()
e.activate('a')
"""
knowledge base
top down:
goal: the gui
editor window is a kind of pygame window
pygame window is a kind of thing..
"""
class Node(object):
pass
class Assertion(Node):
def ass(self):
if self.object != None:
e.assert_('a', self.verb, (self.subject, self.object))
else:
e.assert_('a', self.verb, (self.subject, ))
#Assertion(verb =
class ClassDefinition(Node):
def ass(self):
e.assert_('a', 'is class', ('',))
class Program(Node):
def __init__(self, name, codes):
self.name = name
self.codes = codes
def to_text(self):
return self.name+"\n"+self.codes.to_text()
def run(self):
self.ass()
e.activate('a')
def ass(self):
e.assert_('a', 'is a kind of', (self, node))
program = Program("x", 3)