Git Product home page Git Product logo

prolog_bfs's Introduction

A simple prolog breadth first search interpreter

How to use it

Visit: https://askuri.github.io/PrologBFS/wasm/ or build it from source. Suppose your executable is named "prolog_bfs", type "prolog_bfs program_file" and it will run. WebAssembly: run "start_server.sh" and go to http://localhost:8080/

Install Instructions

Prerequisites

Dependencies:

We develop on Ubuntu Linux. If you use windows or another OS, you might need to change the commands accordingly.

Install

#Boost libraries
sudo apt-get install libboost-all-dev
git clone https://github.com/LhKipp/Prolog_BFS.git
cd Prolog_BFS
./build_xxx.sh

There are 2 different build scripts. "build_native" builds the cli application and "build_wasm" builds the WebAssembly files. If you first build wasm, then native (or the other way around) make sure to delete the CMakeCache.txt file! Otherwise the build might fail.

Building native

Run build_native.sh. Currently, this only runs test cases.

Building for WebAssembly

  1. Source your emsdk environment
  2. Run ./build_wasm.sh <env> where can be either
    • dev for a development build (fast compilation, no optimization, no test suite)
    • prod for a production build (slow compilation, O3 optimization, no test suite)
    • test for a testing build (even slower compilation, O3 optimization, with test suite) You may omit , resulting in a dev build.

Running tests in the browser

  1. Run a test build
  2. Open your browser's javascript console while being on the prolog bfs site
  3. Run runTests() in the console. You should see the test output there

Known Limitations

  1. Only integer arithmetic is supported.
  2. Variables / constant names starting with an underscore are not supported. (This implies that a single "_" as a variable name is not supported)
  3. The only supported built in predicates are ==, ==, is/2 and append/3.
  4. The online version has a limit of 500MB memory. For the offline version there is no memory usage check. If an endless program has been supplied, the program won't stop allocating memory. Make sure to kill the program before all memory is exhausted.

Contributors

  • Martin Weber (https://github.com/askuri). Created the web version, tested the program, gave constructive feedback, found some bugs. Big thanks.

prolog_bfs's People

Contributors

lhkipp avatar askuri avatar lionkor avatar

Watchers

James Cloos avatar  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.