This PR sets up the new integrated test/bench suite. It then migrates all benchmarks and some related tests to the new suite. There's also some documentation and some linting. For now, a lot of the old tests are left alone so this PR doesn't become even larger than it already is. Eventually, all tests should be migrated to the new suite though so there isn't a confusing mix of two systems.
31 lines
695 B
Text
31 lines
695 B
Text
inductive AltCore (α : Type)
|
||
| default (val : α)
|
||
| alt (name : String) (val : α)
|
||
|
||
inductive Code where
|
||
| cases (alt: AltCore Code)
|
||
| return (id : Nat)
|
||
|
||
abbrev Alt := AltCore Code
|
||
|
||
def AltCore.getCode : Alt → Code
|
||
| .default c => c
|
||
| .alt _ c => c
|
||
|
||
def AltCore.update (alt : Alt) (c : Code) : Alt :=
|
||
match alt with
|
||
| .default _ => if true then alt else .default c
|
||
| .alt n _ => if true then alt else .alt n c
|
||
|
||
example (alt : Alt) : Code :=
|
||
alt.getCode
|
||
|
||
def Alt.getCode' : Alt → Code
|
||
| .default c => c
|
||
| .alt _ c => c
|
||
|
||
example (alt : Alt) : Code :=
|
||
if true then .return 1 else alt.getCode'
|
||
|
||
example (alt : Alt) : Code :=
|
||
if true then alt.getCode' else .return 0
|