https://github.com/anidipta/prolog
College 4th Sem Lab Stuffs
https://github.com/anidipta/prolog
git prolog prolog-interpreter prolog-programming-language
Last synced: 8 months ago
JSON representation
College 4th Sem Lab Stuffs
- Host: GitHub
- URL: https://github.com/anidipta/prolog
- Owner: Anidipta
- License: gpl-3.0
- Created: 2025-02-19T20:01:20.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-02-28T14:15:43.000Z (8 months ago)
- Last Synced: 2025-02-28T19:47:32.971Z (8 months ago)
- Topics: git, prolog, prolog-interpreter, prolog-programming-language
- Language: Prolog
- Homepage:
- Size: 214 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Prolog Lab Assignment
## 📌 Overview
This repository contains implementations of various Prolog assignments covering family trees, recursion, list operations, logic gates, sorting algorithms, database queries, graph search, puzzles, and expert systems.
## 📅 Assignment Breakdown
### 📍 Day 1: Family Tree Implementation 🌳 (day1.pl)
### 📍 Day 2: Recursive Definitions 🔄 (day2.pl)
### 📍 Day 3: Working with Numbers 🔢 (day3.pl)
- Using operators for mathematical operations (`+`, `-`, `*`, `/`, `mod`)
- Calculating with numbers and processing collections
### 📍 Day 4: List Operations 📜 (day4.pl)
- Finding the number of elements in a list
- Retrieving the K-th element
- Checking if an element exists in a list
- Identifying vowels and digits in a list
### 📍 Day 5: Use of Accumulators 📂 (day5.pl)
- Basic list operations
- Defining logic gates (`AND`, `OR`, `NOT`, `NAND`, `NOR`, `XOR`, `XNOR`)
- Simulating an electronic circuit
### 📍 Day 6: Sorting Algorithm 🔢 (day6.pl)
- Implementing Bubble Sort using CUT (`!`)
### 📍 Day 7: Employee Database 👩💻 (day7.pl)
- Storing employee records in Prolog
- Querying employee details:
- Retrieve employees with `EMPNAME='Lakshmi Shrivastava'` working in `AMAZON`
- Retrieve employee details working in `TCS`, `CTS`, `AMAZON` from `CSE`, `CSE-AIML`, `CSE-DS` at `HIT`
### 📍 Day 8: Graph Search Algorithms 🔍 (day8.pl)
- Depth-First Search (DFS)
- Breadth-First Search (BFS)
### 📍 Day 9: Puzzle Implementations 🧩 (day9.pl)
- 8-Queens problem ♟️
- Towers of Hanoi 🗼
- Missionaries and Cannibals problem 🚣♂️
### 📍 Day 10: Expert System 🤖 (day10.pl)
- Bird Recognition System 🦜
- Disease Diagnosis System 🏥
- Natural Language Processing (NLP) tasks 🗣️
## 🛠️ Technologies Used
- **Prolog** (SWI-Prolog recommended)
- **GitHub** for version control
- **Markdown** for documentation
## 🚀 Getting Started
### Installation
1. Install [SWI-Prolog](https://www.swi-prolog.org/Download.html)
2. Clone the repository:
```bash
git clone https://github.com/yourusername/Prolog.git
cd Prolog
```
3. Run any Prolog file:
```bash
swipl file_name.pl
```
## 📂 Repository Structure
```
prolog-lab/
│── day1.pl
│── day2.pl
│── day3.pl
│── day4.pl
│── day5.pl
│── day6.pl
│── day7.pl
│── day8.pl
│── day9.pl
│── day10.pl
│── README.md
```
## 📖 References
- [SWI-Prolog Documentation](https://www.swi-prolog.org/) 📚
- [Prolog Tutorials](https://www.learnprolognow.org/) 🎓
## 📝 Author
[Anidipta Pal](https://github.com/Anidipta)