Git Product home page Git Product logo

logic-engine's Introduction

logic-engine

Engine for logic programming hosted in Go.

Why

Logic programming is a paradigm well suited to solving combinatory and constrained problems, where we can express a set of relationships and query the solver for a solution that satisfies all constraints simultaneously.

This library was born as a simple unification solver that eventually grew too big and warranted its own project. It is not intended as a standalone language, but rather a hosted one that is able to manipulate Go objects and call Go code. As such, it may be used as an engine instead of shelling out to a full Prolog environment, which necessarily involve some ser-/deserialization.

Features

  • Last-call optimization
  • Dicts
  • Prolog parser
  • DCGs
  • Attributed variables
  • Packages
  • Go integration
  • Delimited continuations
  • Tabling
  • Finite-domain constraint solver

Lots of work ahead :)

About

The execution environment is an interpreter of the Warren Abstract Machine (WAM), that use regular Go pointers instead of managing memory regions directly (heap, stack, choicepoints). This way, we get garbage collection for free and simplify many other concepts -- for example, we keep separate stacks for environments and choicepoints, and environments that are still referenced won't get lost after they return. We also don't need instructions like put_unsafe_value, that promote a value from the register to the stack, since there's no heap region.

To learn more about the WAM, see Aït-Kaci's tutorial.

logic-engine's People

Contributors

brunokim avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

prolognexus

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.