ceptr
|
The ceptr processing model consits of reducing a semantic tree of process nodes. Processes can either be system processes (provided by the virtual machine) or composed processes declared in in the context of the receptor.
The virtual machine provides the following system processes:
Process | Children (inputs) | Reduces To (output) | Comments |
---|---|---|---|
NOOP |
| result(PASSTHRU:NULL_STRUCTURE) | no-op this process reduces to its single "do" parameter. |
DEF_SYMBOL |
| symbol(SYMBOL:RESULT_SYMBOL) | define a new symbol |
DEF_STRUCTURE |
| structure(STRUCTURE:RESULT_STRUCTURE) | define a new structure |
DEF_PROCESS |
| process(PROCESS:RESULT_PROCESS) | define a new process |
DEF_RECEPTOR |
| receptor(RECEPTOR:RESULT_RECEPTOR) | define a new receptor |
DEF_PROTOCOL |
| protocol(PROTOCOL:RESULT_PROTOCOL) | define a new protocol |
NEW |
| xaddr(SYMBOL:WHICH_XADDR) | new instance reduces to the xaddr of a newly created instance of type NEW_TYPE. the structures of "what" and "value" must match, but not the symbols |
GET |
| value(ANY:NULL_STRUCTURE) | get instance value reduces to the value of the instance at the xaddr of the "what" parameter |
DEL |
| value(ANY:NULL_STRUCTURE) | delete instance reduces to the value of the deleted instance at the xaddr of the "what" parameter |
DO |
| result(PASSTHRU:NULL_STRUCTURE) | do execute a SCOPE of instructions for side-effects returning the value of the last one. I would like it better if the actions could just be the children of the DO process |
PARAMETER |
| result(PASSTHRU:NULL_STRUCTURE) | get parameter data |
DISSOLVE |
| result(PASSTHRU:NULL_STRUCTURE) | merge children into parent's children remove the root of the child, merging it's children into the parent's children at the process's spot |
TRANSCODE |
| result(PASSTHRU:NULL_STRUCTURE) | transform semantic type transform the semantic types of a itemstree to a different type as specified in the parameters. If TRANSCODE_ITEMS has multiple children DISSOLVE is implied |
GET_LABEL |
| result(PASSTHRU:NULL_STRUCTURE) | get a symbol's label |
COND |
| result(PASSTHRU:NULL_STRUCTURE) | cond this is a traditional lisp "cond" process that reduces conditionally to the COND_PAIR that evaluates to true, or to the COND_ELSE in none of them do. |
IF |
| result(PASSTHRU:NULL_STRUCTURE) | if this is a traditional "if" process that reduces conditionally to either the "then" or the "else" parameter depending on the value of the "condition" parameter. Note: we may be replacing this with a more lispy COND process |
ITERATE |
| result(PASSTHRU:NULL_STRUCTURE) | iterate a process this process checks the structure of the result of the "condition" param, if it's a BOOLEAN, it treats the iteration as a while loop and iterates until the BOOLEAN is false; if it's an INTEGER it treats the iteration as repeat loop and iterates as many times as the value of the INTEGER; if it's a ITERATE_ON_SYMBOL then it iterates on all the instances of that symbol type which get added into the PARAMS each time through |
SAY |
| signal id(SYMBOL:SIGNAL_UUID) | send a message to a receptor |
REQUEST |
| response(ANY:NULL_STRUCTURE) | send a request to a receptor if there is no "callback" param, then this process will block until the result comes back or the "until" causes cleanup of pending request. |
CONVERSE |
| result(PASSTHRU:NULL_STRUCTURE) | set up a conversation scope for signaling Use "until" to specify when the system will terminate the conversation. Use "wait" to specify whether the CONVERSE instruction should be paused when it goes out of scope waiting for the conversation to complete. If you use asynchronous REQUEST or LISTEN instructions in the scope the conversation and you don’t set "wait" to TRUE you will want to use the THIS_SCOPE instruction to get the conversation identifier so you can call the COMPLETE instruction someplace later or the conversation will never get cleaned up. |
COMPLETE |
| result(PASSTHRU:NULL_STRUCTURE) | cause a conversation to come to completion Cleans up a conversation and causes the CONVERSE instruction to reduce to value of "with". If "conversation" provided, completes that conversation, otherwise assumes the value of THIS_SCOPE. If the specified conversation doesn’t exist (i.e. because it was cleaned up by its end conditions) COMPLETE will invoke the error handler. Note that it’s possible that the CONVERSE instruction was already reduced, in which case the value of with_someting will get ignored. If the COMPLETE instruction is not inside a CONVERSE scope, it will be reduced to the value of "conversation" |
THIS_SCOPE | conversation(SYMBOL:CONVERSATION_UUID) | get the conversation id of the current scope Reduces to the identifier of the current conversation. Executing THIS_SCOPE not somewhere inside a CONVERSE will invoke the error handler. | |
SELF_ADDR |
| address(PASSTHRU:NULL_STRUCTURE) | self address reduces to current RECEPTOR_ADDRESS as a use of the as symbol |
LISTEN |
| error(SYMBOL:REDUCTION_ERROR_SYMBOL) | plant a listener If you don't provide an action, the assumption is that the LISTEN process will block and will reduce to the SEMTREX_MATCH. This will also force the END_CONDITIONS/REPETITIONS to COUNT:1. If "for" carrier is NULL_SYMBOL the expectation will match on all carriers. |
MATCH |
| matched(SYMBOL:BOOLEAN) | semtrex match |
RESPOND |
| response id(SYMBOL:SIGNAL_UUID) | respond to signal |
QUOTE |
| result(PASSTHRU:NULL_STRUCTURE) | quote a process so that it can be passed as a value |
FILL |
| result(PASSTHRU:NULL_STRUCTURE) | fill template from map |
FILL_FROM_MATCH | result(ANY:NULL_STRUCTURE) | fill template from match results | |
RAISE |
| result(STRUCTURE:NULL_STRUCTURE) | raise reduction error this process doesn't really return anything, because it triggers the handler for the error in the "error" parameter |
STREAM_READ |
| result(PASSTHRU:NULL_STRUCTURE) | read from a stream the data on the stream will appear as the surface of the symbol type given by the "into" param. Clearly this could get ugly as there is no semantic checking that that's ok... |
STREAM_WRITE |
| result(PASSTHRU:NULL_STRUCTURE) | write to a stream |
STREAM_ALIVE |
| alive(SYMBOL:BOOLEAN) | test if stream is alive for reading |
STREAM_CLOSE |
| true(SYMBOL:BOOLEAN) | close a stream |
CONCAT_STR |
| concatenation(STRUCTURE:CSTRING) | concatinate strings concatenates two strings of any symbol type into an new symbol type specified by the "into" parameter |
EXPAND_STR |
| ascii tree(SYMBOL:ASCII_CHARS) | expand string converts a CSTRING into an ASCII_CHARS tree |
CONTRACT_STR |
| string(STRUCTURE:CSTRING) | contract to string converts any number of chars or cstring into a single cstring of symbol type indicated by the into param |
EQ_SYM | equality(SYMBOL:BOOLEAN) | test equality test the quality of two SYMBOL type parameters | |
ADD_INT | sum(STRUCTURE:INTEGER) | addition | |
SUB_INT | difference(STRUCTURE:INTEGER) | subtract | |
MULT_INT | product(STRUCTURE:INTEGER) | multiply | |
DIV_INT | quotient(STRUCTURE:INTEGER) | divide | |
MOD_INT | remainder(STRUCTURE:INTEGER) | modulo | |
EQ_INT | equality(SYMBOL:BOOLEAN) | test equality | |
LT_INT | result(SYMBOL:BOOLEAN) | test less than | |
GT_INT | result(SYMBOL:BOOLEAN) | test greater than | |
LTE_INT | result(SYMBOL:BOOLEAN) | test less than or equal | |
GTE_INT | result(SYMBOL:BOOLEAN) | test greater than or equal | |
POP_PATH |
| result(PASSTHRU:NULL_SYMBOL) | pop values off a tree path |
CONTINUE |
| result(PASSTHRU:NULL_SYMBOL) | restart reduction at some parent |
INITIATE_PROTOCOL |
| error(SYMBOL:REDUCTION_ERROR_SYMBOL) | initiate the first step of a protocol |
MAGIC | result(ANY:NULL_STRUCTURE) | dark magic this process reduces to hardcoded special things as a scaffold for things we don't know how to build in ceptr yet. | |
date2usshortdate |
| to(SYMBOL:US_SHORT_DATE) | date to us short format date transcoder |
time2shortime |
| to(SYMBOL:SHORT_TIME) | time to short format date transcoder |
send_request | response(ANY:NULL_STRUCTURE) | send request | |
send_response | response id(SYMBOL:SIGNAL_UUID) | send response | |
fill_i_am |
| identity(STRUCTURE:RECEPTOR_IDENTITY) | fill i am |
line_2_command | signal id(SYMBOL:SIGNAL_UUID) | parse a COMMAND from a LINE | |
respond_with_yup | response id(SYMBOL:SIGNAL_UUID) | respond with yup | |
request_membership | result(SYMBOL:SIGNAL_UUID) | request membership | |
enroll | result(STRUCTURE:NULL_STRUCTURE) | enroll client | |
speak | result(SYMBOL:SIGNAL_UUID) | speak | |
group_listen | result(SYMBOL:SIGNAL_UUID) | group_listen | |
time_request | response(SYMBOL:TICK) | request current time | |
meda_type_2_ascii_str |
| output(SYMBOL:ASCII_STR) | media type transcoder |
content_type_2_line |
| output(SYMBOL:LINE) | content type transcoder |
http_response_status_2_ascii_str |
| output(SYMBOL:ASCII_STR) | http response status transcoder |
http_response_2_lines |
| output(SYMBOL:LINES) | http response transcoder |
line_2_httpreq | signal id(SYMBOL:SIGNAL_UUID) | parse an HTTP_REQUEST from a LINE | |
ascii_chars_2_http_req |
| output(SYMBOL:HTTP_REQUEST) | http req transcoder |
httpresp | response(SYMBOL:HTTP_RESPONSE) | build an HTTP_RESPONSE |