KtorZ
5ce30b2632
Rename AList -> Pairs due to popular demand.
2024-05-23 16:45:40 +02:00
rvcas
c3ad52b50f
feat: add compiler version to aiken.toml
2024-05-22 15:35:57 -04:00
rvcas
c1a913f420
fix(config): add default for plutus version
2024-05-22 13:59:56 -04:00
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
f306f1715a
feat: use plutus version in address command
...
relates to #907
2024-05-21 17:04:25 -04:00
rvcas
3bc3792aa3
feat: add plutus version to aiken.toml
...
relates to #907
2024-05-21 17:02:20 -04:00
microproofs
c1c2cd97b7
New test 103 and clippy fixes
2024-05-21 11:56:12 -04:00
KtorZ
1ed4fa1c69
Show warning when ignoring modules + restyle warnings slightly
...
Fixes #916 .
2024-05-14 13:27:19 +02:00
KtorZ
c5de9adcd3
Add some log output / feedback to completion --install
2024-05-10 17:31:48 +02:00
rvcas
f8ce46d0f4
chore(ci): run cargo dist init
2024-05-08 11:05:30 -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
microproofs
68f1dcc65d
Add comment as a reminder to future me
2024-05-06 11:48:10 -04:00
microproofs
2f61f59b60
Closes #909
2024-05-06 11:35:05 -04:00
microproofs
a44ed4c1a8
Change prelude Map to AList
2024-05-04 14:04:12 -04:00
KtorZ
03a5a9293c
Replace snapshot test for export recursive function
...
This test contains a pattern match on a 2-tuple, which induced a
slight code change in UPLC as expected.
2024-05-04 14:04:12 -04:00
KtorZ
7cb548a749
Fix ordinal index on pairs
2024-05-04 14:04:12 -04:00
KtorZ
2cb2c7fa1f
Add dedicated 'Pair' typed and untyped expression
...
Before this commit, we would parse 'Pair' as a user-defined
data-types, and thus piggybacking on that whole record system. While
perhaps handy for some things, it's also semantically wrong and
induces a lot more complexity in codegen which now needs to
systematically distinguish every data-type access between pairs, and
others.
So it's better to have it as a separate expression, and handle it
similar to tuples (since it's fundamentally a 2-tuple with a special
serialization).
2024-05-04 14:04:12 -04:00
KtorZ
390bccd406
Fix blueprint validator test snapshot.
2024-05-04 14:04:12 -04:00
microproofs
ebe415cfc9
fix errors
2024-05-04 14:04:12 -04:00
microproofs
d7574e738f
fix: remaining cargo tests
2024-05-04 14:04:12 -04:00
microproofs
999e408a28
fix some more tests
2024-05-04 14:04:12 -04:00
microproofs
cb1ca84dad
fixing more tests
2024-05-04 14:04:12 -04:00
microproofs
75b076552c
feat: Do a major overhaul on how we check types to allow for match patterns instead of if statements
...
Also fix one more test
2024-05-04 14:04:12 -04:00
microproofs
3c332ca42a
Few more places in codegen where we need to be able to deal with Pair records
2024-05-04 14:04:12 -04:00
microproofs
26f68c2fb4
fix: found various unify and type issues while running 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
Micah Kendall
d25b8f91c7
feat: Emit keyword
2024-04-12 21:40:27 -04:00
rvcas
17ddbfaafa
chore: remove dbg
2024-04-08 14:30:07 -04:00
rvcas
5fc338a1eb
test: add some snapshot tests for export type
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
aa3896e92a
feat(export): allow trace levels to be controlled
2024-04-08 14:30:07 -04:00
rvcas
dac3308620
feat(Project::export): use Export::from_function and transpose
...
Co-authored-by: Kasey White <kwhitemsg@gmail.com>
2024-04-08 14:30:07 -04:00
rvcas
8ed930ac5a
feat: implement Export object based on blueprint
...
Co-authored-by: Kasey White <kwhitemsg@gmail.com>
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
rvcas
f50f7e42db
feat(project): create export type
...
Co-authored-by: Kasey White <kwhitemsg@gmail.com>
2024-04-08 14:30:07 -04:00
rvcas
1d462314c4
feat: use new generate_raw function
2024-04-08 14:30:07 -04:00
rvcas
7d67f1497c
feat(export): implement basic command functionality
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
rvcas
075668b52e
chore: Release
2024-03-25 22:09:37 -04:00
KtorZ
4e8042fd06
chore: Release
2024-03-22 16:10:17 +01:00
microproofs
8495f98c1d
remove print
2024-03-17 16:26:10 -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
d1ba8db889
Do not generate documentation for empty modules.
2024-03-15 21:40:57 +01:00
KtorZ
6515efeb73
Implementing remaining shrinking strategies.
...
This makes the search for counterexample slower in some cases by 30-40% with the hope of finding better counterexamples. We might want to add a flag '--simplification-level' to the command-line to let users decide on the level of simplifications.
2024-03-15 13:36:05 +01:00
Matthias Benkort
b09e0316fa
Merge pull request #877 from aiken-lang/dependencies-pruning
...
Only compile modules the project depends on
2024-03-15 00:25:00 +01:00
KtorZ
9986bc6bfd
Remove duplication between docs & compile
...
And move some logic out of project/lib to be near the CheckedModule
instead. The project API is already quite heavy and long, so making it
more lightweight is generally what we want to tend to.
2024-03-15 00:05:39 +01:00
KtorZ
1caed3e87c
Use BTreeSet instead of HashSet whenever possible.
2024-03-14 23:08:39 +01:00
Matthias Benkort
3f254dbe6b
Merge pull request #875 from aiken-lang/rvcas/expect_opaque
...
block expects on opaque types
2024-03-14 19:43:47 +01:00
KtorZ
fd50473a32
Only compile modules the project depends on
...
This changes ensure that we only compile modules from dependencies
that are used (or transitively used) in the project. This allows to
discard entire compilation steps at a module level, for modules that
we do not use.
The main goal of this change isn't performances. It's about making
dependencies management slightly easier in the time we decide whether
and how we want to manage transitive dependencies in Aiken.
A concrete case here is aiken-lang/stdlib, which will soon depend on
aiken-lang/fuzz. However, we do not want to require every single
project depending on stdlib to also require fuzz. So instead, we want
to seggregate fuzz API from stdlib in separate module, and only
compile those if they appear in the pruned dependency graph.
While the goal isn't performances, here are some benchmarks analyzing
the performances of deps pruning on a simple project depends on a few
modules from stdlib:
Benchmark 1: ./aiken-without-deps-pruning check scratchpad
Time (mean ± σ): 190.3 ms ± 101.1 ms [User: 584.5 ms, System: 14.2 ms]
Range (min … max): 153.0 ms … 477.7 ms 10 runs
Benchmark 2: ./aiken-with-deps-pruning check scratchpad
Time (mean ± σ): 162.3 ms ± 46.3 ms [User: 572.6 ms, System: 14.0 ms]
Range (min … max): 142.8 ms … 293.7 ms 10 runs
As we can see, this change seems to have an overall positive impact on
the compilation time.
2024-03-14 19:41:50 +01:00
KtorZ
038c5b2d34
Rewrite run_n_times to not be recursive but mutates arguments.
...
We reach a stack-overflow for n > 2000 otherwise. Mutation works well here and is a valid use-case.
2024-03-14 14:18:38 +01: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
4fbb4fe2db
Handle fuzzer failing unexpected
...
We shouldn't panic here but bubble the error up to the user to inform
them about a possibly ill-formed fuzzer.
Fixes #864 .
2024-03-11 01:04:46 +01:00
KtorZ
0e0bed3c9d
Collect traces from last prop-test run on failure
2024-03-10 19:24:25 +01:00
KtorZ
d4069148c7
Remove UnitTestResult's output field
...
Dead-code. Also renamed 'logs' to 'traces'.
2024-03-10 19:00:01 +01:00
KtorZ
be7d07fa99
Always show test traces (unless manually turned off with flag)
...
On both failures and success.
2024-03-10 18:53:11 +01:00
KtorZ
80a9393db7
Add --include-dependencies to 'aiken docs'
...
Fixes #867 .
2024-03-09 22:35:38 +01:00
KtorZ
6ba74125c7
Remove extra newlines in test report and only print coverage on success.
2024-03-09 20:32:42 +01:00
KtorZ
22b86a5f82
Add --max-success for running more or less prop runs on demand.
2024-03-09 19:17:57 +01:00
Matthias Benkort
7f0df40b4e
Merge pull request #862 from SundaeSwap-finance/pi/summary-check-count
...
Include the number of tests / checks run as part of the summary
2024-03-09 13:10:16 +01:00
Pi Lanningham
ebd6c3a56e
Cargo fmt
2024-03-08 20:43:27 -05:00
Pi Lanningham
ace58e368c
Correctly report the checks count
...
It might be slightly cleaner and more extensible to change to return a summary, potentially even making track the tests, coverage, etc. so it can be serialized to JSON. But, for now, this is much simpler, and the approach that KtorZ suggested.
2024-03-08 20:40:50 -05:00
KtorZ
77faee672e
cargo fmt --all
2024-03-09 01:28:48 +01:00
KtorZ
bbe7c0bc01
report prop test coverage labels on success.
2024-03-09 01:28:29 +01:00
KtorZ
96da70149d
Count labels in properties.
...
We'll piggyback on the tracing capabilities of the VM to provide labelling for prop tests. To ensure we do not interfere with normal traces, we only count traces that starts with a NUL byte as label. That convention is assumed to be known of the companion fuzz library that should then provide the labelling capabilities as a dedicated function.
2024-03-09 01:28:29 +01:00
rvcas
cb0ae0c074
feat: impl some conversion methods on CheckedModule
2024-03-08 19:19:07 -05:00
rvcas
2b5ed95df5
feat: serialize as cbor
2024-03-08 19:19:07 -05:00
rvcas
fe6710935d
feat: impl serde on errythang
2024-03-08 19:19:07 -05:00
Pi Lanningham
e944f10372
Add an optional check count; when we run a command that runs tests, we can set this to Some(x) and it'll print in the summary
2024-03-08 17:36:32 -05:00
KtorZ
a9d596f4cb
Memoize simplification steps during property-based shrinking.
...
I've been benchmarking that through the shrink of 'large' lists, and the cache brings about 1.5x speed increase. For small and simple cases, the cache as no visible effects (positive or negative).
2024-03-08 18:58:51 +01: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
rvcas
fab6d5aff7
chore: fix fmt
2024-03-07 19:32:33 -05:00
KtorZ
8e558d893f
Only reify unit tests assertions on failure.
2024-03-07 19:07:55 +01:00
KtorZ
0d599f7e2d
re-add missing newline after test blocks.
2024-03-07 18:28:21 +01:00
KtorZ
23a22a65cb
Handle (recursive) generic types during reification.
...
Also moved a bunch of functions from code-gen back into _tipo_, as
they're better suited and generic enough to be reused elsewhere.
2024-03-07 18:07:52 +01:00
microproofs
a3fbe6c155
fix tests
2024-03-06 23:27:10 -05:00
microproofs
bdd84dc952
fixing the tests lead to me create a new function for converting from data
2024-03-06 23:27:10 -05:00
KtorZ
0f926d3c31
Fix code-gen tests due to associativity change.
2024-03-07 01:28:51 +01:00
KtorZ
bff822ea7f
Rework unit test report to leverage new reification
...
And also provide slightly better errors when traces, or trace-if-false operators are present.
2024-03-07 01:20:40 +01:00
KtorZ
59996850c1
Implement 'reify_constant' and rename reify to 'reify_data'
...
Both fullfill similar goal, but reify_constant sits one level above.
2024-03-07 01:17:06 +01:00
rvcas
c9ab1aec98
chore: consume errs instead of cloning
2024-03-06 18:20:14 -05:00
rvcas
f8377af0c8
feat(parse): run in parallel
2024-03-06 18:16:07 -05:00
rvcas
9c5556aa1e
feat(deps): remove tests from ast and ignore warnings
2024-03-06 18:16:07 -05:00
microproofs
b146db8c95
update package dependency
2024-03-05 10:23:29 -05:00
KtorZ
966a20f691
Fix run_n_times for properties expected to fail.
2024-03-04 23:41:37 +01:00
KtorZ
4d432513e0
Fix interesting case identification for properties expected to fail.
2024-03-04 23:28:45 +01:00
KtorZ
fbeb611e5f
Show counter examples in green when property is expected to fail.
2024-03-04 20:41:04 +01:00
KtorZ
df3baa082e
Remove 'seed' arg from 'with_project' to FinishedTests event
...
Also polish a bit the output of tests, move test result to stdout to allow filtering out warnings by redirecting stderr to /dev/null.
2024-03-04 18:43:51 +01: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
8e8e0de044
cargo fmt --all
2024-03-04 14:46:16 +01:00