This repository contains solutions for the exercises from the "Logical Programming" course, offered in the 5th semester of the 2022 academic year at the University of Piraeus, Department of Informatics. The exercises are implemented in Prolog, and each solution is accompanied by a detailed PDF document that includes the code and an example of correct execution.
- Institution: University of Piraeus
- Department: Department of Informatics
- Course: Logic programming (2022)
- Semester: 5th
- Prolog
The repository is organized into three folders, each corresponding to a specific exercise. Inside each folder, you will find:
- A
.pl
file containing the Prolog code for the exercise. - A
.pdf
file with documentation, including an explanation of the solution and examples of correct execution.
-
Task: Implement Prolog predicates for managing and querying a database of families registered in a municipal registry.
-
Topics Covered: Prolog knowledge base, list handling, querying with conditions based on family size, birth year, and employment status.
-
Task: Write Prolog predicates to operate on lists, including determining list precedence, inclusion, and finding common elements.
-
Topics Covered: List operations in Prolog, including sublist detection, element matching, and list pairing.
-
Task: Model an object (e.g., a personal computer) in Prolog, including its components and subcomponents, and query its properties and materials.
-
Topics Covered: Prolog facts and rules, hierarchical data modeling, material classification, and complex querying.
- Ensure you have Prolog installed on your machine.
- Navigate to the desired exercise folder in your terminal or Prolog environment.
- Load the Prolog file by running the following command:
Replace
[number-exercise].
number
with the exercise number (first, second, or third). - Execute the queries provided in the documentation PDF to test the solutions.
This project is licensed under the MIT License - see the LICENSE file for details.