Back

README

DSC-16: Artificial Intelligence - Practicals

Course

Welcome to the collection of practical assignments for the Artificial Intelligence course. This repository contains implementations for various logic-based problems and algorithms using Prolog.


🛠️ Environment Setup

This project uses Prolog. We recommend using SWI-Prolog for running these programs.

Quick Setup:

  1. Install SWI-Prolog: Download and install from swi-prolog.org.
  2. Load the File: Open the terminal in this directory and run:

```prolog

?- [practical].

```

(Note: Ensure you are loading the .pl file)

  1. Run Queries: After loading, you can start querying predicates like father(john, X). or factorial(5, F).

👉 Click here for detailed Documentation and Examples


📅 List of Practicals

This repository covers the following 15 practicals as implemented in Practical.pl:

  1. Family Tree Implementation - Define family relationships using facts and rules.
  2. List Concatenation - Concatenate two lists into a third list.
  3. List Reversal - Reverse the elements of a list.
  4. Sum of Two Numbers - Calculate the sum of two numerical values.
  5. Maximum of Two Numbers - Find the larger of two numbers.
  6. Factorial - Compute the factorial of a given number.
  7. Fibonacci Series - Generate the Nth Fibonacci number.
  8. Power Function - Calculate the power (Num^Pow).
  9. Multiplication - Implement multiplication through recursive addition.
  10. Membership Check - Check if an element is a member of a list.
  11. Sum of List - Calculate the total sum of elements in a list.
  12. Even/Odd Length - Determine if the length of a list is even or odd.
  13. Maximum in List - Find the maximum value within a list.
  14. Insert at Position - Insert an item at a specific index in a list.
  15. Delete at Position - Remove an element from a specific index in a list.

<p align="right">

<i>Developed with ❤️ by <a href="https://github.com/16ratneshkumar">16ratneshkumar</a></i>

</p>