Hostname: page-component-cd9895bd7-dzt6s Total loading time: 0 Render date: 2024-12-22T21:46:07.773Z Has data issue: false hasContentIssue false

Finiteness and rational sequences, constructively*

Published online by Cambridge University Press:  05 April 2017

TARMO UUSTALU
Affiliation:
Institute of Cybernetics, Tallinn University of Technology, Akadeemia tee 21, 12618 Tallinn, Estonia (e-mails: tarmo@cs.ioc.ee, niccolo@cs.ioc.ee)
NICCOLÒ VELTRI
Affiliation:
Institute of Cybernetics, Tallinn University of Technology, Akadeemia tee 21, 12618 Tallinn, Estonia (e-mails: tarmo@cs.ioc.ee, niccolo@cs.ioc.ee)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

Rational sequences are possibly infinite sequences with a finite number of distinct suffixes. In this paper, we present different implementations of rational sequences in Martin–Löf type theory. First, we literally translate the above definition of rational sequence into the language of type theory, i.e., we construct predicates on possibly infinite sequences expressing the finiteness of the set of suffixes. In type theory, there exist several inequivalent notions of finiteness. We consider two of them, listability and Noetherianness, and show that in the implementation of rational sequences the two notions are interchangeable. Then we introduce the type of lists with backpointers, which is an inductive implementation of rational sequences. Lists with backpointers can be unwound into rational sequences, and rational sequences can be truncated into lists with backpointers. As an example, we see how to convert the fractional representation of a rational number into its decimal representation and vice versa.

Type
Articles
Copyright
Copyright © Cambridge University Press 2017 

Footnotes

*

This work was supported by the ERDF funded project Coinduction, the Estonian Ministry of Education and Research institutional research grant no. IUT33-13 and the Estonian Science Foundation grant no. 9475.

References

Adámek, J., Milius, S. & Velebil, J. (2003) Free iterative theories: A coalgebraic view. Math. Struct. Comput. Sci. 13 (2), 259320.Google Scholar
Ancona, D. (2013) Regular corecursion in Prolog. Comput. Lang. Syst. Struct. 39 (4), 142162.Google Scholar
Bezem, M., Nakata, K. & Uustalu, T. (2012) On streams that are finitely red. Log. Meth. Comput. Sci. 8 (4), article 4.Google Scholar
Bloom, S. L. & Elgot, C. C. (1976) The existence and construction of free iterative theories. J. Comput. Syst. Sci. 12 (3), 305318.Google Scholar
Coquand, T. & Spiwack, A. (2010) Constructively finite? In Scientific Contributions in Honor of Mirian Andrés Gómez, Laureano Lambán, L., Romero, A. & Rubio, J. (eds), Universidad de La Rioja, pp. 217230.Google Scholar
Courcelle, B. (1983) Fundamental properties of infinite trees. Theor. Comput. Sci. 25, 95169.Google Scholar
Elgot, C. C. (1975) Monadic computation and iterative algebraic theories. In Logic Colloquium '73, Studies in Logic and Foundations of Mathematics, vol. 80, Amsterdam: North-Holland, pp. 175230.Google Scholar
Elgot, C. C., Bloom, S. L. & Tindell, R. (1978) On the algebraic structure of rooted trees. J. Comput. Syst. Sci. 16 (3), 361399.Google Scholar
Firsov, D. & Uustalu, T. (2015) Dependently typed programming with finite sets. In Proceedings of 11th ACM SIGPLAN Wksh. on Generic Programming, WGP '15, New York: ACM Press, pp. 3344.Google Scholar
Firsov, D., Uustalu, T. & Veltri, N. (2016) Variations on Noetherianness. In Proceedings of 6th Wksh. on Mathematically Structured Functional Programming, MSFP 2016, Atkey, R. & Krishnaswami, N. (eds), Electron. Proc. in Theor. Comput. Sci. Sydney: Open Publishing Assoc.Google Scholar
Ghani, N., Hamana, M., Uustalu, T. & Vene, V. (2006) Representing cyclic structures as nested datatypes (2006). In Proceedings of 7th Symp. on Trends in Functional Programming, TFP 2006, Nilsson, H. (ed), Univ. of Nottingham, pp. 173188.Google Scholar
Ginali, S. (1979) Regular trees and the free iterative theory. J. Comput. Syst. Sci. 18 (3), 228242.Google Scholar
Huet, G. (1997) The zipper. J. Funct.Program. 7 (5), 549554.Google Scholar
Jeannin, J.-B., Kozen, D. & Silva, A. (2013) Language constructs for non-well-founded computation. In Proceedings of 22nd European Symposium on Programming, ESOP 2013, Felleisen, M. & Gardner, P. (eds), Lect. Notes in Comput. Sci., vol. 7792, Heidelberg: Springer, pp. 6180.Google Scholar
Norell, U. (2009) Dependently typed programming in Agda. In Revised Lectures from 6th International School. on Advanced Functional Programming, AFP 2008, Koopman, P., Plasmeijer, R. & Swierstra, S. D. (eds), Lect. Notes in Comput. Sci., vol. 5832, Heidelberg: Springer, pp. 230266.Google Scholar
Parmann, E. (2014) Investigating streamless sets. In Proceedings of 20th International Conference on Types for Proofs and Programs, TYPES 2014, Herbelin, H., Letouzey, P. & Sozeau, M. (eds), Leibniz Int. Proc. in Informatics, vol. 39, Saarbrücken/Wadern: Dagstuhl Publishing, pp. 187201.Google Scholar
Spadotti, R. (2015) A mechanized theory of regular trees in dependent type theory. In Proceedings of 6th International Conference on Interactive Theorem Proving, ITP 2015, Urban, C. & Zhang, X. (eds), Lect. Notes in Comput. Sci., vol. 9236, Heidelberg: Springer, pp. 405420.Google Scholar
Spadotti, R. (2016) Une théorie mécanisée des arbres réguliers en théorie des types dépendants. PhD Thesis, Université Toulouse 3 Paul Sabatier.Google Scholar
Turbak, F. & Wells, J. (2001) Cycle therapy: A prescription for fold and unfold on regular trees. In Proceedings of 3rd ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming, PPDP 2001, New York: ACM Press, pp. 137149.Google Scholar
Submit a response

Discussions

No Discussions have been published for this article.