Skip to content

Commit 941a2c5

Browse files
authored
Merge pull request #7089 from qinheping/manual-loop-invariant-synthesizer
CONTRACTS: Documenting semantic of loop invariant synthesizers
2 parents 22cd6d1 + 83b85eb commit 941a2c5

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/goto-instrument/synthesizer/enumerative_loop_invariant_synthesizer.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ Author: Qinheping Hu
2121
class messaget;
2222

2323
/// Enumerative loop invariant synthesizers.
24-
/// It handles `goto_model` containing only checks instrumented by
24+
/// It is designed for `goto_model` containing only checks instrumented by
2525
/// `goto-instrument` with the `--pointer-check` flag.
26+
/// When other checks present, it will just enumerate candidates and check
27+
/// if they are valid.
2628
class enumerative_loop_invariant_synthesizert
2729
: public loop_invariant_synthesizer_baset
2830
{
@@ -34,6 +36,8 @@ class enumerative_loop_invariant_synthesizert
3436
{
3537
}
3638

39+
/// This synthesizer guarantees that, with the synthesized loop invariants,
40+
/// all checks in the annotated GOTO program pass.
3741
invariant_mapt synthesize_all() override;
3842
exprt synthesize(loop_idt loop_id) override;
3943

src/goto-instrument/synthesizer/loop_invariant_synthesizer_base.h

+5-4
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@ class loop_invariant_synthesizer_baset
3838
}
3939
virtual ~loop_invariant_synthesizer_baset() = default;
4040

41-
/// Synthesize loop invariants with which all checks in `goto_model`
42-
/// succeed. The result is a map from `loop_idt` ids of loops to `exprt`
43-
/// the goto-expression representation of synthesized invariants.
41+
/// Synthesize loop invariants that are inductive in the given GOTO program.
42+
///
43+
/// The result is a map from `loop_idt` ids of loops to `exprt`
44+
/// the GOTO-expression representation of synthesized invariants.
4445
virtual invariant_mapt synthesize_all() = 0;
4546

46-
/// Synthesize loop invariant for a specified loop in the `goto_model`
47+
/// Synthesize loop invariant for a specified loop in the `goto_model`.
4748
virtual exprt synthesize(loop_idt) = 0;
4849

4950
protected:

0 commit comments

Comments
 (0)