|
cprover
|
Back to contracts-dev
The code implementing contracts-dev-spec is found in Dynamic Frame Condition Checking (DFCC)
We go over each class and explain how it works in relation to others.
The dfcct class is the main entry point into the transformation.
The method dfcct::transform_goto_model first separates the functions of the goto model in different groups (functions to instrument, pure contract symbols from which to generate code, functions to check against contracts, functions to replace with contracts) and applies the transformation to the whole goto model, by scheduling the translation passes described in contracts-dev-spec :
Each of these translation passes is implemented in a specific class:
| Class | Specification |
|---|---|
| dfcc_instrumentt | Implements contracts-dev-spec-dfcc for goto_functiont, goto_programt, or subsequences of instructions of goto_programt |
| dfcc_is_fresht | Implements contracts-dev-spec-is-fresh |
| dfcc_pointer_in_ranget | Implements contracts-dev-spec-pointer-in-range |
| dfcc_pointer_equalst | Implements contracts-dev-spec-pointer-equals |
| dfcc_lift_memory_predicatest | Implements contracts-dev-spec-memory-predicates-rewriting |
| dfcc_is_freeablet | Implements contracts-dev-spec-is-freeable |
| dfcc_obeys_contractt | Implements contracts-dev-spec-obeys-contract |
| dfcc_spec_functionst | Implements contracts-dev-spec-spec-rewriting |
| dfcc_wrapper_programt | Implements contracts-dev-spec-contract-checking for contracts |
| Implements contracts-dev-spec-contract-replacement for contracts | |
| dfcc_contract_handlert | Implements contracts-dev-spec-codegen for contracts |
| Implements the interface dfcc_contract_handlert for contract by delegating operations to dfcc_wrapper_programt | |
| dfcc_swap_and_wrapt | Implements contracts-dev-spec-contract-checking by delegating basic operations to dfcc_contract_handlert |
| Implements contracts-dev-spec-contract-replacement by delegating basic operations to dfcc_contract_handlert | |
| Implements contracts-dev-spec-contract-checking-rec by delegating basic operations to dfcc_contract_handlert |
The following classes contain utility methods: