An open API service indexing awesome lists of open source software.

https://github.com/jelhamm/100-projects-for-prolog

"The repository '100 Mini Projects for Prolog' includes small projects for learning and practicing Prolog."
https://github.com/jelhamm/100-projects-for-prolog

bfs-search dfs-algorithm dls-algorithm graph graph-path-finder ids-algorithm list-operation list-operations mathematical-programming prolog prolog-implementation prolog-programming-language prolog-rules sorting-algorithms sorting-algorithms-implemented string-algorithms

Last synced: about 2 months ago
JSON representation

"The repository '100 Mini Projects for Prolog' includes small projects for learning and practicing Prolog."

Awesome Lists containing this project

README

        

# 100 Project for Prolog

This repository is a comprehensive collection of diverse [Prolog](https://en.wikipedia.org/wiki/Prolog#:~:text=Prolog%20is%20a%20Turing%2Dcomplete,for%20intelligent%20knowledge%2Dprocessing%20applications.) programming challenges designed to enhance your understanding and proficiency in Prolog. Whether you are a beginner looking to learn the basics of Prolog or an experienced programmer aiming to refine your skills, this repository provides a wealth of problems and projects to explore.

## Table of Contents

**1. [Introduction](#introduction)**

**2. [Installation](#installation)**

**3. [Project Categories](#project-categories)**

- **[Math Problems](#Math-problems)**

- **[Graph Problems](#Graph-Problems)**

- **[List Operations](#list-operations)**

- **[Matrix Problems](#matrix-Problems)**

- **[String Operations](#String-Operations)**

- **[Graph Path Finder](#Graph-Path-Finder)**

- **[Sorting Algorithms](#Sorting-Algorithms)**

- **[Searching Algorithms](#statistics-Algorithms)**

- **[Statistics And Probability](#statistics-and-probability)**

**4. [Usage](#usage)**

**5. [Contribution](#contribution)**

**6. [License](#license)**

## Introduction

This repository is designed for those interested in learning Prolog by working through practical examples.
Each project is self-contained and includes a clear description of the problem, the Prolog code to solve it, and instructions on how to run the code. Whether you are a beginner or an experienced developer, you will find valuable insights and challenges in these projects.

## Installation

To get started with the projects in this repository, you will need to have Prolog installed on your machine.

Follow the steps below to set up your environment:

1. Install SWI-Prolog:

- Visit the [SWI-Prolog website](https://www.swi-prolog.org/Download.html) and download the installer for your operating system.
- Follow the installation instructions provided on the website.

2. Clone this repository:
```bash
* git clone https://github.com/jElhamm/100-Projects-for-Prolog

* cd 100-Projects-for-Prolog
```

# 📚 Project Categories

## ➗ Math Problems

**1. [Calculating Power](Math%20Problems/Calculating%20Power)**

**2. [Calculating Factorial](Math%20Problems/Calculating%20Factorial)**

**3. [Checking Prime Numbers](Math%20Problems/Checking%20Prime%20Numbers)**

**4. [Find Factors of a Number N](Math%20Problems/Find%20Factors%20of%20a%20Number%20N)**

**5. [Converting Binary to Decimal](Math%20Problems/Converting%20Binary%20to%20Decimal)**

**6. [Converting Decimal to Binary](Math%20Problems/Converting%20Decimal%20to%20Binary)**

**7. [Calculating Fibonacci Numbers](Math%20Problems/Calculating%20Fibonacci%20Numbers)**

**8. [Generate Prime Numbers up to N](Math%20Problems/Generate%20Prime%20Numbers%20up%20to%20N)**

**9. [Calculate the Least Common Multiple (LCM)](Math%20Problems/Calculate%20the%20Least%20Common%20Multiple%20(LCM))**

**10. [Calculate the Greatest Common Divisor (GCD)](Math%20Problems/Calculate%20the%20Greatest%20Common%20Divisor%20(GCD))**

## 🕸️ Graph Problems

**11. [Find and Count All Edges](Graph%20Problems/Find%20and%20Count%20All%20Edges)**

**12. [Find Neighbors of a Node](Graph%20Problems/Find%20Neighbors%20of%20a%20Node)**

**13. [Find and Count All Nodes](Graph%20Problems/Find%20and%20Count%20All%20Nodes)**

**14. [Checking Graph Homomorphism](Graph%20Problems/Checking%20Graph%20Homomorphism)**

**15. [Check if a Graph is Connected](Graph%20Problems/Check%20if%20a%20Graph%20is%20Connected)**

**16. [Finding Minimum Spanning Tree](Graph%20Problems/Finding%20Minimum%20Spanning%20Tree)**

**17. [Find All Paths Between Two Nodes](Graph%20Problems/Find%20All%20Paths%20Between%20Two%20Nodes)**

**18. [Convert a Directed Graph to an Undirected](Graph%20Problems/Convert%20a%20Directed%20Graph%20to%20an%20Undirected)**

## 📋 List Operations

**19. [Reverse](List%20Operations/Reverse)**

**20. [Find Max](List%20Operations/Find%20Max)**

**21. [Find Min](List%20Operations/Find%20Min)**

**22. [Sum List](List%20Operations/Sum%20List)**

**23. [Is Sorted](List%20Operations/Is%20Sorted)**

**24. [List Length](List%20Operations/List%20Length)**

**25. [Add Element](List%20Operations/Add%20Element)**

**26. [Check Equality](List%20Operations/Check%20Equality)**

**27. [Append Two Lists](List%20Operations/Append%20Two%20Lists)**

**28. [Average Elements](List%20Operations/Average%20Elements)**

**29. [Check Membership](List%20Operations/Check%20Membership)**

**30. [Sublist Predicate](List%20Operations/Sublist%20Predicate)**

**31. [Remove Duplicates](List%20Operations/Remove%20Duplicates)**

**32. [Intersect Two Lists](List%20Operations/Intersect%20Two%20Lists)**

**33. [Convert List to Set](List%20Operations/Convert%20List%20to%20Set)**

**34. [Even Sum Calculator](List%20Operations/Even%20Sum%20Calculator)**

**35. [Split List Predicate](List%20Operations/Split%20List%20Predicate)**

**36. [Nth Element Retrieval](List%20Operations/Nth%20Element%20Retrieval)**

**37. [Rotate List to the Left](List%20Operations/Rotate%20List%20to%20the%20Left)**

**38. [Rotate List to the Right](List%20Operations/Rotate%20List%20to%20the%20Right)**

**39. [Find Second Largest Element](List%20Operations/Find%20Second%20Largest%20Element)**

**40. [Delete Occurrences Elements](List%20Operations/Delete%20Occurrences%20Elements)**

**41. [Find Second Smallest Element](List%20Operations/Find%20Second%20Smallest%20Element)**

**42. [Longest Sublist with No Duplicates](List%20Operations/Longest%20Sublist%20with%20No%20Duplicates)**

## 🧮 Matrix Problems

**43. [Matrix Trace](Matrix%20Problems/Matrix%20Trace)**

**44. [Identity Matrix](Matrix%20Problems/Identity%20Matrix)**

**45. [Matrix Addition](Matrix%20Problems/Matrix%20Addition)**

**46. [Transpose Matrix](Matrix%20Problems/Transpose%20Matrix)**

**47. [Matrix Inversion](Matrix%20Problems/Matrix%20Inversion)**

**48. [Matrix Dimensions](Matrix%20Problems/Matrix%20Dimensions)**

**49. [Sum of Odd Elements](Matrix%20Problems/Sum%20of%20Odd%20Elements)**

**50. [Check Square Matrix](Matrix%20Problems/Check%20Square%20Matrix)**

**51. [Calculating The Trace](Matrix%20Problems/Calculating%20The%20Trace)**

**52. [Finding Even Elements](Matrix%20Problems/Finding%20Even%20Elements)**

**53. [Matrix Multiplication](Matrix%20Problems/Matrix%20Multiplication)**

**54. [Check Symmetric Matrix](Matrix%20Problems/Check%20Symmetric%20Matrix)**

**55. [Largest Element in Matrix](Matrix%20Problems/Largest%20Element%20in%20Matrix)**

**56. [List to Matrix Conversion](Matrix%20Problems/List%20to%20Matrix%20Conversion)**

**57. [Matrix to List Conversion](Matrix%20Problems/Matrix%20to%20List%20Conversion)**

**58. [Smallest Element in Matrix](Matrix%20Problems/Smallest%20Element%20in%20Matrix)**

**59. [Sum of Odd Numbers in Each Row](Matrix%20Problems/Sum%20of%20Odd%20Numbers%20in%20Each%20Row)**

**60. [Sum of Even Numbers in Each Column](Matrix%20Problems/Sum%20of%20Even%20Numbers%20in%20Each%20Column)**

## 🌐 String Operations

**61. [Reversing String](String%20Operations/Reversing%20String)**

**62. [Replacing a Character](String%20Operations/Replacing%20a%20Character)**

**63. [Find the Largest Word](String%20Operations/Find%20the%20Largest%20Word)**

**64. [Find the Smallest Word](String%20Operations/Find%20the%20Smallest%20Word)**

**65. [Convert String to List](String%20Operations/Convert%20String%20to%20List)**

**66. [Finding All Subsequences](String%20Operations/Finding%20All%20Subsequences)**

**67. [Find the Last Occurrence](String%20Operations/Find%20the%20Last%20Occurrence)**

**68. [Concatenating Two Strings](String%20Operations/Concatenating%20Two%20Strings)**

**69. [Find the First Occurrence](String%20Operations/Find%20the%20First%20Occurrence)**

**70. [Extract Numbers from String](String%20Operations/Extract%20Numbers%20from%20String)**

**71. [Check Two Strings are Equal](String%20Operations/Check%20Two%20Strings%20are%20Equal)**

**72. [Counting the Number of Words](String%20Operations/Counting%20the%20Number%20of%20Words)**

**73. [Convert a List of Characters](String%20Operations/Convert%20a%20List%20of%20Characters)**

**74. [Removing Duplicate Characters](String%20Operations/Removing%20Duplicate%20Characters)**

**75. [Checking String is Palindrome](String%20Operations/Checking%20String%20is%20Palindrome)**

**76. [Finding the Length of a String](String%20Operations/Finding%20the%20Length%20of%20a%20String)**

**77. [Counting Characters in a String](String%20Operations/Counting%20Characters%20in%20a%20String)**

**78. [Converting Lowercase Letters to Uppercase](String%20Operations/Converting%20Lowercase%20Letters%20to%20Uppercase)**

**79. [Converting Uppercase Letters to Lowercase](String%20Operations/Converting%20Uppercase%20Letters%20to%20Lowercase)**

## ✏️ Graph Path Finder

**80. [GraphPathFinder](#Graph%20Path%20Finder)**

## 🔄 Sorting Algorithms

**81. [Shell Sort](Sorting%20Algorithms/Shell%20Sort)**

**82. [Quick Sort](Sorting%20Algorithms/Quick%20Sort)**

**83. [Merge Sort](Sorting%20Algorithms/Merge%20Sort)**

**84. [Bubble Sort](Sorting%20Algorithms/Bubble%20Sort)**

**85. [Insertion Sort](Sorting%20Algorithms/Insertion%20Sort)**

**86. [Selection Sort](Sorting%20Algorithms/Selection%20Sort)**

## 🔍 Searching Algorithms

**87. [Binary Search](Searching%20Algorithms/Binary%20Search)**

**88. [Linear Search](Searching%20Algorithms/Linear%20Search)**

**89. [Detect Cycles in a Directed](Searching%20Algorithms/Detect%20Cycles%20in%20a%20Directed)**

**90. [Find the K-th Smallest Element](Searching%20Algorithms/Find%20the%20K-th%20Smallest%20Element)**

**91. [Find the Last Duplicate Element](Searching%20Algorithms/Find%20the%20Last%20Duplicate%20Element)**

**92. [Find the First Duplicate Element](Searching%20Algorithms/Find%20the%20First%20Duplicate%20Element)**

## 📈 Statistics And Probability

**93. [Calculate Mean](Statistics%20And%20Probability/Calculate%20Mean)**

**94. [Calculate Mode](Statistics%20And%20Probability/Calculate%20Mode)**

**95. [Calculate Range](Statistics%20And%20Probability/Calculate%20Range)**

**96. [Calculate Median](Statistics%20And%20Probability/Calculate%20Median)**

**97. [Calculate Variance](Statistics%20And%20Probability/Calculate%20Variance)**

**98. [Dice Roll Simulation](Statistics%20And%20Probability/Dice%20Roll%20Simulation)**

**99. [Coin Toss Simulation](Statistics%20And%20Probability/Coin%20Toss%20Simulation)**

**100. [Calculate Standard Deviation](Statistics%20And%20Probability/Calculate%20Standard%20Deviation)**

## Usage

Each project is contained within its respective folder. To run a project, follow these steps:

1. Navigate to the project folder:

```bash
cd Project-Name
```

- For example, to navigate to the project for calculating the mean:
```bash
cd Statistics_and_Probability/Calculate_Mean
```

2. Open the Prolog file in SWI-Prolog:

```bash
swipl project_name.pl
```

- For example:

```bash
swipl mean.pl
```

3. Follow the instructions in the project file to execute the code.

## Contributing

- Please fork the repository, make your changes, and submit a pull request.
- Ensure your code adheres to the existing style and includes relevant tests.
- For detailed guidelines, check the project's issues or discussions.

## License

This repository is licensed under the MIT License.

See the [LICENSE](./LICENSE) file for more details.