Skip to content

avulaankith/swi-prolog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SWI-Prolog Repository

Welcome to the SWI-Prolog Repository! This repository contains various Prolog files showcasing logical representations, relationships, and implementations in the Prolog programming language.

Files Overview:

  1. file.pl:

    • Content Overview:
      • Defines predicates and rules for relationships between people, food, life status, and preferences.
    • Logic Demonstrated:
      • Facts and rules regarding people, their status (alive or killed), food, eating habits, and preferences.
    • Usage:
      • Explore relationships, food choices, and logical implications within the defined predicates.
    • Disclaimer:
      • Simplified examples for educational purposes; not exhaustive or for production use.
  2. first.pl:

    • Content Overview:
      • Introduces simple facts and relationships between individuals, attributes, and numbers.
    • Logic Demonstrated:
      • Basic facts about friendships, a singer, and an odd number.
    • Usage:
      • Understand basic relationships and facts within the defined predicates.
    • Disclaimer:
      • Provides elementary examples for learning Prolog fundamentals.
  3. minor1.pl:

    • Content Overview:
      • Contains predicates and rules depicting relationships between people, food, survival, and preferences.
    • Logic Demonstrated:
      • Predicates related to people, food choices, survival logic, and likes/dislikes.
    • Usage:
      • Investigate relationships, food preferences, and survival conditions within the defined predicates.
    • Disclaimer:
      • Simplified logic examples designed for educational purposes.
  4. nodes.pl:

    • Content Overview:
      • Defines predicates and rules establishing paths between nodes in a graph.
    • Logic Demonstrated:
      • Graph representation using edges and rules for path finding between nodes.
    • Usage:
      • Explore graph traversal and path-finding functionalities within the defined predicates.
    • Disclaimer:
      • Provides basic examples of graph theory implementation in Prolog.
  5. factorial.pl:

    • Content Overview:
      • Contains a Prolog predicate for calculating factorials.
    • Logic Demonstrated:
      • Predicate to calculate factorials using recursion.
    • Usage:
      • Query the factorial/2 predicate to calculate factorials.
    • Disclaimer:
      • Simplified factorial calculation for educational purposes.
  6. family.pl:

    • Content Overview:
      • Defines facts and rules representing familial relationships.
    • Logic Demonstrated:
      • Parent-child relationships established by parent/2 predicate, and rules inferring father and mother relationships.
    • Usage:
      • Explore familial relationships using defined predicates.
    • Disclaimer:
      • Basic familial relationship examples for educational purposes.

How to Use:

  1. Loading Files:

    • Load any desired file (e.g., consult('file.pl').) into an SWI-Prolog interpreter or environment.
  2. Querying Predicates:

    • Query-defined predicates in each file to explore relationships, facts, or specific functionalities.
  3. Contribution:

    • Feel free to enhance or expand upon existing files or create new Prolog files to contribute to the repository.

Any inquiries, suggestions, or contributions are welcomed.

Thank you for exploring the SWI-Prolog Repository!