https://github.com/axone-protocol/prolog
🧠 The Axone Prolog VM
https://github.com/axone-protocol/prolog
prolog scripting-language virtual-machine
Last synced: 3 months ago
JSON representation
🧠 The Axone Prolog VM
- Host: GitHub
- URL: https://github.com/axone-protocol/prolog
- Owner: axone-protocol
- License: mit
- Created: 2024-05-16T15:43:08.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2026-02-12T19:35:38.000Z (4 months ago)
- Last Synced: 2026-02-13T03:19:15.969Z (4 months ago)
- Topics: prolog, scripting-language, virtual-machine
- Language: Go
- Homepage:
- Size: 2.37 MB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ccamel - axone-protocol/prolog - 🧠 The Axone Prolog VM (Go)
README
[](https://axone.xyz)
# Axone Prolog Virtual Machine
[](https://github.com/axone-protocol/prolog/actions/workflows/build.yml)
[](https://codecov.io/gh/axone-protocol/prolog)
[](https://pkg.go.dev/github.com/axone-protocol/prolog)
[](https://goreportcard.com/report/github.com/axone-protocol/prolog)
[](https://conventionalcommits.org)
[](https://github.com/axone-protocol/.github/blob/main/CODE_OF_CONDUCT.md)
[](https://opensource.org/license/mit)
> [!IMPORTANT]
> This repository is a _hard fork_ of [ichiban/prolog](https://github.com/ichiban/prolog), customized to meet the specific requirements of the [Axone protocol](https://github.com/axone-protocol). It is maintained independently for our use case, and upstream updates may not be regularly integrated.
>
> For the original, general-purpose Prolog implementation or to contribute to the broader community, please visit the [ichiban/prolog repository](https://github.com/ichiban/prolog).
## What is this?
`axone-protocol/prolog` is a Prolog virtual machine written in Go, designed to be embedded in blockchain environments.
It serves as the core of the [Axone protocol](https://axone.xyz) for decentralized, logic-based smart contracts.
This project is a fork of the [ichiban/prolog](https://github.com/ichiban/prolog) repository, striving to maintain
ISO standard compliance where feasible while adapting to the unique constraints of blockchain execution.
## Deviations from the ISO Standard
The following customizations have been made to adapt the original `ichiban/prolog` implementation to the blockchain environment:
- Capped variable allocation to limit the number of variables.
- Replaced maps with ordered maps to ensure deterministic execution.
- Implemented secure integer arithmetic for functors.
- Integrated [cockroachdb/apd](https://github.com/cockroachdb/apd) for floating-point arithmetic.
- Removed support for trigonometric functions (`sin`, `cos`, `tan`, `asin`, `acos`, `atan`).
- Introduced VM hooks for enhanced Prolog execution control.
- Added support for the `Dict` term.
- Added support for `read_write` mode for bidirectional file I/O, enabling half-duplex transactional devices in the host's VFS.
- `halt/0` and `halt/1` stop Prolog execution by signaling a VM halt (the host decides how to handle exit codes).
- Added VM metering capability to track and limit resource consumption across multiple dimensions (instructions, unifications, list processing, term copying, arithmetic evaluation, and structural comparisons).
## License
Distributed under the MIT license. See `LICENSE` for more information.
## Bug reports & feature requests
If you notice anything not behaving how you expected, if you would like to make a suggestion or would like
to request a new feature, please open a [**new issue**](https://github.com/axone-protocol/axoned/issues/new/choose). We appreciate any help
you're willing to give!
> Don't hesitate to ask if you are having trouble setting up your project repository, creating your first branch or
> configuring your development environment. Mentors and maintainers are here to help!
## You want to get involved? 😍
So you want to contribute? Great! ❤️ We appreciate any help you're willing to give. Don't hesitate to open issues and/or
submit pull requests.
We believe that collaboration is key to the success of the Axone project. Join our Community discussions on the [Community space](https://github.com/orgs/axone-protocol/discussions) to:
- Engage in conversations with peers and experts.
- Share your insights and experiences with Axone.
- Learn from others and expand your knowledge of the protocol.
The Community space serves as a hub for discussions, questions, and knowledge-sharing related to Axone.
We encourage you to actively participate and contribute to the growth of our community.
Please check out Axone health files:
- [Contributing](https://github.com/axone-protocol/.github/blob/main/CONTRIBUTING.md)
- [Code of conduct](https://github.com/axone-protocol/.github/blob/main/CODE_OF_CONDUCT.md)
## Acknowledgements
We would like to thank the following projects for their inspiration and for providing the foundation for this project:
- [ichiban](https://github.com/ichiban) for the original Prolog implementation.