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%
Build a date range validation utility with formal contract specifications. The implementation should include preconditions and postconditions that can be verified to ensure correctness.
Validates that a date falls within a specified range and performs date arithmetic correctly.
Calculates the number of days between two dates and validates business logic constraints.
@generates
from datetime import date, timedelta
def is_date_in_range(start: date, end: date, check: date) -> bool:
"""
Check if a date falls within a specified range (inclusive).
pre: start <= end
post: __return__ == (start <= check <= end)
"""
pass
def add_days_to_date(start: date, days: int) -> date:
"""
Add a specified number of days to a date.
pre: days >= 0
post[start]: __return__ >= start
"""
pass
def days_between(start: date, end: date) -> int:
"""
Calculate the number of days between two dates.
pre: start <= end
post: __return__ >= 0
"""
passProvides symbolic execution and contract verification capabilities for Python code, including support for standard library types like datetime.
@satisfied-by