Abstract
This paper introduces KOKO, a symbolic evaluator designed for the Gist specification language. By treating high-level specifications as sets of logical axioms, KOKO allows developers to "run" their requirements to identify unexpected behaviors and logical bugs long before implementation begins. The system addresses the challenges of massive nondeterminism and global constraints inherent in powerful specification languages.
Introduction
Software development often fails due to misunderstood requirements or hidden logical contradictions. Formal specification languages like Gist help by describing what a system should do rather than how to do it. However, Gist's expressive power—including descriptive references and "look-ahead" constraints—makes it difficult to execute using standard symbolic methods. KOKO bridges this gap by making abstract specifications executable in a symbolic sense to validate user intent.
Modeling the World as a Relational Database
KOKO models the state of the world as a relational database where objects are created, destroyed, and linked through complex relationships. This structure allows the system to handle the high-level abstractions found in Gist specifications.
In this framework, every statement in a Gist specification is translated into domain axioms expressed in first-order temporal logic. Constraints act as filters that prune any execution path that might eventually violate a rule, effectively handling Gist's unique "look-ahead" property.
The KOKO Methodology
KOKO factors symbolic execution into several key processes:
- Axiomatization: Translating Gist statements into temporal logic axioms.
- Forward Inference: Using an inference engine to derive consequences from these axioms. For example, if a constraint dictates specific relationships between entities, KOKO infers the necessary state changes to maintain consistency.
- Symbolic Instances: Handling "reference by description" (e.g., "any red box") by creating typed symbolic placeholders. This allows for the discovery of potential aliasing issues.
- Predicate Transformers: Propagating facts across state changes (insertions/deletions of relations) to map how changes ripple through the logical state.
Key Insights and Results
One of the paper's core insights is that high-level specifications are often easier to execute symbolically than low-level code because they deal directly with intended logic rather than implementation "noise."
KOKO's utility is demonstrated through its ability to uncover "bugs in intent." In a marriage domain example, KOKO successfully deduced that:
- A person cannot marry themselves due to gender constraints.
- If two people marry, they must have different genders.
- The specification was flawed because it did not explicitly forbid marrying someone to whom you are already married.
Limitations and Future Work
While KOKO can produce complete descriptions of non-trivial specifications, such as postal routers or file systems, it faces limitations in handling infinite loops and historical references. Future work will focus on improving the forward inference engine's heuristics to better distinguish between significant and trivial logical consequences, as well as handling the arbitrary interleaving of parallel processes.
Summary updated