Header menu logo F# Header menu logo Averest

TernaryLogic Module

This module implements algorithms checking properties of ternary functions.

Types

Type Description

THREE

this datatype defines the values of ternary logic

TernaryLogic

this datatype defines the formulas of ternary logic; note that TernEqu is equality which is always a boolean value, and different to equivalence

Functions and values

Function or value Description

BTab2DNF f

Full Usage: BTab2DNF f

Parameters:
Returns: Set<Set<TernaryLogic>>

BTab2DNF computes for a B-ternary function table a propositional logic formula in DNF according to [Muka72]. The result is returned as a set of set of literals.

f : Map<THREE list, THREE>
Returns: Set<Set<TernaryLogic>>

CloseByDC1 fSet

Full Usage: CloseByDC1 fSet

Parameters:
Returns: Set<Map<THREE list, THREE>>

compute all functions xNew & f1(x) | !xNew & f0(x)) for f0,f1 of the given set

fSet : Map<THREE list, THREE> seq
Returns: Set<Map<THREE list, THREE>>

CloseByDC2 fSet

Full Usage: CloseByDC2 fSet

Parameters:
Returns: Set<Map<THREE list, THREE>>

compute all DC2-functions over the given set

fSet : Map<THREE list, THREE> seq
Returns: Set<Map<THREE list, THREE>>

CloseByDC3 fSet

Full Usage: CloseByDC3 fSet

Parameters:
Returns: Set<Map<THREE list, THREE>>

compute all DC3-functions over the given set

fSet : Map<THREE list, THREE> seq
Returns: Set<Map<THREE list, THREE>>

CloseByDC4 fSet

Full Usage: CloseByDC4 fSet

Parameters:
Returns: Set<Map<THREE list, THREE>>

compute all DC4-functions over the given set

fSet : Map<THREE list, THREE> seq
Returns: Set<Map<THREE list, THREE>>

CloseByParITE fSet

Full Usage: CloseByParITE fSet

Parameters:
Returns: Set<Map<THREE list, THREE>>

compute all functions ParITE(xNew,f1(x),f0(x)) for f0,f1 of the given set

fSet : Map<THREE list, THREE> seq
Returns: Set<Map<THREE list, THREE>>

CloseBySeqITE fSet

Full Usage: CloseBySeqITE fSet

Parameters:
Returns: Set<Map<THREE list, THREE>>

compute all functions SeqITE(xNew,f1(x),f0(x)) for f0,f1 of the given set

fSet : Map<THREE list, THREE> seq
Returns: Set<Map<THREE list, THREE>>

DNF2Str dnf

Full Usage: DNF2Str dnf

Parameters:
Returns: string

DNF2Str converts a DNF given as set of sets of literals to a string.

dnf : Set<Set<TernaryLogic>>
Returns: string

DecompMono idx f

Full Usage: DecompMono idx f

Parameters:
Returns: Map<THREE list, THREE> * Map<THREE list, THREE> * Map<THREE list, THREE> * Map<THREE list, THREE>

compute the DC4 decomposition of a monotone function

idx : int
f : Map<THREE list, THREE>
Returns: Map<THREE list, THREE> * Map<THREE list, THREE> * Map<THREE list, THREE> * Map<THREE list, THREE>

EvalTernaryLogic rho t

Full Usage: EvalTernaryLogic rho t

Parameters:
Returns: THREE

evaluate a ternary logic formula with a variable assignment rho

rho : Map<string, THREE>
t : TernaryLogic
Returns: THREE

FiringTree ostr f

Full Usage: FiringTree ostr f

Parameters:

compute a firing tree of a ternary function

ostr : TextWriter
f : Map<THREE list, THREE>

GetCoFactors idx f

Full Usage: GetCoFactors idx f

Parameters:
Returns: Map<THREE list, THREE> * Map<THREE list, THREE> * Map<THREE list, THREE>

compute the cofactors of a given function

idx : int
f : Map<THREE list, THREE>
Returns: Map<THREE list, THREE> * Map<THREE list, THREE> * Map<THREE list, THREE>

GetHazards f

Full Usage: GetHazards f

Parameters:
Returns: Set<THREE * THREE list>

compute all hazards of a given ternary function; the hazards are returned as a set of pairs (b,x) such that the function has a logic 1-hazard at x if b is TRUE, the function has a logic 0-hazard at x if b is FALSE, and f has a function hazard at x if b is BOT.

f : Map<THREE list, THREE>
Returns: Set<THREE * THREE list>

