Show HN: Vector-logic, a lightweight rules engine from first principles
github.comvector-logic is light-weight propositional logic inference engine. Optimised for simple queries like "what is the value of 'y' given all rules and evidences", and also allows you to iterate through the entire valid set (all valid assignments).
We also bothered to make the interface very simple and intuitive - you'll have very shallow learning curve.
First of all, it uses compact representatin of rules - similar to DNF, but converted to a sparse matrix.
Second, for the inference (which is a process of compiling the knowledge base) the order in which rules are compiled is crucial. We use two types of heuristic optimisations for this process, one is based on Jaccard similarity, another is so called predator-pray heuristics.
Happy to give more details, let me know
We built vector-logic (it's on PyPI) and wrote a hands-on guide for Towards Data Science: https://towardsdatascience.com/building-a-rules-engine-from-...
The whole framework is based on a theory we call 'State Algebra,' which we co-authored for arXiv: https://arxiv.org/abs/2509.10326
Happy to answer any questions!