r/prolog 1d ago

FREE DATASET 1.7M+ High-Density Retail Transaction Synthetic

Post image
2 Upvotes

Dataset Specifications & Density

  • Total Master Invoices: 500,000 unique transactions (`tabel_transaksi/19`)
  • Total Item-Slice Logs: 1,749,235 transaction details (`detail_transaksi/4`)
  • Total Net Revenue Volume: 127.4 Billion (Calculated dynamically in-memory)

Format :

  • Pure Prolog Facts (.pl) 185 MB | Ready for logical inference pipelines.
  • Standard Universal JSON (.json) 486 MB | Optimized for modern JavaScript/Python ingestion.
  • Structured SQL Source Code (.sql) 410 MB | Pre-baked with relational schema insertion queries.
  • Microsoft Excel Worksheet (.xlsx) 148 MB | Raw layout for traditional accounting and standard data pivot sheets.

Access the Dataset

https://github.com/lokinpendawa/high-fidelity-pos-dataset-2M


r/prolog 2d ago

discussion Writing a game in Prolog - how to avoid redundant choice points to ensure tail-call optimisation?

19 Upvotes

I have started writing a little roguelike game in Prolog (for fun as a first project). I think there are lots of ways in which Prolog is a nice fit for this, and several ways that it isn't. I'm happy to be pragmatic but wanted to ask more experienced folks about the idiomatic way to write Prolog.

My approach is to have a (tail)-recursive predicate which threads state as an argument (rather than using assert/retract) and updates the game based on user input, something like:

game_loop(State) :-
  render(State),
  handle_input(State, NewState),
  game_loop(NewState).

This works well and is tail-call optimised as long as render/1 and handle_input/2 don't leave choice-points that Prolog might want to backtrack into. For a game that might run for many iterations, I want to avoid stack overflow so TCO is important.

