-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for describing variables. #145
Comments
Absolutely, this would be a lightweight means of supporting something close to a natural language output for contracts. It immediately comes to mind that we could extend |
Indeed! Just to confirm that we're on the same page, the idea is to define a constructor for
Then, we'd have to add a similar constructor argument to
|
Exactly! 😃 |
Consider the following example from the space_mission case study:
This raises some questions:
|
Also, we would need a scheme for generating IDs when we apply term rewriting. For example, rule 4 rewrites:
into:
Suppose |
Currently, we only have the notion of a name for a variable--it serves as its ID. This is a string. The name is used to know how we connect contracts to each other. A description could be an arbitrary string that gives an explanation for a variable, e.g.,
An ID could be generated by Pacti or given by the user as a string. A description could be given by the user as a sentence (e.g., "requirement E57 of standard IEEE AAA.BBB v1.2").
This is true also after performing contract computations. For the moment, we could gave a |
Instead of using comments to describe contract variables, it would be useful to keep track of the description in the variable object.
That is, instead of the constructor:
We should have something like this:
It would be useful to show this description in Pacti's error messages. For example, the
IoContract
constructor raises an error when variables appear in inputs and outputs. For such error messages, it would be helpful to show the associated variable description, if any.The text was updated successfully, but these errors were encountered: