jif.types

## Class PrincipalConstraint

- java.lang.Object
- - jif.types.Constraint
  - - jif.types.PrincipalConstraint

-     public class PrincipalConstraint
      extends Constraint

  A `PrincipalConstraint` represents a constraint on principals, which may either be an actsfor or an equivalence constraint. `PrincipalConstraint`s are generated during type checking and label checking. `PrincipalConstraint`s in turn produce `Equations` which are what the `Solver` will use to find a satisfying assignment for `Variables`.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class jif.types.Constraint

      `Constraint.Kind`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Constraint.Kind` | `ACTSFOR` An actsfor kind of constraint.
    `static Constraint.Kind` | `EQUIV` An equivalence kind of constraint.

    - ### Fields inherited from class jif.types.Constraint

      `env, kind, lhs, messages, pos, report, rhs`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PrincipalConstraint(Principal lhs, Constraint.Kind kind, Principal rhs, LabelEnv env, polyglot.util.Position pos, ConstraintMessage msg, boolean report)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addActsforEqns(java.util.Collection<Equation> eqns, Principal left, Principal right)` Produce equations that require `left` to act for `right`, and add them to `eqns`.
    `java.util.Collection<Equation>` | `getEquations()` Produce a `Collection` of `Equations` for this constraint.
    `boolean` | `hasVariables()`
    `Principal` | `lhsPrincipal()`
    `Principal` | `rhsPrincipal()`

    - ### Methods inherited from class jif.types.Constraint

      `detailMsg, env, isCanonical, kind, messages, msg, position, report, technicalMsg, toString`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### EQUIV

          public static final Constraint.Kind EQUIV

      An equivalence kind of constraint. That is, the constraint requires that lhs ≽ rhs and rhs ≽ lhs.

    - #### ACTSFOR

          public static final Constraint.Kind ACTSFOR

      An actsfor kind of constraint. That is, the constraint requires that lhs ≽ rhs.

  - ### Constructor Detail

    - #### PrincipalConstraint

          public PrincipalConstraint(Principal lhs,
                                     Constraint.Kind kind,
                                     Principal rhs,
                                     LabelEnv env,
                                     polyglot.util.Position pos,
                                     ConstraintMessage msg,
                                     boolean report)

  - ### Method Detail

    - #### lhsPrincipal

          public Principal lhsPrincipal()

    - #### rhsPrincipal

          public Principal rhsPrincipal()

    - #### getEquations

          public java.util.Collection<Equation> getEquations()

      Produce a `Collection` of `Equations` for this constraint.
      Specified by:
        `getEquations` in class `Constraint`

    - #### addActsforEqns

          protected void addActsforEqns(java.util.Collection<Equation> eqns,
                                        Principal left,
                                        Principal right)

      Produce equations that require `left` to act for `right`, and add them to `eqns`.

    - #### hasVariables

          public boolean hasVariables()

      Specified by:
        `hasVariables` in class `Constraint`