MTab2DNF f

Full Usage: MTab2DNF f

Parameters:
Returns: Set<Set<TernaryLogic>>

MTab2DNF computes for a monotone ternary function table a propositional logic formula in DNF. The result is returned as a set of set of literals.

f : Map<THREE list, THREE>
Returns: Set<Set<TernaryLogic>>

MTab2MukaDNF f

Full Usage: MTab2MukaDNF f

Parameters:
Returns: Set<Set<TernaryLogic>> * Set<Set<TernaryLogic>>

MTab2MukaDNF computes for a monotone ternary function table a propositional logic formula of the form Φ1 ∨ ⊥∧¬Φ0 where Φ1 and Φ0 are in DNF. Hence, the function returns a pair (Φ1,Φ0) where both Φ1 and Φ0 are sets of sets of literals.

f : Map<THREE list, THREE>
Returns: Set<Set<TernaryLogic>> * Set<Set<TernaryLogic>>

MkFunctionOfPrimes (stablePrime0, stablePrime1)

Full Usage: MkFunctionOfPrimes (stablePrime0, stablePrime1)

Parameters:
    stablePrime0 : THREE list array
    stablePrime1 : THREE list array

Returns: Map<THREE list, THREE>

given disjoint primes prime0 and prime1 as generated by function MkStablePrimes, this function generates a stable function with the same boolean core

stablePrime0 : THREE list array
stablePrime1 : THREE list array
Returns: Map<THREE list, THREE>

MkHazardFree f

Full Usage: MkHazardFree f

Parameters:
Returns: Map<THREE list, THREE>

generate the maximal hazard-free function for a given function

f : Map<THREE list, THREE>
Returns: Map<THREE list, THREE>

MkStablePrimes (prime0, prime1)

Full Usage: MkStablePrimes (prime0, prime1)

Parameters:
Returns: THREE list array * THREE list array

This function modifies the prime implicants prime0 and prime1 of a ternary function so that the primes represent a stable function with the same boolean core.

prime0 : Set<THREE list>
prime1 : Set<THREE list>
Returns: THREE list array * THREE list array

MonotonicExtensions f

Full Usage: MonotonicExtensions f

Parameters:
Returns: Set<Map<THREE list, THREE>>

compute all total monotonic extensions of a partial ternary function

f : Map<THREE list, THREE>
Returns: Set<Map<THREE list, THREE>>

ParseTernaryLogic s

Full Usage: ParseTernaryLogic s

Parameters:
    s : string

Returns: TernaryLogic

This function parses a string to a ternary logic formula

s : string
Returns: TernaryLogic

PrimeSpectrum f

Full Usage: PrimeSpectrum f

Parameters:
Returns: Set<THREE list> * Set<THREE list> * Set<THREE list>

compute the spectrum of the given monotone function, i.e., the set of minimal input vectors where f(x)=0 or f(x)=1 holds, and the set of maximal input vectors where f(x)=⊥ holds.

f : Map<THREE list, THREE>
Returns: Set<THREE list> * Set<THREE list> * Set<THREE list>

PrintFiringTable ostr (prime0, prime1)

Full Usage: PrintFiringTable ostr (prime0, prime1)

Parameters:

print a firing table in html format

ostr : TextWriter
prime0 : THREE list seq
prime1 : THREE list seq

PrintFunctionAsHtmlTable useTH ostr f

Full Usage: PrintFunctionAsHtmlTable useTH ostr f

Parameters:

print a function table in html format

useTH : bool
ostr : TextWriter
f : Map<List<THREE>, THREE>

PrintFunctionAsLatexTable ostr f

Full Usage: PrintFunctionAsLatexTable ostr f

Parameters:

print a function table in LaTeX format

ostr : TextWriter
f : Map<List<THREE>, THREE>

PrintFunctionAsTextTable ostr f

Full Usage: PrintFunctionAsTextTable ostr f

Parameters:

print a function table in ASCII format

ostr : TextWriter
f : Map<List<THREE>, THREE>

TTab2DNF f

Full Usage: TTab2DNF f

Parameters:
Returns: Set<Set<TernaryLogic>>

TTab2DNF computes for a ternary function table a propositional logic formula in DNF. The result is returned as a set of set of literals.

f : Map<THREE list, THREE>
Returns: Set<Set<TernaryLogic>>

TernaryLogic2Latex e

Full Usage: TernaryLogic2Latex e

Parameters:
Returns: string
e : TernaryLogic
Returns: string

