The paper formalizes regular expressions as an inductive datatype and formal languages as a coinductive codatatype in Dafny. It introduces the concept of bisimilarity of languages and equips languages with an algebraic structure. The denotational semantics of regular expressions is defined as an induced function from regular expressions to formal languages, and it is proven that this function preserves algebraic structures up to pointwise bisimilarity.
The paper then equips the set of regular expressions with a coalgebraic structure of the type of unpointed deterministic automata and formalizes the operational semantics of regular expressions as an induced function from regular expressions to formal languages. It is shown that this function preserves coalgebraic structures.
Finally, the paper proves that the denotational and operational semantics of regular expressions coincide, up to pointwise bisimilarity. It also shows that the function formalizing the operational semantics is an algebra homomorphism. The proofs leverage Dafny's built-in inductive and coinductive reasoning capabilities.
Vers une autre langue
à partir du contenu source
arxiv.org
Questions plus approfondies