// ===========================================================================
// This file has been generated by
// Typical, version 1.14.3,
// (C) 2004-2009 Robert Grimm and New York University,
// on Sunday, September 27, 2009 at 10:36:56 PM.
// Edit at your own risk.
// ===========================================================================

package xtc.typical;

import java.math.BigInteger;

import xtc.util.Pair;

import xtc.tree.Node;

/** Types for Typical. */
public class TypicalTypes {
  /** Implementation of constructor 'BoolT' in variant 'raw_type'. */
  public static class BoolT extends raw_type<Tuple.T0> {
    public BoolT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.BoolT;
    }

    public boolean isBoolT() {
      return true;
    }

    public String getName() {
      return "BoolT";
    }

    public String toString() {
      return "BoolT";
    }
  }

  /** Implementation of constructor 'IntT' in variant 'raw_type'. */
  public static class IntT extends raw_type<Tuple.T0> {
    public IntT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.IntT;
    }

    public boolean isIntT() {
      return true;
    }

    public String getName() {
      return "IntT";
    }

    public String toString() {
      return "IntT";
    }
  }

  /** Implementation of constructor 'Float32T' in variant 'raw_type'. */
  public static class Float32T extends raw_type<Tuple.T0> {
    public Float32T() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.Float32T;
    }

    public boolean isFloat32T() {
      return true;
    }

    public String getName() {
      return "Float32T";
    }

    public String toString() {
      return "Float32T";
    }
  }

  /** Implementation of constructor 'Float64T' in variant 'raw_type'. */
  public static class Float64T extends raw_type<Tuple.T0> {
    public Float64T() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.Float64T;
    }

    public boolean isFloat64T() {
      return true;
    }

    public String getName() {
      return "Float64T";
    }

    public String toString() {
      return "Float64T";
    }
  }

  /** Implementation of constructor 'StringT' in variant 'raw_type'. */
  public static class StringT extends raw_type<Tuple.T0> {
    public StringT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.StringT;
    }

    public boolean isStringT() {
      return true;
    }

    public String getName() {
      return "StringT";
    }

    public String toString() {
      return "StringT";
    }
  }

  /** Implementation of constructor 'WildcardT' in variant 'raw_type'. */
  public static class WildcardT extends raw_type<Tuple.T0> {
    public WildcardT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.WildcardT;
    }

    public boolean isWildcardT() {
      return true;
    }

    public String getName() {
      return "WildcardT";
    }

    public String toString() {
      return "WildcardT";
    }
  }

  /** Implementation of constructor 'AnyT' in variant 'raw_type'. */
  public static class AnyT extends raw_type<Tuple.T0> {
    public AnyT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.AnyT;
    }

    public boolean isAnyT() {
      return true;
    }

    public String getName() {
      return "AnyT";
    }

    public String toString() {
      return "AnyT";
    }
  }

  /** Implementation of constructor 'TypeName' in variant 'raw_type'. */
  public static class TypeName extends raw_type<Tuple.T1<String>> {
    public TypeName(String member1) {
      tuple = new Tuple.T1<String>(member1);
    }

    public final Tag tag() {
      return Tag.TypeName;
    }

    public boolean isTypeName() {
      return true;
    }

    public String getName() {
      return "TypeName";
    }

    public String toString() {
      return "TypeName of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'FunctionT' in variant 'raw_type'. */
  public static class FunctionT extends raw_type<Tuple.T2<Pair<TypicalTypes.raw_type<?>>, TypicalTypes.raw_type<?>>> {
    public FunctionT(Pair<TypicalTypes.raw_type<?>> member1, TypicalTypes.raw_type<?> member2) {
      tuple = new Tuple.T2<Pair<TypicalTypes.raw_type<?>>, TypicalTypes.raw_type<?>>(member1, member2);
    }

    public final Tag tag() {
      return Tag.FunctionT;
    }

    public boolean isFunctionT() {
      return true;
    }

    public String getName() {
      return "FunctionT";
    }

    public String toString() {
      return "FunctionT of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'ConstructorT' in variant 'raw_type'. */
  public static class ConstructorT extends raw_type<Tuple.T3<String, String, TypicalTypes.raw_type<?>>> {
    public ConstructorT(String member1, String member2, TypicalTypes.raw_type<?> member3) {
      tuple = new Tuple.T3<String, String, TypicalTypes.raw_type<?>>(member1, member2, member3);
    }

    public final Tag tag() {
      return Tag.ConstructorT;
    }

    public boolean isConstructorT() {
      return true;
    }

    public String getName() {
      return "ConstructorT";
    }

    public boolean equals(Object o) {
      if (o == null) {
        return false;
      }
      if (!(o instanceof ConstructorT)) {
        return false;
      }

      ConstructorT other = (ConstructorT)o;
      boolean res = true;

      res = res && Analyzer.equal(this.getTuple().get2(), other.getTuple().get2());
      return res;
    }

    public String toString() {
      return "ConstructorT of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'VariantT' in variant 'raw_type'. */
  public static class VariantT extends raw_type<Tuple.T1<Pair<TypicalTypes.raw_type<?>>>> {
    public VariantT(Pair<TypicalTypes.raw_type<?>> member1) {
      tuple = new Tuple.T1<Pair<TypicalTypes.raw_type<?>>>(member1);
    }

    public final Tag tag() {
      return Tag.VariantT;
    }

    public boolean isVariantT() {
      return true;
    }

    public String getName() {
      return "VariantT";
    }

    public String toString() {
      return "VariantT of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'FieldT' in variant 'raw_type'. */
  public static class FieldT extends raw_type<Tuple.T3<String, String, TypicalTypes.raw_type<?>>> {
    public FieldT(String member1, String member2, TypicalTypes.raw_type<?> member3) {
      tuple = new Tuple.T3<String, String, TypicalTypes.raw_type<?>>(member1, member2, member3);
    }

    public final Tag tag() {
      return Tag.FieldT;
    }

    public boolean isFieldT() {
      return true;
    }

    public String getName() {
      return "FieldT";
    }

    public boolean equals(Object o) {
      if (o == null) {
        return false;
      }
      if (!(o instanceof FieldT)) {
        return false;
      }

      FieldT other = (FieldT)o;
      boolean res = true;

      res = res && Analyzer.equal(this.getTuple().get3(), other.getTuple().get3());
      return res;
    }

    public String toString() {
      return "FieldT of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'RecordT' in variant 'raw_type'. */
  public static class RecordT extends raw_type<Tuple.T1<Pair<TypicalTypes.raw_type<?>>>> {
    public RecordT(Pair<TypicalTypes.raw_type<?>> member1) {
      tuple = new Tuple.T1<Pair<TypicalTypes.raw_type<?>>>(member1);
    }

    public final Tag tag() {
      return Tag.RecordT;
    }

    public boolean isRecordT() {
      return true;
    }

    public String getName() {
      return "RecordT";
    }

    public String toString() {
      return "RecordT of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'TupleT' in variant 'raw_type'. */
  public static class TupleT extends raw_type<Tuple.T1<Pair<TypicalTypes.raw_type<?>>>> {
    public TupleT(Pair<TypicalTypes.raw_type<?>> member1) {
      tuple = new Tuple.T1<Pair<TypicalTypes.raw_type<?>>>(member1);
    }

    public final Tag tag() {
      return Tag.TupleT;
    }

    public boolean isTupleT() {
      return true;
    }

    public String getName() {
      return "TupleT";
    }

    public String toString() {
      return "TupleT of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'VariableT' in variant 'raw_type'. */
  public static class VariableT extends raw_type<Tuple.T2<String, Boolean>> {
    public VariableT(String member1, Boolean member2) {
      tuple = new Tuple.T2<String, Boolean>(member1, member2);
    }

    public final Tag tag() {
      return Tag.VariableT;
    }

    public boolean isVariableT() {
      return true;
    }

    public String getName() {
      return "VariableT";
    }

    public String toString() {
      return "VariableT of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'ConstructedT' in variant 'raw_type'. */
  public static class ConstructedT extends raw_type<Tuple.T2<Pair<TypicalTypes.raw_type<?>>, String>> {
    public ConstructedT(Pair<TypicalTypes.raw_type<?>> member1, String member2) {
      tuple = new Tuple.T2<Pair<TypicalTypes.raw_type<?>>, String>(member1, member2);
    }

    public final Tag tag() {
      return Tag.ConstructedT;
    }

    public boolean isConstructedT() {
      return true;
    }

    public String getName() {
      return "ConstructedT";
    }

    public boolean equals(Object o) {
      if (o == null) {
        return false;
      }
      if (!(o instanceof ConstructedT)) {
        return false;
      }

      ConstructedT other = (ConstructedT)o;
      boolean res = true;

      res = res && Analyzer.equal(this.getTuple().get1(), other.getTuple().get1());
      res = res && Analyzer.equal(this.getTuple().get2(), other.getTuple().get2());
      return res;
    }

    public String toString() {
      return "ConstructedT of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'PairOfType' in variant 'raw_type'. */
  public static class PairOfType extends raw_type<Tuple.T2<TypicalTypes.raw_type<?>, TypicalTypes.raw_type<?>>> {
    public PairOfType(TypicalTypes.raw_type<?> member1, TypicalTypes.raw_type<?> member2) {
      tuple = new Tuple.T2<TypicalTypes.raw_type<?>, TypicalTypes.raw_type<?>>(member1, member2);
    }

    public final Tag tag() {
      return Tag.PairOfType;
    }

    public boolean isPairOfType() {
      return true;
    }

    public String getName() {
      return "PairOfType";
    }

    public String toString() {
      return "PairOfType of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'PolyVariantT' in variant 'raw_type'. */
  public static class PolyVariantT extends raw_type<Tuple.T1<Pair<TypicalTypes.raw_type<?>>>> {
    public PolyVariantT(Pair<TypicalTypes.raw_type<?>> member1) {
      tuple = new Tuple.T1<Pair<TypicalTypes.raw_type<?>>>(member1);
    }

    public final Tag tag() {
      return Tag.PolyVariantT;
    }

    public boolean isPolyVariantT() {
      return true;
    }

    public String getName() {
      return "PolyVariantT";
    }

    public String toString() {
      return "PolyVariantT of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'NodeTypeT' in variant 'raw_type'. */
  public static class NodeTypeT extends raw_type<Tuple.T0> {
    public NodeTypeT() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.NodeTypeT;
    }

    public boolean isNodeTypeT() {
      return true;
    }

    public String getName() {
      return "NodeTypeT";
    }

    public String toString() {
      return "NodeTypeT";
    }
  }

  /** Implementation of constructor 'StringName' in variant 'raw_type'. */
  public static class StringName extends raw_type<Tuple.T1<String>> {
    public StringName(String member1) {
      tuple = new Tuple.T1<String>(member1);
    }

    public final Tag tag() {
      return Tag.StringName;
    }

    public boolean isStringName() {
      return true;
    }

    public String getName() {
      return "StringName";
    }

    public String toString() {
      return "StringName of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'StringList' in variant 'raw_type'. */
  public static class StringList extends raw_type<Tuple.T1<Pair<String>>> {
    public StringList(Pair<String> member1) {
      tuple = new Tuple.T1<Pair<String>>(member1);
    }

    public final Tag tag() {
      return Tag.StringList;
    }

    public boolean isStringList() {
      return true;
    }

    public String getName() {
      return "StringList";
    }

    public String toString() {
      return "StringList of " + tuple.toString();
    }
  }

  /** Superclass of all constructors in variant 'raw_type'. */
  public static abstract class raw_type<T extends Tuple> extends Variant<T> {
    public static enum Tag {
      BoolT,
      IntT,
      Float32T,
      Float64T,
      StringT,
      WildcardT,
      AnyT,
      TypeName,
      FunctionT,
      ConstructorT,
      VariantT,
      FieldT,
      RecordT,
      TupleT,
      VariableT,
      ConstructedT,
      PairOfType,
      PolyVariantT,
      NodeTypeT,
      StringName,
      StringList
    }

    protected raw_type() {
    }

    public abstract Tag tag();

    public boolean isBoolT() {
      return false;
    }

    public boolean isIntT() {
      return false;
    }

    public boolean isFloat32T() {
      return false;
    }

    public boolean isFloat64T() {
      return false;
    }

    public boolean isStringT() {
      return false;
    }

    public boolean isWildcardT() {
      return false;
    }

    public boolean isAnyT() {
      return false;
    }

    public boolean isTypeName() {
      return false;
    }

    public boolean isFunctionT() {
      return false;
    }

    public boolean isConstructorT() {
      return false;
    }

    public boolean isVariantT() {
      return false;
    }

    public boolean isFieldT() {
      return false;
    }

    public boolean isRecordT() {
      return false;
    }

    public boolean isTupleT() {
      return false;
    }

    public boolean isVariableT() {
      return false;
    }

    public boolean isConstructedT() {
      return false;
    }

    public boolean isPairOfType() {
      return false;
    }

    public boolean isPolyVariantT() {
      return false;
    }

    public boolean isNodeTypeT() {
      return false;
    }

    public boolean isStringName() {
      return false;
    }

    public boolean isStringList() {
      return false;
    }
  }

  /** Implementation of record 'type'. */
  public static class type implements Record {
    public TypicalTypes.raw_type<?> type;

    public type(TypicalTypes.raw_type<?> type) {
      this.type = type;
    }

    public boolean equals(Object o) {
      if (o == null) {
        return false;
      }
      if (!(o instanceof type)) {
        return false;
      }

      type other = (type)o;
      boolean res = true;

      res = res && type.equals(other.type);
      return res;
    }

    public String toString() {
      return "{" + (null == type ? "?" : type.toString()) + "}";
    }
  }

  /** Implementation of record 'call'. */
  public static class call implements Record {
    public String caller;
    public String callee;

    public call(String caller, String callee) {
      this.caller = caller;
      this.callee = callee;
    }

    public boolean equals(Object o) {
      if (!(o instanceof call)) {
        return true;
      }

      final call r = Analyzer.cast(o);

      if (!(null != caller && caller.equals(null == r ? null : r.caller))) {
        return false;
      }
      if (!(null != callee && callee.equals(null == r ? null : r.callee))) {
        return false;
      }
      return true;
    }

    public String toString() {
      return "{" + (null == caller ? "?" : caller.toString()) + ","  + (null == callee ? "?" : callee.toString()) + "}";
    }
  }

  /** Implementation of record 'graph'. */
  public static class graph implements Record {
    public Pair<String> functionList;
    public Pair<TypicalTypes.call> edges;

    public graph(Pair<String> functionList, Pair<TypicalTypes.call> edges) {
      this.functionList = functionList;
      this.edges = edges;
    }

    public boolean equals(Object o) {
      if (!(o instanceof graph)) {
        return true;
      }

      final graph r = Analyzer.cast(o);

      if (!(null != functionList && functionList.equals(null == r ? null : r.functionList))) {
        return false;
      }
      if (!(null != edges && edges.equals(null == r ? null : r.edges))) {
        return false;
      }
      return true;
    }

    public String toString() {
      return "{" + (null == functionList ? "?" : functionList.toString()) + ","  + (null == edges ? "?" : edges.toString()) + "}";
    }
  }

  /** Implementation of record 'group'. */
  public static class group implements Record {
    public Pair<String> group;
    public Pair<Pair<String>> circles;

    public group(Pair<String> group, Pair<Pair<String>> circles) {
      this.group = group;
      this.circles = circles;
    }

    public boolean equals(Object o) {
      if (!(o instanceof group)) {
        return true;
      }

      final group r = Analyzer.cast(o);

      if (!(null != group && group.equals(null == r ? null : r.group))) {
        return false;
      }
      if (!(null != circles && circles.equals(null == r ? null : r.circles))) {
        return false;
      }
      return true;
    }

    public String toString() {
      return "{" + (null == group ? "?" : group.toString()) + ","  + (null == circles ? "?" : circles.toString()) + "}";
    }
  }

  /** Implementation of record 'nodeRec'. */
  public static class nodeRec implements Record {
    public String name;
    public Pair<String> mutualList;
    public Pair<String> dependList;

    public nodeRec(String name, Pair<String> mutualList, Pair<String> dependList) {
      this.name = name;
      this.mutualList = mutualList;
      this.dependList = dependList;
    }

    public boolean equals(Object o) {
      if (!(o instanceof nodeRec)) {
        return true;
      }

      final nodeRec r = Analyzer.cast(o);

      if (!(null != name && name.equals(null == r ? null : r.name))) {
        return false;
      }
      if (!(null != mutualList && mutualList.equals(null == r ? null : r.mutualList))) {
        return false;
      }
      if (!(null != dependList && dependList.equals(null == r ? null : r.dependList))) {
        return false;
      }
      return true;
    }

    public String toString() {
      return "{" + (null == name ? "?" : name.toString()) + ","  + (null == mutualList ? "?" : mutualList.toString()) + ","  + (null == dependList ? "?" : dependList.toString()) + "}";
    }
  }

  /** Implementation of record 'funcRec'. */
  public static class funcRec implements Record {
    public Pair<TypicalTypes.raw_type<?>> paras;
    public TypicalTypes.raw_type<?> ret;

    public funcRec(Pair<TypicalTypes.raw_type<?>> paras, TypicalTypes.raw_type<?> ret) {
      this.paras = paras;
      this.ret = ret;
    }

    public boolean equals(Object o) {
      if (!(o instanceof funcRec)) {
        return true;
      }

      final funcRec r = Analyzer.cast(o);

      if (!(null != paras && paras.equals(null == r ? null : r.paras))) {
        return false;
      }
      if (!(null != ret && ret.equals(null == r ? null : r.ret))) {
        return false;
      }
      return true;
    }

    public String toString() {
      return "{" + (null == paras ? "?" : paras.toString()) + ","  + (null == ret ? "?" : ret.toString()) + "}";
    }
  }

  /** Implementation of record 'entry'. */
  public static class entry implements Record {
    public String entryName;
    public TypicalTypes.raw_type<?> entryType;

    public entry(String entryName, TypicalTypes.raw_type<?> entryType) {
      this.entryName = entryName;
      this.entryType = entryType;
    }

    public boolean equals(Object o) {
      if (!(o instanceof entry)) {
        return true;
      }

      final entry r = Analyzer.cast(o);

      if (!(null != entryName && entryName.equals(null == r ? null : r.entryName))) {
        return false;
      }
      if (!(null != entryType && entryType.equals(null == r ? null : r.entryType))) {
        return false;
      }
      return true;
    }

    public String toString() {
      return "{" + (null == entryName ? "?" : entryName.toString()) + ","  + (null == entryType ? "?" : entryType.toString()) + "}";
    }
  }

  /** Implementation of constructor 'BotPattern' in variant 'pattern'. */
  public static class BotPattern extends pattern<Tuple.T0> {
    public BotPattern() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.BotPattern;
    }

    public boolean isBotPattern() {
      return true;
    }

    public String getName() {
      return "BotPattern";
    }

    public String toString() {
      return "BotPattern";
    }
  }

  /** Implementation of constructor 'WildCardPattern' in variant 'pattern'. */
  public static class WildCardPattern extends pattern<Tuple.T0> {
    public WildCardPattern() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.WildCardPattern;
    }

    public boolean isWildCardPattern() {
      return true;
    }

    public String getName() {
      return "WildCardPattern";
    }

    public String toString() {
      return "WildCardPattern";
    }
  }

  /** Implementation of constructor 'VariablePattern' in variant 'pattern'. */
  public static class VariablePattern extends pattern<Tuple.T1<String>> {
    public VariablePattern(String member1) {
      tuple = new Tuple.T1<String>(member1);
    }

    public final Tag tag() {
      return Tag.VariablePattern;
    }

    public boolean isVariablePattern() {
      return true;
    }

    public String getName() {
      return "VariablePattern";
    }

    public String toString() {
      return "VariablePattern of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'ConstantPattern' in variant 'pattern'. */
  public static class ConstantPattern extends pattern<Tuple.T1<TypicalTypes.value>> {
    public ConstantPattern(TypicalTypes.value member1) {
      tuple = new Tuple.T1<TypicalTypes.value>(member1);
    }

    public final Tag tag() {
      return Tag.ConstantPattern;
    }

    public boolean isConstantPattern() {
      return true;
    }

    public String getName() {
      return "ConstantPattern";
    }

    public String toString() {
      return "ConstantPattern of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'TupPattern' in variant 'pattern'. */
  public static class TupPattern extends pattern<Tuple.T1<Pair<TypicalTypes.patternRecord>>> {
    public TupPattern(Pair<TypicalTypes.patternRecord> member1) {
      tuple = new Tuple.T1<Pair<TypicalTypes.patternRecord>>(member1);
    }

    public final Tag tag() {
      return Tag.TupPattern;
    }

    public boolean isTupPattern() {
      return true;
    }

    public String getName() {
      return "TupPattern";
    }

    public String toString() {
      return "TupPattern of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'RecPattern' in variant 'pattern'. */
  public static class RecPattern extends pattern<Tuple.T1<Pair<TypicalTypes.patternRecord>>> {
    public RecPattern(Pair<TypicalTypes.patternRecord> member1) {
      tuple = new Tuple.T1<Pair<TypicalTypes.patternRecord>>(member1);
    }

    public final Tag tag() {
      return Tag.RecPattern;
    }

    public boolean isRecPattern() {
      return true;
    }

    public String getName() {
      return "RecPattern";
    }

    public String toString() {
      return "RecPattern of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'EmptyPattern' in variant 'pattern'. */
  public static class EmptyPattern extends pattern<Tuple.T0> {
    public EmptyPattern() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.EmptyPattern;
    }

    public boolean isEmptyPattern() {
      return true;
    }

    public String getName() {
      return "EmptyPattern";
    }

    public String toString() {
      return "EmptyPattern";
    }
  }

  /** Implementation of constructor 'PairPattern' in variant 'pattern'. */
  public static class PairPattern extends pattern<Tuple.T2<TypicalTypes.patternRecord, TypicalTypes.patternRecord>> {
    public PairPattern(TypicalTypes.patternRecord member1, TypicalTypes.patternRecord member2) {
      tuple = new Tuple.T2<TypicalTypes.patternRecord, TypicalTypes.patternRecord>(member1, member2);
    }

    public final Tag tag() {
      return Tag.PairPattern;
    }

    public boolean isPairPattern() {
      return true;
    }

    public String getName() {
      return "PairPattern";
    }

    public String toString() {
      return "PairPattern of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'RecFieldPattern' in variant 'pattern'. */
  public static class RecFieldPattern extends pattern<Tuple.T2<String, TypicalTypes.patternRecord>> {
    public RecFieldPattern(String member1, TypicalTypes.patternRecord member2) {
      tuple = new Tuple.T2<String, TypicalTypes.patternRecord>(member1, member2);
    }

    public final Tag tag() {
      return Tag.RecFieldPattern;
    }

    public boolean isRecFieldPattern() {
      return true;
    }

    public String getName() {
      return "RecFieldPattern";
    }

    public String toString() {
      return "RecFieldPattern of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'ConstructorPattern' in variant 'pattern'. */
  public static class ConstructorPattern extends pattern<Tuple.T2<String, Pair<TypicalTypes.patternRecord>>> {
    public ConstructorPattern(String member1, Pair<TypicalTypes.patternRecord> member2) {
      tuple = new Tuple.T2<String, Pair<TypicalTypes.patternRecord>>(member1, member2);
    }

    public final Tag tag() {
      return Tag.ConstructorPattern;
    }

    public boolean isConstructorPattern() {
      return true;
    }

    public String getName() {
      return "ConstructorPattern";
    }

    public String toString() {
      return "ConstructorPattern of " + tuple.toString();
    }
  }

  /** Superclass of all constructors in variant 'pattern'. */
  public static abstract class pattern<T extends Tuple> extends Variant<T> {
    public static enum Tag {
      BotPattern,
      WildCardPattern,
      VariablePattern,
      ConstantPattern,
      TupPattern,
      RecPattern,
      EmptyPattern,
      PairPattern,
      RecFieldPattern,
      ConstructorPattern
    }

    protected pattern() {
    }

    public abstract Tag tag();

    public boolean isBotPattern() {
      return false;
    }

    public boolean isWildCardPattern() {
      return false;
    }

    public boolean isVariablePattern() {
      return false;
    }

    public boolean isConstantPattern() {
      return false;
    }

    public boolean isTupPattern() {
      return false;
    }

    public boolean isRecPattern() {
      return false;
    }

    public boolean isEmptyPattern() {
      return false;
    }

    public boolean isPairPattern() {
      return false;
    }

    public boolean isRecFieldPattern() {
      return false;
    }

    public boolean isConstructorPattern() {
      return false;
    }
  }

  /** Implementation of record 'patternRecord'. */
  public static class patternRecord implements Record {
    public TypicalTypes.pattern pat;
    public Node nod;
    public Boolean guarded;

    public patternRecord(TypicalTypes.pattern pat, Node nod, Boolean guarded) {
      this.pat = pat;
      this.nod = nod;
      this.guarded = guarded;
    }

    public boolean equals(Object o) {
      if (!(o instanceof patternRecord)) {
        return true;
      }

      final patternRecord r = Analyzer.cast(o);

      if (!(null != pat && pat.equals(null == r ? null : r.pat))) {
        return false;
      }
      if (!(null != nod && nod.equals(null == r ? null : r.nod))) {
        return false;
      }
      if (!(null != guarded && guarded.equals(null == r ? null : r.guarded))) {
        return false;
      }
      return true;
    }

    public String toString() {
      return "{" + (null == pat ? "?" : pat.toString()) + ","  + (null == nod ? "?" : nod.toString()) + ","  + (null == guarded ? "?" : guarded.toString()) + "}";
    }
  }

  /** Implementation of constructor 'StringValue' in variant 'value'. */
  public static class StringValue extends value<Tuple.T1<String>> {
    public StringValue(String member1) {
      tuple = new Tuple.T1<String>(member1);
    }

    public final Tag tag() {
      return Tag.StringValue;
    }

    public boolean isStringValue() {
      return true;
    }

    public String getName() {
      return "StringValue";
    }

    public String toString() {
      return "StringValue of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'FloatValue' in variant 'value'. */
  public static class FloatValue extends value<Tuple.T1<Double>> {
    public FloatValue(Double member1) {
      tuple = new Tuple.T1<Double>(member1);
    }

    public final Tag tag() {
      return Tag.FloatValue;
    }

    public boolean isFloatValue() {
      return true;
    }

    public String getName() {
      return "FloatValue";
    }

    public String toString() {
      return "FloatValue of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'IntValue' in variant 'value'. */
  public static class IntValue extends value<Tuple.T1<BigInteger>> {
    public IntValue(BigInteger member1) {
      tuple = new Tuple.T1<BigInteger>(member1);
    }

    public final Tag tag() {
      return Tag.IntValue;
    }

    public boolean isIntValue() {
      return true;
    }

    public String getName() {
      return "IntValue";
    }

    public String toString() {
      return "IntValue of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'BoolValue' in variant 'value'. */
  public static class BoolValue extends value<Tuple.T1<Boolean>> {
    public BoolValue(Boolean member1) {
      tuple = new Tuple.T1<Boolean>(member1);
    }

    public final Tag tag() {
      return Tag.BoolValue;
    }

    public boolean isBoolValue() {
      return true;
    }

    public String getName() {
      return "BoolValue";
    }

    public String toString() {
      return "BoolValue of " + tuple.toString();
    }
  }

  /** Superclass of all constructors in variant 'value'. */
  public static abstract class value<T extends Tuple> extends Variant<T> {
    public static enum Tag {
      StringValue,
      FloatValue,
      IntValue,
      BoolValue
    }

    protected value() {
    }

    public abstract Tag tag();

    public boolean isStringValue() {
      return false;
    }

    public boolean isFloatValue() {
      return false;
    }

    public boolean isIntValue() {
      return false;
    }

    public boolean isBoolValue() {
      return false;
    }
  }

  /** Implementation of constructor 'None' in variant 'result'. */
  public static class None extends result<Tuple.T0> {
    public None() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.None;
    }

    public boolean isNone() {
      return true;
    }

    public String getName() {
      return "None";
    }

    public String toString() {
      return "None";
    }
  }

  /** Implementation of constructor 'Some' in variant 'result'. */
  public static class Some extends result<Tuple.T1<Pair<TypicalTypes.pattern>>> {
    public Some(Pair<TypicalTypes.pattern> member1) {
      tuple = new Tuple.T1<Pair<TypicalTypes.pattern>>(member1);
    }

    public final Tag tag() {
      return Tag.Some;
    }

    public boolean isSome() {
      return true;
    }

    public String getName() {
      return "Some";
    }

    public String toString() {
      return "Some of " + tuple.toString();
    }
  }

  /** Superclass of all constructors in variant 'result'. */
  public static abstract class result<T extends Tuple> extends Variant<T> {
    public static enum Tag {
      None,
      Some
    }

    protected result() {
    }

    public abstract Tag tag();

    public boolean isNone() {
      return false;
    }

    public boolean isSome() {
      return false;
    }
  }

  /** Implementation of constructor 'BotConstr' in variant 'constr'. */
  public static class BotConstr extends constr<Tuple.T0> {
    public BotConstr() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.BotConstr;
    }

    public boolean isBotConstr() {
      return true;
    }

    public String getName() {
      return "BotConstr";
    }

    public String toString() {
      return "BotConstr";
    }
  }

  /** Implementation of constructor 'WildConstr' in variant 'constr'. */
  public static class WildConstr extends constr<Tuple.T0> {
    public WildConstr() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.WildConstr;
    }

    public boolean isWildConstr() {
      return true;
    }

    public String getName() {
      return "WildConstr";
    }

    public String toString() {
      return "WildConstr";
    }
  }

  /** Implementation of constructor 'Const' in variant 'constr'. */
  public static class Const extends constr<Tuple.T1<TypicalTypes.value>> {
    public Const(TypicalTypes.value member1) {
      tuple = new Tuple.T1<TypicalTypes.value>(member1);
    }

    public final Tag tag() {
      return Tag.Const;
    }

    public boolean isConst() {
      return true;
    }

    public String getName() {
      return "Const";
    }

    public String toString() {
      return "Const of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'EmptyConstr' in variant 'constr'. */
  public static class EmptyConstr extends constr<Tuple.T0> {
    public EmptyConstr() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.EmptyConstr;
    }

    public boolean isEmptyConstr() {
      return true;
    }

    public String getName() {
      return "EmptyConstr";
    }

    public String toString() {
      return "EmptyConstr";
    }
  }

  /** Implementation of constructor 'PairConstr' in variant 'constr'. */
  public static class PairConstr extends constr<Tuple.T0> {
    public PairConstr() {
      tuple = new Tuple.T0();
    }

    public final Tag tag() {
      return Tag.PairConstr;
    }

    public boolean isPairConstr() {
      return true;
    }

    public String getName() {
      return "PairConstr";
    }

    public String toString() {
      return "PairConstr";
    }
  }

  /** Implementation of constructor 'CConstr' in variant 'constr'. */
  public static class CConstr extends constr<Tuple.T2<String, BigInteger>> {
    public CConstr(String member1, BigInteger member2) {
      tuple = new Tuple.T2<String, BigInteger>(member1, member2);
    }

    public final Tag tag() {
      return Tag.CConstr;
    }

    public boolean isCConstr() {
      return true;
    }

    public String getName() {
      return "CConstr";
    }

    public String toString() {
      return "CConstr of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'RecordConstr' in variant 'constr'. */
  public static class RecordConstr extends constr<Tuple.T1<BigInteger>> {
    public RecordConstr(BigInteger member1) {
      tuple = new Tuple.T1<BigInteger>(member1);
    }

    public final Tag tag() {
      return Tag.RecordConstr;
    }

    public boolean isRecordConstr() {
      return true;
    }

    public String getName() {
      return "RecordConstr";
    }

    public String toString() {
      return "RecordConstr of " + tuple.toString();
    }
  }

  /** Implementation of constructor 'TupleConstr' in variant 'constr'. */
  public static class TupleConstr extends constr<Tuple.T1<BigInteger>> {
    public TupleConstr(BigInteger member1) {
      tuple = new Tuple.T1<BigInteger>(member1);
    }

    public final Tag tag() {
      return Tag.TupleConstr;
    }

    public boolean isTupleConstr() {
      return true;
    }

    public String getName() {
      return "TupleConstr";
    }

    public String toString() {
      return "TupleConstr of " + tuple.toString();
    }
  }

  /** Superclass of all constructors in variant 'constr'. */
  public static abstract class constr<T extends Tuple> extends Variant<T> {
    public static enum Tag {
      BotConstr,
      WildConstr,
      Const,
      EmptyConstr,
      PairConstr,
      CConstr,
      RecordConstr,
      TupleConstr
    }

    protected constr() {
    }

    public abstract Tag tag();

    public boolean isBotConstr() {
      return false;
    }

    public boolean isWildConstr() {
      return false;
    }

    public boolean isConst() {
      return false;
    }

    public boolean isEmptyConstr() {
      return false;
    }

    public boolean isPairConstr() {
      return false;
    }

    public boolean isCConstr() {
      return false;
    }

    public boolean isRecordConstr() {
      return false;
    }

    public boolean isTupleConstr() {
      return false;
    }
  }

  private TypicalTypes() {
  }
}
