Documentation
¶
Overview ¶
Package lib is the shipped library of derived relations. It is a set of Datalog modules over the relations that stdlib/relations projects. Each module registers in the fact layer's vocabulary at the path its file name gives (agni issue 751). component.dl defines component.two_terminal, component.probed_both and component.probed_one; net.dl defines net.has_test_point. A query calls them exactly as it calls a base relation, and `agni query --relations <path>` prints a member's signature and definition. Each member has a reference page in docs/, and docsite/content/build/library-member.md is the how-to for adding one.
A member belongs here when it is a general hardware question many queries ask. If only a single report needs a member, it belongs in that report's query. If a Go rule or a Spec must read it, it is promoted to a base relation in stdlib/relations instead (DECISIONS, "The Datalog engine lives in jaala").
The package imports core/query and stdlib/relations so the Datalog language and the relations these modules read are registered before the modules are. The fact layer composes and checks the vocabulary at every registration, so a module arriving first would be refused. A binary that wants the library blank-imports this package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Module ¶
Module is one library file. It holds the module path for its rules, its Datalog text, and the name of its source file.
func Modules ¶
func Modules() []Module
Modules returns the shipped library's modules in file-name order.
func Read ¶
Read loads a library laid out like this package. Each `<module.path>.dl` file at the root of fsys is one module, registered at the path its name gives. Each `docs/<member.path>.md` is a member's reference page. A file whose name starts with "_" is skipped, so a template can sit beside the pages. A missing docs directory is an empty set of pages, not an error.
A project's own `lib/` directory is read with the same function, so the two layouts cannot drift. Read only reads files. Composing the modules into a vocabulary decides whether they parse and what they may read.