Analyze Python code for correctness using symbolic execution and SMT solving to automatically find counterexamples for functions with type annotations and contracts.
86
Build a tool that compares two Python function implementations to find inputs where they behave differently.
@generates
def compare_functions(func1, func2, timeout=5.0):
"""
Compare two functions to find inputs where they behave differently.
Args:
func1: First function to compare
func2: Second function to compare
timeout: Maximum time in seconds to search for differences
Returns:
dict with keys:
- 'found': bool, True if a difference was discovered
- 'input': dict mapping argument names to values (present if found=True)
- 'difference_type': str, one of 'return_value' or 'exception' (present if found=True)
Example:
result = compare_functions(version1, version2, timeout=10.0)
if result['found']:
print(f"Functions differ on input: {result['input']}")
"""
passProvides symbolic execution and behavioral difference detection capabilities.
Install with Tessl CLI
npx tessl i tessl/pypi-crosshair-toolevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10