tessl install tessl/pypi-crosshair-tool@0.0.0Analyze Python code for correctness using symbolic execution and SMT solving to automatically find counterexamples for functions with type annotations and contracts.
Agent Success
Agent success rate when using this tile
86%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.25x
Baseline
Agent success rate without this tile
69%
A Python utility that generates symbolic values for testing and constraint solving. The generator creates symbolic representations of Python types that can be used in symbolic execution and validation scenarios.
@generates
from typing import Any, Type
class SymbolicValueGenerator:
"""
A generator that creates symbolic values for different Python types.
"""
def create_symbolic(self, type_hint: Type, name: str = "sym") -> Any:
"""
Creates a symbolic value of the specified type.
Args:
type_hint: The Python type to generate a symbolic value for
name: A variable name for the symbolic value (default: "sym")
Returns:
A symbolic value that represents the given type and can be
used in constraint solving and symbolic execution
Raises:
TypeError: If the type is not supported for symbolic generation
"""
pass
def realize(self, symbolic_value: Any) -> Any:
"""
Converts a symbolic value to a concrete value.
Args:
symbolic_value: A symbolic value to convert
Returns:
A concrete Python value
"""
passProvides symbolic execution and type proxy support for generating symbolic values.