Skip to main content Accessibility help
×
Home
Hostname: page-component-544b6db54f-zts5g Total loading time: 0.159 Render date: 2021-10-15T21:49:05.418Z Has data issue: true Feature Flags: { "shouldUseShareProductTool": true, "shouldUseHypothesis": true, "isUnsiloEnabled": true, "metricsAbstractViews": false, "figures": true, "newCiteModal": false, "newCitedByModal": true, "newEcommerce": true, "newUsageEvents": true }

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)

Abstract

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 

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

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.CrossRefGoogle 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.CrossRefGoogle Scholar
Bloom, S. L. & Elgot, C. C. (1976) The existence and construction of free iterative theories. J. Comput. Syst. Sci. 12 (3), 305318.CrossRefGoogle 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.CrossRefGoogle 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.CrossRefGoogle 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.CrossRefGoogle Scholar
Huet, G. (1997) The zipper. J. Funct.Program. 7 (5), 549554.CrossRefGoogle 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.
2
Cited by

Send article to Kindle

To send this article to your Kindle, first ensure no-reply@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about sending to your Kindle. Find out more about sending to your Kindle.

Note you can select to send to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be sent to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Finiteness and rational sequences, constructively*
Available formats
×

Send article to Dropbox

To send this article to your Dropbox account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your <service> account. Find out more about sending content to Dropbox.

Finiteness and rational sequences, constructively*
Available formats
×

Send article to Google Drive

To send this article to your Google Drive account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your <service> account. Find out more about sending content to Google Drive.

Finiteness and rational sequences, constructively*
Available formats
×
×

Reply to: Submit a response

Please enter your response.

Your details

Please enter a valid email address.

Conflicting interests

Do you have any conflicting interests? *