mediKanren VS microKanren

Compare mediKanren vs microKanren and see what are their differences.

mediKanren

Proof-of-concept for reasoning over the SemMedDB knowledge base, using miniKanren + heuristics + indexing. (by webyrd)

microKanren

The implementation of microKanren, a featherweight relational programming language (by jasonhemann)
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
mediKanren microKanren
6 2
316 298
- -
8.1 0.0
16 days ago almost 10 years ago
Racket Scheme
MIT License -
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

mediKanren

Posts with mentions or reviews of mediKanren. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-05-25.
  • Annotated implementation of microKanren: an embeddable logic language
    9 projects | news.ycombinator.com | 25 May 2022
    Not really production, but probably THE most impressive biomedicine research work I've seen (and I'm an academic MD):

    https://github.com/webyrd/mediKanren

    This is a FOL theorem prover that uses medical research articles as terms. They use it to do genetics and drug repurposing metaresearch. It's like the wet dream of all the biomed machine learning fanboys out there, except that:

    1. it's not machine learning

    and

    2. it really works

  • Human Knowledge and PhDs
    1 project | /r/coolguides | 22 May 2022
    And wow, he uses logic programming to deduce a diagnostic from the facts https://github.com/webyrd/mediKanren .. and used to find out what his son had https://www.statnews.com/2019/07/25/ai-expert-writing-code-save-son/
  • With a nudge from AI, ketamine emerges as a potential rare disease treatment
    2 projects | news.ycombinator.com | 7 Aug 2021
  • William Byrd on Logic and Relational Programming, MiniKanren (2014)
    4 projects | news.ycombinator.com | 1 Jun 2021
    Hi Kamaal!

    I know Cisco is using core.logic, which is David Nolen's Clojure variant of miniKanren, in their ThreatGrid product. I think the Enterprisey uses of mediKanren are a bit different than the purely relational programming that I find most interesting, though.

    Having said that, we are now on our second generation of mediKanren, which is software that performs reasoning over large biomedical knowledge graphs:

    https://github.com/webyrd/mediKanren/tree/master/medikanren2

    mediKanren is being developed by the Hugh Kaul Precision Medicine Institute at the University of Alabama at Birmingham (HKPMI). HKPMI is run by Matt Might, who you may know from his work on abstract interpretation and parsing with derivatives, or from his more recent work on precision medicine. mediKanren is part of the NIH NCATS Biomedical Data Translator Project, and is funded by NCATS:

    https://ncats.nih.gov/translator

    Greg Rosenblatt, who sped up Barliman's relational interpreter many order of magnitude, has been hacking on dbKanren, which augments miniKanren with automatic goal reordering, stratified queries/aggregation, a graph database engine, and many other goodies. dbKanren is the heart of mediKanren 2.

    I can imagine co-writing a book on mediKanren 2, and its uses for precision medicine...

    Cheers,

    --Will

  • Bertrand Might: Life, legacy and next steps
    1 project | news.ycombinator.com | 22 Jan 2021
    The Precision Medicine Institute that I now run produces mediKanren: https://github.com/webyrd/mediKanren

    It's an open source logical reasoning engine (read: 1960's AI) for drug repurposing that we deploy routinely to help patients.

    There is always a need for better relationalization of biological data sets that feed such tools too.

    For example, SemMedDB is really showing its age for NLP of the scientific literature and yet it is still astonishingly useful for helping patients even as is.

microKanren

