Skip to main content

Δ Sindi: Semantic Invariant Differencing for Solidity Smart Contracts

SInDi compares two Solidity boolean predicates (e.g., require guards) and decides whether they are equivalent, or one is stronger.

Install

pip install sindi

Quick usage

Library

from sindi import Comparator, ComparatorRulesOnly

cmp = Comparator()
print(cmp.compare("a > b", "a >= b"))
# "The first predicate is stronger."

light = ComparatorRulesOnly()
print(light.compare("a > b * 2", "a > b"))
# "The first predicate is stronger."

CLI

# Compare (full)
sindi compare "msg.sender == msg.origin && a >= b" "msg.sender == msg.origin"

# Light comparator (no SMT)
sindi compare "a > b * 2" "a > b" --light

# Rewrite / tokenize / parse / simplify
sindi rewrite "isOwner() && now >= 0"
sindi tokenize "..." --json
sindi parse "..." --tree
sindi simplify "..." --show-sympy --json

API (tiny)

  • Comparator().compare(p1: str, p2: str) -> str Full semantic differencing (SymPy + selective Z3 where needed).

  • ComparatorRulesOnly().compare(p1: str, p2: str) -> str Lightweight, solver-free structural/rewrites reasoning.


Notes: Functions & arrays are treated as uninterpreted symbols for reasoning. Division is modeled as a * b**-1. Variables are assumed non-negative in SMT checks.

Metadata

Release files for sindi 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sindi 0.2.1
File Size Uploaded
sindi-0.2.1.tar.gz 41.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sindi 0.2.1
File Interpreter ABI Platform
sindi-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 74.9 kB

Release files / sindi-0.2.1.tar.gz

Download URL sindi-0.2.1.tar.gz
Size 41.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3af8a63707d9b8087baea08868cce50dc6b5b166a04beff6f9dfaf01955a9158
BLAKE2b-256 checksum
How to use checksums
41feef853a0e422da80cc6ba9caa0f3f7fcfe2636d1670a02c31618c21dde5c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.9

Release files / sindi-0.2.1-py3-none-any.whl

Download URL sindi-0.2.1-py3-none-any.whl
Size 33.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9be604d965ec9e13f2b0417d94048949009280fb9c2353100be83f2ff9823514
BLAKE2b-256 checksum
How to use checksums
5f170eaa88ec47763122adef3318aa0ef4eeaa90bee932f31fdc424a6f12aae9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.14

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page