Aletheia.Reader.Actions (Aletheia v0.1.1)

Copy Markdown View Source

Turns lib/aletheia/reader/grammar.aether's raw capture tree into Episteme.Term-shaped data -- mirrors ichor's own test/support/prolog_actions.ex worked example closely, adapted to build real Episteme.Term.Var/Compound structs (and native lists, via the ./2 encoding Episteme.Term.deconstruct/1 implements) instead of that fixture's plain tuples.

Variable names are scoped to one clause: every X within one clause (head and whole body) must share one ref, but two clauses using X never share one. handle_token(:VAR, ...) deliberately does NOT mint a ref directly -- it produces a {:var_ref, name} placeholder, only ever resolved by freshen/1's own fold-then-rewrite pass over the whole clause at once (same reason ichor's fixture does this: a variable can't be freshened consistently until every occurrence of its name within the clause is known first).

Summary

Functions

A fresh context, seeded with the default Prolog operator table.

Functions

new_context()

@spec new_context() :: %{operators: Ichor.Toolkit.Pratt.table()}

A fresh context, seeded with the default Prolog operator table.