Simple symbolic Virtual Machine in Python and Z3
Project description
Micro-SVM
A simple and very basic symbolic virtual machine.
[!IMPORTANT] This is a major piece for an ongoing research project. We are currently working hard on preparing our results for a publication.
Overview
Micro-SVM is a standalone symbolic execution engine designed to:
- Explore program execution paths.
- Analyze control flow and state transitions.
- Validate program specifications against expected behaviors.
- Detect potential defects (e.g., unhandled exceptions, infinite loops).
This package provides the core symbolic execution engine used in research projects for defect discovery and path validation. It is not a full programming language implementation but rather a tool for analyzing executable specifications.
Supported features
- A range of primitive types:
boolean,int8/16/32/64,integer,real,char,string. - Symbolic primitive values.
- Built-in containers for primitives:
array<T>,set<T>,map<K,V>,transform<K,V>(same asmap, more limited but sometimes faster). - Functions and/or static methods.
- Java/C#-like reference values (
ref<T>for references of known type, plainreffor "opaque" cases). - Structures and "classes" (i.e., structures with methods) with multiple inheritance.
- Handling of abstract methods and virtual calls.
- Intrinsics for specific operations.
- Basic library/program specification serialization (JSON).
- Ability to discover and validate both normal and failing execution paths (see examples).
- Basic class-based user-defined exception handling (i.e. the usual
try-catch-finallytriplet andthrow). - Basic decoding of complex structures (containers and structures/classes) as Python objects (i.e. as a list, a list of pairs or a dictionary).
Installation
pip install micro-svm
Known limitations
- No function/method overload.
- No type checks. It is expected for a specification to be validated and type-checked by external tools.
- Little to no type conversion. The implementation relies heavily on Z3 in that aspect.
- No support for IEEE floats.
- Eager function/method execution. For every discovered program path, the machine checks if the whole path can be executed or not.
For example, when processing
x = parse_bool(input) or panic()or similar expression thepanic()call would always be visited unless modelled otherwise in the user specification. - Very crude fault handling for certain language- and runtime-specific edge-cases. It is only possible to:
- not allowing any fault to occur during a path's execution (default),
- check if they might have happened (i.e., using
CompilerContext.get_fault_status/clear_fault_status), - ignore faulty operations.
- Exceptions regarding null-dereferencing, invalid array indexing and alike cannot be raised and caught automatically. It is advised to use
CompilerContext.get_fault_statusandthrowto raise a suitable exception object. Note thatget_fault_statusis unhelpful unlessSymbolicStateMachine.fault_modeis set toSTORE. - No tools for managing dynamic reflection operations (field access by symbolic name strings, method creation, etc.).
Cite
@software{microsvm2026,
title={Micro-SVM: A simple symbolic VM in Python and Z3},
author={Mikhail Onischuck},
year={2026},
url={https://github.com/dog-m/micro-svm-engine}
}
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file micro_svm-1.0.6.tar.gz.
File metadata
- Download URL: micro_svm-1.0.6.tar.gz
- Upload date:
- Size: 60.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2517f08fb23d7ac56b14f66f68875c1c7b7cd764b60d992ba0ce7c0b5b361615
|
|
| MD5 |
9cc77060e1b17d7674c0243184488f13
|
|
| BLAKE2b-256 |
21b8c566b80d0667bc9b94467bd70f9f788806faa0b443eafd2040ab5c8ff975
|
Provenance
The following attestation bundles were made for micro_svm-1.0.6.tar.gz:
Publisher:
python-publish.yml on dog-m/micro-svm-engine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
micro_svm-1.0.6.tar.gz -
Subject digest:
2517f08fb23d7ac56b14f66f68875c1c7b7cd764b60d992ba0ce7c0b5b361615 - Sigstore transparency entry: 1050355198
- Sigstore integration time:
-
Permalink:
dog-m/micro-svm-engine@38da63b5507c7785a7031e8efe078f8a3c2e0047 -
Branch / Tag:
refs/tags/v1.0.6 - Owner: https://github.com/dog-m
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@38da63b5507c7785a7031e8efe078f8a3c2e0047 -
Trigger Event:
release
-
Statement type:
File details
Details for the file micro_svm-1.0.6-py3-none-any.whl.
File metadata
- Download URL: micro_svm-1.0.6-py3-none-any.whl
- Upload date:
- Size: 59.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ff165ec0eda1f5cc5e19e265f572dd95321c7398b43570eaaf94bd12b70e492
|
|
| MD5 |
fed1d4b356d1b83859b975affe25f9e4
|
|
| BLAKE2b-256 |
b037003b2ba3b8d01e5bfca9fb8bd4d37ea6b86153a111916297958b6b49f33a
|
Provenance
The following attestation bundles were made for micro_svm-1.0.6-py3-none-any.whl:
Publisher:
python-publish.yml on dog-m/micro-svm-engine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
micro_svm-1.0.6-py3-none-any.whl -
Subject digest:
8ff165ec0eda1f5cc5e19e265f572dd95321c7398b43570eaaf94bd12b70e492 - Sigstore transparency entry: 1050355222
- Sigstore integration time:
-
Permalink:
dog-m/micro-svm-engine@38da63b5507c7785a7031e8efe078f8a3c2e0047 -
Branch / Tag:
refs/tags/v1.0.6 - Owner: https://github.com/dog-m
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@38da63b5507c7785a7031e8efe078f8a3c2e0047 -
Trigger Event:
release
-
Statement type: