Analyze Python code for correctness using symbolic execution and SMT solving to automatically find counterexamples for functions with type annotations and contracts.
86
{
"context": "This criteria evaluates how effectively an engineer uses CrossHair's symbolic execution capabilities, particularly its support for standard library types like datetime, to implement contract-verified date validation functions with proper preconditions and postconditions.",
"type": "weighted_checklist",
"checklist": [
{
"name": "PEP316 Contract Syntax",
"description": "Uses PEP316-style docstring contracts with 'pre:' and 'post:' declarations for all three functions (is_date_in_range, add_days_to_date, days_between) as specified in the API. Contracts must be in docstrings and use the exact 'pre:' and 'post:' prefix format that CrossHair recognizes.",
"max_score": 30
},
{
"name": "Datetime Type Usage",
"description": "Correctly uses Python's datetime.date type for all date parameters and return values, ensuring compatibility with CrossHair's symbolic datetime implementations.",
"max_score": 20
},
{
"name": "Precondition Implementation",
"description": "Implements all preconditions correctly: start <= end for is_date_in_range and days_between, days >= 0 for add_days_to_date.",
"max_score": 20
},
{
"name": "Postcondition Implementation",
"description": "Implements all postconditions correctly using '__return__' to reference return values: proper boolean logic for is_date_in_range, result >= start for add_days_to_date (with post[start] to track mutations), result >= 0 for days_between.",
"max_score": 20
},
{
"name": "Date Arithmetic Operations",
"description": "Uses timedelta for date arithmetic in add_days_to_date and correctly computes date differences in days_between using datetime operations.",
"max_score": 10
}
]
}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