Commit Graph

310 Commits

Author SHA1 Message Date
microproofs
36c80f36c1 fix tests 2023-08-07 12:02:44 -04:00
microproofs
f5c7d222aa optmization fix 2023-08-07 12:02:44 -04:00
microproofs
960a15c4ec checkpoint - fixing tests and stuff 2023-08-07 12:02:44 -04:00
microproofs
6eeb282dee Now code gen is finished and we just have testing 2023-08-07 12:02:44 -04:00
rvcas
be7a441205 fix(uplc): pair type formatting closes #680 2023-07-19 13:49:05 -04:00
Pi Lanningham
189150612c cargo fmt :| 2023-07-09 23:16:01 -04:00
Pi Lanningham
26a4c57805 Clippy cleanup 2023-07-09 23:16:01 -04:00
Pi Lanningham
c4690c6e00 Data parsing, tests 2023-07-09 23:16:01 -04:00
Pi Lanningham
6d9a95ef2d Add all but data parsing
Updates the parsing to the standard, *except* for Data, since that'll be more involved
2023-07-09 23:16:01 -04:00
Pi Lanningham
a48c45b737 Formatting 2023-07-09 23:16:01 -04:00
Pi Lanningham
ecff82659d Tweak pretty-printing
This pretty printing now (mostly) matches https://github.com/input-output-hk/plutus/issues/4751#issuecomment-1538377273; the only concern is whether the PlutusData stuff should be upstreamed to pallas, and whether pallas has a way to print BigInts easier
2023-07-09 23:16:01 -04:00
KtorZ
2a747305f7 Fixes evaluation of large positive bigint in the UPLC machine
Fixes #511.
2023-07-05 18:52:14 +02:00
rvcas
8a7df7f66b test: add empty list test 2023-07-04 17:19:29 -04:00
microproofs
42544af799 fix: safe encode bits to check for 2^num_bits <= byte we are encoding
fix: I thought namedDeBruijn takes advantage of Binder for encoding and decoding.
It does not...
fix: Debruijn was being converted to NamedDeBruijn incorrectly
2023-06-30 23:06:38 -04:00
microproofs
93135cebbb fix: redeemers in the script context are sorted by redeemer ptr not data hash 2023-06-16 12:24:44 -04:00
microproofs
a5245fdc6b chore: couple more identity tests in optimize step 2023-06-10 00:01:54 -04:00
rvcas
8d107b1293 fix(build): --uplc must use Program<Name> to pretty print 2023-06-07 16:25:59 -04:00
rvcas
335cc0c8bc feat(cli): rework uplc subcommands
closes #553

* rename flat to encode
* rename unflat to decode
* alias both to their old names
* both only print to stdout
  use can pipe to file
* split cbor and hex flags
* hex flag works for either cbor or flat
* encode takes --to flag
  [name, named-debruijn, debruijn]
* decode takes --from flag
  [name, named-debruijn, debruijn]
2023-06-01 23:50:59 -04:00
Niels Mündler
00ac6b6c56 Fix dumping of builtin pairs 2023-05-25 18:03:24 -04:00
rvcas
a124a16a61 feat(tests): implement a way to express that tests can fail 2023-05-25 16:54:53 -04:00
microproofs
340ed3b6a5 fix: case where identity function was used as a param.
This was causing a free unique. The fix is after stripping applied usage of identity,
we then check if it is passed around and if so we leave in the function declaration.
2023-05-16 16:21:37 -04:00
microproofs
c3eab4cc2a chore: fix up when tuple deconstruction test
add inline test for optimization tests
add some more builder functions
2023-05-11 18:06:46 -04:00
rvcas
1fb31e246c fix: better conditional comp for wasm 2023-05-11 16:59:54 -04:00
microproofs
0c3dc0580a chore: add if_else optimization test 2023-05-09 19:09:24 -04:00
microproofs
6456001cbc fix: the uplc optimization tests were missing intern
add builtin force reduce tests
2023-05-09 18:55:53 -04:00
microproofs
419b946a82 fix: wrap_data_reduce optimization should leave constr data
and unconstr data untouched.
2023-05-09 16:56:50 -04:00
microproofs
b36cf1c029 chore: refactor default functions in uplc_code_gen.
feat: Add an identity optimization to remove functions that return the argument only.
2023-05-08 16:15:09 -04:00
microproofs
d2dbae1cbf fix:
Negative numbers now show up as a constant instead of 0 - that number

