diff options
author | Unknown <t-alekm@A3479878.redmond.corp.microsoft.com> | 2011-07-03 17:59:13 -0700 |
---|---|---|
committer | Unknown <t-alekm@A3479878.redmond.corp.microsoft.com> | 2011-07-03 17:59:13 -0700 |
commit | 9b8c0b44fc7ffa9d292b46d63965a2431c19e2ae (patch) | |
tree | 4b6f73d34b92a79a28ebadaf16c91e9747b53a5c /Jennisys/Analyzer.fs | |
parent | 8a7d7782f7f13f60e8638b3988b9d12d33ffa571 (diff) |
added some doc comments
Diffstat (limited to 'Jennisys/Analyzer.fs')
-rw-r--r-- | Jennisys/Analyzer.fs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Jennisys/Analyzer.fs b/Jennisys/Analyzer.fs index fab61ff4..48adcca1 100644 --- a/Jennisys/Analyzer.fs +++ b/Jennisys/Analyzer.fs @@ -43,15 +43,12 @@ let GenMethodAnalysisCode comp methodName signature pre post = (match signature with | Sig(ins,outs) -> List.concat [ins; outs] |> List.fold (fun acc vd -> acc + (sprintf " var %s;" (PrintVarDecl vd)) + newline) "") + - // assume preconditions " // assume precondition" + newline + " assume " + (PrintExpr 0 pre) + ";" + newline + - // assume invariant and postcondition " // assume invariant and postcondition" + newline + " assume Valid();" + newline + " assume " + (PrintExpr 0 post) + ";" + newline + - // inline the user defined invariant because assuming Valid() doesn't always work - " // assume user defined invariant again because assuming Valid() doesn't always work" + + " // assume user defined invariant again because assuming Valid() doesn't always work" + newline + (GetInvariantsAsList comp |> PrintSep newline (fun e -> " assume " + (PrintExpr 0 e) + ";")) + newline + // if the following assert fails, the model hints at what code to generate; if the verification succeeds, an implementation would be infeasible " // assert false to search for a model satisfying the assumed constraints" + newline + @@ -66,6 +63,7 @@ let MethodAnalysisPrinter onlyForThisCompMethod comp mthd = | _ -> "" | _ -> "" +/// Returns whether the code synthesized for the given method can be verified with Dafny let VerifySolution (heap,env,ctx) prog comp mthd = // print the solution to file and try to verify it with Dafny let solution = Map.empty |> Map.add (comp,mthd) (heap,env,ctx) |