/Logic-Programming

Logic Programming Projects: Pies, Activities, Crosswords, Numbers, Skyscrapers, and Optimization. Implemented in Prolog with constraint programming libraries (Assignments 4-7).

Primary LanguageProlog

Logic Programming Projects

This repository contains 7 Logic Programming projects completed during the Academic Year 2022-23. Each project is stored in a separate folder, and each folder may contain input files.

Project 1: Pies Ordering

Description: This project focuses on arranging circular pies of different sizes in a specific order using a spatula. The goal is to arrange the pies in a column, with the larger pies at the bottom and the smallest pie at the top.

Folder: Project1_Pies_Ordering

Project 2: Activity Assignment

Description: In this project, activities and individuals are represented. The task is to assign activities to individuals while considering constraints such as the maximum total time an individual can undertake and the minimum time between successive activities.

Folder: Project2_Activity_Assignment

Project 3: Crossword Solver

Description: This project involves solving a square-shaped crossword puzzle. The dimensions and black positions of the crossword are given, along with a list of words to be placed in the puzzle. The goal is to find a feasible placement of the words in the crossword.

Folder: Project3_Crossword_Solver

Constrain Programming Projects

Use of libraries ic/ic_global/gfd/branch_and_bound

Project 4: Number Division

Description: The objective of this project is to divide a set of positive integers into two subsets, ensuring that both subsets have the same number of elements, the sum of elements in each subset is equal, and the sum of squares of elements in each subset is also equal.

Folder: Project4_Number_Division

Project 5: Maximum Satisfiability

Description: This project deals with solving the Maximum Satisfiability (MAXSAT) problem, which involves assigning truth values to propositional symbols in order to maximize the number of true sentences in a given formula in conjunctive normal form (CNF).

Folder: Project5_Maximum_Satisfiability

Project 6: Skyscraper Puzzle

Description: In this project, you will solve various instances of the skyscraper puzzle through constrained programming. The skyscraper puzzle involves a square grid of dimension N, where each cell must contain a skyscraper of integer height from 1 to N. The objective is to fill the grid in such a way that each row and column contains different heights, and the numbers given at the edges of the grid indicate the number of skyscrapers visible from that point along the entire length of the row or column.

Folder: Project6_Skyscraper_Puzzle

Project 7: Optimized Activity Assignment

Description: This project extends the activity assignment problem by introducing a cost function that quantifies the equal distribution of labor time between individuals. The goal is to find an optimal assignment of activities to individuals that minimizes the cost function.

Folder: Project7_Optimized_Activity_Assignment

Feel free to explore each project folder for more details and the corresponding implementations.