Git Product home page Git Product logo

gulava's Introduction

Gulava

Relational programming library for Java.

Gulava allows you to write relational predicates in Java. You can write Prolog-style predicates and use them from normal Java code, seamlessly integrated with the magic of annotation processors.

See the GitHub wiki for some how-tos and to get started writing your own predicates and logic value types.

This repository requires Bazel to build, test, and run. After you have set up Bazel, you can run the demo:

bazel run //java/gulava:Demo

Note that Gulava is not an official Google product.

Contributing

Gulava doesn't have a particular long-term goal in mind besides exploring relational programming. Any contributions to that end are welcome! That could be something like:

  • New relational programming features, like constraint support.
  • Interesting demos, like the one in java/gulava/Demo.java but better.
  • Data structures or other utilities, like java/gulava/util/Queue.java.

Related

MicroKanren paper: http://webyrd.net/scheme-2013/papers/HemannMuKanren2013.pdf

gulava's People

Contributors

matvore avatar nd avatar yaojingguo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gulava's Issues

Maybe generic type arguments can be used to indicate equivalent values

Instead of this:

    final Goal order_select(Cons<?, ?> sub, Cons<?, ?> full) {
      return conj(
          same(sub.car(), full.car()),
          order(sub.cdr(), full.cdr()));
    }

It would be nice to write:

    final <A> Goal order_select(Cons<A, ?> sub, Cons<A, ?> full) {
      return order(sub.cdr(), full.cdr());
    }

This could be called an overloading of the meaning of generic type arguments. That's not a bad thing necessarily.

Implement constraints

How constraints could work:

  • In Subst, store instances of Constraint interface in place of actual values for vars that are constrained
  • Multiple variables can share the same Constraint, for instance to express (A != 5 || B != 10).
  • When binding a Var and it has a Constraint assigned to it, verify it is still satisfied. If so, the Constraint can choose to change the Subst and replace itself with a new Constraint, assign new Constraints to different Vars, etc.

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.