Revert "Start working on using a decision tree for when expr. Also fmt fix"

This reverts commit e8f74985d5.
This commit is contained in:
microproofs
2024-10-08 13:33:05 -04:00
parent e8f74985d5
commit 5d4b3e69b9
6 changed files with 16 additions and 330 deletions

View File

@@ -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]
}
}
@@ -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
}
}

View File

@@ -63,7 +63,8 @@ pub fn descendants(board: ChessSet) -> List<ChessSet> {
|> quicksort(compare_chess_set)
|> list.map(fn(t) { t.2nd })
[_] -> singles
_ -> []
_ ->
[]
}
}
}

View File

@@ -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