Removed unused feature.

Optimized use statements in main.

Simplified truth_combinations code a little.

Updated OpenAPI spec
This commit is contained in:
Martin Berg Alstad
2024-06-22 20:38:55 +02:00
parent 38fc8ce383
commit 1b94e63915
11 changed files with 566 additions and 86 deletions

View File

@ -3,29 +3,50 @@ using TypeSpec.OpenAPI;
namespace Models;
@summary("A binary operator")
enum BinaryOperator {
AND,
OR,
IMPLICATION
AND,
OR,
IMPLICATION,
}
@summary("The inverse of an expression")
model ExpressionNot {
not: Expression;
@summary("The expression to negate")
not: Expression;
}
@summary("A binary expression")
model ExpressionBinary {
left: Expression;
operator: BinaryOperator;
right: Expression;
@summary("The left expression")
left: Expression;
@summary("The binary operator")
operator: BinaryOperator;
@summary("The right expression")
right: Expression;
}
@summary("An atomic expression")
model ExpressionAtomic {
atomic: string;
@summary("The atomic value")
atomic: string;
}
@oneOf
@summary("A truth expression")
union Expression {
ExpressionNot;
ExpressionBinary;
ExpressionAtomic;
}
ExpressionNot,
ExpressionBinary,
ExpressionAtomic,
}
@summary("A truth table")
model TruthTable {
@summary("The header of the truth table")
header: string[];
@summary("The rows and columns of the truth table")
truthMatrix: boolean[][];
}