2024-06-04 23:00:22 +03:00
|
|
|
/**
|
|
|
|
* Module: Schema of Synthesis Operations.
|
|
|
|
*/
|
2025-02-12 21:36:25 +03:00
|
|
|
|
2025-02-22 14:04:01 +03:00
|
|
|
import { type Graph } from '@/models/Graph';
|
2024-07-21 15:19:57 +03:00
|
|
|
|
2025-02-21 21:15:05 +03:00
|
|
|
import { type ICstSubstituteInfo, type IOperationDTO, type IOperationSchemaDTO } from '../backend/types';
|
2025-02-18 23:39:11 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents Operation.
|
|
|
|
*/
|
|
|
|
export interface IOperation extends IOperationDTO {
|
|
|
|
is_owned: boolean;
|
|
|
|
is_consolidation: boolean; // aka 'diamond synthesis'
|
|
|
|
substitutions: ICstSubstituteInfo[];
|
|
|
|
arguments: number[];
|
|
|
|
}
|
2024-07-21 15:19:57 +03:00
|
|
|
|
2024-07-26 00:34:08 +03:00
|
|
|
/**
|
|
|
|
* Represents {@link IOperationSchema} statistics.
|
|
|
|
*/
|
|
|
|
export interface IOperationSchemaStats {
|
|
|
|
count_operations: number;
|
|
|
|
count_inputs: number;
|
|
|
|
count_synthesis: number;
|
|
|
|
count_schemas: number;
|
2024-08-23 21:29:07 +03:00
|
|
|
count_owned: number;
|
2024-07-26 00:34:08 +03:00
|
|
|
}
|
|
|
|
|
2024-07-21 15:19:57 +03:00
|
|
|
/**
|
2025-01-30 19:55:38 +03:00
|
|
|
* Represents OperationSchema.
|
2024-06-04 23:00:22 +03:00
|
|
|
*/
|
2025-02-18 23:39:11 +03:00
|
|
|
export interface IOperationSchema extends IOperationSchemaDTO {
|
2025-01-30 19:55:38 +03:00
|
|
|
items: IOperation[];
|
2024-06-04 23:00:22 +03:00
|
|
|
|
2024-07-21 15:19:57 +03:00
|
|
|
graph: Graph;
|
2025-02-12 15:13:37 +03:00
|
|
|
schemas: number[];
|
2024-07-26 00:34:08 +03:00
|
|
|
stats: IOperationSchemaStats;
|
2025-02-17 15:12:15 +03:00
|
|
|
operationByID: Map<number, IOperation>;
|
2024-07-21 15:19:57 +03:00
|
|
|
}
|
|
|
|
|
2024-08-26 17:25:07 +03:00
|
|
|
/**
|
|
|
|
* Represents substitution error description.
|
|
|
|
*/
|
|
|
|
export interface ISubstitutionErrorDescription {
|
|
|
|
errorType: SubstitutionErrorType;
|
|
|
|
params: string[];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents Substitution table error types.
|
|
|
|
*/
|
|
|
|
export enum SubstitutionErrorType {
|
|
|
|
invalidIDs,
|
2024-08-26 22:53:27 +03:00
|
|
|
incorrectCst,
|
2024-08-26 17:25:07 +03:00
|
|
|
invalidClasses,
|
|
|
|
invalidBasic,
|
|
|
|
invalidConstant,
|
2024-08-26 22:53:27 +03:00
|
|
|
typificationCycle,
|
|
|
|
baseSubstitutionNotSet,
|
|
|
|
unequalTypification,
|
2024-08-28 12:34:29 +03:00
|
|
|
unequalExpressions,
|
2024-08-26 22:53:27 +03:00
|
|
|
unequalArgsCount,
|
|
|
|
unequalArgs
|
2024-08-26 17:25:07 +03:00
|
|
|
}
|