One user-space repair task per eligible HWE debug-diag / compile-deploy base ID: 320 admitted (C 218, C++ 97, build scripts 5), 1 skipped by the content filter. Each ships a public spec with a check-to-basis table, at least two defects with single-fix fixtures, a symptom-masking fixture and an alternative correct implementation. Claude re-checked all 320: structure, the HWE quality items and trace6 Docker calibration receipts against current digests (320/320 USABLE). Difficulty is unmeasured. Known follow-up: 212 tasks use 120 ad-hoc family names; the next batch maps them to the canonical list. The batch's 1,256-line progress log stays in its factory report and the 36-local branch batch15-hwe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
52 lines
1.5 KiB
C
52 lines
1.5 KiB
C
#ifndef EXPR_H
|
|
#define EXPR_H
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#define EX_MAX_CHILDREN 8
|
|
#define EX_NAME_SIZE 16
|
|
#define EX_TEXT_LIMIT 4096
|
|
#define EX_VALUE_LIMIT INT64_C(1000000000000)
|
|
typedef enum {
|
|
EX_OK, EX_SYNTAX, EX_LIMIT, EX_MEMORY, EX_ARITH,
|
|
EX_UNBOUND, EX_BUFFER, EX_ARGUMENT
|
|
} ex_status;
|
|
typedef enum {
|
|
EX_NUMBER, EX_VARIABLE, EX_ADD, EX_SUB, EX_MUL,
|
|
EX_MIN, EX_MAX, EX_NEG, EX_ABS, EX_SUM
|
|
} ex_kind;
|
|
typedef struct ex_node {
|
|
ex_kind kind;
|
|
int64_t number;
|
|
char name[EX_NAME_SIZE];
|
|
size_t arity;
|
|
struct ex_node *child[EX_MAX_CHILDREN];
|
|
} ex_node;
|
|
typedef void *(*ex_allocate)(void *, size_t);
|
|
typedef void (*ex_release)(void *, void *);
|
|
typedef struct {
|
|
void *context;
|
|
ex_allocate allocate;
|
|
ex_release release;
|
|
} ex_allocator;
|
|
typedef struct {
|
|
ex_node *root;
|
|
ex_allocator memory;
|
|
size_t max_nodes;
|
|
size_t max_depth;
|
|
} ex_tree;
|
|
typedef struct {
|
|
const char *name;
|
|
int64_t value;
|
|
} ex_binding;
|
|
typedef void (*ex_visitor)(void *, const ex_node *);
|
|
ex_status ex_init(ex_tree *, ex_allocator, size_t, size_t);
|
|
void ex_destroy(ex_tree *);
|
|
ex_status ex_parse(ex_tree *, const char *, size_t);
|
|
ex_status ex_clone(ex_tree *, const ex_tree *);
|
|
size_t ex_count(const ex_tree *);
|
|
size_t ex_height(const ex_tree *);
|
|
void ex_visit(const ex_tree *, ex_visitor, void *);
|
|
ex_status ex_render(const ex_tree *, char *, size_t, size_t *);
|
|
ex_status ex_evaluate(const ex_tree *, const ex_binding *, size_t, int64_t *);
|
|
#endif
|