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 behavior if table updated during iteration.
filter{<name>:s,<newname>:s,<regex>:s}(<pattern>) -> {<count>:n}
* create new table with by matching table values against <pattern>
<pattern> : AND(<pattern>,<pattern>)
| OR(<pattern>,<pattern>)
| NOT(<pattern>)
| EXISTS(<term>;<pattern>)
| MATCH(<patternterm>)
| EQUALS(<term>)
* use operator of <term> of EXISTS to extract embedded list
to check <pattern> against.
* might want ALL(<term>;<pattern>)
<placeholder> | PLACEHOLDER()
A <patternterm> is a term with embedded SLOT() or MATCH(<pattern>) terms.
Anything matches a slot. A MATCH(<pattern>) causes recursion of match operation
with new <pattern>. Otherwise, the MATCH proceeds as long as the <patternterm>
is identical to the instance.
There is a pitfall here in that the <patternterm> can not contain a MATCH opid
intended to match a MATCH opid in the instance as it will be interpreted instead
of matched. Could be fixed with quoting mechanism, but it is unlikely to be a problem.
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
|