Skip to main content

The Foldl Operator as a Coequalizer Using Coq

  • Conference paper
Computer Aided Systems Theory - EUROCAST 2009 (EUROCAST 2009)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 5717))

Included in the following conference series:

  • 1118 Accesses

Abstract

In the present work a Coq based approach is taken to characterize the foldl using a functorial structure from which an inductive type is determined. With μ F being an initial F–algebra and (B,θ) another F–algebra, two F–algebras with support B×μ F are constructed and then coequalized. This coequalization morphism allows the definition of foldl structurally.

After examining some significant examples we propose the following methodology to define a foldl operator. Let F be a polynomial endofunctor and (μ F ,in F ) its initial algebra. We define two F–algebras with support B×μ F , and h1,h2:F(B×μ F ) →B ×μ F constructed such that in one of them the argument of the initial type is syntactically (structurally) lower than that in the other. Then, \({\mathit{foldl}}:B\times\mu_F \rightarrow B\) can be defined as a specific morphism that coequalizes them \((h_1;{\mathit{foldl}}=h_2;{\mathit{foldl}}).\)

For an initial F–algebra with distinguished element (as in the case of lists), foldl is a coequalizer of h1 and h2.

The proofs are performed using the Coq proof system. In this context, constructive approach stress that existence is constructive, therefore with a computational content.

Detailed structure for proofs in Coq is included but interactive code is omited. See the section 4 for a repository with the complete source code.

Partially supported by Xunta de Galicia PGIDIT07TIC005105PR and MEC TIN2005-08986.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 129.00
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 169.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Arbib, M.A., Manes, E.G.: Algebraic Approaches to Program Semantics. The AKM Series in Theoretical Computer Science. Springer, Heidelberg (1986)

    Google Scholar 

  2. Belleannée, C., Brisset, P., Ridoux, O.: A Pragmatic Reconstruction of λ–Prolog. The Journal of Logic Programming (1994)

    Google Scholar 

  3. Bertot, Y., Castéran, P.: Interactive Theorem Proving and Program Development. EATCS Series. Springer, Heidelberg (2004)

    Google Scholar 

  4. Freire, J.L., Blanco, A.: On the abstraction process. In: Brain Processes, Theories and Models. MIT Press, Cambridge (1996)

    Google Scholar 

  5. Freire Nistal, J.L., Blanco Ferro, A., Freire Brañas, J.E., Sánchez Penas, J.J.: EUROCAST 2001. LNCS, vol. 2178, pp. 583–596. Springer, Heidelberg (2001)

    Google Scholar 

  6. Freire, J.L., Freire, E., Blanco, A.: On Recursive Functions and Well–Founded Relations in the Calculus of Constructions. In: Moreno Díaz, R., Pichler, F., Quesada Arencibia, A. (eds.) EUROCAST 2005. LNCS, vol. 3643, pp. 69–80. Springer, Heidelberg (2005)

    Google Scholar 

  7. Gibbons, J., Hutton, G.: Proof methods for corecursive programs. Fundamenta Informaticae Special Issue on Program Transformation 66(4), 353–366 (2005)

    Google Scholar 

  8. Gibbons, J., Hutton, G., Altenkirch, T.: When is a function a fold or an unfold? Electronic Notes in Theoretical Computer Science 44(1) (2001)

    Google Scholar 

  9. Greiner, J.: Programming with Inductive and Co-Inductive Types, Technical report, School of Computer Science, Carnegie Mellon University, Pittsburgh (1992)

    Google Scholar 

  10. Jay, C.B.: Tail Recursion through Universal Invariants, Technical report, University of Edinburgh (1993)

    Google Scholar 

  11. Jacobs, B., Rutten, J.: A Tutorial on (Co)Algebras and (Co)Induction. EATCS Bulletin 62 (1997)

    Google Scholar 

  12. Naish, L., Sterling, L.: A Higher Order Reconstruction of Stepwise Enhancement. In: Fuchs, N.E. (ed.) LOPSTR 1997. LNCS, vol. 1463, pp. 245–262. Springer, Heidelberg (1998)

    Google Scholar 

  13. http://alliance.seas.upenn.edu/~plclub/cgi-bin/poplmark

  14. Weber, T., Caldwell, J.: Constructively Characterizing Fold and Unfold. In: Bruynooghe, M. (ed.) LOPSTR 2003. LNCS, vol. 3018, pp. 110–127. Springer, Heidelberg (2003)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2009 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Blanco, A., Freire, E., Freire, J.L., Paris, J. (2009). The Foldl Operator as a Coequalizer Using Coq. In: Moreno-Díaz, R., Pichler, F., Quesada-Arencibia, A. (eds) Computer Aided Systems Theory - EUROCAST 2009. EUROCAST 2009. Lecture Notes in Computer Science, vol 5717. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-04772-5_23

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-04772-5_23

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-04771-8

  • Online ISBN: 978-3-642-04772-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics