Skip to content

Commit

Permalink
Revert "Start working on using a decision tree for when expr. Also fm…
Browse files Browse the repository at this point in the history
…t fix"

This reverts commit e8f7498.
  • Loading branch information
MicroProofs committed Oct 8, 2024
1 parent e8f7498 commit 5d4b3e6
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 330 deletions.
12 changes: 8 additions & 4 deletions benchmarks/lib/benchmarks/clausify/benchmark.ak
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ fn split(formula: Formula) -> List<Formula> {
fn do_split(f: Formula, fs: List<Formula>) -> List<Formula> {
when f is {
Con(p, q) -> do_split(p, do_split(q, fs))
_ -> [f, ..fs]
_ ->
[f, ..fs]
}
}

Expand Down Expand Up @@ -260,11 +261,14 @@ fn tautclause(var: LRVars) -> Bool {
/// insertion of an item into an ordered list
fn insert_ordered(es: List<a>, e: a, compare: fn(a, a) -> Ordering) -> List<a> {
when es is {
[] -> [e]
[] ->
[e]
[head, ..tail] ->
when compare(e, head) is {
Less -> [e, ..es]
Greater -> [head, ..insert_ordered(tail, e, compare)]
Less ->
[e, ..es]
Greater ->
[head, ..insert_ordered(tail, e, compare)]
Equal -> es
}
}
Expand Down
3 changes: 2 additions & 1 deletion benchmarks/lib/benchmarks/knights/heuristic.ak
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ pub fn descendants(board: ChessSet) -> List<ChessSet> {
|> quicksort(compare_chess_set)
|> list.map(fn(t) { t.2nd })
[_] -> singles
_ -> []
_ ->
[]
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion benchmarks/lib/benchmarks/knights/sort.ak
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ use aiken/collection/list

pub fn quicksort(xs: List<a>, compare: fn(a, a) -> Ordering) -> List<a> {
when xs is {
[] -> []
[] ->
[]
[head, ..tail] -> {
let before =
tail
Expand Down
1 change: 0 additions & 1 deletion crates/aiken-lang/src/gen_uplc.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
pub mod air;
pub mod builder;
pub mod decision_tree;
pub mod interner;
pub mod tree;

Expand Down
321 changes: 0 additions & 321 deletions crates/aiken-lang/src/gen_uplc/decision_tree.rs

This file was deleted.

6 changes: 4 additions & 2 deletions examples/gift_card/validators/multi.ak
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ validator redeem(creator: ByteArray) {

fn insert(self: List<a>, e: a, compare: fn(a, a) -> Ordering) -> List<a> {
when self is {
[] -> [e]
[] ->
[e]
[x, ..xs] ->
if compare(e, x) == Less {
[e, ..self]
Expand Down Expand Up @@ -152,7 +153,8 @@ fn create_expected_minted_nfts(
} else {
let token_name = blake2b_256(bytearray.push(base, counter))

let accum = [token_name, ..accum]
let accum =
[token_name, ..accum]

create_expected_minted_nfts(base, counter - 1, accum)
}
Expand Down

0 comments on commit 5d4b3e6

Please sign in to comment.