3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-10-10 09:48:05 +00:00

add retry, rename to optibot

This commit is contained in:
Nikolaj Bjorner 2025-02-14 08:39:21 -08:00
parent 6b9ce8638f
commit 0cf2b5f515
2 changed files with 76 additions and 24 deletions

View file

@ -0,0 +1,20 @@
script({
title: "optimize functions in a file",
files: "src/muz/spacer/spacer_qe_project.cpp"
})
import { splitFunctions, invokeLLMOpt, mergeFunctionsFromList, mergeCompileFunction} from "./myai.genai.mts";
const inputFile = env.files[0];
let funs = await splitFunctions(inputFile);
let new_code = inputFile.content;
for (const fun of funs) {
if (fun.code.length < 200) // don't sweat the small stuff
continue;
let answer = await invokeLLMOpt(fun.code);
if (answer)
new_code = await mergeCompileFunction(inputFile, new_code, funs, answer);
}
await workspace.writeText(inputFile.filename + ".opt.cpp", new_code);