Formal Languages aa bb baab ··· ε ba ab Formally Coinductively and a b a b a b a b a b a b a b . . . . . . . . . . . . Dmitriy Traytel
Contribution Isabelle H O L ∀ = library of formal languages in α λ β →
Contribution define regular operations ∅ , ε , Atom, + , · , ∗ prove axioms of Kleene Algebra Isabelle H O L ∀ = library of formal languages in α λ β →
Contribution define regular operations ∅ , ε , Atom, + , · , ∗ prove axioms of Kleene Algebra Isabelle H O L ∀ = Coinductive library of formal languages in α λ β →
Contribution define regular operations ∅ , ε , Atom, + , · , ∗ prove axioms of Kleene Algebra Isabelle H O L ∀ = Coinductive library of formal languages in α λ β → Tutorial for corecursion and coinduction
Contribution define regular operations ∅ , ε , Atom, + , · , ∗ prove axioms of Kleene Algebra Isabelle H O L ∀ = Coinductive library of formal languages in α λ β → Formal Structure Tutorial for corecursion and coinduction Computation Deduction
Contribution define regular operations ∅ , ε , Atom, + , · , ∗ prove axioms of Kleene Algebra Isabelle H O L ∀ = Coinductive library of formal languages in α This talk: Tutorial in 20 min λ β → Formal Structure Tutorial for corecursion and coinduction Computation Deduction
Related Work: A Selection of CoTutorials t n n n e a o p o t i s y i s t i t c s r a u u s t a c d A e n d f r i o o o o C C o C r P Jacobs, Rutten EATCS’97 stream Rutten CONCUR’98 language Giménez, Castéran ’98 stream, lazy list Rutten MSCS ’05 stream Hinze JFP ’11 stream Chlipala ’13 stream, while Rot, Rutten, Bonsangue language LATA’13 Kozen, Silva MSCS ’14 stream Setzer Festschrift Jäger’16 stream e l H O e l L b Traytel FSCD’16 language a ∀ s I = α λ β →
Codatatype Corecursion Coinduction
Codatatype Corecursion Coinduction
a b a b a b a b a b a b a b . . . . . . . . . . . .
lang = L bool codatatype lang lang a b a b a b a b a b a b a b . . . . . . . . . . . .
codatatype α lang = L bool ( α ⇒ α lang ) a b a b a b a b a b a b a b . . . . . . . . . . . .
codatatype α lang = L bool ( α ⇒ α lang ) a b a b a b a b a b a b a b . . . . . . . . . . . .
codatatype α lang = L bool ( α ⇒ α lang ) a b a b a b a b a b a b a b . . . . . . . . . . . .
codatatype α lang = L bool ( α ⇒ α lang ) o :: α lang ⇒ bool δ :: α lang ⇒ α ⇒ α lang a b a b a b a b a b a b a b . . . . . . . . . . . .
primrec ∈ ∈ :: α list ⇒ α lang ⇒ bool [] ∈ ∈ L = o L aw ∈ ∈ L = w ∈ ∈ δ L a a b a b a b a b a b a b a b . . . . . . . . . . . .
primrec ∈ ∈ :: α list ⇒ α lang ⇒ bool [] ∈ ∈ L = o L aw ∈ ∈ L = w ∈ ∈ δ L a aa ∈ ∈ a b a b a b a b a b a b a b . . . . . . . . . . . .
primrec ∈ ∈ :: α list ⇒ α lang ⇒ bool [] ∈ ∈ L = o L aw ∈ ∈ L = w ∈ ∈ δ L a a b a ∈ ∈ a b a b a b a b a b a b . . . . . . . . . . . .
primrec ∈ ∈ :: α list ⇒ α lang ⇒ bool [] ∈ ∈ L = o L aw ∈ ∈ L = w ∈ ∈ δ L a a b a b a b [] ∈ ∈ a b a b a b a b . . . . . . . . . . . .
primrec ∈ ∈ :: α list ⇒ α lang ⇒ bool [] ∈ ∈ L = o L aw ∈ ∈ L = w ∈ ∈ δ L a a b a b a b a b a b a b a b . . . . . . . . . . . .
Codatatype Corecursion Coinduction
primcorec ∅ :: α lang o ∅ = δ ∅ = λ _ . ∅
primcorec ∅ :: α lang o ∅ = δ ∅ = λ _ . ∅ a b a b a b . . . . . .
primcorec ∅ :: α lang primcorec ε :: α lang o ∅ = o ε = δ ∅ = λ _ . ∅ δ ε = λ _ . ∅ a b a b a b a b a b a b . . . . . . . . . . . .
primcorec ∅ :: α lang primcorec ε :: α lang o ∅ = o ε = δ ∅ = λ _ . ∅ δ ε = λ _ . ∅ a b a b a b a b a b a b . . . . . . . . . . . . primcorec Atom :: α ⇒ α lang o ( Atom a ) = δ ( Atom a ) = λ b . if a = b then ε else ∅
primcorec ∅ :: α lang primcorec ε :: α lang o ∅ = o ε = δ ∅ = λ _ . ∅ δ ε = λ _ . ∅ a b a b a b a b a b a b . . . . . . . . . . . . primcorec Atom :: α ⇒ α lang o ( Atom a ) = δ ( Atom a ) = λ b . if a = b then ε else ∅ a b a b a b a b a b a b . . . . . . . . . . . .
primrec primcorec Syntactic criterion for termination productivity α list ⇒ ··· ··· ⇒ α lang of functions of type
primrec primcorec Syntactic criterion for termination productivity α list ⇒ ··· ··· ⇒ α lang of functions of type Philosophy consume 1 pattern match argument
primrec primcorec Syntactic criterion for termination productivity α list ⇒ ··· ··· ⇒ α lang of functions of type Philosophy consume 1 produce 1 pattern match argument copattern match output
primrec primcorec Syntactic criterion for termination productivity α list ⇒ ··· ··· ⇒ α lang of functions of type Philosophy consume 1 produce 1 pattern match argument copattern match output (Co)recursive call arguments very restricted context arbitrary
primrec primcorec Syntactic criterion for termination productivity α list ⇒ ··· ··· ⇒ α lang of functions of type Philosophy consume 1 produce 1 pattern match argument copattern match output (Co)recursive call arguments very restricted arbitrary context arbitrary very restricted
primrec primcorec Syntactic criterion for termination productivity α list ⇒ ··· ··· ⇒ α lang of functions of type Philosophy consume 1 produce 1 pattern match argument copattern match output (Co)recursive call arguments very restricted arbitrary context arbitrary very restricted a b a b a b a b a b a b . . . . . . . . . . . . Atom a Atom b
primrec primcorec Syntactic criterion for termination productivity α list ⇒ ··· ··· ⇒ α lang of functions of type Philosophy consume 1 produce 1 pattern match argument copattern match output (Co)recursive call arguments very restricted arbitrary context arbitrary very restricted a b a b a b = + a b a b a b a b a b a b . . . . . . . . . . . . . . . . . . Atom a Atom b
primrec primcorec Syntactic criterion for termination productivity α list ⇒ ··· ··· ⇒ α lang of functions of type Philosophy consume 1 produce 1 pattern match argument copattern match output (Co)recursive call arguments very restricted arbitrary context arbitrary very restricted primcorec + :: α lang ⇒ α lang ⇒ α lang o ( L + K ) = o L ∨ o K δ ( L + K ) = λ a . δ L a + δ K a a b a b a b = + a b a b a b a b a b a b . . . . . . . . . . . . . . . . . . Atom a Atom b
o ∅ = o ε = δ ∅ = λ _ . ∅ δ ε = λ _ . ∅ o ( Atom a ) = δ ( Atom a ) = λ b . if a = b then ε else ∅ o ( L + K ) = o L ∨ o K δ ( L + K ) = λ a . δ L a + δ K a
L , K :: α lang = o ∅ = o ε L + ∅ = L o ( Atom a ) = nullability o ( L + K ) = o L ∨ o K = λ _ . ∅ δ ∅ = λ _ . ∅ δ ε δ ( Atom a ) = λ b . if a = b then ε else ∅ Brzozowski δ ( L + K ) = λ a . δ L a + δ K a derivative
L , K :: α regex = o ∅ = o ε L + ∅ � = L o ( Atom a ) = o ( L + K ) = o L ∨ o K = λ _ . ∅ d ∅ = λ _ . ∅ d ε d ( Atom a ) = λ b . if a = b then ε else ∅ d ( L + K ) = λ a . d L a + d K a
L , K :: α regex = o ∅ = o ε L + ∅ � = L o ( Atom a ) = o ( L + K ) = o L ∨ o K o ( L · K ) = o L ∧ o K o ( L ∗ ) = = λ _ . ∅ d ∅ = λ _ . ∅ d ε d ( Atom a ) = λ b . if a = b then ε else ∅ d ( L + K ) = λ a . d L a + d K a d ( L · K ) = ... d ( L ∗ ) = ...
L , K :: α regex = o ∅ = o ε L + ∅ � = L o ( Atom a ) = nullability o ( L + K ) = o L ∨ o K o ( L · K ) = o L ∧ o K o ( L ∗ ) = = λ _ . ∅ d ∅ = λ _ . ∅ d ε d ( Atom a ) = λ b . if a = b then ε else ∅ Brzozowski d ( L + K ) = λ a . d L a + d K a derivative d ( L · K ) = ... d ( L ∗ ) = ...
L , K :: α regex L + ∅ � = L o ( L · K ) = o L ∧ o K d ( L · K ) = ...
primcorec · :: α lang ⇒ α lang ⇒ α lang o ( L · K ) = o L ∧ o K δ ( L · K ) = λ a . if o L then δ L a · K + δ K a else δ L a · K
Nonprimitively corecursive specification ✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿ · :: α lang ⇒ α lang ⇒ α lang primcorec o ( L · K ) = o L ∧ o K δ ( L · K ) = λ a . if o L then δ L a · K + δ K a else δ L a · K
Recommend
More recommend