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 user account management system that validates user operations using runtime contract enforcement.
@generates
class UserAccount:
"""
A user account with username, age, and balance.
Attributes:
username: Alphanumeric string, 3-20 characters
age: Integer between 18 and 120 (inclusive)
balance: Non-negative float
"""
def __init__(self, username: str, age: int) -> None:
"""
Create a new user account.
Args:
username: The username for the account
age: The user's age
"""
pass
def deposit(self, amount: float) -> None:
"""
Deposit money into the account.
Args:
amount: The amount to deposit
"""
pass
def withdraw(self, amount: float) -> None:
"""
Withdraw money from the account.
Args:
amount: The amount to withdraw
"""
pass
def update_username(self, new_username: str) -> None:
"""
Update the account's username.
Args:
new_username: The new username
"""
passProvides runtime contract enforcement with decorators for validating preconditions and postconditions.