Documentation ¶
Index ¶
- Constants
- type AlgorithmConfig
- type RunContext
- func (ctx *RunContext) BestResult() *candidate.CandidateWithSize
- func (ctx *RunContext) CountTokens(bytes []byte) int
- func (ctx *RunContext) CurrentSemanticStrategy() int
- func (ctx *RunContext) ExhaustedSemanticStrategies() bool
- func (ctx *RunContext) GetHash() [16]byte
- func (ctx *RunContext) GetStrategyName(index int) string
- func (ctx *RunContext) GetStrategyNames() []string
- func (ctx *RunContext) IncrementSemanticStrategy()
- func (ctx *RunContext) InputDir() string
- func (ctx *RunContext) InputFilename() string
- func (ctx *RunContext) Language() string
- func (ctx *RunContext) ReductionDir() string
- func (ctx *RunContext) SemanticApplicationMethod() SemanticApplicationMethod
- func (ctx *RunContext) SemanticReduce(bytes []byte) ([][]byte, error)
- func (ctx *RunContext) SemanticReduceWithStrategy(bytes []byte, strategyIndex int) ([][]byte, error)
- func (ctx *RunContext) SemanticStrategiesTotal() int
- func (ctx *RunContext) SetExhaustedSemanticStrategies()
- func (ctx *RunContext) ShouldSkipStrategy(strategyIndex int) bool
- func (ctx *RunContext) Sizes() SizeContext
- func (ctx *RunContext) StartTimeFormatted() string
- func (ctx *RunContext) SyntacticReducer() syntactic.Functions
- func (ctx *RunContext) TestFilename() string
- func (ctx *RunContext) UpdateCurrent(candidatePath string, candidateSize int) error
- type RunContextErr
- type SemanticApplicationMethod
- type SizeContext
Constants ¶
View Source
const RunContextFolderPrefix = "seru_reduction_"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlgorithmConfig ¶
type AlgorithmConfig struct {
// contains filtered or unexported fields
}
func NewAlgorithmConfig ¶
func NewAlgorithmConfig(useIsolation bool, reducer syntactic.Reducer, activeStrategies *collection.Set) *AlgorithmConfig
func (AlgorithmConfig) String ¶
func (a AlgorithmConfig) String() string
type RunContext ¶
type RunContext struct { Metrics *metrics.Iterations // contains filtered or unexported fields }
RunContext holds all data necessary for reduction
func NewRunContext ¶
func NewRunContext(givenLanguage, inputFilePath, testScriptPath string, algorithmConfig AlgorithmConfig) (*RunContext, error)
func (*RunContext) BestResult ¶
func (ctx *RunContext) BestResult() *candidate.CandidateWithSize
func (*RunContext) CountTokens ¶
func (ctx *RunContext) CountTokens(bytes []byte) int
func (*RunContext) CurrentSemanticStrategy ¶
func (ctx *RunContext) CurrentSemanticStrategy() int
func (*RunContext) ExhaustedSemanticStrategies ¶
func (ctx *RunContext) ExhaustedSemanticStrategies() bool
func (*RunContext) GetHash ¶
func (ctx *RunContext) GetHash() [16]byte
func (*RunContext) GetStrategyName ¶
func (ctx *RunContext) GetStrategyName(index int) string
func (*RunContext) GetStrategyNames ¶
func (ctx *RunContext) GetStrategyNames() []string
func (*RunContext) IncrementSemanticStrategy ¶
func (ctx *RunContext) IncrementSemanticStrategy()
func (*RunContext) InputDir ¶
func (ctx *RunContext) InputDir() string
func (*RunContext) InputFilename ¶
func (ctx *RunContext) InputFilename() string
func (*RunContext) Language ¶
func (ctx *RunContext) Language() string
func (*RunContext) ReductionDir ¶
func (ctx *RunContext) ReductionDir() string
func (*RunContext) SemanticApplicationMethod ¶
func (ctx *RunContext) SemanticApplicationMethod() SemanticApplicationMethod
func (*RunContext) SemanticReduce ¶
func (ctx *RunContext) SemanticReduce(bytes []byte) ([][]byte, error)
func (*RunContext) SemanticReduceWithStrategy ¶
func (ctx *RunContext) SemanticReduceWithStrategy(bytes []byte, strategyIndex int) ([][]byte, error)
func (*RunContext) SemanticStrategiesTotal ¶
func (ctx *RunContext) SemanticStrategiesTotal() int
func (*RunContext) SetExhaustedSemanticStrategies ¶
func (ctx *RunContext) SetExhaustedSemanticStrategies()
func (*RunContext) ShouldSkipStrategy ¶
func (ctx *RunContext) ShouldSkipStrategy(strategyIndex int) bool
func (*RunContext) Sizes ¶
func (ctx *RunContext) Sizes() SizeContext
func (*RunContext) StartTimeFormatted ¶
func (ctx *RunContext) StartTimeFormatted() string
func (*RunContext) SyntacticReducer ¶
func (ctx *RunContext) SyntacticReducer() syntactic.Functions
func (*RunContext) TestFilename ¶
func (ctx *RunContext) TestFilename() string
func (*RunContext) UpdateCurrent ¶
func (ctx *RunContext) UpdateCurrent(candidatePath string, candidateSize int) error
type RunContextErr ¶
type RunContextErr struct {
// contains filtered or unexported fields
}
func NewRunContextErr ¶
func NewRunContextErr(err error) *RunContextErr
func (*RunContextErr) Error ¶
func (e *RunContextErr) Error() string
type SemanticApplicationMethod ¶
type SemanticApplicationMethod string
const ( ApplyFirstOnly SemanticApplicationMethod = "ApplyFirstOnly" ApplyAllCombined SemanticApplicationMethod = "ApplyAllCombined" )
type SizeContext ¶
Click to show internal directories.
Click to hide internal directories.