toysolver-0.7.0: Assorted decision procedures for SAT, SMT, Max-SAT, PB, MIP, etc
Copyright(c) Masahiro Sakai 2016
LicenseBSD-style
Maintainermasahiro.sakai@gmail.com
Stabilityprovisional
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell2010
Extensions
  • TypeSynonymInstances
  • FlexibleInstances
  • ConstrainedClassMethods
  • MultiParamTypeClasses
  • FunctionalDependencies
  • KindSignatures

ToySolver.Combinatorial.HittingSet.InterestingSets

Description

Synopsis

Problem definition

class Monad m => IsProblem prob m | prob -> m where Source #

A problem is essentially a pair of an IntSet (universe) and a monotone pure function IntSet -> Bool (isInteresting), but we generalize a bit for potentialial optimization opportunity.

For simple cases you can just use SimpleProblem instance.

Minimal complete definition

universe, (isInteresting | isInteresting')

Methods

universe :: prob -> IntSet Source #

isInteresting :: prob -> IntSet -> m Bool Source #

Interesting sets are lower closed subsets of universe, i.e. if xs is interesting then ysxs is also interesting.

isInteresting' :: prob -> IntSet -> m InterestingOrUninterestingSet Source #

If xs is interesting it returns InterestingSet ys where ys is an interesting superset of xs. If xs is uninteresting it returns UninterestingSet ys where ys is an uninteresting subset of xs.

grow :: prob -> IntSet -> m IntSet Source #

grow xs computes maximal interesting set ys that is a superset of xs.

shrink :: prob -> IntSet -> m IntSet Source #

shrink xs computes minimal uninteresting set ys that is a subset of xs.

maximalInterestingSet :: prob -> IntSet -> m (Maybe IntSet) Source #

If xs is an interesting set maximalInterestingSet prob xs returns Just ys such that ys is a maximal interesting superset of xs, otherwise it returns Nothing.

minimalUninterestingSet :: prob -> IntSet -> m (Maybe IntSet) Source #

If xs is an uninteresting set minimalUninterestingSet prob xs returns Just ys such that ys is a minimal uninteresting subset of xs, otherwise it returns Nothing.

minimalUninterestingSetOrMaximalInterestingSet :: prob -> IntSet -> m InterestingOrUninterestingSet Source #

If xs is an uninteresting set minimalUninterestingSetOrMaximalInterestingSet prob xs returns Left ys such that ys is a minimal uninteresting subset of xs. If xs is an interesting set minimalUninterestingSetOrMaximalInterestingSet prob xs returns Right ys such that ys is a maximal interesting superset of xs

data InterestingOrUninterestingSet Source #

Instances

Instances details
Eq InterestingOrUninterestingSet Source # 
Instance details

Defined in ToySolver.Combinatorial.HittingSet.InterestingSets

Ord InterestingOrUninterestingSet Source # 
Instance details

Defined in ToySolver.Combinatorial.HittingSet.InterestingSets

Read InterestingOrUninterestingSet Source # 
Instance details

Defined in ToySolver.Combinatorial.HittingSet.InterestingSets

Show InterestingOrUninterestingSet Source # 
Instance details

Defined in ToySolver.Combinatorial.HittingSet.InterestingSets

defaultGrow :: IsProblem prob m => prob -> IntSet -> m IntSet Source #

Default implementation of grow using isInteresting'.

defaultShrink :: IsProblem prob m => prob -> IntSet -> m IntSet Source #

Default implementation of shrink using isInteresting'.

defaultMaximalInterestingSet :: IsProblem prob m => prob -> IntSet -> m (Maybe IntSet) Source #

Default implementation of maximalUninterestingSet using isInteresting' and grow.

defaultMinimalUninterestingSet :: IsProblem prob m => prob -> IntSet -> m (Maybe IntSet) Source #

Default implementation of minimalUninterestingSet using isInteresting' and shrink.

Options for maximal interesting sets enumeration

Datatype for monotone CNF/DNF dualization

data ImplicateOrImplicant Source #