Retrieve the type of a previously typed term
Currently, it is only possible to use the type of a term in the type rule that creates it. The type of a term cannot be retrieved after analysis.
Possible solutions:
Submitted by Gabriël Konat on 1 May 2013 at 16:31
- Annotate the term with the task ID of the PropCalc task that has the resulting type so that the type can be retrieved by looking up the result of the PropCalc task. Not easy to do at the moment because the type tasks cannot annotate the AST, they transform into a task.
- Recreate the PropCalc task after analysis, this should produce the same task ID as before which can also be used to retrieve the resulting type. This requires an API for creating a task and retrieving its ID, without adding it to the task engine.
Issue Log
On 2 May 2013 at 08:25 Gabriël Konat commented:
Fixed in WebDSL2 using the first method. Terms are annotated with their type as True(){Type(Result(1))}, the actual type of a term can be retrieved using the type-of rule, which retrieves the type using the annotation.
On 2 May 2013 at 08:25 Gabriël Konat closed this issue.
Log in to post comments