Skip to main content Accessibility help
×
Home
Hostname: page-component-684bc48f8b-kbg4c Total loading time: 0.343 Render date: 2021-04-12T13:47:20.185Z Has data issue: true Feature Flags: { "shouldUseShareProductTool": true, "shouldUseHypothesis": true, "isUnsiloEnabled": true, "metricsAbstractViews": false, "figures": false, "newCiteModal": false, "newCitedByModal": true }

Tabling, Rational Terms, and Coinduction Finally Together!

Published online by Cambridge University Press:  21 July 2014

THEOFRASTOS MANTADELIS
Affiliation:
CRACS & INESC TEC, Faculty of Sciences, University of Porto, Rua do Campo Alegre, 1021/1055, 4169-007 Porto, Portugal (e-mail: theo.mantadelis@dcc.fc.up.pt, ricroc@dcc.fc.up.pt, pmoura@inescporto.pt)
RICARDO ROCHA
Affiliation:
CRACS & INESC TEC, Faculty of Sciences, University of Porto, Rua do Campo Alegre, 1021/1055, 4169-007 Porto, Portugal (e-mail: theo.mantadelis@dcc.fc.up.pt, ricroc@dcc.fc.up.pt, pmoura@inescporto.pt)
PAULO MOURA
Affiliation:
CRACS & INESC TEC, Faculty of Sciences, University of Porto, Rua do Campo Alegre, 1021/1055, 4169-007 Porto, Portugal (e-mail: theo.mantadelis@dcc.fc.up.pt, ricroc@dcc.fc.up.pt, pmoura@inescporto.pt)

Abstract

Tabling is a commonly used technique in logic programming for avoiding cyclic behavior of logic programs and enabling more declarative program definitions. Furthermore, tabling often improves computational performance. Rational term are terms with one or more infinite sub-terms but with a finite representation. Rational terms can be generated in Prolog by omitting the occurs check when unifying two terms. Applications of rational terms include definite clause grammars, constraint handling systems, and coinduction. In this paper, we report our extension of YAP's Prolog tabling mechanism to support rational terms. We describe the internal representation of rational terms within the table space and prove its correctness. We then use this extension to implement a tabling based approach to coinduction. We compare our approach with current coinductive transformations and describe the implementation. In addition, we present an algorithm that ensures a canonical representation for rational terms.

Type
Regular Papers
Copyright
Copyright © Cambridge University Press 2014 

Access options

Get access to the full version of this content by using one of the access options below.

References

Ancona, D. 2013. Regular Corecursion in Prolog. Computer Languages, Systems & Structures 39, 4, 142162. Special issue on the Programming Languages track at the 27th ACM Symposium on Applied Computing.CrossRefGoogle Scholar
Bagnara, R., Gori, R., Hill, P. M., and Zaffanella, E. 2001. Finite-Tree Analysis for Constraint Logic-Based Languages: The Complete Unabridged Version.Google Scholar
Chen, W. and Warren, D. S. 1996. Tabled Evaluation with Delaying for General Logic Programs. Journal of the ACM 43, 1, 2074.CrossRefGoogle Scholar
Colmerauer, A. 1982. Prolog and Infinite Trees. In Logic Programming, Clark, K. L. and Tärnlund, S.-A., Eds. Academic Press, 231251.Google Scholar
Giannesini, F. and Cohen, J. 1984. Parser generation and grammar manipulation using prolog's infinite trees. The Journal of Logic Programming 1, 3, 253265.CrossRefGoogle Scholar
Gordon, A. D. 1994. A Tutorial on Co-induction and Functional Programming. In Glasgow Functional Programming Workshop. Springer-Verlag, 7895.Google Scholar
Gupta, G., Bansal, A., Min, R., Simon, L., and Mallya, A. 2007. Coinductive logic programming and its applications. In Logic Programming. LNCS, vol. 4670. Springer-Verlag, 2744.CrossRefGoogle Scholar
Hopcroft, J. E. and Karp, R. M. 1971. A linear algorithm for testing equivalence of finite automata. Tech. rep., Cornell University.Google Scholar
Jaffar, J. and Stuckey, P. J. 1986. Semantics of Infinite Tree Logic Programming. Theoretical Computer Science 46, 0, 141158.CrossRefGoogle Scholar
Meister, M. and Frühwirth, T. 2006. Complexity of the CHR rational tree equation solver. In Constraint Handling Rules. Vol. 452. 77–92.Google Scholar
Moura, P. 2013. A Portable and Efficient Implementation of Coinductive Logic Programming. In International Symposium on Practical Aspects of Declarative Languages. LNCS, vol. 7752. Springer-Verlag, 7792.CrossRefGoogle Scholar
Raimundo, J. and Rocha, R. 2010. Compact Lists for Tabled Evaluation. In International Symposium on Practical Aspects of Declarative Languages. Number 5937 in LNCS. Springer-Verlag, 249263.CrossRefGoogle Scholar
Ramakrishnan, I. V., Rao, P., Sagonas, K., Swift, T., and Warren, D. S. 1999. Efficient Access Mechanisms for Tabled Logic Programs. Journal of Logic Programming 38, 1, 3154.CrossRefGoogle Scholar
Santos Costa, V., Rocha, R., and Damas, L. 2012. The YAP Prolog System. Journal of Theory and Practice of Logic Programming 12, 1&2, 534.CrossRefGoogle Scholar
Schrijvers, T. and Oliveira, B. C. 2012. Rational Term Equality, Functionally. In Implementation and Application of Functional Languages, 24th Symposium, Pre-Proceedings, R. Hinze, Ed.Google Scholar
Simon, L., Bansal, A., Mallya, A., and Gupta, G. 2007. Co-Logic Programming: Extending Logic Programming with Coinduction. In Automata, Languages and Programming. Lecture Notes in Computer Science, vol. 4596. Springer-Verlag, 472483.CrossRefGoogle Scholar
Stickel, M. E. 1988. A prolog technology theorem prover: Implementation by an extended prolog compiler. Journal of Automated Reasoning 4, 4, 353380.CrossRefGoogle Scholar
Swift, T. and Warren, D. S. 2012. XSB: Extending Prolog with Tabled Logic Programming. Theory and Practice of Logic Programming 12, 1 & 2, 157187.CrossRefGoogle Scholar
Wielemaker, J., Schrijvers, T., Triska, M., and Lager, T. 2012. SWI-Prolog. Journal of Theory and Practice of Logic Programming 12, 1&2, 6796.CrossRefGoogle Scholar

MANTADELIS et al.

Tabling, Rational Terms, and Coinduction Finally Together!

PDF 230 KB

Altmetric attention score

Full text views

Full text views reflects PDF downloads, PDFs sent to Google Drive, Dropbox and Kindle and HTML full text views.

Total number of HTML views: 0
Total number of PDF views: 17 *
View data table for this chart

* Views captured on Cambridge Core between September 2016 - 12th April 2021. This data will be updated every 24 hours.

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.

Tabling, Rational Terms, and Coinduction Finally Together!
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.

Tabling, Rational Terms, and Coinduction Finally Together!
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.

Tabling, Rational Terms, and Coinduction Finally Together!
Available formats
×
×

Reply to: Submit a response


Your details


Conflicting interests

Do you have any conflicting interests? *