public class ContractBodyBuilder
extends java.lang.Object
| Constructor and Description |
|---|
ContractBodyBuilder()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addMode(ModeBuilder modeBuilder)
Add a mode
|
void |
assume(Expr expr)
Add an assumption.
|
void |
assume(java.lang.String name,
Expr expr)
Add an assumption.
|
IdExpr |
createConstant(java.lang.String name,
Expr expr)
Create a ghost constant.
|
IdExpr |
createConstant(java.lang.String name,
Type type)
Create a ghost constant.
|
IdExpr |
createConstant(java.lang.String name,
Type type,
Expr expr)
Create a ghost constant.
|
IdExpr |
createVarDef(java.lang.String name,
Type type,
Expr expr)
Create a ghost variable.
|
void |
guarantee(Expr expr)
Add a guarantee.
|
void |
guarantee(java.lang.String name,
Expr expr)
Add a guarantee.
|
void |
importContract(java.lang.String id,
java.util.List<Expr> inputs,
java.util.List<IdExpr> outputs)
Import a contract.
|
void |
weaklyAssume(Expr expr)
Add a a weakly assume.
|
void |
weaklyAssume(java.lang.String name,
Expr expr)
Add a weakly assume.
|
void |
weaklyGuarantee(Expr expr)
Add a guarantee.
|
void |
weaklyGuarantee(java.lang.String name,
Expr expr)
Add a weakly guarantee.
|
public IdExpr createConstant(java.lang.String name, Type type)
name - name of ghost constanttype - type of ghost constantpublic IdExpr createConstant(java.lang.String name, Expr expr)
name - name of ghost constantexpr - expression specifying value assigned to ghost constantpublic IdExpr createConstant(java.lang.String name, Type type, Expr expr)
name - name of ghost constanttype - type of ghost constantexpr - expression specifying value assigned to ghost constantpublic IdExpr createVarDef(java.lang.String name, Type type, Expr expr)
name - name of ghost variabletype - type of ghost variableexpr - expression specifying stream of values assigned to ghost variablepublic void assume(Expr expr)
n is a constraint one must respect in
order to use n legally. It cannot mention the outputs of n in the current
state, but referring to outputs under a pre is fine.expr - an expression representing a constraintpublic void assume(java.lang.String name,
Expr expr)
n is a constraint one must respect in
order to use n legally. It cannot mention the outputs of n in the current
state, but referring to outputs under a pre is fine.name - name of the assumptionexpr - an expression representing a constraintpublic void weaklyAssume(Expr expr)
n is a constraint one must respect in
order to use n legally. It cannot mention the outputs of n in the current
state, but referring to outputs under a pre is fine. Use this function if you are
interested in computing an IVC among a subset of the assumptions.expr - an expression representing a constraintpublic void weaklyAssume(java.lang.String name,
Expr expr)
n is a constraint one must respect in
order to use n legally. It cannot mention the outputs of n in the current
state, but referring to outputs under a pre is fine. Use this function if you are
interested in computing an IVC among a subset of the assumptions.name - name of the assumptionexpr - an expression representing a constraintpublic void guarantee(Expr expr)
expr - constraint expressing the behavior of a nodepublic void guarantee(java.lang.String name,
Expr expr)
name - name of the guaranteeexpr - constraint expressing the behavior of a nodepublic void weaklyGuarantee(Expr expr)
expr - constraint expressing the behavior of a nodepublic void weaklyGuarantee(java.lang.String name,
Expr expr)
name - name of the guaranteeexpr - constraint expressing the behavior of a nodepublic void addMode(ModeBuilder modeBuilder)
modeBuilder - a mode builderpublic void importContract(java.lang.String id,
java.util.List<Expr> inputs,
java.util.List<IdExpr> outputs)
(A,G,M) and we import (A',G',M'), the resulting
contract is (A U A', G U G', M U M') where U is set union.
When importing a contract, it is necessary to specify how the instantiation of the contract is performed. This defines a mapping from the input (output) formal parameters to the actual ones of the import.
When importing contract c in the contract of node n, it is illegal to
mention an output of n in the actual input parameters of the import of c.
id - name of contract to importinputs - inputs to the contractoutputs - outputs of the contract