public static SemanticType Compose(AtomicType input, AtomicType intermediate, AtomicType output) { return(new FunctionalType(new SemanticType[] { new FunctionalType(new SemanticType[] { input }, intermediate), new FunctionalType(new SemanticType[] { intermediate }, output), input }, output)); }
public override int CompareTo(SemanticType other) { if (other is FunctionalType) { return(-1); } AtomicType that = other as AtomicType; int thisValue = 0; if (this.Equals(INDIVIDUAL)) { thisValue = 0; } else if (this.Equals(TRUTH_VALUE)) { thisValue = 1; } else if (this.Equals(CONFORMITY_VALUE)) { thisValue = 2; } else if (this.Equals(QUESTION)) { thisValue = 3; } else if (this.Equals(ASSERTION)) { thisValue = 4; } int thatValue = 0; if (that.Equals(INDIVIDUAL)) { thatValue = 0; } else if (that.Equals(TRUTH_VALUE)) { thatValue = 1; } else if (that.Equals(CONFORMITY_VALUE)) { thatValue = 2; } else if (that.Equals(QUESTION)) { thatValue = 3; } else if (that.Equals(ASSERTION)) { thatValue = 4; } return(thisValue - thatValue); }
public FunctionalType(SemanticType[] input, AtomicType output) { for (int i = 0; i < input.Length; i++) { if (input[i] == null) { throw new ArgumentException("SemanticType constructor: inputs must not be null"); } } Input = input; Output = output; }