Saturday, December 10, 2011

OK Gestalt!!

So I dumped the latest version of gfun, undebugged, but closer to the general idea. am going to slim match down to the match of only one nest of two g graphs. Then the idea is that some inspiration will effect us, the community of man, and match will be discovered, launching the age of the global brain.

I was thumbing through the sqlite opcode system, where sqlite compiles statements into unary and binary operators. Perhaps truthiness comes from looking at that code more closely; match might be an extension of the idea idea. Any operator that has a bounded domain is overlayerd to the client graph, it is translated into a set of opcodes, two or three, that executes that operators idea of pass,select,delete,update. The bounding operator says, this is what my domain looks like, what maps to select, to pass, to delete,etc The operator gets compiled codes ready to match against possible members of its domain, found in the other graph. The operator's tiny codes get pre-pended to other operators it bounds.
We simplify it, as always. Imagine a little expression tree, with maybe a three bytes of expression codes. We get a directed graph of these, the opcodes analogous, or exactly the links, including overloads. Choices for little opcode bytes are the TE modifiers and selectors, * ? . , Going from left to right in TE syntax, we unfold the boundering link, capture the TE modifiers in a group of buyes, then nes the sug graphs that appear under it, with their little byte code. The default code is match on key word match. Then later we decide, do overloads overule? and stuff like that.

So, when a match point gets to us from SQLITE_DONE, or triggering on a bounding operator, the machine prepares another bud in the tiny tree of past expressions about things.

Now, the SQL statement, or some statement will be launched. We can create a call backs, one that takes a row suggestion from SQL and checks it against the expression tree. The thing should work for insert into as well as select. Then in version 3 we merge this idea closer to the sqlite where function. Anyway, it narrows truth down to little expression trees.

So, the pinball machine has been pushed upward. We generate the tiny tree, then as we generate sql statements, we have options on how to use tiny tree. One, bind its variables to the general statement, two call one or more versions of a call back on the tree. Depending on the brains in the sql, vs the cost of going back to G; general selects or inserts or updates can have less or more intelligence, and use less or more of the tiny tree.

OK, tiny tree is a directed graph, but any given general statement under execution is a linear descent of that tree. Hence, g can extract that descent in bytes of linear array, almost just like regex! It extracts the truth array just prior to launch, all binds and g call backs pick all or part of that array as needed.

This works, I hereby patent this idea in the name of the open source community, any other effort to patent or make proprietary these ideas is overridden by cutnpaste.

Anyway, I will start by partitioning truth into some set, each element of that set coming with its not inverse. Like, match keyword and unmatch keyword. My lite:

match with keyword (this can be any key word fro an array of kept keys in the bounding ops)
match opcode
select current element
pass current element
stop on condition (there might be more than one stop condition, dunna)

So, for example, I can see many key words might need matching, and all or some of the operators. So the machine builds the tree roboticaly, as operators come in. Then the machine compiles the quick list just before sql start. So the mechanics becomes simple, if the pointer points to a far bound, put a new expression in the ready tree, make a context for the graphs and put them on the unready list so they run. The scheduler, finds a ready filter, and quickly scans down the nest of filters, extracting the linear truth opcodes, as a linear executable set. Executable by two or three means. Again, binding, call back, and when the machine in in single step mode, it does it itself.

No comments: