Introduction
In the field of formal methods and multi-agent systems, the transition from system verification to automated synthesis represents a major advancement. While verification ensures a system adheres to specifications, synthesis automatically generates the logic required to fulfill them. This paper, originally presented at TARK 2013, introduces the first practical tool for the automated synthesis of Knowledge-based Programs (KBPs).
The Challenge of Knowledge-Based Synthesis
Knowledge-based programs are essential in distributed computing, where protocol logic often depends on an agent's epistemic state—what it "knows." For instance, a protocol might state: "If I know the leader has crashed, I will initiate an election." However, "knowledge" is an abstract concept that cannot be directly executed on hardware. To run such a program, these knowledge conditions must be translated into concrete checks on local variables (e.g., if timeout_flag == true), a process known as synthesis.
Historically, this translation was performed manually through rigorous "pencil and paper" analysis. Given the subtle interconnections of information in distributed systems, manual synthesis is error-prone and scales poorly. While tools existed to verify manual implementations, practical tools for automatic generation—especially for systems where agents have "perfect recall" of their past observations—were previously unavailable.
Methodology: Symbolic Representation
The authors address these challenges by treating synthesis as an incremental symbolic search. A key innovation is the use of Binary Decision Diagrams (BDDs) to represent sets of states and transition relations.
As shown in the comparison between a standard decision tree and a Reduced OBDD, BDDs provide a compact data structure that exploits logical redundancies. This allows the representation of massive state spaces without the "state explosion problem" that typically limits explicit-state tools.
The synthesis algorithm proceeds time-step by time-step for a program of length $N$. At each step $k$, it constructs an epistemic Kripke structure. The core of the method involves substitution discovery: finding a boolean expression over an agent's observable variables that is logically equivalent to the knowledge formula in the KBP. Once identified, this expression replaces the knowledge operator, resulting in a standard, runnable program.
The research focuses on two synchronous environments:
- Clock Semantics: Agents are aware of the current time.
- Synchronous Perfect Recall (SPR): Agents remember all past observations. The authors introduce "history variables" to track past states, effectively reducing SPR problems to Clock-based ones.
Experimental Evaluation and Results
The symbolic approach was evaluated using two benchmarks: the Muddy Children Puzzle and Leader Election in a Ring. The results demonstrated a dramatic performance improvement over the state-of-the-art explicit-state tool, DEMO.
- Scaling: In the Muddy Children puzzle with 7 children, DEMO required 897 seconds, whereas the symbolic tool (MCK) completed the task in just 6 seconds.
- Performance Limits: When scaled to 10 children, DEMO timed out after 10 hours, while MCK synthesized the implementation in under one minute (57s) for clock semantics. Even under the more complex SPR semantics, MCK handled 10 children in approximately 20 minutes, a task beyond DEMO's capabilities.
- Distributed Protocols: The tool successfully synthesized a protocol for a 3-agent ring across 10 execution steps, managing the complexity of $(k+1)^n$ possible run histories.
Conclusion
This work reinforces the utility of KBPs as high-level specifications and highlights the power of symbolic methods over explicit-state enumeration. While current synthesis is limited to atemporal logic and bounded programs, it provides a robust foundation for future work in infinite-loop synthesis and probabilistic knowledge.
Summary updated