Pattern and Copattern matching
Anton Setzer Swansea University, Swansea UK Leeds Logic Seminar, 13 May 2015
Anton Setzer (Swansea) Pattern and Copattern matching 1/ 46
Pattern and Copattern matching Anton Setzer Swansea University, - - PowerPoint PPT Presentation
Pattern and Copattern matching Anton Setzer Swansea University, Swansea UK Leeds Logic Seminar, 13 May 2015 Anton Setzer (Swansea) Pattern and Copattern matching 1/ 46 Iteration, Recursion, Induction Coiteration, Corecursion Bisimilarity
Anton Setzer (Swansea) Pattern and Copattern matching 1/ 46
Anton Setzer (Swansea) Pattern and Copattern matching 2/ 46
Iteration, Recursion, Induction
Anton Setzer (Swansea) Pattern and Copattern matching 3/ 46
Iteration, Recursion, Induction
Anton Setzer (Swansea) Pattern and Copattern matching 4/ 46
Iteration, Recursion, Induction
Anton Setzer (Swansea) Pattern and Copattern matching 5/ 46
Iteration, Recursion, Induction
Anton Setzer (Swansea) Pattern and Copattern matching 6/ 46
Iteration, Recursion, Induction
Anton Setzer (Swansea) Pattern and Copattern matching 7/ 46
Iteration, Recursion, Induction
Anton Setzer (Swansea) Pattern and Copattern matching 8/ 46
Iteration, Recursion, Induction
Anton Setzer (Swansea) Pattern and Copattern matching 9/ 46
Coiteration, Corecursion
Anton Setzer (Swansea) Pattern and Copattern matching 10/ 46
Coiteration, Corecursion
Anton Setzer (Swansea) Pattern and Copattern matching 11/ 46
Coiteration, Corecursion
Anton Setzer (Swansea) Pattern and Copattern matching 12/ 46
Coiteration, Corecursion
Anton Setzer (Swansea) Pattern and Copattern matching 13/ 46
Coiteration, Corecursion
Anton Setzer (Swansea) Pattern and Copattern matching 14/ 46
Coiteration, Corecursion
Anton Setzer (Swansea) Pattern and Copattern matching 15/ 46
Coiteration, Corecursion
Anton Setzer (Swansea) Pattern and Copattern matching 16/ 46
Bisimilarity and Coinduction
Anton Setzer (Swansea) Pattern and Copattern matching 17/ 46
Bisimilarity and Coinduction
Anton Setzer (Swansea) Pattern and Copattern matching 18/ 46
Bisimilarity and Coinduction
Anton Setzer (Swansea) Pattern and Copattern matching 19/ 46
Bisimilarity and Coinduction
Anton Setzer (Swansea) Pattern and Copattern matching 20/ 46
Bisimilarity and Coinduction
Anton Setzer (Swansea) Pattern and Copattern matching 21/ 46
Bisimilarity and Coinduction
◮ either a proof of tail s ∼ tail s′ defined before ◮ or use the corecursion hypothesis f (tail s) (tail s′) x′ for some
Anton Setzer (Swansea) Pattern and Copattern matching 22/ 46
Bisimilarity and Coinduction
Anton Setzer (Swansea) Pattern and Copattern matching 23/ 46
Bisimilarity and Coinduction
Anton Setzer (Swansea) Pattern and Copattern matching 24/ 46
Bisimilarity and Coinduction
Anton Setzer (Swansea) Pattern and Copattern matching 25/ 46
Bisimilarity and Coinduction
Anton Setzer (Swansea) Pattern and Copattern matching 26/ 46
Bisimilarity and Coinduction
Anton Setzer (Swansea) Pattern and Copattern matching 27/ 46
Bisimilarity and Coinduction
Anton Setzer (Swansea) Pattern and Copattern matching 28/ 46
Bisimilarity and Coinduction
Anton Setzer (Swansea) Pattern and Copattern matching 29/ 46
Proofs by Coinduction of Bisimilarity in Transition Systems
Anton Setzer (Swansea) Pattern and Copattern matching 30/ 46
Proofs by Coinduction of Bisimilarity in Transition Systems
x x x p q r
Anton Setzer (Swansea) Pattern and Copattern matching 31/ 46
Proofs by Coinduction of Bisimilarity in Transition Systems
x x x p q r
◮ Assume p −
◮ Assume q −
◮ Assume p −
◮ Assume r −
Anton Setzer (Swansea) Pattern and Copattern matching 32/ 46
Proofs by Coinduction of Bisimilarity in Transition Systems
Anton Setzer (Swansea) Pattern and Copattern matching 33/ 46
Proofs by Coinduction of Bisimilarity in Transition Systems
Anton Setzer (Swansea) Pattern and Copattern matching 34/ 46
Mixed Patterns and Copatterns
Anton Setzer (Swansea) Pattern and Copattern matching 35/ 46
Mixed Patterns and Copatterns
Anton Setzer (Swansea) Pattern and Copattern matching 36/ 46
Mixed Patterns and Copatterns
Anton Setzer (Swansea) Pattern and Copattern matching 37/ 46
Mixed Patterns and Copatterns
Anton Setzer (Swansea) Pattern and Copattern matching 38/ 46
Mixed Patterns and Copatterns
Anton Setzer (Swansea) Pattern and Copattern matching 38/ 46
Mixed Patterns and Copatterns
Anton Setzer (Swansea) Pattern and Copattern matching 38/ 46
Mixed Patterns and Copatterns
Anton Setzer (Swansea) Pattern and Copattern matching 38/ 46
Mixed Patterns and Copatterns
Anton Setzer (Swansea) Pattern and Copattern matching 38/ 46
Mixed Patterns and Copatterns
Anton Setzer (Swansea) Pattern and Copattern matching 38/ 46
Mixed Patterns and Copatterns
Anton Setzer (Swansea) Pattern and Copattern matching 39/ 46
Unnesting of Pattern/Copattern Matching
Anton Setzer (Swansea) Pattern and Copattern matching 40/ 46
Unnesting of Pattern/Copattern Matching
Anton Setzer (Swansea) Pattern and Copattern matching 41/ 46
Unnesting of Pattern/Copattern Matching
Anton Setzer (Swansea) Pattern and Copattern matching 42/ 46
Unnesting of Pattern/Copattern Matching
◮ Main reason: interactive programs running continuously in various
◮ In the corecursion step we have a proof obligation, and can use the
Anton Setzer (Swansea) Pattern and Copattern matching 45/ 46
Unnesting of Pattern/Copattern Matching
◮ Pattern matching is an elimination principle for inductive types (initial
◮ Copattern matching is an introduction principle for coinductive types
Anton Setzer (Swansea) Pattern and Copattern matching 46/ 46