SaaSHub helps you find the best software and product alternatives Learn more →
Top 23 logic-programming Open-Source Projects
-
logica
Logica is a logic programming language that compiles to SQL. It runs on Google BigQuery, PostgreSQL and SQLite.
-
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.
-
souffle
Soufflé is a variant of Datalog for tool designers crafting analyses in Horn clauses. Soufflé synthesizes a native parallel C++ program from a logic specification.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
pyswip
PySwip is a Python - SWI-Prolog bridge enabling to query SWI-Prolog in your Python programs. It features an (incomplete) SWI-Prolog foreign language interface, a utility class that makes it easy querying with Prolog and also a Pythonic interface.
-
ciao
Ciao is a modern Prolog implementation that builds up from a logic-based simple kernel designed to be portable, extensible, and modular.
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
Link to GitHub -->
Project mention: Prolog language for PostgreSQL proof of concept | news.ycombinator.com | 2024-03-30If you're interested in this I would also recommend you check out Logica[0], which is a datalog-like language that is explicitly made to compile to SQL queries.
Project mention: If given a list of properties/definitions and relationship between them, could a machine come up with (mostly senseless, but) true implications? | /r/math | 2023-07-11Still, there are many useful tools based on these ideas, used by programmers and mathematicians alike. What you describe sounds rather like Datalog (e.g. Soufflé Datalog), where you supply some rules and an initial fact, and the system repeatedly expands out the set of facts until nothing new can be derived. (This has to be finite, if you want to get anywhere.) In Prolog (e.g. SWI Prolog) you also supply a set of rules and facts, but instead of a fact as your starting point, you give a query containing some unknown variables, and the system tries to find an assignment of the variables that proves the query. And finally there is a rich array of theorem provers and proof assistants such as Agda, Coq, Lean, and Twelf, which can all be used to help check your reasoning or explore new ideas.
Consider using Datalog (the incredible subset of Prolog) for this perfect use case. Compared to Prolog, you get:
1. Free de-duplication. No more debugging why a predicate is returning the same result more than once.
2. Commutativity. Order of predicates does not change the result. Finally, true logic programming!
3. Easy static analysis. There are many papers that describe how to do points-to analysis (and other similar techniques) with Datalog rules that fit on a single page :O
Souffle[0] is a mature Datalog that is highly performant and has many nice features. I highly recommend playing with it!
https://github.com/composewell/streamly/issues/1307 seems related, but it was a long time ago. We weren't heavy users anyway, so our streaming philosophy is now "conduit if it's simple and plugging into a conduit-using library, streaming if you're doing complicated things".
One of the easiest to get started on Datalog in my opinion is really clingo https://potassco.org/clingo/ , which can be pip installed and has python bindings. Answer Set Programming goes beyond datalog, but it holds datalog semantics as a sublanguage. It is unfortunate this is not well advertised.
```
Souffle and Cozo mentioned below already implement the whole of "traditional" datalog.
Percival (https://github.com/ekzhang/percival) has some very nice examples showing how you can interactively write and test rules on top of a datalog interpreter.
Bud (http://bloom-lang.net/bud/) is Hellerstein's proof of concept playground. It has bit-rotted in the past few years, but the examples are readable even if you can't easily get it working.
The complexity can be quite good. You can syntactically determine when you've written linear recursion (equivalent to a for loop) vs not. Otherwise, the complexity is what you'd expect from incremental view maintenance in a normal SQL database. Which is to say O(n^k) with k being the number of relations joined, but usually much, much less with appropriate indexes and skew in the data. All the usual tricks concerning data normalization and indexes from databases apply.
Project mention: Find Legal Moves in Brass Birmingham with Datalog | news.ycombinator.com | 2023-11-21
Project mention: Logtalk portable solution for the Advent of Code 2023 Day 8 problem | /r/prolog | 2023-12-09
There are open source ports that have a clear license now: https://github.com/Shen-Language/shen-sources/blob/master/LI...
That said, even if I don't use this a lot, I pay for Shen Professional to support development. Like you, I got and read the book and like the ideas, and I decided to support the project because I rather be sold something explicit (a programming language) than who knows what I get sold through a language that is open source but depends on a few or even one big company to pay the devs.
logic-programming related posts
- Kanren: An extensible, lightweight relational/logic programming DSL in Python
- The Power of Prolog
- Datalog in 100 lines of JavaScript (2022)
- Learn Datalog Today
- Logtalk portable solution for the Advent of Code 2023 Day 8 problem
- Are higher order functions and functors equivalent like how closures and objects are equivalent?
- Logtalk 3.69.0 released
-
A note from our sponsor - SaaSHub
www.saashub.com | 19 Apr 2024
Index
What are some of the best open-source logic-programming projects? This list will help you:
Project | Stars | |
---|---|---|
1 | oso | 3,387 |
2 | logica | 1,678 |
3 | the-power-of-prolog | 1,160 |
4 | meander | 906 |
5 | swipl-devel | 894 |
6 | souffle | 858 |
7 | streamly | 847 |
8 | atomspace | 775 |
9 | precept | 651 |
10 | clingo | 582 |
11 | percival | 571 |
12 | tau-prolog | 546 |
13 | prolog | 532 |
14 | crepe | 442 |
15 | pyswip | 441 |
16 | logtalk3 | 393 |
17 | ascent | 367 |
18 | shen-sources | 344 |
19 | holmes | 297 |
20 | PyNeuraLogic | 267 |
21 | tar.pl | 255 |
22 | ciao | 239 |
23 | poprc | 233 |