Commit Graph

151 Commits

Author SHA1 Message Date
microproofs
c16bd06e97 make sure traverse_uplc_with_helper is always passing the arg to lambda before running the with function.
Breaks #945 again
2024-05-22 11:58:05 -04:00
rvcas
edf82f773c chore: update snapshots 2024-05-22 11:30:02 -04:00
rvcas
f5c4f4cb37 chore(plutus_version): use a cuter name in the config field 2024-05-21 17:13:12 -04:00
rvcas
3bc3792aa3 feat: add plutus version to aiken.toml
relates to #907
2024-05-21 17:02:20 -04:00
KtorZ
ef70c6b8a8 Re-use generic id across builtin type-definitions.
This was somehow wrong and corrected by codegen later on, but we should be re-using the same generic id across an entire definition if the variable refers to the same element.
2024-05-06 15:17:01 -04:00
KtorZ
390bccd406 Fix blueprint validator test snapshot. 2024-05-04 14:04:12 -04:00
microproofs
d7574e738f fix: remaining cargo tests 2024-05-04 14:04:12 -04:00
microproofs
61a021f9e3 update pair to handle alias 2024-05-04 14:04:12 -04:00
microproofs
d05d8e7de6 Start working on separating pairs from 2 tuples in Aiken
co-authored-by: KtorZ <matthias.benkort@gmail.com>
2024-05-04 14:04:12 -04:00
rvcas
17ddbfaafa chore: remove dbg 2024-04-08 14:30:07 -04:00
rvcas
5cb1e23008 fix: program generate should only run after params and args are validated 2024-04-08 14:30:07 -04:00
rvcas
cac119338d feat(blueprint): a memoized program that only runs code gen every other time 2024-04-08 14:30:07 -04:00
rvcas
3cdb21ad6b feat(blueprint): make a helper public 2024-04-08 14:30:07 -04:00
rvcas
a11b1fa56a chore: cleanup validator creator method 2024-04-08 14:30:07 -04:00
rvcas
9322020a5e feat(blueprint): re-export Error 2024-04-08 14:30:07 -04:00
microproofs
a6003c3be9 chore: push changes in blueprint snapshot test 2024-03-27 15:57:29 -04:00
microproofs
61936cb91e fix(codegen): Add tracing when checking for a constr vs another primitive 2024-03-17 16:25:17 -04:00
KtorZ
0343aeca34 Fix remaining insta snapshots. 2024-03-14 11:06:53 +01:00
rvcas
7af4ef53ab feat: block expects on opaque types 2024-03-13 20:17:54 -04:00
KtorZ
a578728a94 Resolve type aliases based on inferred types.
Before this commit, we would always show the 'declared form' of type aliases, with their generic, non-instantiated parameters. This now tries to unify the annotation with the underlying inferred type to provide even better alias pretty printing.
2024-03-08 16:01:21 +01:00
KtorZ
ed9f5c6ef7 Preserve TypeAlias in types for better context/feedback. 2024-03-08 15:59:33 +01:00
microproofs
eb07365e73 fix tests 2024-03-08 00:12:44 -05:00
microproofs
275db2fd11 update tests 2024-03-08 00:12:44 -05:00
microproofs
a3fbe6c155 fix tests 2024-03-06 23:27:10 -05:00
microproofs
d971d9818b update tests and ensure identity reducer handles no_inline lambda 2024-03-04 10:52:56 -05:00
microproofs
4e0aaf970f update tests and fix final unique issues 2024-03-04 10:52:56 -05:00
KtorZ
900b73b21a cargo fmt --all 2024-03-03 21:05:43 +01:00
KtorZ
30841fe000 Rework generate_raw to avoid need to intern in prop tests
Also, this commit makes `apply_term` automatically re-intern the
  program since it isn't safe to apply any term onto a UPLC program. In
  particular, terms that introduce new let-bindings (via lambdas) will
  mess with the already generated DeBruijn indices.

  The problem doesn't occur for pure constant terms like Data. So we
  still have a safe and fast version 'apply_data' when needed.
