ProgramFacts.Model (program_facts v0.2.0)

Copy Markdown View Source

Semantic summary model for generated programs.

Built-in generators construct this model first, then materialize source files and facts through to_program/1. Existing generated programs can also be projected back into this model with from_program/1.

Summary

Functions

Starts a fluent semantic model builder.

Projects a generated program into its semantic summary model.

Builds a semantic model from generated source files and structural facts.

Materializes a semantic model as a generated program with facts derived from the model.

Types

t()

@type t() :: %ProgramFacts.Model{
  features: MapSet.t(atom()),
  files: [ProgramFacts.File.t()],
  functions: [ProgramFacts.Facts.function_id()],
  id: String.t(),
  metadata: map(),
  modules: [module()],
  policy: atom(),
  relationships: map(),
  seed: integer()
}

Functions

builder(opts)

Starts a fluent semantic model builder.

from_program(program)

Projects a generated program into its semantic summary model.

new(attrs)

Builds a semantic model from generated source files and structural facts.

to_program(model)

Materializes a semantic model as a generated program with facts derived from the model.