fixedpoint.go

Fixedpoint solver for Datalog and constrained Horn clauses (CHC)

Types

type Context

Context methods (receiver omitted for clarity)

Methods:

NewFixedpoint

func (ctx *Context) NewFixedpoint() *Fixedpoint

NewFixedpoint creates a new fixedpoint solver

type Fixedpoint

Fixedpoint represents a fixedpoint solver for Datalog/CHC queries

Methods:

AddCover

func (f *Fixedpoint) AddCover(level int, predicate *FuncDecl, property *Expr)

AddCover adds a cover constraint to a predicate at a given level

AddFact

func (f *Fixedpoint) AddFact(pred *FuncDecl, args []int)

AddFact adds a table fact to the fixedpoint solver

AddRule

func (f *Fixedpoint) AddRule(rule *Expr, name *Symbol)

AddRule adds a rule (Horn clause) to the fixedpoint solver The rule should be an implication of the form body => head where head is a relation and body is a conjunction of relations

Assert

func (f *Fixedpoint) Assert(constraint *Expr)

Assert adds a constraint into the fixedpoint solver

FromFile

func (f *Fixedpoint) FromFile(filename string)

FromFile parses a Datalog program from a file

FromString

func (f *Fixedpoint) FromString(s string)

FromString parses a Datalog program from a string

GetAnswer

func (f *Fixedpoint) GetAnswer() *Expr

GetAnswer retrieves the satisfying instance or instances of solver, or definitions for the recursive predicates that show unsatisfiability

GetAssertions

func (f *Fixedpoint) GetAssertions() *ASTVector

GetAssertions retrieves the fixedpoint assertions as an AST vector

GetCoverDelta

func (f *Fixedpoint) GetCoverDelta(level int, predicate *FuncDecl) *Expr

GetCoverDelta retrieves the cover delta for a given predicate and level

GetHelp

func (f *Fixedpoint) GetHelp() string

GetHelp returns a string describing all available fixedpoint solver parameters

GetNumLevels

func (f *Fixedpoint) GetNumLevels(predicate *FuncDecl) int

GetNumLevels retrieves the number of levels explored for a given predicate

GetParamDescrs

func (f *Fixedpoint) GetParamDescrs() *ParamDescrs

GetParamDescrs retrieves parameter descriptions for the fixedpoint solver

GetReasonUnknown

func (f *Fixedpoint) GetReasonUnknown() string

GetReasonUnknown retrieves explanation why fixedpoint engine returned status Unknown

GetRules

func (f *Fixedpoint) GetRules() string

GetRules retrieves the current rules as a string

GetStatistics

func (f *Fixedpoint) GetStatistics() *Statistics

GetStatistics retrieves statistics for the fixedpoint solver

Query

func (f *Fixedpoint) Query(query *Expr) Status

Query queries the fixedpoint solver with a constraint Returns Satisfiable if there is a derivation, Unsatisfiable if not

QueryRelations

func (f *Fixedpoint) QueryRelations(relations []*FuncDecl) Status

QueryRelations queries the fixedpoint solver with an array of relations Returns Satisfiable if any relation is non-empty, Unsatisfiable otherwise

RegisterRelation

func (f *Fixedpoint) RegisterRelation(funcDecl *FuncDecl)

RegisterRelation registers a predicate as a recursive relation

SetParams

func (f *Fixedpoint) SetParams(params *Params)

SetParams sets the fixedpoint solver parameters

SetPredicateRepresentation

func (f *Fixedpoint) SetPredicateRepresentation(funcDecl *FuncDecl, kinds []C.Z3_symbol)

SetPredicateRepresentation sets the predicate representation for a given relation

String

func (f *Fixedpoint) String() string

String returns the string representation of the fixedpoint solver

UpdateRule

func (f *Fixedpoint) UpdateRule(rule *Expr, name *Symbol)

UpdateRule updates a named rule in the fixedpoint solver

type Statistics

Statistics represents statistics for Z3 solvers

Methods:

GetDoubleValue

func (s *Statistics) GetDoubleValue(idx int) float64

GetDoubleValue returns the double value at the given index

GetKey

func (s *Statistics) GetKey(idx int) string

GetKey returns the key (name) of a statistical data entry at the given index

GetUintValue

func (s *Statistics) GetUintValue(idx int) uint64

GetUintValue returns the unsigned integer value at the given index

IsDouble

func (s *Statistics) IsDouble(idx int) bool

IsDouble returns true if the statistical data at the given index is double

IsUint

func (s *Statistics) IsUint(idx int) bool

IsUint returns true if the statistical data at the given index is unsigned integer

Size

func (s *Statistics) Size() int

Size returns the number of statistical data entries

String

func (s *Statistics) String() string

String returns the string representation of statistics