Database Commands: <cmd> create{<name>:s}() -> () delete{<name>:s}() -> () put{<name>:s}(<key>;<value>) -> () get{<name>:s}(<key>) -> <value> remove{<name>}(<key>) -> () iterate{<name>:s}([some(<key>) | some())] -> [some(<key>) | some()],<val> some() arg indicates begin iteration some() return indicates end ? arbitrary behaviour if table updated during iteration. filter{<name>:s,<newname>:s,<regex>:s}(<pattern>) -> {<count>:n} * create new table with matching <pattern> : AND(<pattern>,<pattern>) | OR(<pattern>,<pattern>) | NOT(<pattern>) | EXISTS(<term>;<pattern>) | MATCH(<patternterm>) * use operator of <term> of EXISTS to extract embedded list to check <pattern> against. * might want ALL(<term>;<pattern>) <placeholder> | PLACEHOLDER() <patternterm> a term whose leaves are <placeholder>s. Anything matches a <placeholder>. <patternterm> may contain embedded patterns. As such, the pattern OPIDs occurring in a pattern term but not meant to be a pattern should be escaped. Alternatively, we could use more obscure OPIDS such as !DB_PATTERN_AND etc to decrease chance of clash. Future addition: We could extend <patternterm> to include MATCHVAR{<name>:s} which adds matching value to an environment, and then could instantate a result term from the environment. Multiple occurences of same MATCHVAR would require matching instances to be identical. mapfilter{<name>:s,<regex>:s}(<pattern>;<vpattern>) -> {<count>:n} * <vpattern> contains only MATCHVARs and terms to instantiate result. Protocol <req> : !req{<seq>:n}(<cmd>) <rsp> : !rsp{<seq>:n}(<result>) <notice> : !notice{<seq>:n}(<message>) * no response <result> : !value()(<term>) | !ack() | !fail(<message>) FTTB : expect straigtforward one-to-one sequential Nuprl sends <req> and gets <rsp>. Future : - nuprl sends sequence of reqs without waiting for response. * possibly add form of requests that don't expect response. - add call backs from shadowdb to nuprl. - maybe add partial response to return sequence of result terms