Skip to content

Requires and ensures clauses with descriptions #7181

Open
@feliperodri

Description

@feliperodri

Similar to how __CPROVER_assert(bool cond, char *msg) accepts a string that shows up in the terminal output,
we could modify the front end to allow users to name ensures and requires clauses in function contracts with an optional string. For example,

int foo(int *arr, size_t size)
__CPROVER_requires(size > 0 , "some text")
__CPROVER_ensures(__CPROVER_return_value == 1 , "some text")
{
}

Metadata

Metadata

Assignees

Labels

Code ContractsFunction and loop contractsawsBugs or features of importance to AWS CBMC usersenhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions