All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.cvc5.modes.ProofFormat Maven / Gradle / Ivy

The newest version!
package io.github.cvc5.modes;

import io.github.cvc5.CVC5ApiException;
import java.util.HashMap;
import java.util.Map;

public enum ProofFormat
{
  /**
   * Do not translate proof output.
   */
  NONE(0),
  /**
   * Output DOT proof.
   */
  DOT(1),
  /**
   * Output LFSC proof.
   */
  LFSC(2),
  /**
   * Output Alethe proof.
   */
  ALETHE(3),
  /**
   * Output Cooperating Proof Calculus proof based on Eunoia signatures.
   */
  CPC(4),
  /**
   * Use the proof format mode set in the solver options.
   */
  DEFAULT(5),
;

  /* the int value of the ProofFormat */
  private int value;
  private static int minValue = 0;
  private static int maxValue = 0;
  private static Map enumMap = new HashMap<>();

  private ProofFormat(int value)
  {
    this.value = value;
  }

  static
  {
    boolean firstValue = true;
    for (ProofFormat enumerator : ProofFormat.values())
    {
      int value = enumerator.getValue();
      if (firstValue)
      {
        minValue = value;
        maxValue = value;
        firstValue = false;
      }
      minValue = Math.min(minValue, value);
      maxValue = Math.max(maxValue, value);
      enumMap.put(value, enumerator);
    }
  }

  public static ProofFormat fromInt(int value) throws CVC5ApiException
  {
    if (value < minValue || value > maxValue)
    {
      throw new CVC5ApiException("ProofFormat value " + value + " is outside the valid range ["
          + minValue + "," + maxValue + "]");
    }
    return enumMap.get(value);
  }

  public int getValue()
  {
    return value;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy