Skip to main content

Language with Refinement Types

Project description

Aeon

Aeon is a statically-typed programming language with native support for Liquid Types (refinement types), developed at LASIGE, University of Lisbon.

Unlike LiquidHaskell or LiquidJava, where refinement types are bolted onto an existing language, Aeon was designed from the ground up around them. The type system lets you express precise properties of values directly in types — for example, "an integer greater than zero" — and the compiler proves these properties hold using the Z3 SMT solver.

Beyond refinement types, Aeon also offers:

  • Python FFI — call any Python function natively, giving you access to the full Python ecosystem.
  • Program synthesis — leave ?holes in your program and let Aeon fill them in using genetic programming, enumerative search, or LLM-backed synthesis.
  • A growing standard library — modules for List, Math, Array, Image, and more.

Aeon is implemented as a Python interpreter and is under active development.

📖 Documentation: https://alcides.github.io/aeon

Installation

Aeon is distributed on PyPI and can be run directly via uvx:

uvx --from aeonlang aeon [file.ae]

Examples

Refinement Types

Refinement types let you attach predicates to base types. Here, sqrt is declared to accept only positive integers — passing a negative value is a compile-time error, not a runtime crash. The native keyword bridges to Python:

def sqrt : (i: {x:Int | x > 0}) -> Float := native "__import__('math').sqrt";

def main (i:Int) : Unit :=
    print (sqrt (-25))   # type-checking error: -25 does not satisfy x > 0

Program Synthesis

Aeon can synthesize code to satisfy a refinement specification. Mark the body with ?hole and Aeon will search for an implementation that meets the type:

@minimize_int(deposit)
def deposit : {d:Int | d > 0 && d * 21900 >= 10000000} := ?hole;

Run with uv run python -m aeon --budget 10 -s gp file.ae to synthesize the minimum annual deposit that reaches a $10,000 goal in 20 years at 1% interest.

More examples — including image processing, machine learning, and probabilistic programming — live in the examples/ directory.

Authors

Aeon has been developed at LASIGE, University of Lisbon by:

Publications

Let us know if your paper uses Aeon, to list it here.

Citation

Please cite as:

Fonseca, Alcides, Paulo Santos, and Sara Silva. "The usability argument for refinement typed genetic programming." International Conference on Parallel Problem Solving from Nature. Cham: Springer International Publishing, 2020.

BibTeX:

@inproceedings{fonseca2020usability,
  title={The usability argument for refinement typed genetic programming},
  author={Fonseca, Alcides and Santos, Paulo and Silva, Sara},
  booktitle={International Conference on Parallel Problem Solving from Nature},
  pages={18--32},
  year={2020},
  organization={Springer}
}

Acknowledgements

This work was supported by Fundação para a Ciência e Tecnologia (FCT) through:

And by Lisboa2020, Compete2020 and FEDER through:

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

aeonlang-4.1.3.tar.gz (350.3 kB view details)

Uploaded Source

Built Distribution

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

aeonlang-4.1.3-py3-none-any.whl (416.6 kB view details)

Uploaded Python 3

File details

Details for the file aeonlang-4.1.3.tar.gz.

File metadata

  • Download URL: aeonlang-4.1.3.tar.gz
  • Upload date:
  • Size: 350.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for aeonlang-4.1.3.tar.gz
Algorithm Hash digest
SHA256 ae799d74fe4dbb9edb8cb6da6041df4acd55cf869a44383f67dcc2564ba299cf
MD5 2914c08298f982abc920efa09f447952
BLAKE2b-256 30ab877cb70eab862ca07c6e2d55a7ea1a87207284fc1792d3b878dc29a8030a

See more details on using hashes here.

File details

Details for the file aeonlang-4.1.3-py3-none-any.whl.

File metadata

  • Download URL: aeonlang-4.1.3-py3-none-any.whl
  • Upload date:
  • Size: 416.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for aeonlang-4.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 65e95e706564b33da84eb14215e181f17f0cde426f77d2ea50d391ab261d4e17
MD5 1dd892cfc6197f53e0b7ae1e843ff45d
BLAKE2b-256 b5c1fa9c9308da159c1f6867142a52c7be1d0bd23e4d78a98edbfff5fc977290

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