Based on notation from Geometric Algebra for Computer Science and targeting versor.js.
Test out the grammar and export a parser at the PEG.js Online Version.
Outer Product
| #!/usr/bin/env python3 | |
| """ | |
| Codebase analyzer using Recursive Language Models (RLM) via DSPy. | |
| Based on: https://kmad.ai/Recursive-Language-Models-Security-Audit | |
| Usage: | |
| python analyze-codebase.py --mode security --output report.md | |
| python analyze-codebase.py --mode documentation --exclude tests,vendor | |
| python analyze-codebase.py --mode quality --max-iterations 50 |
| $ vagrant up --debug | |
| INFO global: Vagrant version: 2.2.7 | |
| INFO global: Ruby version: 2.4.9 | |
| INFO global: RubyGems version: 2.6.14.4 | |
| INFO global: VAGRANT_INSTALLER_VERSION="2" | |
| INFO global: VAGRANT_INSTALLER_ENV="1" | |
| INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/embedded/gems/2.2.7/gems/vagrant-2.2.7/bin/vagrant" | |
| INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded" | |
| INFO global: VAGRANT_LOG="debug" | |
| WARN global: resolv replacement has not been enabled! |
| { | |
| "Edges": { | |
| "53330552": { | |
| "Type": "LineSegment", | |
| "Vertices": [ | |
| 10212927, | |
| 43495525 | |
| ] | |
| }, | |
| "24807479": { |
| -- Match a hexadecimal digit (lower- or upper-case) | |
| local hexdigit = digit + R("af", "AF") | |
| local hexadecimal = P"0x" * hexdigit^1 * P(-1) | |
| print(hexadecimal:match"0x01") --> '5', match successful | |
| print(hexadecimal:match"0xfa") --> '5', match successful | |
| print(hexadecimal:match"0fa") --> 'nil', match unsuccessful | |
| print(hexadecimal:match"0xfg") --> 'nil', match unsuccessful |
| local lpeg = require"lpeg" | |
| local P, R, S = lpeg.P, lpeg.R, lpeg.S | |
| -- Any non-zero digit: (R stands for Range) | |
| local nonzero = R"19" | |
| -- Only zero: (P stands for Pattern) | |
| local zero = P"0" | |
| -- Any digit: | |
| local digit = R"09" | |
| -- Match a sqeuence of one or more numbers not starting with zero (aka positive numbers) |
Based on notation from Geometric Algebra for Computer Science and targeting versor.js.
Test out the grammar and export a parser at the PEG.js Online Version.
Outer Product