Documentation
¶
Overview ¶
Package lib is the shipped library of derived relations: Datalog modules over the relations stdlib/relations projects, registered in the fact layer's vocabulary at the paths their file names give (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. One that only a single report needs stays in that report's query, and one that a Go rule or a Spec must read 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: the module path its rules register under, its Datalog text, and the file it was read from.
func Modules ¶
func Modules() []Module
Modules returns the shipped library's modules in file-name order.
func Read ¶
Read loads a library laid out as this package's is: each `<module.path>.dl` file at the root of fsys is one module, registered at the path its name gives, and 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; whether the modules parse and what they may read is decided when they are composed into a vocabulary.