Foundational Extensible Corecursion
Jasmin Blanchette Andrei Popescu Dmitriy Traytel
Foundational Extensible Corecursion Jasmin Blanchette Andrei - - PowerPoint PPT Presentation
Foundational Extensible Corecursion Jasmin Blanchette Andrei Popescu Dmitriy Traytel Foundational Extensible Corecursion Jasmin Blanchette Andrei Popescu Dmitriy Traytel Am I Productive? s = 0 : s primitive corecusion s = 0 : s primitive
Jasmin Blanchette Andrei Popescu Dmitriy Traytel
Jasmin Blanchette Andrei Popescu Dmitriy Traytel
primitive corecusion
primitive corecusion
tail evil
tail evil
corecursion up to constructors
corecursion up to constructors
primitive corecusion
primitive corecusion
eo evil
eo evil
s ⊕ t = (head s + head t) : (tail s ⊕ tail t)
primitive corecusion
s ⊕ t = (head s + head t) : (tail s ⊕ tail t)
primitive corecusion
s ⊗ t = (head s * head t) : (tail s ⊗ t ⊕ s ⊗ tail t) corecursion up to ⊕
s ⊗ t = (head s * head t) : (tail s ⊗ t ⊕ s ⊗ tail t) corecursion up to ⊕
corecursion up to constructors and ⊕
corecursion up to constructors and ⊕
s n = if n > 0 then s (n - 1) ⊕ (0 : s (n + 1)) else 1 : s 1
mixed recursion/corecursion up to ⊕
s n = if n > 0 then s (n - 1) ⊕ (0 : s (n + 1)) else 1 : s 1
mixed recursion/corecursion up to ⊕
definingall the green stuffand more
definingall the green stuffand more in an LCF-style proof assistant
definingall the green stuffand more in an LCF-style proof assistant
here and there
definingall the green stuffand more in an LCF-style proof assistant
here and there
Most of the time: automatic
Kernel of
≈
simply typed lambda calculus+ classical higher-order logic (axioms)+ nonrecursive constant definition+ nonrecursive type definition
Kernel of
≈
simply typed lambda calculus+ classical higher-order logic (axioms)+ nonrecursive constant definition+ nonrecursive type definition Our agenda make Isabelle/HOL a (co)recursion-friendly environment LICS’12 ITP’14 IJCAR’14 ESOP’15 ICFP’15
Guarded Coprogramming/Proof Assistants
Isabelle primitive corecursion corecursor
Guarded Coprogramming/Proof Assistants
Isabelle primitive corecursion corecursor Coq corecursion up-to constructors built-in
Guarded Coprogramming/Proof Assistants
Isabelle primitive corecursion corecursor Coq corecursion up-to constructors built-in Agda copatterns + sized types built-in + type system
Guarded Coprogramming/Proof Assistants
Isabelle primitive corecursion corecursor Coq corecursion up-to constructors built-in Agda copatterns + sized types built-in + type system
type system
type system
type system
Guarded Coprogramming/Proof Assistants
Isabelle primitive corecursion corecursor Coq corecursion up-to constructors built-in Agda copatterns + sized types built-in + type system
type system
type system
type system Isabelle’ corecursion up-to friendly operations smart corecursor mixed with recursion + wellfounded recursion
codatatype Stream = Int : Stream
codatatype Stream = Int : Stream
codatatype Stream = Int : Stream
primcorec s ⊕ t = (head s + head t) : (tail s ⊕ tail t)
codatatype Stream = Int : Stream
primcorec s ⊕ t = (head s + head t) : (tail s ⊕ tail t)
codatatype C = ···
primcorec f x =
(Assuming F is a bounded natural functor)
0 :: (A →
0 :: (A →
1 :: (A → ⊕ (F (⊕ A))) → A → C
0 :: (A →
1 :: (A → ⊕ (F (⊕ A))) → A → C
corec s ⊗ t = (head s ∗ head t) : (tail s ⊗ t ⊕ s ⊗ tail t)
1 (λ(s,t).
0 :: (A →
1 :: (A → ⊕ (F (⊕ A))) → A → C
2 :: (A → ⊕
corec s ⊗ t = (head s ∗ head t) : (tail s ⊗ t ⊕ s ⊗ tail t)
1 (λ(s,t).
In the paper
In the paper
In the paper
In the paper In the meantime
In the paper In the meantime Coq constructor+ Agda constructor+ · arbitrary (manual proofs) Isabelle friendly∗ · constructor · friendly∗ (auto proofs)
Jasmin Blanchette Andrei Popescu Dmitriy Traytel
What is s 1?
s n = if n > 0 then s (n - 1) ⊕ (0 : s (n + 1)) else 1 : s 1