Averest


InterconnectNetworksBySMV Module

This file implements functions to generate SMV files for synthesizing correct sorting/splitter networks for a given number of inputs and a desired depth. Further options are found by the global variables below.

Functions and values

Function or value Description

BoolExpr2StringSMV phi

Full Usage: BoolExpr2StringSMV phi

Parameters:
Returns: string

converting a BoolExpr to a string in SMV format

phi : BoolExpr
Returns: string

InterconnectNetworksBySMVTool qscoll

Full Usage: InterconnectNetworksBySMVTool qscoll

Parameters:

the cgi program

qscoll : NameValueCollection

OutputEquations d n

Full Usage: OutputEquations d n

Parameters:
    d : int
    n : int

Returns: Map<(int * int), (Set<Set<BoolExpr> * BoolExpr> * BoolExpr)>

define y{i,k} as the output of channel i after level k; the result is a mapping of (i,k) to BoolExpr that are the case expressions defining y{i,k}

d : int
n : int
Returns: Map<(int * int), (Set<Set<BoolExpr> * BoolExpr> * BoolExpr)>

PredeterminedModules d n casNet

Full Usage: PredeterminedModules d n casNet

Parameters:
    d : int
    n : int
    casNet : (int * int)[][]

generate a map that holds the already predetermined CAS modules given by casNet and some propagation rules

d : int
n : int
casNet : (int * int)[][]

ReadNetworkFromFile inFile

Full Usage: ReadNetworkFromFile inFile

Parameters:
    inFile : string

Returns: (int * int)[][]

read in an incomplete comparator network from a file that shall be completed to a splitter network; the file should list the levels of comparators given in brackets [] containing pairs of integers separated by ";"

inFile : string
Returns: (int * int)[][]

SatisfyExactlyHalfofN eL

Full Usage: SatisfyExactlyHalfofN eL

Parameters:
Returns: BoolExpr list

determine a formula that states that exactly half of the given formulas hold; the result is a DNF of that formula (caution: exponential growth!)

eL : BoolExpr list
Returns: BoolExpr list

SetUpVariables d n

Full Usage: SetUpVariables d n

Parameters:
    d : int
    n : int

Returns: BoolExpr list

generate variables g_{i,j,k} meaning there is a comparator connecting lines i and j in level k, x_{i} meaning the value of input i, and y_{i}_{k} as the output of channel i after level k

d : int
n : int
Returns: BoolExpr list

WellformednessConstraints d n

Full Usage: WellformednessConstraints d n

Parameters:
    d : int
    n : int

Returns: BoolExpr list

generate well-formedness constraints on the variables g{i,j,k}

d : int
n : int
Returns: BoolExpr list

WriteSMV ostr n d

Full Usage: WriteSMV ostr n d

Parameters:

This function writes the SMV file to stream ostr that states that there is no wellformed comparator network with n inputs and maximal depth d.

ostr : TextWriter
n : int
d : int

casMap

Full Usage: casMap

Returns: Map<(int * int * int), bool>

casMap holds already predetermined CAS modules

Returns: Map<(int * int * int), bool>

computeModelCheckingProblem ostr d n casNet

Full Usage: computeModelCheckingProblem ostr d n casNet

Parameters:
    ostr : TextWriter
    d : int
    n : int
    casNet : (int * int)[][]

compute model checking problem

ostr : TextWriter
d : int
n : int
casNet : (int * int)[][]

flattenLevels

Full Usage: flattenLevels

Returns: bool

whether output equations shall be flattened to input variables

Returns: bool

flattenOutputEquations d n

Full Usage: flattenOutputEquations d n

Parameters:
    d : int
    n : int

expand output equations by replacing their left by right hand sides

d : int
n : int

fullLevels

Full Usage: fullLevels

Returns: bool

whether every channel in every level is connected by a CAS module

Returns: bool

gVar

Full Usage: gVar

Returns: BoolExpr[][][]

gVar[i].[j].[k] is an expression that holds iff channels (i,j) are connected by a CAS module in level k

Returns: BoolExpr[][][]

halfOfAsDNF

Full Usage: halfOfAsDNF

Returns: bool

whether halfOf constraint is given in DNF

Returns: bool

halfOfConstr

Full Usage: halfOfConstr

Returns: BoolExpr list

constraints on inputs for splitter (conjunction implies that half of them are true)

Returns: BoolExpr list

noComments

Full Usage: noComments

Returns: bool

don't print output comments, just write SMV file

Returns: bool

onlyFinalCrossHalves

Full Usage: onlyFinalCrossHalves

Returns: bool

whether only the final level of CAS modules may compare halves

Returns: bool

outEqsMap

Full Usage: outEqsMap

Returns: Map<(int * int), (Set<Set<BoolExpr> * BoolExpr> * BoolExpr)>

outEqsMap map (i,k) to a pair (cLL,d) where cLL is a set of guarded actions (gs,e) such that the conjunctions of gs imply y(i,k)=e

Returns: Map<(int * int), (Set<Set<BoolExpr> * BoolExpr> * BoolExpr)>

runNuSMV smvExe smvFileWriter

Full Usage: runNuSMV smvExe smvFileWriter

Parameters:
Returns: string

Running NuSMV on the web server with input coming from stdin: Expected arguments are smvExe which is the path of the executable file of NuSMV like "/srv/www-es/cgi-bin/NuSMV" and a function that will write a input file for NuSMV to a stream.

smvExe : string
smvFileWriter : StreamWriter -> unit
Returns: string

useFinalHC

Full Usage: useFinalHC

Returns: bool

whether final level of CAS network shall be a half cleaner

Returns: bool

useHalfOf

Full Usage: useHalfOf

Returns: bool

whether halfOf constraint shall be added (for splitter networks)

Returns: bool

useInitialPB

Full Usage: useInitialPB

Returns: bool

whether initial level of CAS network shall be a Parberry stage

Returns: bool

useSizeConstr

Full Usage: useSizeConstr

Returns: int option

whether there is a contraint on the number of CAS modules

Returns: int option

wffConstr

Full Usage: wffConstr

Returns: BoolExpr list

wellformedness constraints (conjunction must be satisfied)

Returns: BoolExpr list

xVar

Full Usage: xVar

Returns: BoolExpr[]

xVar[i] is an expression that denotes ith input

Returns: BoolExpr[]

yVar

Full Usage: yVar

Returns: BoolExpr[][]

yVar[i].[k] is an expression that denotes ith output of level k

Returns: BoolExpr[][]