Download benchmarks/Algorithms/integer_divide/rocq/spec_lib.v from PV-SJTU/PV-Bench: direct link, hf CLI and curl.
- Browser
- Download file 854 Bytes
-
https://huggingface.co/datasets/PV-SJTU/PV-Bench/resolve/main/benchmarks/Algorithms/integer_divide/rocq/spec_lib.v
- Command line
-
hf download hf://datasets/PV-SJTU/PV-Bench/benchmarks/Algorithms/integer_divide/rocq/spec_lib.v
-
curl -L -o spec_lib.v https://huggingface.co/datasets/PV-SJTU/PV-Bench/resolve/main/benchmarks/Algorithms/integer_divide/rocq/spec_lib.v
854 Bytes
| From Coq Require Import ZArith List Znumtheory Sorting.Sorted. | |
| Import ListNotations. | |
| Local Open Scope Z_scope. | |
| From Coq Require Import Lia. | |
| (** [PrimeFactorization original factors] is the public mathematical meaning of | |
| the initialized output segment. Membership is deliberately bidirectional: | |
| the segment contains no non-prime/non-divisor and omits no prime divisor of | |
| [original]. [Sorted Z.le] records the program's increasing trial-divisor | |
| order, while the product equation fixes multiplicities to the actual prime | |
| factorization rather than merely listing each distinct divisor once. *) | |
| Definition PrimeFactorization (original : Z) (factors : list Z) : Prop := | |
| Forall prime factors /\ | |
| Sorted Z.le factors /\ | |
| fold_right Z.mul 1 factors = original /\ | |
| (forall q : Z, | |
| In q factors <-> prime q /\ Z.divide q original). | |