2024-06-07 16:27:52 +02:00
|
|
|
import "@typespec/openapi3";
|
|
|
|
using TypeSpec.OpenAPI;
|
|
|
|
|
|
|
|
namespace Models;
|
|
|
|
|
2024-06-22 20:38:55 +02:00
|
|
|
@summary("A binary operator")
|
2024-06-07 16:27:52 +02:00
|
|
|
enum BinaryOperator {
|
2024-06-22 20:38:55 +02:00
|
|
|
AND,
|
|
|
|
OR,
|
|
|
|
IMPLICATION,
|
2024-06-07 16:27:52 +02:00
|
|
|
}
|
|
|
|
|
2024-06-22 20:38:55 +02:00
|
|
|
@summary("The inverse of an expression")
|
2024-06-07 16:27:52 +02:00
|
|
|
model ExpressionNot {
|
2024-06-22 20:38:55 +02:00
|
|
|
@summary("The expression to negate")
|
|
|
|
not: Expression;
|
2024-06-07 16:27:52 +02:00
|
|
|
}
|
|
|
|
|
2024-06-22 20:38:55 +02:00
|
|
|
@summary("A binary expression")
|
2024-06-07 16:27:52 +02:00
|
|
|
model ExpressionBinary {
|
2024-06-22 20:38:55 +02:00
|
|
|
@summary("The left expression")
|
|
|
|
left: Expression;
|
|
|
|
|
|
|
|
@summary("The binary operator")
|
|
|
|
operator: BinaryOperator;
|
|
|
|
|
|
|
|
@summary("The right expression")
|
|
|
|
right: Expression;
|
2024-06-07 16:27:52 +02:00
|
|
|
}
|
|
|
|
|
2024-06-22 20:38:55 +02:00
|
|
|
@summary("An atomic expression")
|
2024-06-07 16:27:52 +02:00
|
|
|
model ExpressionAtomic {
|
2024-06-22 20:38:55 +02:00
|
|
|
@summary("The atomic value")
|
|
|
|
atomic: string;
|
2024-06-07 16:27:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@oneOf
|
2024-06-22 20:38:55 +02:00
|
|
|
@summary("A truth expression")
|
2024-06-07 16:27:52 +02:00
|
|
|
union Expression {
|
2024-06-22 20:38:55 +02:00
|
|
|
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[][];
|
|
|
|
}
|