Documentation ¶
Index ¶
- Constants
- func BothFloat(lvalue reflect.Value, rvalue reflect.Value) bool
- func BothInt(lvalue reflect.Value, rvalue reflect.Value) bool
- func BothString(lvalue reflect.Value, rvalue reflect.Value) bool
- func BothUint(lvalue reflect.Value, rvalue reflect.Value) bool
- func EvaluateOrderedCmp[T constraints.Ordered](h *HeuristicForBooleans, left T, op string, right T, fileName string, line int, ...) bool
- func GetDistanceToEquality(lvalue reflect.Value, rvalue reflect.Value, tracer Tracer) float64
- func GetDistanceToEqualityFloat64(a float64, b float64) float64
- func GetDistanceToEqualityInt64(a int64, b int64) float64
- func GetDistanceToEqualityString(a string, b string) float64
- func GetDistanceToEqualityUint64(a uint64, b uint64) float64
- func GetDistanceToLessThan(lvalue reflect.Value, rvalue reflect.Value) float64
- func GetDistanceToLessThanFloat64(a float64, b float64) float64
- func GetDistanceToLessThanInt64(a int64, b int64) float64
- func GetDistanceToLessThanString(a string, b string) float64
- func GetDistanceToLessThanUint64(a uint64, b uint64) float64
- func GetLeftAlignmentDistance(a string, b string) float64
- func NormalizeValue(v float64) float64
- type HeuristicForBooleans
- func (h *HeuristicForBooleans) ClearLastEvaluation()
- func (h *HeuristicForBooleans) EvaluateAnd(left func() bool, right func() bool, fileName string, line int, branchId int, ...) bool
- func (h *HeuristicForBooleans) EvaluateOr(left func() bool, right func() bool, fileName string, line int, branchId int, ...) bool
- func (h *HeuristicForBooleans) EvaluateUnorderedCmp(left any, op string, right any, fileName string, line int, branchId int, ...) bool
- func (h *HeuristicForBooleans) HandleNot(value bool) bool
- type Tracer
- type Truthness
Constants ¶
View Source
const (
H_REACHED = 0.01 // branch was reached
)
View Source
const (
// MAX_CHAR_DISTANCE 2^16=65536, max distance for a char
MAX_CHAR_DISTANCE = 65_536
)
Variables ¶
This section is empty.
Functions ¶
func EvaluateOrderedCmp ¶
func EvaluateOrderedCmp[T constraints.Ordered](h *HeuristicForBooleans, left T, op string, right T, fileName string, line int, branchId int, tracer Tracer) bool
func GetDistanceToEquality ¶
GetDistanceToEquality compute distance between left and right ==
func GetDistanceToLessThan ¶
GetDistanceToLessThan compute distance between left and right <
func NormalizeValue ¶
NormalizeValue scales to a positive double value to the [0,1] range. v is a non-negative float
Types ¶
type HeuristicForBooleans ¶
type HeuristicForBooleans struct {
// contains filtered or unexported fields
}
func NewHeuristicForBooleans ¶
func NewHeuristicForBooleans() *HeuristicForBooleans
func (*HeuristicForBooleans) ClearLastEvaluation ¶
func (h *HeuristicForBooleans) ClearLastEvaluation()
func (*HeuristicForBooleans) EvaluateAnd ¶
func (*HeuristicForBooleans) EvaluateOr ¶
func (*HeuristicForBooleans) EvaluateUnorderedCmp ¶
func (*HeuristicForBooleans) HandleNot ¶
func (h *HeuristicForBooleans) HandleNot(value bool) bool
type Truthness ¶
func GetEqualityTruthness ¶
func GetLessThanTruthness ¶
func GetLessThanTruthness[T constraints.Ordered](left T, right T) *Truthness
func NewTruthness ¶
func (*Truthness) RescaleFromMin ¶
Click to show internal directories.
Click to hide internal directories.