-
Notifications
You must be signed in to change notification settings - Fork 0
JSON API
Linear terms are either:
- atoms
- subterms connected by tensor or plus
- negations of terms
-
type:string="var" | "neg" | "times" | "plus" -
name:string= the name of the atom iftype = "var", otherwise ignored -
args:arrayoflinprop= the list of arguments iftypeisneg,timesorplus, otherwise ignored. Binary operatorstimesandpluscan have more than 2 arguments, in which case they are applied in a right associative way
Annotated terms are linear propositional terms annotated with a channel.
-
cll:linprop -
channel:string
Composition actions describe a binary combination of 2 labelled processes.
-
act:string= the type of composition, currently"JOIN" | "TENSOR" | "WITH"for sequential, parallel, and conditional composition respectively -
larg:string= the name of the first (or “left”) component process -
lsel:string= a string describing some relevant part of the left process component. This is different depending on the action type. -
rarg:string= the name of the second (or “right”) component process -
rsel:string= a string describing some relevant part of the right process component. This is different depending on the action type. -
res:string= the desired label for the resulting composition
[TODO] Selections are expected as follows:
-
TENSOR: -
WITH: -
JOIN:
Provenance trees are used to determine the origin of each linear proposition in an input or output term.
For example, consider 2 processes:
-
Pwith inputXand outputA ** B -
Qwith inputsBandYand outputC
These can be joined through B. The resulting composition will have inputs X and Y and output A ** C. In this the following hold:
-
Xhas an input provenance ofP -
Yhas an input provenance ofQ - In the output,
Acomes fromPandCcomes fromQso we construct the JSON object"P ** Q"
The structure of the provenace tree matches the syntax tree of the corresponding term. For this reason with copy the structure of linprop but use the name to record the provenance label instead of the atom name.
Subtrees where all propositions have the same provenance can be replaced by an atomic/leaf provenance node with the single label. This is the only exception of the provenance tree not matching the syntax tree.
-
type:string="source" | "times" | "plus" -
name:string= the provenance label iftype = "source", otherwise ignored -
args:arrayofprov= the list of arguments iftypeistimesorplus, otherwise ignored. Binary operatorstimesandpluscan have more than 2 arguments, in which case they are applied in a right associative way
[TODO: clarify provenance labels]
Provenance info is kept in the state. Provenance entries associate a provenance tree to the output (prov_entry) or input (iprov_entry) it corresponds to. Output provenance is associated with a process label whose output it describes. Input provenance is associated with an available input term.
[TODO: clarify]
*In the future, provenance info will be kept directly in the process instead of the state.- This will make thing a bit more intuitive.
prov_entry:
-
name:string= the name/label of the process whose output we are describing -
prov:prov= the corresponding provenance tree
iprov_entry:
-
term:linprop= the (non-negated) linear term of the input we are describing -
prov:prov= the corresponding provenance tree
The action state is used to convey state info to the prover and retrieve proof metadata afterwards.
-
label:string= a unique label identifying the composite process under contruction -
ctr:int= a non-negative counter used to keep variables fresh. Expected to be initialized to0. -
buffered:arrayoflinprop= the types of buffers that were constructed during proof. This used to be the way to determine buffered edges in the frontend, but is now obsolete thanks to the provenance trees. -
joined:arrayoflinterm= the inputs that were used up/connected during aJOINaction. -
iprov:arrayofiprov_entry= input povenance entries -
prov:arrayofprov_entry= output provenance entries
An agent refers to a pi-calculus agent corresponding to a process specification. Currently this is just a string, but we have plans to adopt a more structured representation in the near future.
The complete specification of a process.
-
name:string= a name/label for the process -
inputs:arrayoflinterm -
output:linterm -
prov:prov= the output provenance -
proc:agent= the pi-calculus specification -
actions:arrayofaction= a list of composition actions that construct this process. Empty if the process is atomic. -
copier:bool= true if the prover determines this to be a copy node -
intermediate:bool= true if this is an intermediate composition step (as opposed to an atomic process or completed composition)
All commands include a command field of type string which defines the type of the command.
Ping/keep-alive command. Gives a Pong response.
-
command:string="ping" -
ping:float= a timestamp to measure ping
A command to create a new atomic process.
-
command:string="create" -
name:string= the name of the process to be created -
inputs:arrayoflinprop= a list of inputs. Their channels will be created by the prover. -
output:linprop= the process output. The channcel will be created by the prover.
Binary composition of 2 processes with a single action.
Although a more general composition command is provided, when it comes to simple binary compositions this command executes faster.
-
command:string="compose1" -
action:action= the composition action to be performed. The labels of the 2 arguments must match the labels of the processes provided in the next fields. -
lhs:process= the process corresponding to the first (left) argument of the action -
rhs:process= the process corresponding to the second (right) argument of the action
Construction of a complex composition with one or more actions. Although more general than the binary composition command compose1, it is slower.
-
command:string="compose" -
name:string= the name of the final composition -
components:arrayofprocess= the list of all component processes that will be used -
actions:arrayofaction= the ordered list of actions to be performed
A command used to reconstruct a process composition.
This is legacy command which has now devolved into the compose command. The only difference is that verify does not produce compose responses for intermediate steps. It will only generate one verify response for the final process.
-
command:string="verify" -
name:string= the name of the final composition -
components:arrayofprocess= the list of all component processes that will be used -
actions:arrayofaction= the ordered list of actions to be performed
This is a family of commands that produce executable process deployments.
There are currently 3 types of possible deployments:
-
PiViz: This produces a file for the PiVizTool and/or MWB. -
PiLib: This produces a deployment and code templates using the old PiLib library. -
PEW: This produces a deployment and code templates with the newer PEW library.
-
PiViz -
PiLib-
command:string="pilib" -
process:process= the process to be deployed -
components:arrayofprocess= the list of all dependencies/components required in the composition -
separator:string= the client OS-specific file path separator -
path:string= the base path for the deployment -
pkg:string= the desired name for the Scala package that will contain the code -
project:string= an identifiable name for the deployment. This will be used to identify certain types and classes. -
main:bool=trueif the generation of a template for a main class is required. -
java:bool=trueif the generation of a java runner class is required. This can help integrate the Scala deployment with Java code.
-
-
PEW-
command:string="piviz" -
process:process= the process to be deployed -
components:arrayofprocess= the list of all dependencies/components required in the composition -
separator:string= the client OS-specific file path separator -
path:string= the base path for the deployment -
pkg:string= the desired name for the Scala package that will contain the code -
project:string= an identifiable name for the deployment. This will be used to identify certain types and classes. -
main:bool=trueif the generation of a template for a main class is required. -
java:bool=trueif the generation of a java runner class is required. This can help integrate the Scala deployment with Java code.
-
All responses include a response field of type string which defines the type of the response.
The response to the Ping command.
-
response:string="Pong" -
ping:float= contains the original timestamp received by the prover in thePingcommand.
The response to the create command with a definition of a new atomic process.
-
response:string="CreateProcess" -
process:process= the newly created process
The result of a single binary composition action. The compose command may produce multiple of these, one for each action.
-
response:string="Compose" -
action:action= the composition action that was applied -
process:process= the resulting composite process -
state:actionstate= the updated action state with the associated metadata
The response of the verify command with a reconstructed composite process.
-
response:string="Verify" -
process:process= the reconstructed composition
This is the response to the deploy commands. It describes the files that are required for deployment.
First we need the structure for a single deployment file. This is a file object containing the following fields:
-
path:string= the full path of the file (including its name) in the deployment -
content:string= the content of the file -
overwrite:bool= the reasoner tags the files that are generated fully automatically so that they will be overwritten in consecutive deployments. Files that may be edited by the user (e.g. code templates) have this field marked asfalseto avoid overwritting user content.
Based on this, the deploy response is as follows:
-
response:string="Deploy" -
type:string= the type of deployment. Currently one ofPiViz,PiLiborPEW. -
deployment:Arrayoffile= a list of deployment files.
This response is generated whenever the prover fails to perform a command. Unless there is a bug or associated limitation in the prover, this indicates a user or input error.
-
response:string="CommandFailed" -
content:string= a (sometimes useful) description of the error that occured
This response is generated whenever the prover fails due to an internal exception. This indicates an expected failure in the system.
-
response:string="Exception" -
content:string= the contents of the thrown exception