Skip to main content

Core utilities for the FhY compiler infrastructure.

Project description

FhY Core

PyPI version Python versions CI codecov

FhY Core is a collection of utilities for FhY and other parts of the compiler.

Utility Description
Identifier Unique naming class with a non-unique name hint and a unique ID.
Error Custom error registration and core errors for the compiler.
Expression General expression represented as an AST with a parser and printer.
Constraint General logical constraint.
Parameter Real, integer, ordinal, categorical, and permutation parameters.
Types Extensible type system with open dispatchers for binding, substitution, unification, and structural equivalence; type checking for expressions.
Symbol Table Nested symbol table.
Pass Infrastructure CompilerPass, VisitablePass, and register_pass for building IR passes with diagnostics (PassDiagnostic, DiagnosticLevel) and preserved-analysis tracking.
Pass Manager PassManager sequences transformations and returns PassManagerResult/PassRunRecord; FixpointPassGroup drives until-fixpoint iteration.
Analysis Manager Analysis/AnalysisVisitablePass with AnalysisManager for caching and invalidating analysis results across pass runs.
Validation Manager ValidationManager runs every validator against the IR (collect-all, never fail-fast) and returns a ValidationReport; ValidationFailedError surfaces ERROR diagnostics.
Serializable Trait Serializable/WrappedFamilySerializable with dict, JSON, and binary formats plus registered type IDs.
Value Domain ValueDomain open registry classifying the kind of value an IR operation handles (e.g., DATA_DOMAIN, ADDRESS_DOMAIN), with optional parent hierarchies.
Op Attribute OpAttribute open registry of semantic tags attachable to compiler operations (COMMUTATIVE, ASSOCIATIVE, PURE, ELEMENTWISE).
Compiler Traits - Identity HasIdentifier for stable object identity.
Compiler Traits - Provenance HasProvenance for source/origin tracking.
Compiler Traits - Type Carrier HasType for objects carrying an explicit type.
Compiler Traits - Operands HasOperands for operand-bearing operation/expression nodes.
Compiler Traits - Results HasResults for multi-result operation-like nodes.
Compiler Traits - Freezing Frozen/FrozenMixin for runtime and dataclass immutability.
Compiler Traits - Equality PartialEqual/Equal for dataclass-aware equality semantics.
Compiler Traits - Ordering PartialOrderable/Orderable for dataclass-aware ordering semantics.
Compiler Traits - Verification Verifiable + VerificationError for structural invariant checks.
Compiler Traits - Folding Foldable for constant-fold-like evaluation hooks.
Compiler Traits - Canonicalization Canonicalizable for local canonical form rewrites.
Compiler Traits - Structural Equivalence StructuralEquivalence for shape/value-level IR comparisons.
Compiler Traits - Interned Interned for interned components.
Data Structure - Lattice Lattice (order theory) data structure represented with a POSET.
General Utility - Logging Core logging utilities for all compiler components.
General Utility - Python 3.11 Enums String and integer enum types only introduced in Python 3.11
General Utility - Stack General stack utility that wraps deque.
General Utility - POSET General partially ordered set utility represented as a directed graph.
General Utility - Dictionary Utilities Additional dictionary helper functions.
General Utility - Numeric Predicates is_strict_int rejects bool so contexts requiring a strict integer do not silently accept True/False.

Table of Contents

Install FhY Core from PyPi

Coming Soon

Build FhY Core from Source Code

  1. Clone the repository from GitHub.

    git clone https://github.com/actlab-fhy/FhY-core.git
    
  2. Create and prepare a Python virtual environment.

    cd FhY-core
    python -m venv .venv
    source .venv/bin/activate
    python -m pip install -U pip
    pip install setuptools wheel
    
  3. Install FhY.

    # Standard Installation
    pip install .
    
    # For contributors
    pip install ".[dev]"
    

Contributing - For Developers

Want to start contributing the FhY Core? Please take a look at our contribution guide

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fhy_core-0.1.3.tar.gz (150.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fhy_core-0.1.3-py3-none-any.whl (127.3 kB view details)

Uploaded Python 3

File details

Details for the file fhy_core-0.1.3.tar.gz.

File metadata

  • Download URL: fhy_core-0.1.3.tar.gz
  • Upload date:
  • Size: 150.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for fhy_core-0.1.3.tar.gz
Algorithm Hash digest
SHA256 0fadbf17b4e8b49e61d20810ec9931935431b9d112406b55f0e5366728f5804b
MD5 af7d3f2198a0e141b7300e8603d7f6a9
BLAKE2b-256 9c0e3550cf39e74c84d574d9d6dfd5b39ae7b95346fbe5144dcd88e9e492cf72

See more details on using hashes here.

File details

Details for the file fhy_core-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: fhy_core-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 127.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for fhy_core-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1a3181f52f21c2e104bf00e4b0715c6fe0af92ab9c284c75354bb2744cf2bc3a
MD5 3f9f6d41f831e3c57a80713e44a774d2
BLAKE2b-256 4de51cd065ff2358f3d1cdf630fc07fbf7867edccd15509dd3bccd9695e9665f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page