CS6374: Computational Logic


Course Content

We will begin by learning logic programming and programming in Prolog, the most popular logic programming language. Subsequently, we will study answer set programming, constraint logic programming, and advanced logic programming techniques as well as their applications to knowledge representation and common sense reasoning. We will also study propositional logic, predicate logic and automated theorem proving. We will also study inductive logic programming (machine learning of logic programs), if time permits. Everyone will be required to complete a project developing a common sense reasoning application using the s(ASP) system developed at UT Dallas. The project will be a major part of the course. If you do all the assignments, and attend all classes, you should be a reasonably proficient Prolog/Constraint programmer by the end of the course. You will have a good understanding of answer set programming as well. Learning logic programming has a number of advantages: you will develop a better understanding of computer science and improve your programming as well as problem solving skills. You will also develop a better background for learning AI and automated reasoning techniques as well as formal methods in software engineering. You'll also develop a better appreciation for logic, the basis of all of computer science.


Knowledge of Programming in a traditional language, Discrete Mathematics (CS 5333), and Data Structures (CS 5343). This is a fast-paced, demanding course, meant only for serious students


This will be a lecture/discussion oriented course. Home assignments will consist of exercises and readings from the text. There will be programming assignments as well, to give hands-on experience with the Prolog language. Programming assignments on constraint logic programming and answer set programming will also be given. You are allowed to discuss the assignments with other students but the final work should be your own.


Your grade in the course will be based on grades you get in your homework assignments (10%), mid-semester exam (25%), project (25%), final exam (35%). 5\% of the grade will be based on class participation, etc., and is based on instructor discretion. These percentages can change at the discretion of the instructor.

Assignments and Prolog Resources

You can use any Prolog system to do your assignment. The Prolog system available on our Unix machines (apache, cslinux, etc.) is SWI-Prolog. If you have a home PC and would like to do programming assignments at home, I recommend SWI Prolog that is available free over the net. SICSTUS Prolog is now available locally on apache.utdallase.edu.(click here for manual). See the Prolog resource guide for other Prolog implementations A free GNU-Prolog is also available. Note that constraint logic programming assignments can only be done on SICStus Prolog. We will also be using s(ASP), a predicate answer set programming system developed by my group (it is really Prolog extended with negation based on stable model semantics). You can download the system from http://sourceforge.net/projects/sasp-system/.

All assignments will be submitted on eLearning (or hard copy in class). Please do not submit assignments by email.

Click here to see the tentative list of assignments

Click here to see project ideas

Excerpt from Sicstus Manual on second order predicates and operators

General Information on Constraint Programming click here

A tutorial on CLP by Helmut Simonis click here

A Constraint Programming blog

CLP(FD) code for 8-queens (runs under SICStus): click here

CLP(R) code for rail-road crossing (runs under SICStus): click here

LP Resources:
Talk on Coinductive LP
Gopal Gupta's ASP Intro
DLV Tutorial
ASP Primer
Tutorial by Baral
Tutorial by Son Tran
Intro to Galliwasp system
The s(ASP) answer set programming system
The CLASP answer set programming system
Intro to ASP and Practice Problems
Potsdam ASP Course (code for block worlds problem)
What is Answer Set Programming? By Vladimir Lifschitz

Prolog Programming Competition held at ICLPs: click here

The grammar file for DCG homework click here

Links to additional papers
  • Commonsense Reasoning and Commonsense Knowledge in Artificial Intelligence (CACM, Sep 2015)
  • Can This Man Make AI More Human? (MIT Technology Review)
  • MYCIN: Rule-based Expert System (historical reference, really)