Documentation ¶
Index ¶
- Constants
- Variables
- func LexDocStrings(docs []string) iter.Seq[Token]
- func LexGo(comments *ast.CommentGroup) iter.Seq[Token]
- func LexRunes(runes []rune) iter.Seq[Token]
- func LexString(str string) iter.Seq[Token]
- func Print(ast Node) string
- type AGHyperContract
- type Assumption
- type ConditionalProbabilityQuantifier
- type ConstantNumber
- type Contract
- type Existential
- type ExistentialHyperAssertion
- type Files
- type GoExpresion
- type Group
- type Guarantee
- type HyperAssertion
- type HyperAssertionInterpreter
- func (interpreter *HyperAssertionInterpreter[T]) ExistentialHyperAssertion(assertion ExistentialHyperAssertion[T])
- func (interpreter *HyperAssertionInterpreter[T]) PredicateHyperAssertion(assertion PredicateHyperAssertion[T])
- func (interpreter *HyperAssertionInterpreter[T]) Satisfies(assertion HyperAssertion[T], elements []T) bool
- func (interpreter *HyperAssertionInterpreter[T]) TrueHyperAssertion(assertion TrueHyperAssertion[T])
- func (interpreter *HyperAssertionInterpreter[T]) UniversalHyperAssertion(assertion UniversalHyperAssertion[T])
- type HyperAssertionVisitor
- type Injector
- func (injector Injector) CallWrap(function *dst.FuncDecl) *dst.AssignStmt
- func (injector Injector) Check(name string, contractName string) *dst.IfStmt
- func (injector Injector) ConstructModel(model string, function *dst.FuncDecl) *dst.AssignStmt
- func (injector Injector) Contract(model string, function *dst.FuncDecl) (string, *dst.GenDecl)
- func (injector Injector) Files(files iter.Seq[string])
- func (injector Injector) HasNamedOutputs(function *dst.FuncDecl) bool
- func (injector Injector) Imports(file *dst.File, imports map[string]string)
- func (injector Injector) Inject(file *dst.File)
- func (injector Injector) InputFields(function *dst.FuncDecl) (fields []*dst.Field)
- func (injector Injector) Model(function *dst.FuncDecl) (string, *dst.GenDecl)
- func (injector Injector) OutputFields(function *dst.FuncDecl) (fields []*dst.Field)
- func (injector Injector) Restore(files iter.Seq[string])
- func (injector Injector) Return(function *dst.FuncDecl) *dst.ReturnStmt
- func (injector Injector) Updates(function *dst.FuncDecl) (updates []*dst.AssignStmt)
- func (injector Injector) Wrap(function *dst.FuncDecl) *dst.AssignStmt
- type Lexer
- type LiftedBoolean
- func (lhs LiftedBoolean) And(rhs LiftedBoolean) LiftedBoolean
- func (boolean LiftedBoolean) IsFalse() bool
- func (boolean LiftedBoolean) IsTrue() bool
- func (boolean LiftedBoolean) IsUnknown() bool
- func (boolean LiftedBoolean) Not() LiftedBoolean
- func (lhs LiftedBoolean) Or(rhs LiftedBoolean) LiftedBoolean
- func (boolean LiftedBoolean) String() string
- type MonitorFactory
- func (factory *MonitorFactory) Create(node Node) *dst.CallExpr
- func (factory *MonitorFactory) NewExistentialMonitorCall(existential Existential) *dst.CallExpr
- func (factory *MonitorFactory) NewPredicateMonitorCall(expression GoExpresion) *dst.CallExpr
- func (factory *MonitorFactory) NewUniversalMonitorCall(universal Universal) *dst.CallExpr
- type Node
- type Parser
- type PredicateExpression
- type PredicateHyperAssertion
- type ProbabilisticQuantifier
- type Region
- type Token
- type TokenClass
- type TrueHyperAssertion
- type Universal
- type UniversalHyperAssertion
Constants ¶
View Source
const ( LiftedFalse = LiftedBoolean(0b0000) LiftedUnknown = LiftedBoolean(0b0001) LiftedTrue = LiftedBoolean(0b0011) )
View Source
const ( RegionToken = TokenClass(iota) ForallToken ExistsToken AssumeToken GuaranteeToken IdentifierToken ProbabilityToken ExpressionToken ScopeDelimiterToken ExpressionDelimiterToken LeftParenthesis RightParenthesis EofToken )
Variables ¶
View Source
var ErrFileNotFound = errors.New("file could not be found")
Functions ¶
Types ¶
type AGHyperContract ¶
type AGHyperContract[T any] struct { // contains filtered or unexported fields }
func NewAGHyperContract ¶
func NewAGHyperContract[T any]( assumptions, guarantees []HyperAssertion[T], ) AGHyperContract[T]
func (*AGHyperContract[T]) Assume ¶
func (contract *AGHyperContract[T]) Assume(executions ...T) LiftedBoolean
func (*AGHyperContract[T]) Guarantee ¶
func (contract *AGHyperContract[T]) Guarantee(executions ...T) LiftedBoolean
func (*AGHyperContract[T]) Model ¶
func (contract *AGHyperContract[T]) Model(call func(input T) T)
type Assumption ¶
type Assumption struct {
// contains filtered or unexported fields
}
func NewAssumption ¶
func NewAssumption(assertion Node) Assumption
type ConditionalProbabilityQuantifier ¶
type ConditionalProbabilityQuantifier struct {
// contains filtered or unexported fields
}
func NewConditionalProbabilityQuantifier ¶
func NewConditionalProbabilityQuantifier(event, given Node) ConditionalProbabilityQuantifier
type ConstantNumber ¶
type ConstantNumber struct {
// contains filtered or unexported fields
}
func Number ¶
func Number(value float32) ConstantNumber
type Contract ¶
type Contract struct {
// contains filtered or unexported fields
}
func NewContract ¶
type Existential ¶
type Existential struct {
// contains filtered or unexported fields
}
func NewExistential ¶
func NewExistential(variables []string, assertion Node) Existential
type ExistentialHyperAssertion ¶
type ExistentialHyperAssertion[T any] struct { // contains filtered or unexported fields }
func NewExistentialHyperAssertion ¶
func NewExistentialHyperAssertion[T any](offset, size int, body HyperAssertion[T]) *ExistentialHyperAssertion[T]
func (ExistentialHyperAssertion[T]) Accept ¶
func (assertion ExistentialHyperAssertion[T]) Accept(visitor HyperAssertionVisitor[T])
func (ExistentialHyperAssertion[T]) Size ¶
func (assertion ExistentialHyperAssertion[T]) Size() int
type Files ¶
type Files struct {
// contains filtered or unexported fields
}
func (*Files) AddDirectory ¶
type GoExpresion ¶
type GoExpresion struct {
// contains filtered or unexported fields
}
func NewGoExpression ¶
func NewGoExpression(code string) GoExpresion
type Guarantee ¶
type Guarantee struct {
// contains filtered or unexported fields
}
func NewGuarantee ¶
type HyperAssertion ¶
type HyperAssertion[T any] interface { Accept(visitor HyperAssertionVisitor[T]) Size() int }
HyperAssertion represents an interface for tracking and evaluating the state of assignments over a sequence of elements, typically in the context of quantifiers in formal verification or monitoring systems.
func HyperAssertionFromAST ¶
func HyperAssertionFromAST[T any](node Node) HyperAssertion[T]
type HyperAssertionInterpreter ¶
type HyperAssertionInterpreter[T any] struct { // contains filtered or unexported fields }
func NewHyperAssertionInterpreter ¶
func NewHyperAssertionInterpreter[T any]() HyperAssertionInterpreter[T]
func (*HyperAssertionInterpreter[T]) ExistentialHyperAssertion ¶
func (interpreter *HyperAssertionInterpreter[T]) ExistentialHyperAssertion(assertion ExistentialHyperAssertion[T])
func (*HyperAssertionInterpreter[T]) PredicateHyperAssertion ¶
func (interpreter *HyperAssertionInterpreter[T]) PredicateHyperAssertion(assertion PredicateHyperAssertion[T])
func (*HyperAssertionInterpreter[T]) Satisfies ¶
func (interpreter *HyperAssertionInterpreter[T]) Satisfies(assertion HyperAssertion[T], elements []T) bool
func (*HyperAssertionInterpreter[T]) TrueHyperAssertion ¶
func (interpreter *HyperAssertionInterpreter[T]) TrueHyperAssertion(assertion TrueHyperAssertion[T])
func (*HyperAssertionInterpreter[T]) UniversalHyperAssertion ¶
func (interpreter *HyperAssertionInterpreter[T]) UniversalHyperAssertion(assertion UniversalHyperAssertion[T])
type HyperAssertionVisitor ¶
type HyperAssertionVisitor[T any] interface { UniversalHyperAssertion(assertion UniversalHyperAssertion[T]) ExistentialHyperAssertion(assertion ExistentialHyperAssertion[T]) PredicateHyperAssertion(assertion PredicateHyperAssertion[T]) TrueHyperAssertion(assertion TrueHyperAssertion[T]) }
type Injector ¶
type Injector struct{}
func NewGoInjector ¶
func NewGoInjector() Injector
func (Injector) CallWrap ¶
func (injector Injector) CallWrap(function *dst.FuncDecl) *dst.AssignStmt
func (Injector) ConstructModel ¶
func (Injector) HasNamedOutputs ¶
func (Injector) InputFields ¶
func (Injector) OutputFields ¶
type LiftedBoolean ¶
type LiftedBoolean uint8
func LiftBoolean ¶
func LiftBoolean(value bool) LiftedBoolean
func (LiftedBoolean) And ¶
func (lhs LiftedBoolean) And(rhs LiftedBoolean) LiftedBoolean
func (LiftedBoolean) IsFalse ¶
func (boolean LiftedBoolean) IsFalse() bool
func (LiftedBoolean) IsTrue ¶
func (boolean LiftedBoolean) IsTrue() bool
func (LiftedBoolean) IsUnknown ¶
func (boolean LiftedBoolean) IsUnknown() bool
func (LiftedBoolean) Not ¶
func (boolean LiftedBoolean) Not() LiftedBoolean
func (LiftedBoolean) Or ¶
func (lhs LiftedBoolean) Or(rhs LiftedBoolean) LiftedBoolean
func (LiftedBoolean) String ¶
func (boolean LiftedBoolean) String() string
type MonitorFactory ¶
type MonitorFactory struct {
// contains filtered or unexported fields
}
func NewGoMonitorFactory ¶
func NewGoMonitorFactory(packageName, modelName string) MonitorFactory
func (*MonitorFactory) NewExistentialMonitorCall ¶
func (factory *MonitorFactory) NewExistentialMonitorCall(existential Existential) *dst.CallExpr
func (*MonitorFactory) NewPredicateMonitorCall ¶
func (factory *MonitorFactory) NewPredicateMonitorCall(expression GoExpresion) *dst.CallExpr
func (*MonitorFactory) NewUniversalMonitorCall ¶
func (factory *MonitorFactory) NewUniversalMonitorCall(universal Universal) *dst.CallExpr
type PredicateExpression ¶
type PredicateExpression[T any] struct { // contains filtered or unexported fields }
func NewPredicateExpression ¶
func NewPredicateExpression[T any](predicate func(assignments []T) bool) PredicateExpression[T]
type PredicateHyperAssertion ¶
type PredicateHyperAssertion[T any] struct { // contains filtered or unexported fields }
func NewPredicateHyperAssertion ¶
func NewPredicateHyperAssertion[T any](predicate func(assignments []T) bool) *PredicateHyperAssertion[T]
func (PredicateHyperAssertion[T]) Accept ¶
func (assertion PredicateHyperAssertion[T]) Accept(visitor HyperAssertionVisitor[T])
func (PredicateHyperAssertion[T]) Size ¶
func (assertion PredicateHyperAssertion[T]) Size() int
type ProbabilisticQuantifier ¶
type ProbabilisticQuantifier struct {
// contains filtered or unexported fields
}
func NewProbabilisticQuantifier ¶
func NewProbabilisticQuantifier(body Node) ProbabilisticQuantifier
type Token ¶
type Token struct {
// contains filtered or unexported fields
}
func NewToken ¶
func NewToken(class TokenClass, lexeme string) Token
type TokenClass ¶
type TokenClass uint8
func (TokenClass) String ¶
func (class TokenClass) String() string
type TrueHyperAssertion ¶
type TrueHyperAssertion[T any] struct{}
func NewTrueHyperAssertion ¶
func NewTrueHyperAssertion[T any]() *TrueHyperAssertion[T]
func (TrueHyperAssertion[T]) Accept ¶
func (assertion TrueHyperAssertion[T]) Accept(visitor HyperAssertionVisitor[T])
func (TrueHyperAssertion[T]) Size ¶
func (assertion TrueHyperAssertion[T]) Size() int
type Universal ¶
type Universal struct {
// contains filtered or unexported fields
}
func NewUniversal ¶
type UniversalHyperAssertion ¶
type UniversalHyperAssertion[T any] struct { // contains filtered or unexported fields }
func NewUniversalHyperAssertion ¶
func NewUniversalHyperAssertion[T any](offset, size int, body HyperAssertion[T]) *UniversalHyperAssertion[T]
func (UniversalHyperAssertion[T]) Accept ¶
func (assertion UniversalHyperAssertion[T]) Accept(visitor HyperAssertionVisitor[T])
func (UniversalHyperAssertion[T]) Size ¶
func (assertion UniversalHyperAssertion[T]) Size() int
Source Files ¶
Click to show internal directories.
Click to hide internal directories.