GarryMorrison / Feynman-knowledge-engine

a minimalist but extensible knowledge engine
Other
5 stars 5 forks source link

describe operator tables #22

Open GarryMorrison opened 9 years ago

GarryMorrison commented 9 years ago

for each function operator type we have an entry in one of several hash tables in the processor file. The exact table tells the code how to apply that operator. Currently only I understand how it all works, and even I frequently get it wrong when "wiring in" a new operator. Though console debug info for similar operators helps a lot.

Point is, I need to try and explain these hash tables at some stage, so others can understand.

GarryMorrison commented 6 years ago

The minimalist version is: -- operators are of form: foo S, or foo[op1, ... , opn] S -- where S is either a ket, superposition or sequence -- operators of form: op ket: fn_table = {}

-- operators of form: op ket, but require context too: ket_context_table = {}

-- operators of form: op sp: sp_fn_table = {}

-- operators of form: op sp, but require context too: sp_context_table = {}

-- operators of form: op seq: seq_fn_table = {}

-- operators that require parameters: -- ie, foo[op1, ... , opn] S: compound_table = {}

-- sequence functions are of form: fn(input-seq, seq, seq, ... , seq) or fn(input-seq, context, seq, ... , seq) -- functions of form: fn(input-seq, seq): whitelist_table_1 = {}

-- functions of form: fn(input-seq, seq, seq): whitelist_table_2 = {}

-- functions of form: fn(input-seq, seq, seq, seq): whitelist_table_3 = {}

-- functions of form: fn(input-seq, seq, seq, seq, seq): whitelist_table_4 = {}

-- functions of form: fn(input-seq, context, seq, seq): context_whitelist_table_2 = {}

-- functions of form: fn(input-seq, context, seq, seq, seq): context_whitelist_table_3 = {}