Datasets:
Formats:
json
Languages:
English
Size:
< 1K
Tags:
recursive-self-improvement
program-synthesis
term-rewriting
automated-reasoning
formal-methods
benchmark
Download research/deployment.py from PureOne/Nhais-DQ-Recursive-Search-Contraction: direct link, hf CLI and curl.
- Browser
- Download file 1.46 kB
-
https://huggingface.co/datasets/PureOne/Nhais-DQ-Recursive-Search-Contraction/resolve/main/research/deployment.py
- Command line
-
hf download hf://datasets/PureOne/Nhais-DQ-Recursive-Search-Contraction/research/deployment.py
-
curl -L -o deployment.py https://huggingface.co/datasets/PureOne/Nhais-DQ-Recursive-Search-Contraction/resolve/main/research/deployment.py
1.46 kB
| #!/usr/bin/env python3 | |
| """Supplement: reuse the installed generator rather than rebuild it per query. | |
| This deployment regime was specified AFTER the primary experiment. New seeds | |
| are used for its assessment. It does not replace or conceal the cold-start result. | |
| """ | |
| from collections import deque | |
| from engine import Guard | |
| import time | |
| def search_installed(generators, guard: Guard | None, expansions=6000, wall_budget=None): | |
| start=time.perf_counter();ident=tuple(range(len(generators[0]))) | |
| best={ident:()};products=0;popped=0 | |
| if guard is None: | |
| todo=deque([(ident,())]) | |
| while todo and popped<expansions: | |
| if wall_budget is not None and time.perf_counter()-start>=wall_budget:break | |
| sig,w=todo.popleft();popped+=1 | |
| for a,g in enumerate(generators): | |
| value=tuple(g[x] for x in sig);products+=1 | |
| if value not in best: | |
| child=w+(a,);best[value]=child;todo.append((value,child)) | |
| else: | |
| todo=deque([(ident,(),0)]) | |
| while todo and popped<expansions: | |
| if wall_budget is not None and time.perf_counter()-start>=wall_budget:break | |
| sig,w,state=todo.popleft();popped+=1 | |
| for a,g in enumerate(generators): | |
| ns=guard.next[state][a] | |
| if guard.bad[ns]:continue | |
| value=tuple(g[x] for x in sig);products+=1 | |
| if value not in best: | |
| child=w+(a,);best[value]=child;todo.append((value,child,ns)) | |
| return {'known_semantics':len(best),'products':products,'popped':popped, | |
| 'wall_seconds':time.perf_counter()-start,'best':best} | |