Posts with mentions or reviews of microKanren. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-11-14.
  • Lisp-Stick on a Python
    11 projects | news.ycombinator.com | 14 Nov 2022
    which uses a Lisp to define itself. This means roughly that if you understand enough Lisp to understand this program (and the little recursive offshoots like eval-cond), there is nothing else that you have to learn about Lisp. You officially have read the whole language reference and it is all down to libraries after that. Compare e.g. with trying to write Rust in Rust where I don't think it could be such a short program, so it takes years to feel like you fully understand Rust.

    Indirectly this also means that lisps are very close at hand for “I want to add a scripting language onto this thing but I don't want to, say, embed the whole Lua interpreter” and it allows you to store user programs in a JSON column, say. You also can adapt this to serialize environments so that you can send a read-only lexical closure from computer to computer, plenty of situations like that.

    Aside from the most famous, you have things like this:

    1. The heart of logic programming is also only about 50 lines of Scheme if you want to read that:

    https://github.com/jasonhemann/microKanren/blob/master/micro...

    2. Hygienic macros in Rust probably owe their existence to their appearance in Lisps.

    C2 asks the same question here: https://wiki.c2.com/?LispShowOffExamples with answers like

    3. The object model available in Common Lisp was more powerful than languages like Java/C++ because it had to fit into Lisp terms (“the art of the metaobject protocol” was the 1991 book that explained the more powerful substructure lurking underneath this object system), so a CL programmer could maybe use it to write a quick sort of aspect-oriented programming that would match your needs.

    4. Over there a link shows how in 16 LOC you can implement a new domain-specific language to define and run finite state machines: http://www.findinglisp.com/blog/2004/06/automaton-cleanup.ht...

  • William Byrd on Logic and Relational Programming, MiniKanren (2014)
    4 projects | news.ycombinator.com | 1 Jun 2021
    > I think that with such modern additions (i.e. apart from the cut) Prolog moves closer to the declarative ideal without sacrificing its all-around usability as a general purpose language. What do you think?

    I also used to think that Prolog was moving closer to the delcarative ideal. And I suspect that most expert Prolog programmers believe similarly.

    However, my attitude has changed in the past few years, after seeing Prolog programmers try to implement the relational interpreter from the 2017 ICFP pearl in Prolog.

    The problem is one of composing the pure features needed for expressing a program as complicated as the relational interpreter. (Of course, the relational interpreter is designed to be as short and simple as possible, bit it is still more complicated than pure relations you will find in a Prolog textbook, for example.)

    In theory, you can easily combine unification with the occurs check, SLG-resolution, disequality/disunification constraints, type constraints, etc., and avoid all impure uses of extra-logical features. In practice, I've seen people struggle to combine these features within a single Prolog implementation. In fact, after multiple attempts from multiple Prolog experts, I have yet to see a version of the relational Scheme interpreter in Prolog that can match the behavior of the miniKanren version.

    I'm not claiming that someone couldn't implement a full relational interpreter in Prolog. Obviously they could, since Prolog is Turing-complete. I'm only saying that the default choices of Prolog, plus the intricacies of combining multiple pure features (and leaving out standard and useful non-relational features), seems to make writing a relational interpreter much harder than I would have expected.

    If you are up for a challenge, I'd be happy to work on a Prolog version of the Scheme interpreter with you!

    Based on what I've seen from Prolog experts trying to reproduce the relational interpreter, and conversations with Prolog experts, my current thinking is that Prolog is actually not a good language for relational programming. Too many of the defaults must be adjusted or overridden, too many standard techniques and idioms must be abandoned, and too many potentially incompatible libraries must be composed in order to get everything "just right."

    The problem isn't that relational programming in Prolog isn't possible. The problem is that it requires enough work and non-standard techniques that in practice people don't do it.

    At least, that is what I observe as an outsider.

    If there is an easy way to combine features within a single FOSS Prolog implementation to allow for the types of relational programming we do in miniKanren, I'd be delighted to see it in action. I'd also be delighted to write a paper about it with you! :)

    > Finally, I'd like to know more about minikanrens' search. I'll look around on the internet, but is there a source you would recommend?

    I would recommend reading Jason Hemann and Dan Friedman's lovely little paper on microKanren, which gives a tutorial reconstruction of miniKanren's complete interleaving search, starting from depth-first search:

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

    https://github.com/jasonhemann/microKanren

    The standard exercise for learning microKanren is to translate the resulting ~50 lines of Scheme code into the language of your choice.

    You might also like this more technical paper on the `LogicT` monad:

    Backtracking, interleaving, and terminating monad transformers: (functional pearl)

What are some alternatives?

When comparing mediKanren and microKanren you can also consider the following projects:

racketscript - Racket to JavaScript Compiler

dissertation-single-spaced - Single-spaced version of my dissertation, 'Relational Programming in miniKanren: Techniques, Applications, and Implementations'

awesome-racket - A curated list of awesome Racket frameworks, libraries and software, maintained by Community

calysto_scheme - A Scheme kernel for Jupyter that can use Python libraries

gui

trial - A fully-fledged Common Lisp game engine

frog - Frog is a static blog generator implemented in Racket, targeting Bootstrap and able to use Pygments.

clinch - Common Lisp 3D/2D Graphics Engine for OpenGL

iracket - Jupyter kernel for Racket

legit - CL interface to the GIT binary.

Shin-Barliman - Research project: Program synthesis using updated interface, template and types.