preprocess

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

The preprocess package consists of all the preprocessing operations we can do. In the proposal, preprocessing was optional, but that is not the case now. We should at least apply the transitivity rule so that we can use binary search on the clauses if we want to in the future.

Index

Constants

This section is empty.

Variables

View Source
var Preprocessors = map[string]Preprocessor{
	"nil":      Nil{},
	"t-lin":    TLin{},
	"t-quad":   TQuad{},
	"tie-lin":  TIELin{},
	"tie-quad": TIEQuad{},
}

The Preprocessors variable stores a map from strings to the Preprocessor they are associated with. We use this map when processing command-line arguments.

Functions

This section is empty.

Types

type Nil

type Nil struct{}

The Nil preprocessor does nothing.

func (Nil) Preprocess

func (Nil) Preprocess(db *db.DB)

type Preprocessor

type Preprocessor interface {
	Preprocess(*db.DB)
}

The Preprocessor interface has a single method that applies preprocessing to a db.DB of clauses. It's allowed to add extra clauses, but it should leave all the other variables untouched.

type TIELin

type TIELin struct{}

The TIELin preprocessor applies all the preprocessing rules, effectively eagerly adding constraints for each pair of difference constraints. However, it only applies it to ones that imply all the others so that the number of extra clauses is linear.

func (TIELin) Preprocess

func (TIELin) Preprocess(dbase *db.DB)

type TIEQuad

type TIEQuad struct{}

The TIEQuad preprocessor applies all the preprocessing rules, effectively eagerly adding constraints for each pair of difference constraints. It does so by looping over all the possibilities, causing a quadratic increase in the number of clauses.

func (TIEQuad) Preprocess

func (TIEQuad) Preprocess(dbase *db.DB)

type TLin

type TLin struct{}

The TLin preprocessor only applies the transitivity rule. To do this, it scans across each variable pair's atoms array and says that one implies the next. In this way, the number of extra clauses is linear in the number of atoms associated with a pair of variables.

func (TLin) Preprocess

func (TLin) Preprocess(dbase *db.DB)

type TQuad

type TQuad struct{}

The TQuad preprocessor only applies the transitivity rule. To do this, it tries to apply it to every pair of atoms for each variable pair. In this way, the number of extra clauses is quadratic in the number of atoms.

func (TQuad) Preprocess

func (TQuad) Preprocess(dbase *db.DB)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL