org.apache.sysds.runtime.privacy.propagation

## Class PrivacyPropagator

- java.lang.Object
- - org.apache.sysds.runtime.privacy.propagation.PrivacyPropagator

-     public class PrivacyPropagator
      extends Object

  Class with static methods merging privacy constraints of operands in expressions to generate the privacy constraints of the output.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PrivacyPropagator()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static PrivacyConstraint.PrivacyLevel` | `corePropagation(PrivacyConstraint.PrivacyLevel[] inputLevels, OperatorType operatorType)` Returns the output privacy level based on the given input privacy levels and operator type.
    `static PrivacyConstraint` | `mergeBinary(PrivacyConstraint privacyConstraint1, PrivacyConstraint privacyConstraint2)`
    `static PrivacyConstraint` | `mergeNary(PrivacyConstraint[] privacyConstraints)`
    `static PrivacyConstraint` | `mergeNary(PrivacyConstraint[] privacyConstraints, OperatorType operatorType)`
    `static Data` | `parseAndSetPrivacyConstraint(Data cd, org.apache.wink.json4j.JSONObject mtd)`
    `static void` | `postProcessInstruction(Instruction inst, ExecutionContext ec)` Propagate privacy constraints to output variables based on privacy constraint of CPOperand output in instruction which has been set during privacy propagation preprocessing.
    `static Instruction` | `preprocessAppendCPInstruction(AppendCPInstruction inst, ExecutionContext ec)`
    `static Instruction` | `preprocessBinaryCPInstruction(BinaryCPInstruction inst, ExecutionContext ec)`
    `static Instruction` | `preprocessBuiltinNary(BuiltinNaryCPInstruction inst, ExecutionContext ec)`
    `static Instruction` | `preprocessCPInstructionFineGrained(CPInstruction inst, ExecutionContext ec)`
    `static Instruction` | `preprocessExternal(FunctionCallCPInstruction inst, ExecutionContext ec)`
    `static Instruction` | `preprocessInstruction(Instruction inst, ExecutionContext ec)` Propagate privacy constraints from input to output CPOperands in case the privacy constraints of the input are activated.
    `static Instruction` | `preprocessInstructionSimple(Instruction inst, ExecutionContext ec)` Throw exception if privacy constraints are activated or return instruction if privacy is not activated
    `static Instruction` | `preprocessMultiReturn(ComputationCPInstruction inst, ExecutionContext ec)`
    `static Instruction` | `preprocessParameterizedBuiltin(ParameterizedBuiltinCPInstruction inst, ExecutionContext ec)`
    `static Instruction` | `preprocessQuaternary(QuaternaryCPInstruction inst, ExecutionContext ec)`
    `static Instruction` | `preprocessTernaryCPInstruction(ComputationCPInstruction inst, ExecutionContext ec)`
    `static Instruction` | `preprocessUnaryCPInstruction(UnaryCPInstruction inst, ExecutionContext ec)`
    `static Instruction` | `preprocessVariableCPInstruction(VariableCPInstruction inst, ExecutionContext ec)`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PrivacyPropagator

          public PrivacyPropagator()

  - ### Method Detail

    - #### parseAndSetPrivacyConstraint

          public static Data parseAndSetPrivacyConstraint(Data cd,
                                                          org.apache.wink.json4j.JSONObject mtd)
                                                   throws org.apache.wink.json4j.JSONException

      Throws:
        `org.apache.wink.json4j.JSONException`

    - #### corePropagation

          public static PrivacyConstraint.PrivacyLevel corePropagation(PrivacyConstraint.PrivacyLevel[] inputLevels,
                                                                       OperatorType operatorType)

      Returns the output privacy level based on the given input privacy levels and operator type. It represents the basic logic of privacy propagation: Unary input: Input | NonAggregate | Aggregate ----------------------------------- priv | priv | priv privAgg | privAgg | none none | none | none Binary input: Input | NonAggregate | Aggregate -------------------------------------------- priv-priv | priv | priv priv-privAgg | priv | priv priv-none | priv | priv privAgg-priv | priv | priv none-priv | priv | priv privAgg-privAgg | privAgg | none none-none | none | none privAgg-none | privAgg | none none-privAgg | privAgg | none
      Parameters:
        `inputLevels` - privacy levels of the input
        `operatorType` - type of the operator which is either an aggregation (Aggregate) or not an aggregation (NonAggregate)
      Returns:
        output privacy level

    - #### mergeNary

          public static PrivacyConstraint mergeNary(PrivacyConstraint[] privacyConstraints,
                                                    OperatorType operatorType)

    - #### mergeBinary

          public static PrivacyConstraint mergeBinary(PrivacyConstraint privacyConstraint1,
                                                      PrivacyConstraint privacyConstraint2)

    - #### mergeNary

          public static PrivacyConstraint mergeNary(PrivacyConstraint[] privacyConstraints)

    - #### preprocessInstruction

          public static Instruction preprocessInstruction(Instruction inst,
                                                          ExecutionContext ec)

      Propagate privacy constraints from input to output CPOperands in case the privacy constraints of the input are activated.
      Parameters:
        `inst` - instruction for which the privacy constraints are propagated
        `ec` - execution context
      Returns:
        instruction with propagated privacy constraints (usually the same instance as the input inst)

    - #### preprocessCPInstructionFineGrained

          public static Instruction preprocessCPInstructionFineGrained(CPInstruction inst,
                                                                       ExecutionContext ec)

    - #### preprocessAppendCPInstruction

          public static Instruction preprocessAppendCPInstruction(AppendCPInstruction inst,
                                                                  ExecutionContext ec)

    - #### preprocessBinaryCPInstruction

          public static Instruction preprocessBinaryCPInstruction(BinaryCPInstruction inst,
                                                                  ExecutionContext ec)

    - #### preprocessInstructionSimple

          public static Instruction preprocessInstructionSimple(Instruction inst,
                                                                ExecutionContext ec)

      Throw exception if privacy constraints are activated or return instruction if privacy is not activated
      Parameters:
        `inst` - instruction
        `ec` - execution context
      Returns:
        instruction

    - #### preprocessExternal

          public static Instruction preprocessExternal(FunctionCallCPInstruction inst,
                                                       ExecutionContext ec)

    - #### preprocessMultiReturn

          public static Instruction preprocessMultiReturn(ComputationCPInstruction inst,
                                                          ExecutionContext ec)

    - #### preprocessParameterizedBuiltin

          public static Instruction preprocessParameterizedBuiltin(ParameterizedBuiltinCPInstruction inst,
                                                                   ExecutionContext ec)

    - #### preprocessBuiltinNary

          public static Instruction preprocessBuiltinNary(BuiltinNaryCPInstruction inst,
                                                          ExecutionContext ec)

    - #### preprocessQuaternary

          public static Instruction preprocessQuaternary(QuaternaryCPInstruction inst,
                                                         ExecutionContext ec)

    - #### preprocessTernaryCPInstruction

          public static Instruction preprocessTernaryCPInstruction(ComputationCPInstruction inst,
                                                                   ExecutionContext ec)

    - #### preprocessUnaryCPInstruction

          public static Instruction preprocessUnaryCPInstruction(UnaryCPInstruction inst,
                                                                 ExecutionContext ec)

    - #### preprocessVariableCPInstruction

          public static Instruction preprocessVariableCPInstruction(VariableCPInstruction inst,
                                                                    ExecutionContext ec)

    - #### postProcessInstruction

          public static void postProcessInstruction(Instruction inst,
                                                    ExecutionContext ec)

      Propagate privacy constraints to output variables based on privacy constraint of CPOperand output in instruction which has been set during privacy propagation preprocessing.
      Parameters:
        `inst` - instruction for which privacy constraints are propagated
        `ec` - execution context

Copyright © 2021 The Apache Software Foundation. All rights reserved.