TernaryLogic2TernFun t

Full Usage: TernaryLogic2TernFun t

Parameters:
Returns: Map<THREE list, THREE>

convert a ternary logic expression to an explicit map

t : TernaryLogic
Returns: Map<THREE list, THREE>

TernaryLogicEquiv t1 t2

Full Usage: TernaryLogicEquiv t1 t2

Parameters:
Returns: Map<string, THREE> list

check equivalence of two ternary logic expressions

t1 : TernaryLogic
t2 : TernaryLogic
Returns: Map<string, THREE> list

TernaryLogicTool qscoll

Full Usage: TernaryLogicTool qscoll

Parameters:

teaching tool function

qscoll : NameValueCollection

TernaryLogicValidity t

Full Usage: TernaryLogicValidity t

Parameters:
Returns: Map<string, THREE> list

check validity of two ternary logic expressions (only makes sense for formulas with equality)

t : TernaryLogic
Returns: Map<string, THREE> list

VarsOfTernaryLogic t

Full Usage: VarsOfTernaryLogic t

Parameters:
Returns: Set<string>

compute the set of variables that occur in a ternary logic expression

t : TernaryLogic
Returns: Set<string>

funLattice2Dot ostr fS printTable

Full Usage: funLattice2Dot ostr fS printTable

Parameters:

compare all ternary functions of a given set an draw a Hasse diagram in graphviz format where the function printTable is used to print each one

ostr : 'a
fS : Set<Map<List<THREE>, THREE>>
printTable : 'a -> Map<List<THREE>, THREE> -> unit

inf x1 x2

Full Usage: inf x1 x2

Parameters:
Returns: THREE

infimum of two values

x1 : THREE
x2 : THREE
Returns: THREE

infMany vS

Full Usage: infMany vS

Parameters:
Returns: THREE

compute infimum and supremum of a set of values

vS : THREE seq
Returns: THREE

infSeq x1 x2

Full Usage: infSeq x1 x2

Parameters:
Returns: THREE list

infimum on the components of two vectors

x1 : THREE list
x2 : THREE list
Returns: THREE list

isBternary f

Full Usage: isBternary f

Parameters:
Returns: bool

check whether a given function is B-ternary

f : Map<THREE list, THREE>
Returns: bool

isCommutative f

Full Usage: isCommutative f

Parameters:
Returns: bool

check commutativity of a ternary function with two arguments

f : Map<List<THREE>, THREE>
Returns: bool

isDC1 f

Full Usage: isDC1 f

Parameters:
Returns: bool

check whether a given function is has a DC1 decomposition by x[n-1]

f : Map<THREE list, THREE>
Returns: bool

isDC2 f

Full Usage: isDC2 f

Parameters:
Returns: bool

check whether a given function is has a DC2 decomposition by x[n-1]

f : Map<THREE list, THREE>
Returns: bool

isDC3 f

Full Usage: isDC3 f

Parameters:
Returns: bool

check whether a given function is has a DC3 decomposition by x[n-1]

f : Map<THREE list, THREE>
Returns: bool

isLogicHazardFree f

Full Usage: isLogicHazardFree f

Parameters:
Returns: bool

check whether a given ternary function has no logic hazards

f : Map<THREE list, THREE>
Returns: bool

isMonotone f

Full Usage: isMonotone f

Parameters:
Returns: bool

check monotonicity of a (totally defined) ternary function

f : Map<List<THREE>, THREE>
Returns: bool

isSequential f

Full Usage: isSequential f

Parameters:
Returns: bool

check whether a given function is sequential; if so, it returns a sequential decomposition

f : Map<THREE list, THREE>
Returns: bool

isStable f

Full Usage: isStable f

Parameters:
Returns: bool

check whether a given function is stable

f : Map<THREE list, THREE>
Returns: bool

joinable xL1 xL2

Full Usage: joinable xL1 xL2

Parameters:
Returns: bool

check whether two vectors are joinable, i.e., have an upper bound

xL1 : THREE list
xL2 : THREE list
Returns: bool

leq x1 x2

Full Usage: leq x1 x2

Parameters:
Returns: bool

this function defines the order of the semi-lattice

x1 : THREE
x2 : THREE
Returns: bool

leqSeq xL1 xL2

Full Usage: leqSeq xL1 xL2

Parameters:
Returns: bool

extending the order to vectors of the same length

xL1 : THREE seq
xL2 : THREE seq
Returns: bool

Type something to start searching.