Dsxir.Optimizer.COPRO.Proposer.Basic (dsxir v0.4.0)

Copy Markdown

Round-zero COPRO proposer. Asks the proposer LM for improved instructions for a single predictor, grounded in that predictor's signature and the current instruction. The current instruction always occupies one of the returned slots so the baseline survives the search; the rest are padded with it on a parse shortfall. Returns exactly n instructions.

Summary

Functions

Generate exactly ctx.n candidate instructions. See the module doc.

Types

ctx()

@type ctx() :: %{
  kind: :basic,
  decl: map(),
  current_instruction: nil | String.t(),
  n: pos_integer(),
  temperature: float(),
  lm: {module(), keyword()}
}

Functions

run(map)

@spec run(ctx()) :: {:ok, [String.t()]} | {:error, Exception.t()}

Generate exactly ctx.n candidate instructions. See the module doc.