GithubHelp home page GithubHelp logo

sarvex / csharp-ukanren Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ozzymcduff/csharp_ukanren

0.0 3.0 0.0 558 KB

A port of microKanren (Ruby) to CSharp

License: MIT License

Ruby 1.91% C# 98.09%

csharp-ukanren's Introduction

microKanren in CSharp Build status

microKanren is a minimalist relational (logic) programming language. This project is a port of microKanren to CSharp. It is an almost exact translation of the original implementation, which was written for Petite Chez Scheme.

Installation

To install MicroKanren, run the following command in the Package Manager Console

PM> Install-Package MicroKanren

Usage

The following example demonstrates how MicroKanren can be used from a simple program:

using MicroKanren;
class SimpleProgram:Core{
    public string Do(){
        var res = CallFresh((q)=> Eq(q, 5) )(EmptyState);
        return res.ToString();
    }
}

> new SimpleProgram().Do()
(((([0] . 5)) . 1))

See the spec file for more examples. The spec file is almost an exact port of the microKanren tests written in Scheme.

Credits

The code in this gem is closely based on the following sources:

  • The microKanren paper by Jason Hemann and Daniel P. Friedman. I read this paper a couple of times, and will probably have to read it a few more before I have a better understanding about what this code is doing and how to write more effective logic programs.
  • This code is also in parts copied from Scott Vokes' port of microKanren to Lua. It was great to have the Lua code as a second example of the implementation in the paper, and it made my job especially easy since Lua is so similar to Ruby.

Dependencies

This project requires .net 4.0 or higher.

Contributing

  1. Fork it ( https://github.com/wallymathieu/csharp_ukanren/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

See LICENSE.txt.

Author

See credits for source of original code. This is a port of a port written by [Justin Leitgeb] (http://justinleitgeb.com). This port is written by Oskar Gewalli.

csharp-ukanren's People

Contributors

jsl avatar mecampbellsoup avatar wallymathieu avatar

Watchers

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