Expect on constructors without field maps no longer panics

Expect on constructors with discard as assigned field names now no longer throws free unique
2023-04-30 14:44:54 -04:00
microproofs
0d0c96deda commit validator changes and tests 2023-04-28 17:05:46 -04:00
microproofs
b108c0f610 chore: add optimization test on unwrap data 2023-04-27 12:17:57 -04:00
microproofs
c3184c544c fix: wrap data reduce had the wrong argument called in recursively, thus skipping over cases that should have been reduced
chore: Add unit tests on for uplc optimizations
2023-04-26 17:22:16 -04:00
microproofs
ae68ae9afb fix: wrong var usage on inline_direct_reduce, now it properly looks at applied func not arg 2023-04-25 01:57:04 -04:00
microproofs
016634fc38 fix: inline_direct_reduce now works properly 2023-04-21 16:01:54 -04:00
microproofs
0b7d217bd0 convert acceptance test 8 2023-04-21 16:01:54 -04:00
microproofs
23a7e7e680 chore: convert acceptance test 5
Also constructors with no fields are now converted to a constant data term.
2023-04-19 16:08:55 -04:00
microproofs
9de713803a feat: Add wrap data reduce which helps prevent unnecessary wrap to unwrap and vice versa.
fix: in inline_reduce the wrong arg name was used. arg instead of argument

refactor var occurences
2023-04-19 16:08:55 -04:00
microproofs
7dd13f8d73 feat: add end to end tests to replace acceptance tests with strict uplc comparison.
Add acceptance tests 1,2, 6 as end to end tests
2023-04-19 16:08:55 -04:00
rvcas
e3f2fb5393 fix: need to return deserialization error here 2023-04-17 10:50:40 -04:00
rvcas
ccc450659a chore: switch discharge value back to the recursive form for simplicity 2023-04-13 01:28:27 -04:00
microproofs
564939ab61 feat
* remove more Rc's
* reconstruct Value::Builtin only when needed

Co-authored-by: Lucas Rosa <x@rvcas.dev>
2023-04-13 01:28:27 -04:00
microproofs
09a6ea51d6 feat(machine): reduce term allocations
* remove term from VBuiltin
* and also means we don't need the useless wrapping

Co-authored-by: Lucas Rosa <x@rvcas.dev>
2023-04-13 01:28:27 -04:00
rvcas
70f12d3fc5 chore: new branch with some things from the bumpalo branch 2023-04-13 01:28:27 -04:00
Kasey White
e69a70f49c remove final wrapper and replace with equivalent air elements 2023-04-09 17:43:56 -04:00
Kasey White
f8483da4e0 Code gen now handles expecting on validator args in the air stack.
Thus allowing us to use code gen created functions to expect on data types including recursive ones.
Some minor tweaks to the air.
Added a uplc optimization for later.
2023-04-09 17:43:56 -04:00
Kasey White
a1b3ae52d8 fix: optimization that was being ignored 2023-04-09 17:43:56 -04:00
KtorZ
9033b44044 Implement quick builder on PlutusData.
In the same spirit of the existing Term builder; I also added a `data`
  method to lift a `PlutusData` into a `Term<T>` and generalized a bit
  the builder to only require a `Term<Name>` when necessary and remain
  generic otherwise.

  The `PlutusData` builder could potentially be upstreamed to pallas
  diretly.
2023-04-08 08:57:03 +02:00
rvcas
1444c9328d fix some typos 2023-04-07 16:51:18 -04:00
KtorZ
057102c491 Add function to uplc::parser for string escape
Was originally written as a way to fix a failing property test on the
  program_builder; but the program builder is now gone. This function
  is still useful to have around.
2023-04-05 14:27:20 +02:00
rvcas
298e8068ee chore: remove program_builder 2023-03-30 21:15:27 -04:00
KtorZ
1d3315005c Support some single-character escape sequences in UPLC
Fixes #472.

  This also partially addresses #195. However, as pointed out in one of
  the comment, there's no 'official rule' when it comes to what should
  be considered valid escape sequences. Haskell relies mostly on the
  AttoParsec library and Rust also has its own set of rules.

  This is in particular true for unicode escape sequences, but there is
  a common middleground for some usual single character escapes such as
  \n or \\. So we now at least support these.

  For more complicated escape sequence, please refer to #195 for now and
  keep the discussion going there.
2023-03-30 11:50:59 +02:00