Repository navigation
Commit bfa6c60
+ Algae 3: parser, dual-mode evaluator, debugger REPL, differential tests
Port of ../algae3 (the Algae2 revival) into the SWObjects family:
- lib/Algae3Parser.ypp + Algae3Scanner.lpp + Algae3Parser.bnf: house-style
bison-C++/flex (yacker rule names), conflict-free; builds the a3:: AST
(lib/Algae3.hpp) over SWObjects terms/triples/expressions instead of the
reference parser's S-expression strings. bin/algae3 evaluates, dumps the
mode-named action algebra (--algebra), and hosts the debugger (--debug).
- lib/Algae3.cpp: the action pipeline (load with the merge/standardize-apart
contract of sparql-to-algae3.md section 1, ask, test, assert, fwrule-to-
fixpoint, let, bindings, collect with by-grouping / count(distinct) /
group_concat(x, sep) / order/limit/offset, standalone {expr} as HAVING),
per-row proof sets (munion pools them), and both evaluation modes:
top-down correlated ./~/!/scope-lateral vs bottom-up Join/LeftJoin/Minus
with unit-result-set isolation of connective operands and scopes.
Flagged interpretations (file header): set-level orelse; |! as strict
antijoin vs !'s SPARQL-Minus domain-disjoint vacuity.
- Debugger: step/where/print/bindings/watch/try/mode/break/run/reset;
`try ( pattern )` speculatively counts extended/dropped rows under the
current mode and discards; `mode bottomup` mid-session replays the
remaining pipeline under SPARQL algebra.
- tests/Algae3: datasets for every manifesty.yaml entry, vendored .a3 with
local loads, golden results, and differential mode tests: everything
agrees across modes except the two documented divergences -
nested-optional ({v=1,w=9,u=7} vs {v=1,w=9}) and negation-scoped, where
the isolated union branch's naive MINUS cannot discriminate group members
without a bound ?component and removes both neg conjuncts. The whole DNF
rule-engine example (three nested aggregation layers, universal
quantification by counting) evaluates correctly top-down.
All 22 ctest suites pass.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 29f1b38 commit bfa6c60
42 files changed
Lines changed: 3930 additions & 2 deletions
File tree
- bin
- lib
- tests
- Algae3
- data
- expected
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| |||
230 | 231 | | |
231 | 232 | | |
232 | 233 | | |
233 | | - | |
| 234 | + | |
234 | 235 | | |
235 | 236 | | |
236 | 237 | | |
| |||
Binary file not shown.
0 commit comments