Package edu.cornell.cs.apl.viaduct.selection

Types

AbstractProtocolComposer
Link copied to clipboard
abstract class AbstractProtocolComposer : ProtocolComposer

A ProtocolComposer with sensible defaults.

And
Link copied to clipboard
data class And(props: List<SelectionConstraint>) : SelectionConstraint
CommunicationEvent
Link copied to clipboard
data class CommunicationEvent(send: OutputPort, recv: InputPort)
Cost
Link copied to clipboard
data class Cost<C : CostMonoid<C>>(features: PersistentMap<CostFeature, C>) : CostMonoid<Cost<C>> , Map<CostFeature, C> , PrettyPrintable

The cost of executing a piece of code or sending a message. Consists of a map of features over some cost monoid.

CostAdd
Link copied to clipboard
data class CostAdd(lhs: SymbolicCost, rhs: SymbolicCost) : SymbolicCost
CostChoice
Link copied to clipboard
data class CostChoice(choices: List<Pair<SelectionConstraint, SymbolicCost>>) : SymbolicCost

Cost determined by which guard is true. Exactly one guard must be true.

CostEstimator
Link copied to clipboard
interface CostEstimator<C : CostMonoid<C>>

A modular cost model for estimating the cost of executing a program given a protocol assignment.

CostFeature
Link copied to clipboard
typealias CostFeature = String
CostLiteral
Link copied to clipboard
data class CostLiteral(cost: Int) : SymbolicCost
CostMax
Link copied to clipboard
data class CostMax(lhs: SymbolicCost, rhs: SymbolicCost) : SymbolicCost
CostMonoid
Link copied to clipboard
interface CostMonoid<C : CostMonoid<C>> : PrettyPrintable

A commutative monoid that represents a notion of cost for a feature.

CostMul
Link copied to clipboard
data class CostMul(lhs: Int, rhs: SymbolicCost) : SymbolicCost

Multiply cost expression with a scalar. Restrict to scalar multiplication to keep constraint problem linear.

False
Link copied to clipboard
object False : SelectionConstraint
FunctionVariable
Link copied to clipboard
data class FunctionVariable(function: FunctionName, variable: Variable) : PrettyPrintable
GuardVisibilityFlag
Link copied to clipboard
data class GuardVisibilityFlag(variable: String) : SelectionConstraint
HostVariable
Link copied to clipboard
data class HostVariable(variable: String) : SelectionConstraint
Implies
Link copied to clipboard
data class Implies(lhs: SelectionConstraint, rhs: SelectionConstraint) : SelectionConstraint
IntegerCost
Link copied to clipboard
class IntegerCost(cost: Int) : CostMonoid<IntegerCost>
Literal
Link copied to clipboard
data class Literal(literalValue: Boolean) : SelectionConstraint
Not
Link copied to clipboard
data class Not(rhs: SelectionConstraint) : SelectionConstraint
Or
Link copied to clipboard
data class Or(props: List<SelectionConstraint>) : SelectionConstraint
ProtocolAssignment
Link copied to clipboard
data class ProtocolAssignment(assignment: Map<FunctionVariable, Protocol>, propModel: Map<String, Boolean>, problem: SelectionProblem)
ProtocolCommunication
Link copied to clipboard
data class ProtocolCommunication(events: Set<CommunicationEvent>) : Set<CommunicationEvent>
ProtocolComposer
Link copied to clipboard
abstract class ProtocolComposer
ProtocolFactory
Link copied to clipboard
interface ProtocolFactory

Generates a list of Protocols that can implement a given Node, along with constraints that specify when using these protocols is valid.

ProtocolSelection
Link copied to clipboard
class ProtocolSelection(solver: SelectionProblemSolver, protocolFactory: ProtocolFactory, protocolComposer: ProtocolComposer, costEstimator: CostEstimator<IntegerCost>)
SelectionConstraint
Link copied to clipboard
sealed class SelectionConstraint : PrettyPrintable

Custom selection constraints specified for constraint solving during splitting.

