Skip to content

goto-synthesizer cannot handle empty loop #7595

Open
@tautschnig

Description

@tautschnig

CBMC version: current develop (cf084e6)
Operating system: Ubuntu 20.04
Exact command line resulting in the issue:

goto-cc main.c
goto-instrument --pointer-check a.out a.out
goto-synthesizer --dump-loop-contracts a.out

What behaviour did you expect: no violated invariant
What happened instead:

I tried running goto-synthesizer on https://github.com/diffblue/2ls/blob/master/regression/memsafety/simple_true/main.c with the above sequence of commands and got:

Reading GOTO program from 'a.out'
--- begin invariant violation report ---
Invariant check failed
File: ../src/goto-synthesizer/synthesizer_utils.cpp:31 function: get_loop_end_from_loop_head_and_content
Condition: loop_head != loop_end
Reason: Could not find end of the loop starting at: file main.c line 8 function exit
Backtrace:
[...]
Aborted (core dumped)

Also, I tried to replace the loop in line 8 by __CPROVER_assume(0);. This got me a new invariant failure:

Reading GOTO program from 'a.out'
--- begin invariant violation report ---
Invariant check failed
File: ../src/goto-synthesizer/cegis_verifier.cpp:195 function: get_cause_loop_id_for_assigns
Condition: !result.empty()
Reason: The assignable violation is not in a loop.
Backtrace:
[...]
--- end invariant violation report ---
Aborted (core dumped)

Metadata

Metadata

Assignees

Labels

SynthesisInvariant synthesis

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions