Wednesday, November 9, 2011

So we can write an sql interface to G

Every G operation is an SQL script whoe parameters are mapped from a known list of variables related to ros pointers into Gout,G1 and G2; all G graph Stores.  The machine will execute a:
insert into Gout select from G1,G2 where some conditions

How do we indicate stanrd ending conditions? The machine has to set up the G graph pointers for G1, and G2 when done. Gout pointer is known from last insert. So the programming interface reuires a compound select, where the second select is the standard done operation.
(select g1,index,g2.index 
  where g1.operator is stop and g2,.operator is stop

So every standard sql script has a terminating condition and will leave the terminating indices on Gout when done. We have, I think, dispensed completely with any c code in installing operators, we can do it all with M4.

This standard does not hold in character mode, but there will something analagous to match the grammar. So other than the character modifier, the onl  thing left is xml get and xlm put for the long jumps.  That is only a get, convolve recursive,  then xml put the return, with attaching the new sub graph (30 lines of code).

For character mode we the engine has regular expression dll module, then allows installed regex character graphs, making the equivalent state requirements as for sql script.  This is all a few days work, this is all 120-150 lines of code.

So here is the main unit loop:

  • Get the next record from the current G (the one holding the semaphore)
  • Look up the opcode group
  • Look up the opcode from the flavor index
  • Bind the SQL parameters according to the opcode map
  • Exec SQL
  • Check Gout if rowid has changed
  • If so, pop off status and keep machine in correct state
  • If no Gout, the take default pointer update on G current

A the end of each loop, the machine has all the info required for another go round, if need be.

No comments: