Skip to main content
    • Aa
    • Aa

XSB: Extending Prolog with Tabled Logic Programming


The paradigm of Tabled Logic Programming (TLP) is now supported by a number of Prolog systems, including XSB, YAP Prolog, B-Prolog, Mercury, ALS, and Ciao. The reasons for this are partly theoretical: tabling ensures termination and optimal known complexity for queries to a large class of programs. However, the overriding reasons are practical. TLP allows sophisticated programs to be written concisely and efficiently, especially when mechanisms such as tabled negation and call and answer subsumption are supported. As a result, TLP has now been used in a variety of applications from program analysis to querying over the semantic web. This paper provides a survey of TLP and its applications as implemented in the XSB Prolog, along with discussion of how XSB supports tabling with dynamically changing code, and in a multi-threaded environment.

Hide All
Alferes J. J., Azevedo F., Barahona P., Damásio C. and Swift T. 2004. Logic programming techniques for solving circuit diagnosis. In Proceedings of the 18th Artificial Intelligence Applications and Innovations (Aiai-2004), Toulouse, France, Aug 22–27. Kluwer, Dordrecht, Netherlands, 155166.
Alferes J. J., Leite J. A., Pereira L. M. and Quaresma P. 2000. Planning as abductive updating. In Proceedings of the AISB Symposium on AI Planning and Intelligent Agents (AISB'00). AISB, Birmingham, UK, 18.
Barata J., Ribeiro L. and Onori M. 2007. Diagnosis on evolvable production systems. In Proceedings of ISIE 2007 – IEEE International Symposium on Industrial Electronics, Vigo, Spain, June 47.
Bhansali S. and Grosof B. 2005. Extending the SweetDeal approach for e-procurement using SweetRules and RuleML. In Proceedings of International Conference on Rules and Rule Markup Languages (RULE-ML). Springer-Verlag, Berlin, Germany, 113129.
Boulanger D. 1997. Fine-grained goal-directed declarative analysis of logic programs. In International Workshop on Verification, Model Checking and Abstract Interpretation URL:
Calejo M. 2004. Interprolog: Towards a declrative embedding of logic programming in Java. In Proceedings of JELIA, Lisbon, Portugal, Sep 27–30. Springer-Verlag Berlin, Germany, 714717.
Castro J. and Pereira L. M. 2004. Abductive validation of a power-grid diagnoser. In IEA/AIE. LNCS, vol. 3029. Springer-Verlag Berlin, Germany, 838847.
Castro L. and Santos Costa V. 2001. Understanding memory management in prolog systems. In Proceedings of International Conference on Logic Programming (ICLP 2001). LNCS, vol. 2237. Springer-Verlag Berlin, Germany, 1126.
Castro L., Swift T. and Warren D. 2002. Suspending and resuming computations in engines for SLG evaluation. In Proceedings of Practical Applications of Declarative Languages. LNCS, vol. 2257. Springer, Heidelberg, Germany, 332346.
Chen W. and Warren D. S. 1996. Tabled evaluation with delaying for general logic programs. Journal of the ACM 43, 1, 2074.
Chimenti D., Gamboa R., Krishnamurthy R., Naqvi S., Tsur S. and Zaniolo C. 1990. The LDL system prototype. IEEE Data and Knowledge Engineering 2, 7689.
Codish M., Demoen B. and Sagonas K. 1998. Semantics-based program analysis for logic-based languages using XSB. Springer International Journal of Software Tools for Technology Transfer 2, 1 (Nov.), 2945.
Codognet P. and Filé G. 1992. Computations, abstractions and constraints in logic programs. In Proceedings of the International Conference on Computer Languages (ICCL), Oakland, CA, USA. IEEE, New York, USA, 155164.
Cui B. and Swift T. 2002. Preference logic grammars: Fixed-point semantics and application to data standardization. Artificial Intelligence 138, 117147.
Damásio C. V. and Pereira L. M. 2001. Monotonic and residuated logic programs. In Proceedings of Sixth European Conference on Symbolic and Quantitative Approaches to Reasoning with Uncertainty (ECSQARU) Toulouse, France. LNCS, vol. 2143. Springer Verlag, Berlin, Germany, 748759.
Davulcu H., Jones J., Pokorny L., Rued C., Swift T., Vidrevich T. and Warren D. 2002. Ensuring consistency in self-reported data: A case study. In Seventh International Conference on Information Quality (ICIQ-02). MIT, Cambridge, MA, 155166.
Davulcu H., Yang G., Kifer M. and Ramakrishnan I. 2000. Design and implementation of the physical layer in webbases: The XRover experience. In Proceedings of Computational Logic, London, UK, Jul 24–28. Springer, New York, USA, 10941105.
Dawson S., Ramakrishnan C. R. and Warren D. S. 1996. Practical program analysis using general purpose logic programming systems – a case study. In Proceedings of the ACM PLDI Conference, Philadephia, PA, May 21–24. ACM Press, New York, 117126.
Demoen B. and Sagonas K. 1999. CHAT: The copy-hybrid approach to tabling. In proceedings of Practical Applications of Declarative Languages (PADL'99), San Antonio, TX. Springer-Verlag New York, USA, 106121.
Demoen B. and Sagonas K. 2001. Heap memory management in prolog with tabling: Principles and practice. Journal of Functional and Logic Programming 2001, 9, 156.
Drabent W., Henriksson J. and Maluszyński J. 2007. Hybrid reasoning with rules and constraints under well-founded semantics. In Web Reasoning and Rules. 348–357.
Du X., Ramakrishnan C. R. and Smolka S. A. 2000. Tabled resolution + constraints: A recipe for model checking real-time systems. In Proceedings of Real-Time Systems Symposium, Orlando, FL, USA. IEEE, Washington, DC, 175184.
Freire J., Hu R., Swift T. and Warren D. S. 1995. Parallelizing tabled evaluation. In Proceedings of 7th International Symposium on Programming Language Implementation and Logic Programming. LNCS, vol. 982. Springer-Verlag, Utrecht, Netherlands, 115132.
Freire J., Swift T. and Warren D. S. 1998. Beyond depth-first: Improving tabled logic programs through alternative scheduling strategies. Journal of Functional and Logic Prog. 1998, 3, 243268.
Gartner J., Swift T., Tien A., Pereira L. M. and Damásio C. 2000. Psychiatric diagnosis from the viewpoint of computational logic. In First International Conference on Computational Logic, London, UK, Jul 24–28. LNAI, vol. 1866. Springer, New York, USA, 13621376.
Gomes S., Alferes J. and Swift T. 2010. Implementing query answering for hybrid MKNF knowledge bases. In Twelfth International Symposium on Practical Applications of Declarative Languages, Madrid, Spain, Jan 18–19. LNCS, vol. 5937. Springer, Berlin, Germany, 2539.
Grosof B. 2009. SILK: Semantic rules take the next big step in power. Accessed December 2010. URL:
Janssens G. and Sagonas K. 1998. On the use of tabling for abstract interpretation: An experiment with abstract equation systems. In Proceedings of the 1st Workshop on Tabling in Parsing and Deduction, Paris, France, Apr 2–3. Springer, New York, USA, 118126.
Johnson E., Ramakrishnan C., Ramakrishnan I. and Rao P. 1999. A space-efficient engine for subsumption based tabled evaluation of logic programs. In Proceedings of the Symposium on Functional and Logic Progamming. LNCS, vol. 1722. Springer-Verlag, Berlin Germany, 284300.
Kagal L. and Finin T. 2004. Modeling communicative behavior using permissions and obligations. In International Workshop on Agent Communication, New York, NY, USA. LNCS, vol. 3396. Springer, Berlin, Germany, 120133.
Kalantari L. and Ternovska E. 2002. A model checker for verifying ConGolog programs. In Eighteenth National Conference on Artificial Intelligence, Edmonton, Canada, Jul 28–Aug 1. AAAI Press, California, USA, 953954.
Kifer M., Lausen G. and Wu J. 1995. Logical foundations of object-oriented and frame-based languages. Journal of the ACM 42, 741843.
Kifer M. and Subrahmanian V. S. 1992. Theory of generalized annotated logic programming and its applications. Journal of Logic Programming 12, 4, 335368.
Lamma E., Riguzzi F. and Pereira L. M. 2000. Strategies in combined learning via logic programs. Machine Learning 38, 1–2, 6387.
Larson R., Warren D. S., Freire J. and Sagonas K. 1995. Syntactica, Symantica. MIT Press, Cambridge MA.
Lattner A., Gehrke J., Timm I. and Herzog O. 2005a. A knowledge-based approach to behavior decision in intelligent vehicles. In Proceedings of IEEE Intelligent Vehicles Symposium, Las Vegas, NV, USA, Jun 6–8. IEEE, Washington, DC, USA, 466471.
Lattner A., Timm I., Lorenz M. and Herzog O. 2005b. Knowledge-based risk assessment for intelligent vehicles. In IEEE Conference on Integration of Knowledge Intensive Multi-Agent Systems, Apr 18–21. IEEE, Washington, DC, USA, 191196.
Letia I., Craciun F. and Kpe Z. 2001. Norms for DLP agents working in a warehouse scenario. In IEA/AIE, Budapest, Hungary, Jun 4–7. LNCS, vol. 2070. Springer, Berlin, Germany, 728733.
Li J., Pease A. and Barbee C. 2002. Performance of Semantic Search. Technical Report, Teknowledge Corporation, East Palo Alto, California.
Liang S., Fodor P., Wan H. and Kifer M. 2009. OpenRuleBench: An analysis of the performance of rule engines. In Proceedings of 18th International World Wide Web Conference (WWW), Madrid, Spain. ACM Press, New York, USA, 601608.
Marques R. 2007. Concurrent Tabling: Algorithms and Implementation. PhD thesis, Universidade Nova de Lisboa, Portugal.
Marques R. and Swift T. 2008. Concurrent and local evaluation of normal programs. In Proceedings of International. Conference on Logic Programming, Udine, Italy, Dec 9–13. LNCS, vol. 5366. Springer, Berlin, Germany, 206222.
Marques R., Swift T. and Cunha J. 2010. A simple and efficient implementation of concurrent local tabling. In Practical Applications of Declarative Languages, Madrid, Spain, Jan 20–22. LNCS, vol. 5937. Springer, Berlin, Germany, 264278.
Motik B. 2006. Reasoning in Description Logics Using Resolution and Deductive Databases. PhD thesis. Univesität Karlsruhe (TH), Karlsruhe, Germany.
Mukund M., Ramakrishnan C. R., Ramakrishnan I. V. and Verma R. 2000. Symbolic bisimulation using tabled constraint logic programming. In Proceedings of Tabling in Parsing and Deduction Conference (TAPD 2000), Vigo, Spain, Sep 19–21. Springer, Berlin, Germany, 166180.
Muller R., Greiner U. and Rahm E. 2004. Agentwork: A workflow system supporting rule-based workflow adaptation. IEEE Data and Knowledge Engineering 51, 2, 223256.
Niemelä I. 1999. Logic programs with stable model semantics as a constraint logic programming paradigm. Annals of Mathematics and Artificial Intelligence 25, 241273.
Oquendo F. 2004. Formally describing dynamic software architectures with π-ADL. World Scientific and Engineering Transactions on Systems 3, 8, 673679.
Papaterpos C., Georgantis N. and Papatheodorou T. 2001. An ontology for modeling ill-structured domains in intelligent educational systems. In Proceedings of IEEE International Conference on Advanced Learning Technologies. IEEE, New York, USA, 4142.
Pemmasani G., Ramakrishnan C. R. and Ramakrishnan I. V. 2002. Efficient model checking of real time systems using tabled logic programming and constraints. In Proceedings of International Conference on Logic Programming, Copenhagen, Denmark, Jul 29–Aug 1. LNCS, vol. 2401. Springer, Berlin, Germany, 100114.
Pereira L. M. and Pinto A. M. 2009. Layered models top-down querying of normal logic programs. In Practical Applications of Declarative Languages, Georgia, USA, Jan 21–23. Springer, New York, USA, 254268.
Pereira L. M. and Viegas R. D. 2007. Architectural design via declarative programming. In International Conference on Enterprise Information Systems, Madeira, Portugal, Jun 12–16. ICEIS, Portugal, 363369.
Peterson B., Andersen W. and Engel J. 1998. Knowledge Bus: Generating application-focused databases from large ontologies. In Proceedings of KRDB-98, Seattle, USA, Washington, May 31.
Pokorny L. and Ramakrishnan C. 2004. Modeling and verification of distributed autonomous agents using logic programming. In Proceedings of Second International Workshop on Declarative Agent Languages and Technologies, New York, USA, Jul 19. Springer-Verlag, New York, USA, 148165.
Ramakrishna Y. S., Ramakrishnan C. R., Ramakrishnan I. V., Smolka S., Swift T. and Warren D. S. 1997. Efficient model checking using tabled resolution. In Proceedings on the Conference on Automated Verification, Haifa, Israel. Springer-Verlag, Berlin, Germany, 143154.
Ramakrishnan C., Ramakrishnan I., Smolka S., Dong Y., Du X., Roychoudhury A. and Venkatakrishnan V. 2000. XMC: A logic-programming-based verification toolset. In Proceedings on the Conf. on Automated Verification, Chicago, IL. Springer-Verlag, New York, USA, 576590.
Ramakrishnan C., Ramakrishnan I. and Warren D. S. 2007. XcelLog: A deductive spreadsheet system. Knowledge Engineering Review 22, 3, 269279.
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, 3155.
Ramakrishnan I. V., Roychoudhury A. and Swift T. 1997. A rule-based data standardizer for enterprise data bases. In Proceedings of Practical Applications of Prolog Conference, London, UK. Springer-Verlag, London, UK, 255270.
Ramakrishnan R., Srivastava D. and Sudarshan S. 1992. CORAL: Control, relations, and logic. In International Conference on Very Large Data Bases. VLDB End., Vancouver, Canada, Aug 23–27. Morgan Kaufmann, San Fransisco, CA, USA, 238249.
Rocha R. 2001. On Applying Or-Parallelism and Tabling to Logic Programs. PhD thesis, Universidade do Porto, Portugal.
Rocio V. and Lopes J. 1998. Partial parsing, deduction and tabling. In Tabling in Parsing and Deduction (TAPD'98), Paris, France, Apr 23.
Rozenberg G. and Engelfriet J. 1998. Elemenary net systems. In Lectures on Petri Nets I: Basic Models. LNCS, vol. 1491. Springer, Berlin, Germany, 12121.
Sagonas K. and Swift T. 1998. An abstract machine for tabled execution of fixed-order stratified logic programs. ACM TOPLAS 20, 3 (May), 586635.
Sagonas K., Swift T. and Warren D. S. 2000. The limits of fixed-order computation. Theoretical Computer Science 254, 1–2, 465499.
Saha D. and Ramakrishnan C. 2005. Incemental and demand-driven points-to analysis using logic programming. In Proceedings of Principles and Practice of Declarative Programming, Lisbon, Portugal, Jul 11–13. ACM Press, New York, 117128.
Santana P. and Pereira L. M. 2006. Emergence of cooperation through mutual preference revision. In Proceedings of IEA/AIE, Annecy, France. LNCS, vol. 4031. Springer, Berlin, Germany, 8190.
Sarna-Starosta B. 2005. Constraint-Based Analysis of Security Protocols. PhD thesis, SUNY Stony Brook University, New York, USA.
Shankar C., Talwar V., Iyer S., Chen Y., Milojicic D. and Campbell R. 2006. Specification-enhanced policies for automated management of changes in it systems. In Proceedings of 20th Large Installation Systems Administration Conference (LISA '06), Washington DC, Dec 3–8. Sage, New York, USA, 101115.
Shieber S. 1992. Constraint-based Grammar Formailsms. MIT Press, Cambridge, MA.
Simons P., Niemelä I. and Soininen T. 2002. Extending and implementing the stable model semantics. Artificial Intelligence 138, 181234.
Swift T. 1999a. A new formulation of tabled resolution with delay. In EPIA '99: Proceedings of the 9th Portuguese Conference on Artificial Intelligence: Progress in Artificial Intelligence. Springer-Verlag, London, UK, 163177.
Swift T. 1999b. Tabling for non-monotonic programming. Annals of Mathematics and Artificial Intelligence 25, 3–4, 201240.
Swift T. 2004. Deduction in ontologies via answer set programming. In Proceedings of 11th International Conference on Logic Programming and Nonmonotonic Reasoning, Vancouver, Canada, May 16–19. Springer, New York, 275289.
Swift T. 2009. An engine for efficiently computing (sub-)models. In Proceedings of International Conference on Logic Programming, Pasadena, CA, USA, Jul 14–17. LNCS, vol. 5649. Springer, New York, 514518.
Swift T., Pinto A. and Pereira L. M. 2009. Incremental answer completion. In Proceedings of International Conference on Logic Programming, Pasadena, CA, USA, Jul 14–17. LNCS, vol. 5649. Springer, New York, 519524.
Swift T. and Warren D. S. 2010. Tabling with answer subsumption: Implementation, applications and performance. In Proc. of the 12th European Conference on Logics in Artificial Intelligence, JELIA, Springer, Helsinki, Finland, 300312.
Swift T. and Warren D. S. 2003. Coherent Description Framework. Accessed December 2003. URL:
Tangmunarunkit H., Decker S. and Kesselman C. 2003. Ontology-based resource matching in the grid – the grid meets the semantic web. In Proceedings of 2nd International Semantic Web Conference, Florida, USA, Oct 20–23. Springer, New York, USA, 706721.
van Emden M. 1986. Quantitative deduction and its fixpoint theory. Journal of Logic Programming 4, 3753.
van Gelder A., Ross K. and Schlipf J. 1991. Unfounded sets and well-founded semantics for general logic programs. Journal of the ACM 38, 3, 620650.
Wan H., Grosof B., Kifer M., Fodor P. and Liang S. 2009. Logic programming with defaults and argumentation theories. In Proceedings of International Conference on Logic Programming, Pasadena, CA, USA, Jul 14–17. LNCS, vol. 5649. Springer, New York, 432448.
Wielemaker J. 2003. Native preemptive threads in SWI-Prolog. In Proceedings of International Symposium on Practical Applications of Declarative Languages, New Orleans, USA. Springer, New York, 331345.
Yang G., Kifer M. and Zhao C. 2003. FLORA-2: A rule-based knowledge representation and inference infrastructure for the Semantic Web. In ODBASE-2003, Catania, Sicily (Italy), Nov 3–7. Springer-Verlag, Berlin, Germany, 671688.
Zhou N. and Sato T. 2003. Efficient fixpoint computation in linear tabling. In PPDP 03: Proceedings of the 5th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming. ACM Press, New York, 275283.
Zou Y., Finin T. and Chen H. 2004. F-OWL: An inference engine for the semantic web. In Proceedings of Third InternationalWorkshop on Formal Approaches to Agent-Based Systems, Greenbelt, MD, USA, Apr 26–27. LNCS, Vol. 3228. Springer, New York, USA, 238248.
Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

Theory and Practice of Logic Programming
  • ISSN: 1471-0684
  • EISSN: 1475-3081
  • URL: /core/journals/theory-and-practice-of-logic-programming
Please enter your name
Please enter a valid email address
Who would you like to send this to? *



Full text views

Total number of HTML views: 0
Total number of PDF views: 16 *
Loading metrics...

Abstract views

Total abstract views: 297 *
Loading metrics...

* Views captured on Cambridge Core between September 2016 - 21st October 2017. This data will be updated every 24 hours.