Skip to content

Commit

Permalink
adjust benchmark file
Browse files Browse the repository at this point in the history
  • Loading branch information
a committed May 9, 2024
1 parent c1c638b commit bceb445
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions benchmark/benchmarks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function simplify(ex, theory, params = SaturationParams(), postprocess = identit
end


include(joinpath(dirname(pathof(Metatheory)), "../examples/prove.jl"))
include(joinpath(dirname(pathof(Metatheory)), "../examples/basic_maths_theory.jl"))
include(joinpath(dirname(pathof(Metatheory)), "../examples/propositional_logic_theory.jl"))
include(joinpath(dirname(pathof(Metatheory)), "../examples/calculational_logic_theory.jl"))
Expand All @@ -38,9 +39,18 @@ SUITE["egraph"]["addexpr"] = @benchmarkable EGraph($(nested_expr(2000)))
SUITE["basic_maths"] = BenchmarkGroup(["egraphs"])


ex_math = :(a + b + (0 * c) + d)
SUITE["basic_maths"]["simpl1"] =
@benchmarkable (@assert :(a + b + d) == simplify($ex_math, $maths_theory, $(SaturationParams(;timer=false)), postprocess_maths))
simpl1_math = :(a + b + (0 * c) + d)
SUITE["basic_maths"]["simpl1"] = @benchmarkable (@assert :(a + b + d) == simplify(
$simpl1_math,
$maths_theory,
$(SaturationParams(; timer = false)),
postprocess_maths,
))

simpl2_math = :(0 + (1 * foo) * 0 + (a * 0) + a)
SUITE["basic_maths"]["simpl2"] =
@benchmarkable (@assert :a == simplify($simpl2_math, $maths_theory, $(SaturationParams()), postprocess_maths))


# ==================================================================

Expand All @@ -63,8 +73,7 @@ SUITE["prop_logic"]["freges_theorem"] = @benchmarkable (@assert prove($propositi
SUITE["calc_logic"] = BenchmarkGroup(["egraph", "logic"])

SUITE["calc_logic"]["demorgan"] = @benchmarkable (@assert prove($calculational_logic_theory, $ex_demorgan))
# SUITE["calc_logic"]["freges_theorem"] =
# @benchmarkable (@assert prove($calculational_logic_theory, $ex_frege, 1, 10, 10000))
SUITE["calc_logic"]["freges_theorem"] = @benchmarkable (@assert prove($calculational_logic_theory, $ex_frege, 2, 10))

# ==================================================================

Expand Down

0 comments on commit bceb445

Please sign in to comment.