Skip to main content Accessibility help
×
Home
Hostname: page-component-559fc8cf4f-8sgpw Total loading time: 2.361 Render date: 2021-02-26T00:49:06.194Z Has data issue: true Feature Flags: { "shouldUseShareProductTool": true, "shouldUseHypothesis": true, "isUnsiloEnabled": true, "metricsAbstractViews": false, "figures": false, "newCiteModal": false, "newCitedByModal": true }

Coding guidelines for Prolog

Published online by Cambridge University Press:  30 June 2011

MICHAEL A. COVINGTON
Affiliation:
Institute for Artificial Intelligence, The University of Georgia, Athens, GA, USA (e-mail: mc@uga.edu)
ROBERTO BAGNARA
Affiliation:
Department of Mathematics, University of Parma, Itlay BUGSENG srl, Parma, Italy (e-mail: bagnara@cs.unipr.it)
RICHARD A. O'KEEFE
Affiliation:
Department of Computer Science, University of Otago, Dunedin, New Zealand (e-mail: ok@cs.otago.ac.nz)
JAN WIELEMAKER
Affiliation:
Department of Computer Science, VU University Amsterdam, The Netherlands (e-mail: j.wielemaker@cs.vu.nl)
SIMON PRICE
Affiliation:
Intelligent Systems Laboratory, University of Bristol, Bristol, UK (e-mail: simon.price@bristol.ac.uk)

Abstract

Coding standards and good practices are fundamental to a disciplined approach to software projects irrespective of programing languages being employed. Prolog programing can benefit from such an approach, perhaps more than programing in other languages. Despite this, no widely accepted standards and practices seem to have emerged till now. The present paper is a first step toward filling this void: It provides immediate guidelines for code layout, naming conventions, documentation, proper use of Prolog features, program development, debugging, and testing. Presented with each guideline is its rationale and, where sensible options exist, illustrations of the relative pros and cons for each alternative. A coding standard should always be selected on a per-project basis, based on a host of issues pertinent to any given programing project; for this reason the paper goes beyond the mere provision of normative guidelines by discussing key factors and important criteria that should be taken into account when deciding on a full-fledged coding standard for the project.

Type
Regular Papers
Copyright
Copyright © Cambridge University Press 2011

Access options

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

References

Ausnit-Hood, C., Johnson, K. A., Pettit, R. G. IV, and Opdahl, S. B., Eds. 1997. Ada 95 Quality and Style, Guideline for Professional Programmers, Lecture Notes in Computer Science, vol. 1344. Springer-Verlag, Berlin, Germany: Springer-Verlag.Google Scholar
Brady, M. H. 2005. ‘Runsort’—An A daptive Mergesort for Prolog. Computer Science Technical Report TCD-CS-2005-34, Computer Science Department, Trinity College Dublin, Ireland.Google Scholar
Clocksin, W. F. and Mellish, C. S. 2003. Programming in Prolog, 5th ed.Springer, Berlin, Germany.CrossRefGoogle Scholar
Covington, M. A. 1994. Computer languages in type. Journal of Scholarly Publishing 26, 1, 3441.Google Scholar
Covington, M. A. 2002. Some coding guidelines for Prolog [online]. Retrieved 14 June 2011. Available at http://www.ai.uga.edu/mc/plcoding2002.pdfGoogle Scholar
Covington, M. A., Nute, D. and Vellino, A. 1997. Prolog Programming in Depth. Prentice-Hall, Upper Saddle River, NJ.Google Scholar
Fages, F. and Coquery, E. 2001. Typing constraint logic programs. Theory and Practice of Logic Programming 1, 6, 751777.CrossRefGoogle Scholar
Green, R. 1996–2010. Unmaintainable code [online]. Retrieved 14 June 2011. Available at http://mindprod.com/jgloss/unmain.htmlGoogle Scholar
Hermenegildo, M. V. 2000. A documentation generator for (C)LP systems. In Computational Logic: Proceedings of the First International Conference (CL 2000), Lloyd, J. W., Dahl, V., Furbach, U., Kerber, M., Lau, K.-K., Palamidessi, C., Pereira, L. M., Sagiv, Y., and Stuckey, P. J., Eds. Lecture Notes in Computer Science, vol. 1861. Springer-Verlag, London, UK, 13451361.Google Scholar
Hill, P. M. and Lloyd, J. W. 1994. The Gödel Programming Language. MIT Press, Cambridge, MA.Google Scholar
Hoare, C. A. R. 1962. Quicksort. The Computer Journal 5, 1, 1016.CrossRefGoogle Scholar
Jeffery, D., Henderson, F. and Somogyi, Z. 2000. Type classes in Mercury. In Proceedings of the 23rd Australasian Computer Science Conference (ACSC 2000), Edwards, J., Ed. IEEE Computer Society, Canberra, Australia, 128135.Google Scholar
Kernighan, B. W. and Pike, R. 1999. The Practice of Programming. Addison-Wesley Longman, Boston, MA.Google Scholar
Kernighan, B. W. and Plauger, P. J. 1978. The Elements of Programming Style, 2nd ed.McGraw-Hill, New York, NY.Google Scholar
Ledgard, H. and Tauer, J. 1987. Professional Software, Vol. 2: Programming Practice. Addison-Wesley Longman, Boston, MA.Google Scholar
Moura, P. 2003. Logtalk – Design of An Object-Oriented Logic Programming Language. Ph.D. thesis, Department of Computer Science, University of Beira Interior, Portugal.Google Scholar
Mycroft, A. and O'Keefe, R. A. 1984. A polymorphic type system for Prolog. Artificial Intelligence 23, 3, 295307.CrossRefGoogle Scholar
O'Keefe, R. A. 1990. The Craft of Prolog. MIT Press, Cambridge, MA.Google Scholar
Schimpf, J. 2002. Logical loops. In Proceedings of the 18th International Conference on Logic Programming (ICLP 2002), Stuckey, P. J., Ed. Lecture Notes in Computer Science, vol. 2401. Springer, Copenhagen, Denmark, 224238.Google Scholar
Somogyi, Z., Henderson, F. and Conway, T. 1995. Mercury: An efficient purely declarative logic programming language. In Proceedings of the 18th Australasian Computer Science Conference (ACSC '95), Glenelg, Australia, February 1995, (Kotagiri, R., Ed.) Australian Computer Science Communications 17, 1, 499512.Google Scholar
Sun Microsystems. 1999. Code conventions for the Java programming language [online]. Retrieved 14 June 2011. Available at http://java.sun.com/docs/codeconv/.Google Scholar
Thompson, E. M. 1893. Handbook of Greek and Latin Palæography. Kegan Paul, Trench, Trübner & Co, London, U.K.Google Scholar

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: 55 *
View data table for this chart

* Views captured on Cambridge Core between September 2016 - 26th February 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.

Coding guidelines for Prolog
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.

Coding guidelines for Prolog
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.

Coding guidelines for Prolog
Available formats
×
×

Reply to: Submit a response


Your details


Conflicting interests

Do you have any conflicting interests? *