lib

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 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. 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

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. 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

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

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.

Jump to

Keyboard shortcuts

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