Skip to content

Conversation

@tautschnig
Copy link
Collaborator

Make the support for property-guided slicing the same for both
--full-slice and --reachability-slice. Furthermore replace sliced code
by assume(false) instead of unbounded (self-)loops.

Make the support for property-guided slicing the same for both
--full-slice and --reachability-slice. Furthermore replace sliced code
by assume(false) instead of unbounded (self-)loops.
@kroening kroening merged commit 7ddee5f into diffblue:master Apr 4, 2017
@tautschnig tautschnig deleted the reachability-slice branch April 4, 2017 13:39
tautschnig added a commit to tautschnig/cbmc that referenced this pull request Dec 23, 2025
This commit merges the best aspects of two approaches to hash-based loop
identification:
- Clean implementation from PR diffblue#732 (bigweaver/clone-cbmc-private-20251130-231902)
- Comprehensive testing from PR diffblue#786 (bigweaver/clone-cbmc-private-20251209-144542)

Core Implementation (from PR diffblue#732):
- Enhanced loop_idt struct with hash support and backward compatibility
- compute_loop_hashes() using AST fingerprinting approach
- Hash based on source location, loop structure, and body characteristics
- Uses hash_combine() and hash_finalize() utilities
- Clean separation of concerns with modular design

Testing Infrastructure (from PR diffblue#786):
- Unit tests: unit/goto-programs/loop_hash.cpp (Catch2-based)
- Basic regression: 3 test suites (types, nested, stability)
- Comprehensive suite: 21 automated test cases covering:
  * Position independence (11 tests)
  * Sensitivity to changes (4 tests)
  * Determinism (4 tests)
  * Special cases (2 tests)
- Multiple test frameworks: Python (basic + enhanced) and Bash
- Test utilities for hash comparison and extraction

Key Benefits:
- Loop identifiers stable across unrelated code changes
- Hashes change appropriately when loop logic changes
- Backward compatible with existing loop_number system
- Comprehensive test coverage (21+ test cases)
- Well-documented with extensive README files

Files Modified:
- Core: 5 implementation files in src/goto-programs/
- Tests: 52 test files (unit + regression)
- Build: unit/Makefile updated

See LOOP_HASH_MERGE_SUMMARY.md for detailed documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants