Download benchmarks/Algorithms/majority_element/lean/spec_lib.lean from PV-SJTU/PV-Bench: direct link, hf CLI and curl.
- Browser
- Download file 352 Bytes
-
https://huggingface.co/datasets/PV-SJTU/PV-Bench/resolve/main/benchmarks/Algorithms/majority_element/lean/spec_lib.lean
- Command line
-
hf download hf://datasets/PV-SJTU/PV-Bench/benchmarks/Algorithms/majority_element/lean/spec_lib.lean
-
curl -L -o spec_lib.lean https://huggingface.co/datasets/PV-SJTU/PV-Bench/resolve/main/benchmarks/Algorithms/majority_element/lean/spec_lib.lean
352 Bytes
| import AUXLib.Arithmetic | |
| import SimpleC.SL.SeparationLogic | |
| namespace Algorithms.majority_element.lean | |
| open AUXLib | |
| def count (m : Int) : List Int → Int | |
| | [] => 0 | |
| | x :: xs => (if x = m then 1 else 0) + count m xs | |
| def IsMajorityElement (m : Int) (l : List Int) : Prop := | |
| 2 * count m l > (l.length : Int) | |
| end Algorithms.majority_element.lean | |