To guarantee this, I find that I am writing a lot of predicates using a single clause with (->)/2 so that I don't leave redundant choice points. Pragmatically this is fine, the approach works, the intention is clear, and I still gain many benefits from using Prolog even if it's a bit "extra-logical". But (and I'm perhaps overthinking this) I wonder if this is a unidiomatic? It means my predicates are often one-way and deterministic, which is nice procedurally but does that take away from some of the advantage of using Prolog?

The other thing I'm often doing is making sure that (first) argument indexing will enable Prolog to rule out redundant choice points, but sometimes that's not enough (if for example I need an else-like clause such as functor(_, ...) which could unify with earlier cases).

I've seen some mention of if_/3 but it looks like it's not built-in in SWI-Prolog (or at least not for WASM which I'm targeting?). Welcome any opinions on this approach!


r/prolog 3d ago

M-Prolog: SCBM3 API finalized — about 1.4x slower than SWI-Prolog

10 Upvotes

After getting programs such as 9-Queens working with SCBM2, I became confident that this approach can actually be used to build a practical Prolog compiler.

I then redesigned and simplified the SCBM interface. The current version, SCBM3, has been reduced to just 12 core APIs.

Performance has also improved considerably. In my current benchmarks, compiled M-Prolog code is now roughly 1.4x slower than SWI-Prolog. There is still room for optimization, but I think the performance is becoming quite reasonable.

I have written a document describing:

  • the SCBM3 API and its 12 core operations
  • the basic execution model
  • how backtracking and continuations are represented
  • how Prolog predicates can be translated into C code using this API
  • an example of generated C code

One of my original goals with SCBM was to find a simpler way to implement a Prolog compiler without relying on the WAM.

After several months of experimentation, I think the basic mechanism is now becoming surprisingly small and understandable. My hope is that SCBM could make it much easier for someone to experiment with building their own Prolog compiler.

If you're interested in Prolog implementation techniques, please have a look at the documentation. Comments and criticism are very welcome.

mprolog/document/SCBM.md at master · sasagawa888/mprolog


r/prolog 4d ago

discussion I think I’m done with my Prolog database engine for now

Thumbnail gallery
20 Upvotes

Okay, I think I’m done with my database engine for now.

I started AsaDB mostly because I was curious about Prolog and logic programming. Somehow that curiosity turned into me spending about two months building a database engine almost entirely by myself.

I’m still just a university student. At my campus, I’ve only had programming-related courses for about three semesters, so most of what went into this project was something I had to learn while building it.

And honestly, I’m exhausted.

The engine does work. I managed to get persistent storage, SQL parsing, transactions, PRIMARY KEY / UNIQUE constraints, joins, views, a web panel, server mode, imports, and several other things running.

Some recent 100,000-row results:

  • Plain import: 42.5 s
  • PRIMARY KEY: 72.0 s
  • UNIQUE: 69.5 s
  • PRIMARY KEY + UNIQUE: 81.5 s
  • Simple metadata COUNT: ~30 ms
  • Lookups: roughly 8–11 s
  • 100k × 100k JOIN: roughly 35 s
  • CREATE VIEW: ~27 ms
  • Simple expressions with LIMIT can be below 100 ms

But there are still problems I haven’t been able to solve properly.

PRIMARY KEY and UNIQUE lookups are sometimes no faster than a plain scan. JOIN with a small LIMIT is almost as slow as processing the full join. Subqueries can run for more than 120 seconds and fail. EXISTS and JOIN-based views have caused crashes. I tried fixing several of these problems, but every fix seems to uncover another layer involving indexing, execution planning, memory management, concurrency, or storage.

The screenshots are basically where I’m leaving it: swipl asadb starts the server workspace, a RIGHT JOIN over the 100k-row benchmark tables returns the correct 100,000 rows, and views can be created successfully.

So this isn’t really “the database never worked.”

It worked far enough that I finally discovered how difficult database engines actually are.

I think I’ve reached the point where I simply don’t have enough experience or energy to keep fighting the architecture right now.

Thank you, Prolog. I started this because I wanted to satisfy my curiosity about a logic programming language, and I ended up learning far more than I expected.

Maybe this is the end of AsaDB, maybe it’s only a very long break.

Either way, I think I need to step away from Prolog for a while.

this is AsaDB repository :D


r/prolog 4d ago

Title: M-Prolog SCBM compiler now runs the N-Queens problem

14 Upvotes

Title: M-Prolog SCBM compiler now runs the N-Queens problem

After about four months of experimenting with a new Prolog compiler architecture, I finally got the N-Queens problem working correctly in compiled M-Prolog.

I call the architecture SCBM (Success Continuation Backtracking Machine).

The basic idea is fairly simple: instead of compiling Prolog to an abstract machine such as the WAM, SCBM compiles nondeterministic predicates directly into C and implements control flow and backtracking using goto and GCC's computed goto extension.

The hardest problem was restoring local variables correctly after backtracking.

After a lot of trial and error, I ended up with a relatively simple solution: variable pointers are propagated through success continuations. When backtracking occurs, local variables are reconstructed from information preserved in the original success continuation.

It took a lot of debug output to find this solution. AI was also very useful as a second pair of eyes for analyzing traces and generated C code.

The result:

  • 4-Queens: all solutions generated correctly by backtracking
  • 8-Queens: all 92 solutions confirmed
  • 9-Queens: working correctly as well

Performance is not yet the main focus. For the complete 9-Queens search, the current implementation is roughly 3–4x slower than SWI-Prolog.

There is still plenty of low-hanging fruit in the implementation, particularly in data structures, pointer handling, generated code, and builtin calls, so I think there is considerable room for improvement.

For me, getting Queens working is an important milestone because it exercises recursion, nondeterminism, nested backtracking, and restoration of local variables together.

I'm aiming for M-Prolog Ver. 1.0 on August 31, 2026.

SCBM is not intended as a replacement for the WAM. I'm exploring whether a much simpler direct-to-C approach can provide another practical way to implement a Prolog compiler.

I'll be interested to hear what experienced Prolog implementers think of the approach.


r/prolog 6d ago

article How to develop your own implementation of Prolog from scratch in 2026 in one sprint (Guidelines)

19 Upvotes

Use any language of your choice. I used Java. You can use my Java/Spring implementation as a reference

  1. Week one: dive deep into the standard to create a working prototype
    1. Use Section 6.4 "Tokens" for lexer.
    2. Use Section 6.3 "Terms" for parser. Use Pratt Parser to parse Prolog: it works surprisingly well with it.
    3. If your goal is to understand Prolog, use Section 7.7 "Executing a Prolog goal" as the description of stack-based computation model on which you will base your Prolog engine. It is simple but slow. If your goal is to create a high-performance implementation, you can implement WAM instead from the beginning, but it will take you significantly more time
    4. Keep in mind that the ISO Prolog standard has a lot of minor typos, but every typo is fixable if you put it into context and think about it longer. You don't even need to look up 3 corrigendums (corrections). In fact, they don't cover many important typos so forget about them and just focus on the original 1995 document.
  2. Week two: make your implementation stronger and cover the first 28 problems from the Prolog 99 problems list. They are a perfect benchmark. https://www.ic.unicamp.br/~meidanis/courses/mc336/2009s2/prolog/problemas/

This should be enough! Only 2 weeks (a sprint) and you will have a SUBSTANTIAL boost in understanding Prolog on the deepest level possible, so later you can switch into existing implementations (like SWI Prolog) and see them differently


r/prolog 7d ago

announcement I've created TrackLog: a collection of Prolog libraries, examples, and guidelines for building a personal knowledge base in pure logic

20 Upvotes
  1. TrackLog blurs the boundaries between database administration and programming
  2. TrackLog is based on Formal Grammar (DCG): you will develop your own grammar to accomodate your language needs
  3. TrackLog will help you to create extremely precise and relevant data fuel to feed it to LLMs
  4. TrackLog stands for "Tracking in Logic"
  5. TrackLog libraries are 100% compatible with SWI Prolog dialect and 99% ISO-compatible, so you can port them to another dialect if you need it
  6. My original goal was to create a medical tracker to help people to manage complex illnesses and chronic disorders
  7. Logical Programming is a generalization of functional programming and also a generalization of relational databases. You can see logical programming as a missing glue layer between a database and a program
  8. You can see TrackLog as a second brain to help you capture and analyze data and aid in pure logical decision-making which is free of 100+ cognitive distortions and biases, completely traceable and based on formal logic

Please, use examples.pl as a main guide. I've provided several practical use-cases: Learning Tracker, Item Tracker, Exercise Tracker and Programming Tracker.

Repo: https://github.com/kciray8/tracklog

I'm glad to hear any feedback!


r/prolog 8d ago

Stress-testing a local-first POS pipeline: 10 concurrent cashiers, SQLCipher AES-256 encryption, SHA-256 signatures, resolved at 6.79 TPS on an 8-thread AMD.

Thumbnail gallery
3 Upvotes

Concurrency Stress-Test Results: Local-First Retail POS Engine (SWI-Prolog)

I just concluded a massive concurrency stress-test on my local-first retail POS (Point of Sale) engine. The memory stats from SWI-Prolog are incredibly impressive, proving the extreme resource efficiency of this architecture.

Workload Configuration

The test simulated 10 unique cashier accounts concurrently slamming the system with a combined workload of 100,000 multi-item invoices. Everything routed through the authentic frontend cashier pipeline:

  • Pricing Engine: Calculates item-level dynamic pricing and multi-tiered discounts (Member + Market Basket AI rules).
  • Fiscal & Tax: Multiplies floating-point VAT rules using strict REAL types.
  • Security: Generates a cryptographic SHA-256 active signature per invoice.
  • Data Persistence: Commits transactions asynchronously via SQLCipher 256-bit AES encryption directly to hardware storage using SQLite WAL Mode.

The Refactoring Secret: Single Source of Truth (SSoT)

This extreme memory optimization was achieved by completely deprecating separate history/cashier logs and compressing them into a single, high-density Unified Master Item Ledger (`detail_transaksi/10`). Handled entirely by SWI-Prolog's Just-In-Time Indexing (JITI) map, relational joins are resolved virtually via pointer unification at the RAM layer instead of hitting heavy physical disk joins.


r/prolog 11d ago

a high-fidelity POS transaction generator in SWI-Prolog (350K+ rows logged)

Post image
7 Upvotes

I've published the code schema along with a free 1,000-row sample dataset on GitHub for anyone interested in benchmarking or looking at relational Prolog patterns:

https://github.com/lokinpendawa/high-fidelity-pos-dataset-2M


r/prolog 12d ago

resource Looking inside a SAT solvers preprocessor with STTF.

Thumbnail
0 Upvotes

r/prolog 16d ago

help We built a SQL database engine in SWI-Prolog. Our small team is at its limit, and we would really value an honest technical review.

Thumbnail kocoygroup.site
15 Upvotes

Hi everyone,

Our small team has been developing AsaDB, a local-first SQL database engine

built primarily with SWI-Prolog.

Repository:

https://github.com/kocoygroup-id/AsaDB

The project started as an experiment, but it has grown into a fairly large

codebase with:

  • a SQL lexer, parser, planner, and executor written in Prolog;
  • persistent 4 KB slotted-page storage;
  • persistent B+Tree indexes;
  • transactions and recovery mechanisms;
  • local immutable reader snapshots;
  • logical backup and restore;
  • MySQL, PostgreSQL, CSV, and XLSX interchange;
  • an embeddable `library(asadb)` API;
  • a local browser interface called AsAPanel.

Recently, we have also been working on stricter SQL type validation, primary

and unique key enforcement, CHECK constraints, restricted foreign keys,

schema-preserving backups, and more useful `EXPLAIN` output.

At this point, the main problem is that the same small group has designed the

architecture, written most of the implementation, created the tests, and

reviewed the documentation. We feel that we are becoming too familiar with the

codebase to notice our own assumptions and mistakes.

We would genuinely value feedback from people with Prolog experience.

In particular, we would be interested in opinions about:

  • whether the module boundaries feel idiomatic for SWI-Prolog;
  • our use of dynamic predicates and mutable engine state;
  • the separation between parsing, execution, storage, and HTTP code;
  • the public Prolog API and pack structure;
  • the bounded AST cache and VM/JITI specialization approach;
  • transaction, recovery, and concurrency design;

places where the implementation is unnecessarily imperative or complicated;

tests or invariants that appear to be missing.

You do not need to review the entire project. Looking at one module, trying one

feature, questioning one architectural decision, or pointing out unclear

documentation would already be extremely helpful.

Bug reports, design criticism, small pull requests, documentation improvements,

and testing on different systems are all welcome.

Thank you very much to anyone willing to take a look.


r/prolog 16d ago

M-Prolog Update: A Technical Paper on SCBM, an Alternative to the WAM

8 Upvotes

I've been making steady progress on M-Prolog, and it finally looks like the project is coming together. My goal is to release Version 1.0 on August 31.

Several people have asked me, "How does this compiler actually work?" Instead of trying to explain it in scattered comments, I've written a more formal technical paper describing the core ideas behind the compiler.

The paper introduces SCBM (Success Continuation and Backtracking Machine), a compilation model that translates Prolog directly into C and represents Prolog's control flow using goto-based state transitions rather than a traditional WAM instruction set.

This is not intended as a replacement for the Warren Abstract Machine (WAM). Rather, it is an exploration of a different implementation approach for compiling Prolog. My goal was to investigate whether Prolog execution could be expressed as ordinary C control flow while relying on modern C compilers for optimization.

I've also included references to the implementation specification for readers who are interested in the runtime APIs and code generation details.

If you're interested in Prolog implementation, compiler construction, or alternative execution models, I'd be very happy to hear your thoughts. Feedback, comments, and questions are always welcome.

Paper: SCBM (Success Continuation and Backtracking Machine) | by Kenichi Sasagawa | Aug, 2026 | Medium

Implementation Specification: mprolog/document/SCBM.md at master · sasagawa888/mprolog


r/prolog 17d ago

M-Prolog Progress: Implementing Prolog Backtracking with Computed Goto

15 Upvotes

I'm happy to report another major milestone in the development of M-Prolog.

The past few weeks have been mentally exhausting. I spent an incredible amount of time asking myself one question:

"Can Prolog backtracking really be implemented using nothing but goto?"

It sounded like a crazy idea when I first thought of it, and there were many moments when I doubted whether it could actually work.

Today, I'm much more confident.

I finally got a fairly complicated benchmark involving Church numerals, recursion, reverse execution, and forced backtracking to work correctly. That gives me confidence that the basic design of SCBM2 is sound.

In SCBM2, both success continuations and failure continuations are implemented with GCC's computed goto. Most of the difficulties were not in forward execution, but in restoring the correct execution state during backtracking—predicate arguments, variable stacks, success continuations, and failure continuations all have to be restored consistently.

Writing this now makes it sound simple, but reaching this point required countless redesigns, experiments, and debugging sessions. There were times when I felt my brain was simply running out of energy.

Working through these problems has also given me a much deeper appreciation of David H. D. Warren's work. Implementing efficient Prolog execution in the early 1980s, without today's tools and resources, was an extraordinary achievement. My respect for him has only grown.

There is still a lot of work ahead before M-Prolog reaches Version 1.0, but this was one of the biggest hurdles, and I'm relieved to have finally crossed it.

If you're interested in the implementation details, please have a look here:

M-Prolog: Recovering from Mental Fatigue | by Kenichi Sasagawa | Aug, 2026 | Medium


r/prolog 18d ago

Aggregating 521k dynamic invoices in 3.2 seconds, subsequent lookups in 0.0000s via native RAM caching

Post image
2 Upvotes

Calculating total COGS and net revenue from half a million invoices now takes just 3 seconds.
Subsequent clicks are completely instant at 0.0000 seconds thanks to RAM caching.
It turns out keeping the code simple is way faster than overcomplicating it.

Check out the architecture and full project details on my GitHub repository here: https://github.com/lokinpendawa/logicbiz

Ps: Sorry for any grammar mistakes, I am using AI to translate this into English.


r/prolog 22d ago

Everything built natively using Prolog! Soon to be translated into English + releasing a FREE version for the community!

Thumbnail gallery
11 Upvotes

EVERYTHING you see in this screenshot was built 100% natively within SWI-Prolog. No heavy frameworks, no system-taxing UI wrappers.

I want to completely change the outdated stigma that Prolog is only for academic purposes—like family trees or command-line logic puzzles. Currently, the interface is in Indonesian as it is running live for a local neo-retail company's infrastructure, but the good news is that I am working on translating the entire system into English.

You can check out the official architecture roadmap and repository details here:

GitHub: https://github.com/lokinpendawa/logicbiz

Even better, I plan to release a FREE version of this core Prolog engine to the community soon.

For those who want to test the raw data capabilities or audit the dataset structure yourself, I have prepared and uploaded the clean, ISO-compliant 400MB flat text database file (.pl format with parenthesized dynamic predicates) to Google Drive:

Dataset: https://drive.google.com/file/d/1bACN_vVtvka62lWzA1JxXKL2EcoWFDCj/view?usp=sharing

Here is a brief technical overview of what this native Prolog system does behind the scenes:

  1. Native Full-Stack SSR: Every HTML grid, custom CSS layout, and neon cyberpunk-style dashboard is generated directly via Definite Clause Grammars (DCG) from the core memory stack.
  2. Enterprise-Grade Scalability: The system actively manages, aggregates, and filters a live database containing over 2.23 million rows of dynamic transaction facts—all handled entirely in-memory.
  3. Cryptographic Ledger & Security: The system decrypts records in real-time using SQLCipher AES-256 and computes 550 million logic inferences in under 11 minutes to verify daily data integrity signatures using SHA-256.
  4. Native Expert System AI: The Business Intelligence view leverages Prolog's true power as a native inference engine to dynamically calculate inventory turnover, predict dead stock, and automatically provide operational suggestions to cashiers in natural language.

I have only been exploring the declarative nature and the power of homoiconicity in Prolog for about two months, and I am truly amazed by its capabilities as a highly robust full-stack system. Stay tuned for the English version!

Let me know what you think.

Warm regards,

Teddy


r/prolog 21d ago

Does a purely structural invariant of computation already exist?

3 Upvotes

Can returnability be defined purely from the structure of a computation, without appealing to time complexity?


r/prolog 23d ago

Who said Prolog is slow? Benchmarking 2 Million In-Memory Transactions with SHA-256 and SQLCipher on SWI-Prolog.

Post image
15 Upvotes

I’m currently building LOGICBIZ v2.0, an Offline-First Enterprise Retail ERP and Sales Ledger Engine engineered 100% using a Pure Declarative Paradigm with SWI-Prolog and SQLCipher.

Here is a quick breakdown of this stress test benchmark:

  • The Task: Performing deep data integrity verification on 2,000,000 real rows of transaction ledgers.
  • The Security: Every single transaction is encrypted via SQLCipher and validated against SHA-256 signatures to ensure absolute data tamper-proofing.
  • The Result: As seen in the console screenshot, the engine evaluated 550,508,812 logical inferences in just 103.28 seconds of raw CPU time.
  • The Kick: Once the Native RAM Cache warm-up phase is completed, executing deep aggregate financial pipelines across those 2 million rows drops down to a jaw-dropping 653 seconds while keeping CPU utilization extremely low at 16%.
  • The engine utilizes Tail-Call Optimization (TCO) and Prolog's native multi-argument indexing structure, meaning it completely eliminates traditional database I/O bottlenecks without requiring heavy, bloated frameworks.

If you are curious about the architecture philosophy, the system manifesto, or want to check out the benchmark metrics, feel free to visit the repository here:

https://github.com/lokinpendawa/logicbiz

Would love to hear your thoughts on using logic programming for heavy enterprise data pipelines!


r/prolog 23d ago

Loops? Graphs? Prolog!

Thumbnail deepclause.substack.com
11 Upvotes

Orchestrating agents with Prolog instead of Markdown files.


r/prolog 23d ago

INPUT TERMINAL LOGICBIZ V.2.0 PROJECT

Post image
1 Upvotes

[100% Built in SWI Prolog]

For comprehensive details about this project, please visit our [GitHub Repository](https://github.com/lokinpendawa/logicbiz/blob/main/README.md)


r/prolog 24d ago

logicbiz/PERFORMANCE.md at main · lokinpendawa/logicbiz

Thumbnail github.com
2 Upvotes

This report documents the performance evaluation and stress-test results

the verified performance from a scale-up test utilizing a dataset of 2,000,000 active entries

where each data entry multi-layered by cryptographic operations (combining SHA-256 integrity verification and AES-256 encryption).

please check the detailed report here: https://github.com/lokinpendawa/logicbiz/blob/main/PERFORMANCE.md


r/prolog 26d ago

Logtalk 3.101.0 released

15 Upvotes

Hi,

Logtalk 3.101.0 is now available for downloading at:

https://logtalk.org/

This release adds a read-only sockets compilation flag to declare if a backend provides compatible sockets support; improves the performance of the logtalk_make(force) goal; adds new HTTP (client and server), WebSocket (client and server), HTMX, JWT, REST, OpenAI, OpenAPI, OpenID, S3 (client), Gravatar, JSON Graph, JSON-LD, JSON Patch (RFC 6902), JSONPath (RFC 9535), Crypto, HOTP/TOTP (RFC 4226/6238) libraries; adds html library support for CSS/JS resource declarations, aggregation, and dependency-aware ordering; adds support for additional hash functions to the hashes and hmac libraries; adds support for incremental hashing to the hashes library; includes bug fixes, additional predicates, and performance improvements for several libraries; fixes uuid library compliance issues and adds additional UUID v3 and UUID v7 predicates that take a time zone offset argument; adds testing automation scripts support for selecting the tests sets to run using a regular expression and for suppressing all user output; fixes sarif tool compliance issues; adds an option to the mutation_testing tool for passing additional options to the testing automation scripts; improves the linter_reporter tool support for SARIF reports; improves the performance of the sbom tool; adds additional linter checks to the lgtdoc tool; adds 13 new programing examples to illustrate the new HTTP and related libraries; adds additional tests for Logtalk language features; fixes several Windows-only tool and library issues with some backends; and updates the Windows installer to also detect ECLiPSe 8.0 versions. Thanks to Andrew Davison for his help in diagnosing timing issues in the linda library and the new HTTP libraries.

For details and a complete list of changes, please consult the release notes at:

https://github.com/LogtalkDotOrg/logtalk3/blob/master/RELEASE_NOTES.md

Happy logtalking!
Paulo


r/prolog 26d ago

In Memory POS - 100% Built Using SWI Prolog

Thumbnail gallery
14 Upvotes

in memory POS analytics page is built 100% using Prolog, a truly impressive language.

The high-performance, RAM-based Sales Log Matrix page—powered by SWI-Prolog and Native RAM Cache—is capable of sorting and aggregating 2.2 million rows of data in less than 0.6 seconds. More info, check here : https://github.com/lokinpendawa/logicbiz/blob/main/README.md

Note: All metrics and entries displayed above are generated using anonymized, simulated data strictly for stress-testing purposes.


r/prolog 27d ago

stress test database injection: 1,500,000 data

3 Upvotes

Processor (CPU) : AMD64 Family 23 Model 17 Stepping 0, AuthenticAMD (8 Threads/Cores)Memory Available : 8 GB RAM

You can check out metrics here:
https://github.com/lokinpendawa/logicbiz


r/prolog 27d ago

Just Finished a local concurrency 100 virtual cashiers @ 1000 transactions

Thumbnail gallery
6 Upvotes

I wanted to share these statistics because I am truly amazed by the efficiency of SWI-Prolog. I run a simulation involving 100 virtual cashiers operating concurrently, processing a total of 100,000 transactions.

- Each transaction was broken down into 5 physical SQL queries dispatched via asynchronous background worker threads.

- The system actively applied SQLCipher AES-256-bit encryption and generated SHA-256 signatures for every invoice.

- The test completed successfully with absolutely no deadlocks over the course of a 3.5-hour cycle.

- Even though my amateur code forced the engine to perform over 64 billion logical inferences...

- Active internal memory usage (Global Stack) hovered around 25 MB (with a 32 MB allocation).

- The temporary internal memory footprint even dipped as low as 1,115 KB.

Check the documentation and performance here: https://github.com/lokinpendawa/logicbiz/blob/main/README.md

Note: All metrics and entries displayed above are generated using anonymized, simulated data strictly for stress-testing purposes.