Documentation
¶
Overview ¶
Package goose implements conversion from Go source to Perennial definitions.
The exposed interface allows converting individual files as well as whole packages to a single Coq Ast with all the converted definitions, which include user-defined structs in Go as Coq records and a Perennial procedure for each Go function.
See the Goose README at https://github.com/tchajed/goose for a high-level overview. The source also has some design documentation at https://github.com/tchajed/goose/tree/master/docs.
Index ¶
Constants ¶
const FfiImportFmt string = "From Perennial.goose_lang Require Import ffi.%s_prelude."
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config holds global configuration for Coq conversion
func (Config) TranslatePackage ¶
TranslatePackage translates an entire package in a directory to a single Coq Ast with all the declarations in the package.
If the source directory has multiple source files, these are processed in alphabetical order; this must be a topological sort of the definitions or the Coq code will be out-of-order. Realistically files should not have dependencies on each other, although sorting ensures the results are stable and not dependent on map or directory iteration order.
type ConversionError ¶
type ConversionError struct { Category string // the main description of what went wrong Message string // the snippet in the source program responsible for the error GoCode string // (for internal debugging) file:lineno for the goose code that threw the // error GooseCaller string // file:lineno for the source program where GoCode appears GoSrcFile string // (for systematic tests) Pos, End token.Pos }
A ConversionError is a detailed and structured error encountered while converting Go to Coq.
Errors include a category describing the severity of the error.
The category "unsupported" is the only error that should result from normal usage, when attempting to use a feature goose intentionally does not support.
"todo" and "future" are markers for code that could be supported but is not currently handled.
The categories "impossible(go)" and "impossible(no-examples)" indicate a bug in goose (at the very least these cases should be checked and result in an unsupported error)
func (*ConversionError) Error ¶
func (e *ConversionError) Error() string
type Ctx ¶
type Ctx struct { Config // contains filtered or unexported fields }
Ctx is a context for resolving Go code's types and source code
type MultipleErrors ¶
type MultipleErrors []error
func (MultipleErrors) Error ¶
func (es MultipleErrors) Error() string
Directories
¶
Path | Synopsis |
---|---|
cmd
|
|
internal
|
|
examples/append_log
Append-only, sequential, crash-safe log.
|
Append-only, sequential, crash-safe log. |
examples/comments
comments tests package comments, like this one it has multiple files
|
comments tests package comments, like this one it has multiple files |
examples/simpledb
Package simpledb implements a one-table version of LevelDB It buffers all writes in memory; to make data durable, call Compact().
|
Package simpledb implements a one-table version of LevelDB It buffers all writes in memory; to make data durable, call Compact(). |
examples/unittest
unittest is a package full of many independent and small translation examples unittest has two package comments
|
unittest is a package full of many independent and small translation examples unittest has two package comments |
Package machine is a support library for operations on integers.
|
Package machine is a support library for operations on integers. |
filesys
Package filesys is a support library providing access to a single directory in the filesystem.
|
Package filesys is a support library providing access to a single directory in the filesystem. |