2024-03-03 19:33:27 +01:00
KtorZ
c2dc47fa0b Refactor creation of CodeGenerator and management of known data_types and functions.
This was a mess to say to the least. The mess started when we wanted
  to make all definitions in codegen use immutable maps of references --
  which was and still is a good idea. Yet, the population of the data
  types and functions definitions was done somehow in a separate step,
  in a rather ad-hoc manner.

  This commit changes that to ensure the project's data_types and
  functions are populated while type checking the AST such that we need
  not to redo it after.

  The code for registering the data type definitions and function
  definitions was also duplicated in at least 3 places. It is now a
  method of the TypedModule.

  Note: this change isn't only just cosmetic, it's also necessary for
  the commit that follows which aims at adding tests to the set of
  available function definitions, thus allowing to make property tests
  callable.
2024-03-03 19:33:26 +01:00
KtorZ
84c4ccaf4c Forbid opaque types in the application binary interface.
We cannot enforce internal invariants on opaque types from only structural checks on Data. Thus, it is forbidden to find an opaque type in an outward-facing interface. Instead, users should rely on intermediate representations and lift them into opaque types using constructors and methods provided by the type (e.g. Dict.from_list, Rational.from_int, Rational.new, ...)
2024-03-03 13:55:10 +01:00
rvcas
ac0c73a56a chore: clippy fixes 2024-02-13 20:26:12 -05:00
microproofs
6e2f9b9eb9 fix tests 2024-02-07 12:48:07 -05:00
microproofs
713b16e25d we now build forwards when it comes to piplines and expressions
so this test got reordered
2024-02-07 12:36:35 -05:00
KtorZ
3c8460e6af Allow annotating Data for blueprint
This commit allows Data to be optionally annotated with a
  phantom-type. This doesn't change anything in codegen but we can now
  leverage this information to generate better blueprint schemas.
2024-02-07 11:48:52 -05:00
rvcas
589bb9a4b3 chore: change how we depend on pallas 2024-01-24 21:26:48 -05:00
microproofs
ae0b428658 update tests to account for new verbose tracing 2024-01-24 16:29:40 -05:00
microproofs
f79b37d551 Replace 'bool' with 'TraceLevel' in codegen
Co-authored-by: KtorZ <matthias.benkort@gmail.com>
2024-01-19 14:30:15 +01:00
KtorZ
0e2b8ae251 Bump pallas dependencies to include flat bigint patch
Fixes #796.
2024-01-18 18:26:21 +01:00
microproofs
4a8fecb70a fix: satisfy clippy's demands 2024-01-11 14:53:02 -05:00
microproofs
394cac86b8 feat: expect on a type now can take in a msg when in trace mode 2024-01-04 16:03:51 -05:00
microproofs
71cfb6f6af feat: Add specific messages for using expect with booleans
TODO: fill out the rest of the expects with messages
2024-01-04 16:03:51 -05:00
microproofs
7d319077e6 chore: clean up validator comments and
commit script context test lockfile
2023-11-06 15:49:13 -05:00
microproofs
2f694b01cb chore: use insta snapshot for blueprint validator tests 2023-11-06 15:37:04 -05:00
microproofs
a86f08c6d1 update tests for new trace reduction 2023-10-07 19:42:24 -04:00
KtorZ
524d0dadf5 Add compiler's version to blueprint. 2023-10-06 14:17:55 +02:00
microproofs
8a1c824dd7 chore: add specific error for when the validator returns false 2023-10-04 11:08:22 -04:00
microproofs
83f0dd2cbe chore: fix blueprint validator tests 2023-09-29 17:47:39 -04:00
microproofs
47596f0324 feat: Remove tuple_index and record_access in favor of faster more direct functions for
accessing an item in a tuple or a field in a record
2023-09-28 01:05:05 -04:00
microproofs
1bcc9e8524 fix: expect on tuples from data now checks for no more items after the last 2023-09-26 12:49:50 -04:00
rvcas
7b915b7dcf chore: allow clippy::arc_with_non_send_sync in tests 2023-09-13 19:07:45 -04:00