@@ -239,9 +239,6 @@ def pyAnalyzeLaurelCommand (mkDischarge : Core.MkDischargeFn := Core.mkDischarge
239239 { name := "pyspec" ,
240240 help := "PySpec module name (e.g., servicelib.Storage)." ,
241241 takesArg := .repeat "module" },
242- { name := "keep-all-files" ,
243- help := "Store intermediate Laurel and Core programs in <dir>." ,
244- takesArg := .arg "dir" },
245242 { name := "entry-point" ,
246243 help := "Which procedures to verify: main (main fn only), roots (user procs with no user callers, default), or all (all user procs). Only valid in bugFinding mode." ,
247244 takesArg := .arg "mode" },
@@ -278,13 +275,12 @@ def pyAnalyzeLaurelCommand (mkDischarge : Core.MkDischargeFn := Core.mkDischarge
278275 | some path => some <$> IO.FS.Handle.mk path .write
279276 | none => pure none
280277
281- let keepPrefix := keepDir.map (s! "{ ·} /{ baseName} " )
282278 let baseVcDir := keepDir.map (fun dir => (s! "{ dir} /{ baseName} " : System.FilePath))
283279 let pyAnalyzeBase : VerifyOptions :=
284280 { VerifyOptions.default with
285281 verbose := .quiet, removeIrrelevantAxioms := .Precise,
286282 vcDirectory := baseVcDir }
287- let options ← parseVerifyOptions pflags pyAnalyzeBase
283+ let options ← parseVerifyOptions pflags pyAnalyzeBase (inputFile := some filePath)
288284 let isBugFinding := options.checkMode == .bugFinding
289285 || options.checkMode == .bugFindingAssumingCompleteSpec
290286
@@ -313,7 +309,6 @@ def pyAnalyzeLaurelCommand (mkDischarge : Core.MkDischargeFn := Core.mkDischarge
313309 let (outcome, laurelPassStats, pctx) ← StrataPython.Pipeline.runPyAnalyzePipeline {
314310 filePath, specDir
315311 dispatchModules, pyspecModules, sourcePath
316- keepAllFilesPrefix := keepPrefix
317312 verifyOptions := options
318313 entryPoint, isBugFinding
319314 outputMode, skipVerification
@@ -555,12 +550,18 @@ def pyResolveOverloadsCommand : _root_.Command where
555550def pyInterpretCommand : _root_.Command where
556551 name := "pyInterpret"
557552 args := [ "file" ]
558- flags := [{ name := "fuel" , help := "Maximum execution steps." , takesArg := .arg "n" }]
559- ++ laurelTranslateFlags
553+ flags := [{ name := "fuel" , help := "Maximum execution steps." , takesArg := .arg "n" },
554+ { name := "keep-all-files" ,
555+ help := "Store intermediate Laurel and Core programs in <dir>." ,
556+ takesArg := .arg "dir" }]
560557 help := "Interpret a Python Ion program concretely (Python → Laurel → Core → execute)."
561558 callback := fun v pflags => do
562559 let filePath := v[0 ]
563560 let keepDir := pflags.getString "keep-all-files"
561+ -- Derive a prefix *inside* the directory so pipeline-emitted intermediates
562+ -- (`<dir>/<baseName>.<n>.<pass>.laurel.st`) land alongside the final
563+ -- programs instead of as siblings of the directory.
564+ let keepPrefix := keepDir.map (s! "{ ·} /{ deriveBaseName filePath} " )
564565 let fuel ← match pflags.getString "fuel" with
565566 | some s => match s.toNat? with
566567 | .some n => pure n
@@ -574,7 +575,7 @@ def pyInterpretCommand : _root_.Command where
574575 if let some dir := keepDir then
575576 IO.FS.createDirAll dir
576577 IO.FS.writeFile (dir ++ "/laurel.st" ) (toString (Std.format laurel))
577- match ← StrataPython.translateCombinedLaurel laurel keepDir
578+ match ← StrataPython.translateCombinedLaurel laurel keepPrefix
578579 (analysisMode := .Execute) with
579580 | (some core, diags) => pure (core, diags)
580581 | (none, diags) => exitFailure s! "Laurel to Core translation failed: { diags} "
0 commit comments