How correcthorsebatterystaple/hoare-z3 works
Input Processing Layer
• Entry point (src/index.ts)
• Tokenizer (src/tokenizer.ts)
• Grammar parser (grammar.ne and src/grammar.js)
Core Processing Pipeline
• Verification Condition Generation (src/getVerificationConditions.ts)
• Hoare Logic Transformation (src/hoareTransformers.ts)
• Infix to Prefix Conversion (src/infixToPrefix.ts)
• SMT Generation (src/smtGenerator.ts)
Supporting Components
• Built-in Functions/Operations (src/builtin.ts)
• Type Definitions and Interfaces
• Enums for Tokens and Parser Nodes
Component Representation
• Use rectangles for major processing components
• Blue: Input/Output
• Green: Processing Components
• Yellow: Supporting Utilities
• Gray: Configuration/Definition Files
[TypeScript Program + Specifications] →
• [Lexical Analysis (tokenizer.ts)] →
• [Parsing (grammar.ne)] →
• [Verification Condition Generation] →
• [Hoare Logic Transformation] →
• [SMT Generation] →
• [SMT Conditions]
Supporting Components
• How built-in functions interface with the main pipeline
• Demonstrate how type definitions and enums support the system
• Relationship between different interfaces and their usage
Parser Dependencies
• How LexerTokenType and ParserNodeType enums support the parsing process
• How grammar.ne generates the parser
Transformation Pipeline
• Step-by-step transformation from TypeScript to SMT
• How each component feeds into the next
Support System
• Demonstrate how built-in functions are integrated
• Interface implementations and their relationships
Level of Detail Guidelines:
Testing: Indicate test points but don't detail individual test cases
Remember to:
• Keep the main transformation pipeline clear and central
• Use consistent notation throughout
• Bidirectional relationships where they exist
• Annotations for critical transformations
• Error handling paths
• Validation checkpoints