Download benchmarks/Engineering/string/strlen/rocq/solution_spec.c from PV-SJTU/PV-Bench: direct link, hf CLI and curl.
- Browser
- Download file 281 Bytes
-
https://huggingface.co/datasets/PV-SJTU/PV-Bench/resolve/main/benchmarks/Engineering/string/strlen/rocq/solution_spec.c
- Command line
-
hf download hf://datasets/PV-SJTU/PV-Bench/benchmarks/Engineering/string/strlen/rocq/solution_spec.c
-
curl -L -o solution_spec.c https://huggingface.co/datasets/PV-SJTU/PV-Bench/resolve/main/benchmarks/Engineering/string/strlen/rocq/solution_spec.c
281 Bytes
| int strlen(char *s) | |
| /*@ With str | |
| Require valid_string(str) && string_length(str) < INT_MAX && store_string(s, str) | |
| Ensure __return == string_length(str) && store_string(s, str) | |
| */ | |
| { | |
| int i = 0; | |
| while (s[i] != 0) { | |
| i++; | |
| } | |
| return i; | |
| } | |