Giter Club home page Giter Club logo

prolog-interpreter's Introduction

Prolog-Interpreter

A Mini Prolog interpreter written in OCaml

A README file serves as an introductory document for your project, providing essential information to users, contributors, and other stakeholders. Here's a template for a README.md file for a Prolog interpreter project:

Table of Contents

Overview

Prolog is a logic programming language that excels in applications involving symbolic reasoning and complex data relationships. This project aims to bring the power of Prolog to developers and researchers through an intuitive interpreter.

Features

  • Standard Prolog Syntax: Supports most of the common Prolog syntax and predicates.
  • Querying and Reasoning: Perform queries and logical reasoning in a user-friendly REPL (Read-Eval-Print Loop).
  • Built-in Predicates: A selection of built-in predicates to facilitate coding in Prolog.
  • Error Handling: Provides helpful error messages and guidance when syntax or semantic issues arise.
  • Extensibility: Easily extend the interpreter with custom predicates and features.

Installation

To install the Prolog interpreter, follow these steps:

  1. Clone the repository:

    git clone https://github.com/RISHIT7/Prolog-Interpreter.git
  2. Run the interpreter:

    make

    Will run the default prolog file Test.pl
    To run a custom file, write the prolog file into the Test folder, assuming the name is prolog.pl

    make test_file=Test/prolog.pl
    

Usage

After running the interpreter, you can start typing Prolog queries directly into the REPL. The interpreter will evaluate your queries and provide results.

Example queries:

  • To find a solution to a query:

    ?- member(X, [1, 2, 3]).
  • To assert a fact or rule:

    ?- hastype(gt(intT(3), intT(4)), X).
  • Special identifiers:

    ?- integer(3).

Examples

You can find example Prolog scripts in the Test directory. These scripts demonstrate how to use the interpreter for various tasks.

License

This project is licensed under the MIT License. Please see the LICENSE file for more details.

prolog-interpreter's People

Contributors

rishit7 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.