Commit Graph

325 Commits

Author SHA1 Message Date
KtorZ
bfcfc5c41b Implement reification from Maps. 2024-03-03 19:33:25 +01:00
KtorZ
14f1025f0b Display counterexamples as Aiken values instead of raw UPLC. 2024-03-03 19:33:24 +01:00
KtorZ
c766f44601 Allow Fuzzer with type parameter
Also fix shrinker first reduction, as well as passing of List/Tuples to fuzzer.
2024-03-03 19:33:24 +01:00
KtorZ
a703db4d14 Borrow integrated shrinking approach from MiniThesis. 2024-03-03 19:33:24 +01:00
KtorZ
3762473a60 Add preliminary plumbing to run property test through the CLI.
This is very very rough at the moment. But it does a couple of thing:

  1. The 'ArgVia' now contains an Expr/TypedExpr which should unify to a Fuzzer. This is to avoid having to introduce custom logic to handle fuzzer referencing. So this now accepts function call, field access etc.. so long as they unify to the right thing.

  2. I've done quite a lot of cleanup in aiken-project mostly around the tests and the naming surrounding them. What we used to call 'Script' is now called 'Test' and is an enum between UnitTest (ex-Script) and PropertyTest. I've moved some boilerplate and relevant function under those module Impl.

  3. I've completed the end-to-end pipeline of:
     - Compiling the property test
     - Compiling the fuzzer
     - Generating an initial seed
     - Running property tests sequentially, threading the seed through each step.

   An interesting finding is that, I had to wrap the prop test in a similar wrapper that we use for validator, to ensure we convert primitive types wrapped in Data back to UPLC terms. This is necessary because the fuzzer return a ProtoPair (and soon an Array) which holds 'Data'.

  At the moment, we do nothing with the size, though the size should ideally grow after each iteration (up to a certain cap).

  In addition, there are a couple of todo/fixme that I left in the code as reminders of what's left to do beyond the obvious (error and success reporting, testing, etc..)
2024-03-03 19:33:24 +01:00
KtorZ
aadf3cfb48 Allow test definition to carry one parameter
The parameter is special as it takes no annotation but a 'via' keyword followed by an expression that should unify to a Fuzzer<a>, where Fuzzer<a> = fn(Seed) -> (Seed, a). The current commit only allow name identifiers for now. Ultimately, this may allow full expressions.
2024-03-03 19:33:24 +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
d698f76e3c fix(codegen): builtin calls for g1 and g2 where flipped
closes #840
2024-02-29 12:13:51 -05:00
rvcas
d18caaeecb feat(cli): support mainnet address output
closes #832
2024-02-27 21:55:18 -05: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
microproofs
6b97ab71fe fix up code gen tests 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
microproofs
0e2995e16e fix test 2024-02-07 11:48:52 -05:00
microproofs
982eff449e chore: Release 2024-01-31 13:48:20 -05:00
rvcas
3a7a0c1971 chore: remove unused deps 2024-01-30 12:28:18 -05:00
microproofs
8584adc1b7 chore: Release 2024-01-25 15:10:11 -05:00
rvcas
defd36ad8c chore: Release 2024-01-25 11:07:32 -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
00e1942999 another test fix 2024-01-24 16:29:40 -05:00
microproofs
dc61e11813 fix test 2024-01-24 16:29:40 -05:00
microproofs
3c81ebf137 updating more of the tests 2024-01-24 16:29:40 -05:00
microproofs
e523ae63f3 fixed some of the tests 2024-01-24 16:29:40 -05:00
KtorZ
8a90e9eda0 Improve behavior and reporting of tests expected to fail
Fixes #786.
2024-01-19 18:20:58 +01:00
KtorZ
42fdecf41f Fix coloring output of multi-line traces. 2024-01-19 14:30:44 +01:00
KtorZ
59c784778e Convert span's start to line number + col
This requires to make line numbers a first-class citizen in the module
  hierarchy but it is fortunately not _too involved_.
2024-01-19 14:30:15 +01:00
KtorZ
e67d5863a1 Introduce 'compact' trace level verbosity
For now, it only shows the span start. We'll change that in the next commit to show a line number and a column.
2024-01-19 14:30:15 +01: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
d27ea98a8f Rework tracing arguments to --keep-traces & --trace-level
This allows for a more fine-grained control over how the traces are showed. Now users can instrument the compiler to preserve only their user-defined traces, or the only the compiler, or all, or none. We also want to add another trace level on top of that: 'compact' to only show line numbers; which will work for both user-defined and/or compiler-generated traces.
2024-01-19 14:30:15 +01:00
microproofs
86146ae7f4 adding codegen traces 2024-01-19 14:30:14 +01:00
Matthias Benkort
81e29539c8 Merge pull request #803 from aiken-lang/780-possible-bug-with-test-github-action-version-generated-by-aiken-new
fix: aiken new github action version
2024-01-19 14:27:38 +01:00
KtorZ
0e2b8ae251 Bump pallas dependencies to include flat bigint patch
Fixes #796.
2024-01-18 18:26:21 +01:00
microproofs
1796147264 fix: aiken new github action version 2024-01-18 12:10:06 -05:00
microproofs
06672fce05 add new test 2024-01-13 19:29:34 -05: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
4fc65cc600 feat: change expect from data on constrs to take in a message term 2024-01-04 16:03:51 -05:00
microproofs
43e84d7af7 fixing gen_uplc tets 2024-01-04 16:03:51 -05:00
microproofs
412945af3a update aiken code gen test 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
rvcas
2647e4aae6 chore: Release 2023-12-04 22:14:03 -05:00
rvcas
b17b7f287c chore: update to pallas v0.20.0 2023-12-04 21:44:19 -05:00
KtorZ
7645a9460f Display error codes better.
This is a *slight* hack / abuse of the code() method as we are now
  doing a bit of formatting within that function. Yet, we only do so at
  the very top-level (i.e. project's Error) because we can't actually
  fiddle with how miette presents errors.
2023-11-25 15:14:09 +01:00
KtorZ
6c039708c3 Rework 'watch_project' to reuse 'with_project'
Also removed the 'clear' flag to do it by default instead of clogging
  the terminal view.

  This now works pretty nicely, and the logic is back under
  `aiken_project`.
2023-11-25 14:48:22 +01:00
KtorZ
1ca81ec133 Turn evaluation hints into strings earlier, to make project's Error thread-safe. 2023-11-24 09:44:05 +01:00
Pi Lanningham
4bb424ba78 Fix a small bug with the filtering 2023-11-24 08:37:54 +01:00
Pi Lanningham
5945a9515b Disable the doctest, since I don't have an impl of EventListener I can use 2023-11-24 08:37:54 +01:00
Pi Lanningham
5068da3a17 Refactor into cargo-project
Rather than have this logic in the aiken binary, this provides a generic
mechanism to do "something" on file change events.  KtorZ is going to
handle wiring it up to the CLI in the best way for the project.

I tried to write some tests for this, but it's hard to isolate the
watcher logic without wrestling with the borrow checker, or overly
neutering this utility.
2023-11-24 08:37:54 +01:00