@aiql-org/core
v2.9.0
Published
AIQL language parser and multi-target transpiler (JSON/YAML/Python/SQL/Coq/Lean)
Downloads
615
Maintainers
Readme
@aiql-org/core
Core language processing for AIQL — tokenizer, parser, AST types, and multi-target transpiler.
Transpilation Targets
| Target | Extension | Description |
|--------|-----------|-------------|
| Python | .py | Executable Python classes |
| JSON | .json | Structured interchange |
| YAML | .yaml | Human-readable config |
| SQL | .sql | Database schema + queries |
| Coq | .v | Formal verification proofs |
| Lean | .lean | Lean 4 theorem prover |
Usage
import { Tokenizer, Parser, Transpiler } from '@aiql-org/core';
const code = `!Assert { <AI> [learns] <Knowledge> } @0.95`;
const tokens = new Tokenizer(code).tokenize();
const ast = new Parser(tokens).parse();
const output = new Transpiler().transpile(ast, 'python');Attribute Comparisons (v2.7.0)
Attributes now support comparison operators for validation rules:
!Query {
<Event> [occurred_in] <Year> {
year: > 2000
confidence: >= 0.8
}
}Supported operators: >, <, >=, <=, !=.
API
Tokenizer— Converts source code to token streamParser— Converts tokens to ASTTranspiler— Converts AST to target formatAST— TypeScript type definitions for all AST nodes
License
MIT
