lib

package
v0.3.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func Docs

func Docs() map[string]string

Docs returns each shipped member's reference markdown keyed by its path.

Types

type Module

type Module struct {
	Path string
	Text string
	File string
}

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

func Read(fsys fs.FS) ([]Module, map[string]string, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL