Build provably correct software using formal methods like Hoare Logic, Weakest Preconditions, and Design-by-Contract.
99
Quality
100%
Does it follow best practices?
Impact
99%
1.45xAverage score across 5 eval scenarios
You are building a storage component for a safety-critical system. You need to implement a class DataStore that manages a fixed-capacity collection of items.
The DataStore must provide two primary operations: add(item) and retrieve().
Requirements:
DataStore object.Produce a Python file storage.py containing the DataStore class. Ensure that the logic is robust and uses built-in verification mechanisms to enforce all system rules.