Files
KDL_WORK/working2/programs/manifest.md
2026-06-28 20:58:18 +08:00

6.4 KiB
Raw Permalink Blame History

working2 GRL 程序集 Manifest

版本0.1 日期2026-06-28

1. 目录目标

本 manifest 将 通用机器人编程语法规范.md 的语法和语义要求映射到 ABB120 GRL 程序、静态诊断测试、后处理测试和虚拟控制器执行证据。

目标程序目录:

kdl-wasm/web/tests/fixtures/abb120/spec-programs/

机器可读 manifest

kdl-wasm/web/tests/fixtures/abb120/spec-programs/manifest.json

2. 覆盖层级

层级 含义
Runtime 必须进入虚拟控制器执行,并产出 controller/trace/motion queue/IO 证据。
Static 必须由 parser/semantic/KDL diagnostic 覆盖,不要求 happy path 执行。
Post 必须由 ABB/FANUC/KUKA 后处理、导入回读或 report 覆盖。

3. 程序清单

3.1 Runtime

程序 覆盖章节 核心语法
W2_00_MinimalModule.grl 4、5、6、9、10、23 language、module、const、speed、zone、joint_target、movej、proc main。
W2_10_DataTargetToolFrame.grl 6、8、9 bool/int/real/string/time/length/angle/percent、tool、frame、pose、poseq、joint_target、pose_target。
W2_20_ExpressionMath.grl 7 算术、比较、逻辑、括号、单位后缀、pi/e、三角函数、数值函数、编译期求值。
W2_30_MotionAllTypes.grl 10 movej、movel、movec、set_tool、set_frame、set_speed、set_zone、inline 参数优先级。
W2_40_PathEvents.grl 11 path defaults/source、point、event before/after/at distance、run_path。
W2_50_OperationProcess.grl 12 operation kind/process/start_action/end_action、run_operation。
W2_60_IOWaitPulse.grl 13 io.di/do/ai/ao/gi/go/ri/ro、wait、timeout、on_timeout、pulse、all/any/rising/falling/changed。
W2_70_ControlFlow.grl 14 if/elseif/else、while、for、switch、break、continue。
W2_80_ProcFuncCall.grl 15 proc、in/out/inout、call、return、func 返回值、作用域。
W2_90_ExceptionAlarm.grl 16 alarm、raise、try/catch/finally。
W2_99_FullSpecExample.grl 24 规范完整示例的 tool/frame、path、operation、IO event、run_operation 和回 home。

3.2 Static/error

程序 覆盖章节 预期诊断
W2_E10_ExpressionDiagnostics.grl 7、22 GRL_EXPR_PARSEGRL_EXPR_UNKNOWN_SYMBOLGRL_EXPR_UNKNOWN_FUNCTIONGRL_EXPR_ARITYGRL_EXPR_DOMAINGRL_EXPR_DIV_ZEROGRL_EXPR_UNIT_MISMATCHGRL_EXPR_NON_CONSTANT
W2_E20_SemanticDiagnostics.grl 6、15、22 重复符号、类型不匹配、缺失引用、out/inout 非左值、func 缺少 return、func 副作用。
W2_E30_MotionDiagnostics.grl 8、9、10、11、22 关节限位、不可达 pose、movec 共线、缺少 motion 参数、空 path、重复 path point。
W2_E40_ControlFlowDiagnostics.grl 14、22 非法 break/continue、jump 进入块、重复 case、非常量 case、缺失 label。
W2_E50_RuntimeTimeout.grl 13、16 wait timeout、on_timeout alarm/call、报警 source map。

3.3 Post/import

程序 覆盖章节 预期报告
W2_P10_BrandHints.grl 18、20 post_hint@brand.* 消费或报告。
W2_P20_CrossBrandMotion.grl 20 ABB/FANUC/KUKA motion、speed、zone、IO、wait 映射。
W2_P30_Roundtrip.grl 19、20、21 post 后导入回读motion/path/operation 等价或差异明确。

4. 语法规范覆盖矩阵

规范章节 覆盖层级 程序或测试
4. 词法规则 Runtime/Static W2_00_MinimalModule、lexer/parser tests。
5. 顶层结构 Runtime W2_00_MinimalModule
6. 类型系统 Runtime/Static W2_10_DataTargetToolFrameW2_E20_SemanticDiagnostics
7. 表达式与运算 Runtime/Static/Post W2_20_ExpressionMathW2_E10_ExpressionDiagnosticsW2_P20_CrossBrandMotion
8. 坐标、工具和目标点 Runtime/Static W2_10_DataTargetToolFrameW2_E30_MotionDiagnostics
9. 速度和过渡 Runtime/Post W2_20_ExpressionMathW2_30_MotionAllTypesW2_P20_CrossBrandMotion
10. 运动指令 Runtime/Static/Post W2_30_MotionAllTypesW2_E30_MotionDiagnosticsW2_P20_CrossBrandMotion
11. Path 语法 Runtime/Static W2_40_PathEventsW2_E30_MotionDiagnostics
12. Operation 语法 Runtime/Post W2_50_OperationProcessW2_P30_Roundtrip
13. IO 与等待 Runtime W2_60_IOWaitPulseW2_E50_RuntimeTimeout
14. 流程控制 Runtime/Static W2_70_ControlFlowW2_E40_ControlFlowDiagnostics
15. 子程序和函数 Runtime/Static W2_80_ProcFuncCallW2_E20_SemanticDiagnostics
16. 异常、报警和中断 Runtime/Static W2_90_ExceptionAlarmtrap/interrupt 先做 static 边界。
17. 多任务 Runtime/Static W2_90_ExceptionAlarm 的 task 边界 warning。
18. 品牌扩展和后处理提示 Post W2_P10_BrandHints
19. 自动编程生成规则 Post W2_P30_Roundtrip、generator roundtrip tests。
20. 后处理映射规则 Post W2_P20_CrossBrandMotion
21. 编译语义和 IR Runtime/Static 所有 runtime/error 程序的 compile evidence。
22. 语义检查 Runtime/Static W2_E10W2_E50
23. EBNF 语法草案 Runtime/Static W2_00_MinimalModule、parser coverage test 和 grammar fixtures。
24. 完整示例 Runtime/Post W2_99_FullSpecExample 覆盖完整 path/operation/proc 运行结构;W2_P30_Roundtrip 覆盖 post 后导入回读。
25. 实施优先级 Runtime/Static/Post P0 全部映射到上述程序P1 进入 static/post 边界。

5. 证据要求

每个程序必须记录:

  1. program_id
  2. spec_sections
  3. coverage_level
  4. expected_status
  5. expected_diagnostics
  6. runtime_commands
  7. artifact_paths

最终 suite manifest 应生成为 JSON供 CI 和 HTML 虚拟控制器读取。

6. 当前实现状态

状态 证据
程序文件 Done spec-programs/runtime 11 个、static 3 个、error 2 个、post 3 个manifest 层级统计 Runtime 12、Static 4、Post 3。
机器可读 manifest Done spec-programs/manifest.json
suite runner Done kdl-wasm/web/src/suites/abb120SpecSuite.ts
job 生成命令 Done npm run suite:abb120-spec
最新 job Done kdl-wasm/web/test-results/abb120-spec/W2-JOB-20260628022836-51484d62