SelectionConstraintGenerator
Link copied to clipboard
class SelectionConstraintGenerator(program: ProgramNode, protocolFactory: ProtocolFactory, protocolComposer: ProtocolComposer, costEstimator: CostEstimator<IntegerCost>)
SelectionProblem
Link copied to clipboard
data class SelectionProblem(constraints: Set<SelectionConstraint>, cost: SymbolicCost, costMap: Map<Node, SymbolicCost>)

A constrained optimization problem defined by a set of selection constraints and a cost expression to minimize.

SelectionProblemSolver
Link copied to clipboard
interface SelectionProblemSolver
SimpleCostEstimator
Link copied to clipboard
class SimpleCostEstimator(protocolComposer: ProtocolComposer, costRegime: SimpleCostRegime) : CostEstimator<IntegerCost>

Cost estimator for Local, Replication and ABY protocols.

SimpleCostRegime
Link copied to clipboard
enum SimpleCostRegime : Enum<SimpleCostRegime>
SymbolicCost
Link copied to clipboard
sealed class SymbolicCost : CostMonoid<SymbolicCost>

Symbolic cost that will be minimized by a solver.

True
Link copied to clipboard
object True : SelectionConstraint
VariableEquals
Link copied to clipboard
data class VariableEquals(var1: FunctionVariable, var2: FunctionVariable) : SelectionConstraint

Protocols for v1 and v2 are equal.

VariableIn
Link copied to clipboard
data class VariableIn(variable: FunctionVariable, protocol: Protocol) : SelectionConstraint

VariableIn(v, P) holds when v is selected to be a protocol in P

Z3Selection
Link copied to clipboard
class Z3Selection : SelectionProblemSolver

Constraint problem using Z3. Z3 has an optimization module that can return models with minimal cost.

Functions

cached
Link copied to clipboard
fun ProtocolComposer.cached(): ProtocolComposer

Caches values returned by ProtocolComposer.communicateOrNull so it is called once per source/destination pair.

filter
Link copied to clipboard
fun ProtocolFactory.filter(predicate: (Protocol) -> Boolean): ProtocolFactory

Restricts the given factory to protocols that satisfy predicate.

functionVariables
Link copied to clipboard
fun SelectionConstraint.functionVariables(): Set<FunctionVariable>

Some convenience functions.

guardVisibilityVariables
Link copied to clipboard
hostVariables
Link copied to clipboard
fun SelectionConstraint.hostVariables(): Set<HostVariable>
protocols
Link copied to clipboard
fun SelectionConstraint.protocols(): Set<Protocol>
readsFrom
Link copied to clipboard
fun ExpressionNode.readsFrom(nameAnalysis: NameAnalysis, prots: Set<Protocol>): SelectionConstraint

States whether an expression reads only from the protocols in prots

fun DeclarationNode.readsFrom(nameAnalysis: NameAnalysis, to: Set<Protocol>, from: Set<Protocol>): SelectionConstraint

fun LetNode.readsFrom(nameAnalysis: NameAnalysis, to: Set<Protocol>, from: Set<Protocol>): SelectionConstraint

States that if the let node is stored at any protocol in to, it reads from only the protocols in from

sendsTo
Link copied to clipboard
fun DeclarationNode.sendsTo(nameAnalysis: NameAnalysis, from: Set<Protocol>, to: Set<Protocol>): SelectionConstraint

fun LetNode.sendsTo(nameAnalysis: NameAnalysis, from: Set<Protocol>, to: Set<Protocol>): SelectionConstraint

States that if the let node is stores at any protocol in from, it sends to only the protocols in to

unions
Link copied to clipboard
fun Iterable<ProtocolFactory>.unions(): ProtocolFactory

Combines given factories into a single factory that returns protocols from all of them.

fun Iterable<Pair<Set<ProtocolName>, ProtocolComposer>>.unions(): ProtocolComposer

Combines multiple protocol composers into one.

validateProtocolAssignment
Link copied to clipboard
fun validateProtocolAssignment(program: ProgramNode, protocolFactory: ProtocolFactory, protocolComposer: ProtocolComposer, costEstimator: CostEstimator<IntegerCost>, protocolAssignment: ProtocolAssignment)

This function provides a sanity check to ensure that a given protocol assignment satisfies all constraints required on it by the selector.

variableNames
Link copied to clipboard
fun SelectionConstraint.variableNames(): Set<String>