public class ImportedComponentBuilder
extends java.lang.Object
imported function/node. An imported function/node does not have
a body (let ... tel). In a Lustre compiler, this is usually used to encode a C function
or more generally a call to an external library.
In Kind 2, this means that the function/node is always abstract in the contract sense. It can
never be refined, and is always abstracted by its contract. If none is given, then the implicit
(rather weak) contract (*@contract assume true; guarantee true; *) is used.
In a modular analysis, imported functions/nodes will not be analyzed, although if their contract has modes they will be checked for exhaustiveness, consistently with the usual Kind 2 contract workflow.
| Constructor and Description |
|---|
ImportedComponentBuilder(java.lang.String id)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
IdExpr |
createConstInput(java.lang.String name,
Type type)
add a constant input parameter
|
IdExpr |
createVarInput(java.lang.String name,
Type type)
add a variable input parameter
|
IdExpr |
createVarOutput(java.lang.String name,
Type type)
add a variable output parameter
|
void |
setContractBody(ContractBodyBuilder contractBodyBuilder)
set the contract body for the imported component
|
public ImportedComponentBuilder(java.lang.String id)
id - name of the imported componentpublic IdExpr createConstInput(java.lang.String name, Type type)
name - name of the input parametertype - type of the input parameterpublic IdExpr createVarInput(java.lang.String name, Type type)
name - name of the input parametertype - type of the input parameterpublic IdExpr createVarOutput(java.lang.String name, Type type)
name - name of the output parametertype - type of the output parameterpublic void setContractBody(ContractBodyBuilder contractBodyBuilder)
contractBodyBuilder - a builder for the contract body