Class Gates


public class Gates extends ExampleFD
It specifies an adder using gates specified by extensional constraints.
Version:
4.9
  • Constructor Details

    • Gates

      public Gates()
  • Method Details

    • model

      public void model()
      Description copied from class: ExampleFD
      It specifies a standard way of modeling the problem.
      Specified by:
      model in class ExampleFD
    • model

      public void model(BiFunction<IntVar[],int[][],Constraint> tableConstraintProvider)
    • and

      public void and(BooleanVar in1, BooleanVar in2, BooleanVar out, BiFunction<IntVar[],int[][],Constraint> tableConstraintProvider)
      It imposes an extensional constraint enforcing an and relationship between two input parameters and an output parameter.
      Parameters:
      in1 - the first input parameter.
      in2 - the second input parameter.
      out - the output parameter.
      tableConstraintProvider - function that when provided input to create table constraint will create one.
    • or

      public void or(BooleanVar in1, BooleanVar in2, BooleanVar out, BiFunction<IntVar[],int[][],Constraint> tableConstraintProvider)
      It imposes an extensional constraint enforcing an or relationship between two input parameters and an output parameter.
      Parameters:
      in1 - the first input parameter.
      in2 - the second input parameter.
      out - the output parameter.
      tableConstraintProvider - function that when provided input to create table constraint will create one.
    • xor

      public void xor(BooleanVar in1, BooleanVar in2, BooleanVar out, BiFunction<IntVar[],int[][],Constraint> tableConstraintProvider)
      It imposes an extensional constraint enforcing an xor relationship between two input parameters and an output parameter.
      Parameters:
      in1 - the first input parameter.
      in2 - the second input parameter.
      out - the output parameter.
      tableConstraintProvider - function that when provided input to create table constraint will create one.
    • not

      public void not(BooleanVar in, BooleanVar out, BiFunction<IntVar[],int[][],Constraint> tableConstraintProvider)
      It imposes an extensional constraint enforcing an not relationship between input parameter and an output parameter.
      Parameters:
      in - the first input parameter.
      out - the output parameter.
      tableConstraintProvider - function that when provided input to create table constraint will create one.
    • main

      public static void main(String[] args)
      It executes a program to solve gates problems.
      Parameters:
      args - parameters (none)
    • searchSpecific

      public boolean searchSpecific()
      It provides a specific search with extensive printout of the result.
      Returns:
      true if there is a solution, false otherwise.
    • tableConstraintProviderUsingSimpleTable

      public static Constraint tableConstraintProviderUsingSimpleTable(IntVar[] vars, int[][] tuples)
    • tableConstraintProviderUsingExtensionalSTR

      public static Constraint tableConstraintProviderUsingExtensionalSTR(IntVar[] vars, int[][] tuples)