Skip to main content

DFA Mutate

Primitives and utilities for manipulating deterministic finite automata (DFA) represented using the dfa library.

Build Status PyPI version License: MIT

Table of Contents

Installation

If you just need to use dfa_mutate, you can just run:

$ pip install dfa_mutate

For developers, note that this project uses the poetry python package/dependency management tool. Please familarize yourself with it and then run:

$ poetry install

Usage

Example Usage:

from dfa import DFA
import dfa_mutate

dfa1 = DFA(
    start=0,
    inputs={0, 1},
    label=lambda s: (s % 4) == 3,
    transition=lambda s, c: (s + c) % 4,
)

# Pick a specific mutation.
dfa2 = dfa_mutate.add_state(dfa1)
dfa3 = dfa_mutate.change_start(dfa1)
dfa4 = dfa_mutate.change_transition(dfa1)
dfa5 = dfa_mutate.relabel_state(dfa1)

# Infinite Generator mutations round-robin (will repeat).
dfas = dfa_mutate.generate_mutations(orig)

# Sample DFA using softmax over a scoring function (default constant).
# Uses first n dfas generated by above generator.

# NOTE: requires the optional numpy dependency.
dfa6 = dfa_mutate.sample_mutation(dfa1, n=20, score=lambda d: len(d.states()))

# All functions support passing in random number generator.
import random
dfa7 = dfa_mutate.relabel_state(dfa1, random.Random(0))

Metadata

Release files for dfa-mutate 0.1.3

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

Source distribution (sdist)

Source distribution for dfa-mutate 0.1.3
File Size Uploaded Provenance Actions
dfa_mutate-0.1.3.tar.gz 3.7 kB Without provenance Details for dfa_mutate-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dfa-mutate 0.1.3
File Interpreter ABI Platform Actions
dfa_mutate-0.1.3-py3-none-any.whl Python 3 none any Details for dfa_mutate-0.1.3-py3-none-any.whl

Total release size: 7.4 kB

Release files / dfa_mutate-0.1.3.tar.gz

Download URL dfa_mutate-0.1.3.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
285bec27221f8aee9d992b3d9ecfd176be5e0f71c2d94af579af3b29ade16030
BLAKE2b-256 checksum
How to use checksums
4085c461a2eb1ff129cdb3043674b1e75918056fceb7dc5b5e3de9e8087901f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.0 CPython/3.10.9 Linux/5.15.90

Release files / dfa_mutate-0.1.3-py3-none-any.whl

Download URL dfa_mutate-0.1.3-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
abe00e8afb4b7bf164806d3696caa1e511b2e869ac272f22b8e8afee4018d5ed
BLAKE2b-256 checksum
How to use checksums
9fe06bffb032b35a2545ae3bf252f02cbf9cda30d4b43bdb77f766f5078ae81b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.0 CPython/3.10.9 Linux/5.15.90

Security for dfa-mutate 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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