Computer Science > Logic in Computer Science
[Submitted on 22 Dec 2010]
Title:Beating the Productivity Checker Using Embedded Languages
View PDFAbstract:Some total languages, like Agda and Coq, allow the use of guarded corecursion to construct infinite values and proofs. Guarded corecursion is a form of recursion in which arbitrary recursive calls are allowed, as long as they are guarded by a coinductive constructor. Guardedness ensures that programs are productive, i.e. that every finite prefix of an infinite value can be computed in finite time. However, many productive programs are not guarded, and it can be nontrivial to put them in guarded form.
This paper gives a method for turning a productive program into a guarded program. The method amounts to defining a problem-specific language as a data type, writing the program in the problem-specific language, and writing a guarded interpreter for this language.
Submission history
From: EPTCS [view email] [via EPTCS proxy][v1] Wed, 22 Dec 2010 07:09:30 UTC (282 KB)
Ancillary-file links:
Ancillary files (details):
- accompanying-code/README
- accompanying-code/lib/AllNonAsciiChars.hs
- accompanying-code/lib/GNUmakefile
- accompanying-code/lib/GenerateEverything.hs
- accompanying-code/lib/Header
- accompanying-code/lib/LICENCE
- accompanying-code/lib/README.agda
- accompanying-code/lib/README.txt
- accompanying-code/lib/README/Nat.agda
- accompanying-code/lib/Setup.hs
- accompanying-code/lib/lib.cabal
- accompanying-code/lib/release-notes
- accompanying-code/lib/src/Algebra.agda
- accompanying-code/lib/src/Algebra/FunctionProperties.agda
- accompanying-code/lib/src/Algebra/FunctionProperties/Core.agda
- accompanying-code/lib/src/Algebra/Morphism.agda
- accompanying-code/lib/src/Algebra/Operations.agda
- accompanying-code/lib/src/Algebra/Props/AbelianGroup.agda
- accompanying-code/lib/src/Algebra/Props/BooleanAlgebra.agda
- accompanying-code/lib/src/Algebra/Props/DistributiveLattice.agda
- accompanying-code/lib/src/Algebra/Props/Group.agda
- accompanying-code/lib/src/Algebra/Props/Lattice.agda
- accompanying-code/lib/src/Algebra/Props/Ring.agda
- accompanying-code/lib/src/Algebra/RingSolver.agda
- accompanying-code/lib/src/Algebra/RingSolver/AlmostCommutativeRing.agda
- accompanying-code/lib/src/Algebra/RingSolver/Lemmas.agda
- accompanying-code/lib/src/Algebra/RingSolver/Simple.agda
- accompanying-code/lib/src/Algebra/Structures.agda
- accompanying-code/lib/src/Category/Applicative.agda
- accompanying-code/lib/src/Category/Applicative/Indexed.agda
- accompanying-code/lib/src/Category/Functor.agda
- accompanying-code/lib/src/Category/Monad.agda
- accompanying-code/lib/src/Category/Monad/Continuation.agda
- accompanying-code/lib/src/Category/Monad/Identity.agda
- accompanying-code/lib/src/Category/Monad/Indexed.agda
- accompanying-code/lib/src/Category/Monad/Partiality.agda
- accompanying-code/lib/src/Category/Monad/State.agda
- accompanying-code/lib/src/Coinduction.agda
- accompanying-code/lib/src/Data/AVL.agda
- accompanying-code/lib/src/Data/AVL/IndexedMap.agda
- accompanying-code/lib/src/Data/AVL/Sets.agda
- accompanying-code/lib/src/Data/Bin.agda
- accompanying-code/lib/src/Data/Bool.agda
- accompanying-code/lib/src/Data/Bool/Properties.agda
- accompanying-code/lib/src/Data/Bool/Show.agda
- accompanying-code/lib/src/Data/BoundedVec.agda
- accompanying-code/lib/src/Data/BoundedVec/Inefficient.agda
- accompanying-code/lib/src/Data/Char.agda
- accompanying-code/lib/src/Data/Cofin.agda
- accompanying-code/lib/src/Data/Colist.agda
- accompanying-code/lib/src/Data/Conat.agda
- accompanying-code/lib/src/Data/Container.agda
- accompanying-code/lib/src/Data/Container/AlternativeBagAndSetEquality.agda
- accompanying-code/lib/src/Data/Container/Any.agda
- accompanying-code/lib/src/Data/Container/Combinator.agda
- accompanying-code/lib/src/Data/Covec.agda
- accompanying-code/lib/src/Data/DifferenceList.agda
- accompanying-code/lib/src/Data/DifferenceNat.agda
- accompanying-code/lib/src/Data/DifferenceVec.agda
- accompanying-code/lib/src/Data/Digit.agda
- accompanying-code/lib/src/Data/Empty.agda
- accompanying-code/lib/src/Data/Fin.agda
- accompanying-code/lib/src/Data/Fin/Dec.agda
- accompanying-code/lib/src/Data/Fin/Props.agda
- accompanying-code/lib/src/Data/Fin/Subset.agda
- accompanying-code/lib/src/Data/Fin/Subset/Props.agda
- accompanying-code/lib/src/Data/Fin/Substitution.agda
- accompanying-code/lib/src/Data/Fin/Substitution/Example.agda
- accompanying-code/lib/src/Data/Fin/Substitution/Lemmas.agda
- accompanying-code/lib/src/Data/Fin/Substitution/List.agda
- accompanying-code/lib/src/Data/Graph/Acyclic.agda
- accompanying-code/lib/src/Data/Integer.agda
- accompanying-code/lib/src/Data/Integer/Divisibility.agda
- accompanying-code/lib/src/Data/Integer/Properties.agda
- accompanying-code/lib/src/Data/List.agda
- accompanying-code/lib/src/Data/List/All.agda
- accompanying-code/lib/src/Data/List/All/Properties.agda
- accompanying-code/lib/src/Data/List/Any.agda
- accompanying-code/lib/src/Data/List/Any/BagAndSetEquality.agda
- accompanying-code/lib/src/Data/List/Any/Membership.agda
- accompanying-code/lib/src/Data/List/Any/Properties.agda
- accompanying-code/lib/src/Data/List/Countdown.agda
- accompanying-code/lib/src/Data/List/NonEmpty.agda
- accompanying-code/lib/src/Data/List/NonEmpty/Properties.agda
- accompanying-code/lib/src/Data/List/Properties.agda
- accompanying-code/lib/src/Data/List/Reverse.agda
- accompanying-code/lib/src/Data/Maybe.agda
- accompanying-code/lib/src/Data/Maybe/Core.agda
- accompanying-code/lib/src/Data/Nat.agda
- accompanying-code/lib/src/Data/Nat/Coprimality.agda
- accompanying-code/lib/src/Data/Nat/DivMod.agda
- accompanying-code/lib/src/Data/Nat/Divisibility.agda
- accompanying-code/lib/src/Data/Nat/GCD.agda
- accompanying-code/lib/src/Data/Nat/GCD/Lemmas.agda
- accompanying-code/lib/src/Data/Nat/InfinitelyOften.agda
- accompanying-code/lib/src/Data/Nat/LCM.agda
- accompanying-code/lib/src/Data/Nat/Properties.agda
- accompanying-code/lib/src/Data/Nat/Show.agda
- accompanying-code/lib/src/Data/Product.agda
- accompanying-code/lib/src/Data/Rational.agda
- accompanying-code/lib/src/Data/Sign.agda
- accompanying-code/lib/src/Data/Sign/Properties.agda
- accompanying-code/lib/src/Data/Star.agda
- accompanying-code/lib/src/Data/Star/BoundedVec.agda
- accompanying-code/lib/src/Data/Star/Decoration.agda
- accompanying-code/lib/src/Data/Star/Environment.agda
- accompanying-code/lib/src/Data/Star/Fin.agda
- accompanying-code/lib/src/Data/Star/List.agda
- accompanying-code/lib/src/Data/Star/Nat.agda
- accompanying-code/lib/src/Data/Star/Pointer.agda
- accompanying-code/lib/src/Data/Star/Properties.agda
- accompanying-code/lib/src/Data/Star/Vec.agda
- accompanying-code/lib/src/Data/Stream.agda
- accompanying-code/lib/src/Data/String.agda
- accompanying-code/lib/src/Data/Sum.agda
- accompanying-code/lib/src/Data/Unit.agda
- accompanying-code/lib/src/Data/Vec.agda
- accompanying-code/lib/src/Data/Vec/Equality.agda
- accompanying-code/lib/src/Data/Vec/N-ary.agda
- accompanying-code/lib/src/Data/Vec/Properties.agda
- accompanying-code/lib/src/Foreign/Haskell.agda
- accompanying-code/lib/src/Function.agda
- accompanying-code/lib/src/Function/Bijection.agda
- accompanying-code/lib/src/Function/Equality.agda
- accompanying-code/lib/src/Function/Equivalence.agda
- accompanying-code/lib/src/Function/Injection.agda
- accompanying-code/lib/src/Function/Inverse.agda
- accompanying-code/lib/src/Function/Inverse/TypeIsomorphisms.agda
- accompanying-code/lib/src/Function/LeftInverse.agda
- accompanying-code/lib/src/Function/Surjection.agda
- accompanying-code/lib/src/IO.agda
- accompanying-code/lib/src/IO/Primitive.agda
- accompanying-code/lib/src/Induction.agda
- accompanying-code/lib/src/Induction/Lexicographic.agda
- accompanying-code/lib/src/Induction/Nat.agda
- accompanying-code/lib/src/Induction/WellFounded.agda
- accompanying-code/lib/src/Level.agda
- accompanying-code/lib/src/Reflection.agda
- accompanying-code/lib/src/Relation/Binary.agda
- accompanying-code/lib/src/Relation/Binary/Consequences.agda
- accompanying-code/lib/src/Relation/Binary/Consequences/Core.agda
- accompanying-code/lib/src/Relation/Binary/Core.agda
- accompanying-code/lib/src/Relation/Binary/EqReasoning.agda
- accompanying-code/lib/src/Relation/Binary/Flip.agda
- accompanying-code/lib/src/Relation/Binary/HeterogeneousEquality.agda
- accompanying-code/lib/src/Relation/Binary/Indexed.agda
- accompanying-code/lib/src/Relation/Binary/Indexed/Core.agda
- accompanying-code/lib/src/Relation/Binary/InducedPreorders.agda
- accompanying-code/lib/src/Relation/Binary/List/NonStrictLex.agda
- accompanying-code/lib/src/Relation/Binary/List/Pointwise.agda
- accompanying-code/lib/src/Relation/Binary/List/StrictLex.agda
- accompanying-code/lib/src/Relation/Binary/NonStrictToStrict.agda
- accompanying-code/lib/src/Relation/Binary/On.agda
- accompanying-code/lib/src/Relation/Binary/OrderMorphism.agda
- accompanying-code/lib/src/Relation/Binary/PartialOrderReasoning.agda
- accompanying-code/lib/src/Relation/Binary/PreorderReasoning.agda
- accompanying-code/lib/src/Relation/Binary/Product/NonStrictLex.agda
- accompanying-code/lib/src/Relation/Binary/Product/Pointwise.agda
- accompanying-code/lib/src/Relation/Binary/Product/StrictLex.agda
- accompanying-code/lib/src/Relation/Binary/PropositionalEquality.agda
- accompanying-code/lib/src/Relation/Binary/PropositionalEquality/Core.agda
- accompanying-code/lib/src/Relation/Binary/PropositionalEquality/TrustMe.agda
- accompanying-code/lib/src/Relation/Binary/Props/DecTotalOrder.agda
- accompanying-code/lib/src/Relation/Binary/Props/Poset.agda
- accompanying-code/lib/src/Relation/Binary/Props/Preorder.agda
- accompanying-code/lib/src/Relation/Binary/Props/StrictPartialOrder.agda
- accompanying-code/lib/src/Relation/Binary/Props/StrictTotalOrder.agda
- accompanying-code/lib/src/Relation/Binary/Props/TotalOrder.agda
- accompanying-code/lib/src/Relation/Binary/Reflection.agda
- accompanying-code/lib/src/Relation/Binary/Sigma/Pointwise.agda
- accompanying-code/lib/src/Relation/Binary/Simple.agda
- accompanying-code/lib/src/Relation/Binary/StrictPartialOrderReasoning.agda
- accompanying-code/lib/src/Relation/Binary/StrictToNonStrict.agda
- accompanying-code/lib/src/Relation/Binary/Sum.agda
- accompanying-code/lib/src/Relation/Nullary.agda
- accompanying-code/lib/src/Relation/Nullary/Core.agda
- accompanying-code/lib/src/Relation/Nullary/Decidable.agda
- accompanying-code/lib/src/Relation/Nullary/Negation.agda
- accompanying-code/lib/src/Relation/Nullary/Product.agda
- accompanying-code/lib/src/Relation/Nullary/Sum.agda
- accompanying-code/lib/src/Relation/Nullary/Universe.agda
- accompanying-code/lib/src/Relation/Unary.agda
- accompanying-code/lib/src/Size.agda
- accompanying-code/productivity/AdmissibleButNotPostulable.agda
- accompanying-code/productivity/ArbitraryChunks.agda
- accompanying-code/productivity/BreadthFirst.agda
- accompanying-code/productivity/BreadthFirst/Lemmas.agda
- accompanying-code/productivity/BreadthFirst/Programs.agda
- accompanying-code/productivity/BreadthFirst/Universe.agda
- accompanying-code/productivity/BreadthFirstWithoutProof.agda
- accompanying-code/productivity/Contractive.agda
- accompanying-code/productivity/Contractive/Examples.agda
- accompanying-code/productivity/Contractive/Function.agda
- accompanying-code/productivity/Contractive/Stream.agda
- accompanying-code/productivity/Hinze/Lemmas.agda
- accompanying-code/productivity/Hinze/Section2-4.agda
- accompanying-code/productivity/Hinze/Section3.agda
- accompanying-code/productivity/Hinze/Simplified/Section2-4.agda
- accompanying-code/productivity/Hinze/Simplified/Section3.agda
- accompanying-code/productivity/InductiveStreamEquality.agda
- accompanying-code/productivity/InfinitelyOften.agda
- accompanying-code/productivity/LICENCE
- accompanying-code/productivity/Lambda.agda
- accompanying-code/productivity/Lambda/Closure/Equivalence.agda
- accompanying-code/productivity/Lambda/Closure/Functional.agda
- accompanying-code/productivity/Lambda/Closure/Functional/Alternative.agda
- accompanying-code/productivity/Lambda/Closure/Relational.agda
- accompanying-code/productivity/Lambda/Substitution.agda
- accompanying-code/productivity/Lambda/Substitution/Equivalence.agda
- accompanying-code/productivity/Lambda/Substitution/OneSemantics.agda
- accompanying-code/productivity/Lambda/Substitution/TwoSemantics.agda
- accompanying-code/productivity/Lambda/Syntax.agda
- accompanying-code/productivity/Lambda/VirtualMachine.agda
- accompanying-code/productivity/LargeCombinators.agda
- accompanying-code/productivity/MapIterate.agda
- accompanying-code/productivity/Nested.agda
- accompanying-code/productivity/Productivity.agda
- accompanying-code/productivity/RecursiveTypes.agda
- accompanying-code/productivity/RecursiveTypes/Semantics.agda
- accompanying-code/productivity/RecursiveTypes/Substitution.agda
- accompanying-code/productivity/RecursiveTypes/Subterm.agda
- accompanying-code/productivity/RecursiveTypes/Subterm/RestrictedHypothesis.agda
- accompanying-code/productivity/RecursiveTypes/Subtyping/Axiomatic/Coinductive.agda
- accompanying-code/productivity/RecursiveTypes/Subtyping/Axiomatic/Incorrect.agda
- accompanying-code/productivity/RecursiveTypes/Subtyping/Axiomatic/Inductive.agda
- accompanying-code/productivity/RecursiveTypes/Subtyping/Example.agda
- accompanying-code/productivity/RecursiveTypes/Subtyping/Semantic/Coinductive.agda
- accompanying-code/productivity/RecursiveTypes/Subtyping/Semantic/Equivalence.agda
- accompanying-code/productivity/RecursiveTypes/Subtyping/Semantic/Inductive.agda
- accompanying-code/productivity/RecursiveTypes/Syntax.agda
- accompanying-code/productivity/RecursiveTypes/Syntax/UnfoldedOrFixpoint.agda
- accompanying-code/productivity/SingletonChunks.agda
- accompanying-code/productivity/Stream.agda
- accompanying-code/productivity/Stream/Equality.agda
- accompanying-code/productivity/Stream/Pointwise.agda
- accompanying-code/productivity/Stream/Programs.agda
- accompanying-code/productivity/StreamProg.agda
- accompanying-code/productivity/ThueMorse.agda
- accompanying-code/productivity/ThueMorseLeq.agda
- accompanying-code/productivity/Tree.agda
- accompanying-code/productivity/Universe.agda
- accompanying-code/productivity/VenanziosProblem.agda
- (237 additional files not shown) You must enabled JavaScript to view entire file list.
References & Citations
Bibliographic and Citation Tools
Bibliographic Explorer (What is the Explorer?)
Connected Papers (What is Connected Papers?)
Litmaps (What is Litmaps?)
scite Smart Citations (What are Smart Citations?)
Code, Data and Media Associated with this Article
alphaXiv (What is alphaXiv?)
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub (What is DagsHub?)
Gotit.pub (What is GotitPub?)
Hugging Face (What is Huggingface?)
Papers with Code (What is Papers with Code?)
ScienceCast (What is ScienceCast?)
Demos
Recommenders and Search Tools
Influence Flower (What are Influence Flowers?)
CORE Recommender (What is CORE?)
arXivLabs: experimental projects with community collaborators
arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.
Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.
Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.