-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathplan.yml
119 lines (109 loc) · 4.38 KB
/
plan.yml
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
-
plan :
- plan :
- recognize opportunity
- do :
- test change
- small study
- check:
- measure
- review the test
- analyze results
- learning
- act :
- take larger action
-
- create self modifying code :
- parse ast data and extract interesting data from it
- extract data from instance of object
- not needed right now, because we can re-generate the entire thing from the rdf
-
- create python code representing the rdf data as close as possible
- normalize names
- create python names for urls
- create imports for each needed prefix/module
- store original names
- create names for the ontology/namespace object
- represent owl information as class level static data
- evaluate data when needed on init:
- add in base class at runtime:
ref : http://www.linuxjournal.com/node/4540/print
example :
"pyClass.__bases__ += mixInClass"
- review namespaces:
- review why some prefixes are not loaded
- review new prefixes
- track the type of each file/url in the namespace
- parse rda and other formats in the librdf:
- this might be supported
- sort dependencies :
- look at all fields that do not need imports, put them first
- order members of the class by dependency
- break circular dependancies
- metalevels :
- rdfs:Class a rdf:Class, this might be better defined with rdfs:Class a rdf:Class2 where rdf:Class2 is a metaclass at a higher order, and rdf:Class2 would be a rdf:Class3 etc.
- pattern class:
- define a prototype thing using normal python
- extract the ast from the thing
- replace tokens in the ast with variables to create new thing
- pattern ast :
- an ast of an ast is a description of the original ast but expanded once
- create the ast of an ast that will regenerate a new similar ast
- create a method that will generate an ast on the fly with the parameters requested
- replace keywords in ast of ast with parameter values
- replace const parameter values with variables in the new ast of ast
-
-
- use one metaclass per rdfs class:
- representation of rdf on of these :
- store in existing librdf
- possible generate native python representation
- store the entire rdf object in the metaclass:
- be able to lookup the class for any rdf url:
- use world object
- associate the metaclass object with the rdf object
- generate the class methods in the new:
- create elegant python representation of rdf
-
-
-
- extract code from existing python libs
- look for each ast type
- look how each is reachable from the root
- create examples for each ast type
- extract examples from each ast type
- extract statistics for each relationship between ast node types
- extract field information
-
- repeatedly call deparse until you get a basic metadata about ast represention
- how many recursive calls are needed until all asts look the same
- what are the primited parts needed to construct all asts?
- what are the basic rules
-
- create new concise ast representation
- canonical
- simple
- multi language
- generate idiomic python or gcc
- recognise defined idioms
-
- metadata tagging
- create special variables or names that are used to tag metavariables
- generate the variable names based on the tree context, so recursing over the tree prepend names to create very long names
- be able to replace metavariables
-
- build examples on top of each other
- empty function vs function with data
- compare two examples to define one item:
- treat as standard item
-
- like template haskell we could define similar mechanisms without a new syntax by using special named functions or variables recognized by gcc compiler plugins.
-
- dump ast from haskell and use a python script to convert that into haskell code again.
- cmd :
python parseast.py simple.dump-parsed-ast > simple.dump-parsed-ast.hs
- ast :
FakeAst.hs
-
- retest by generating the ast from the generate ast
- test this again, after the third time the dumper slows to a crawl.