<div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">AbstractPPL</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li class="is-active"><a class="tocitem" href>API</a><ul class="internal"><li><a class="tocitem" href="#VarNames"><span>VarNames</span></a></li><li><a class="tocitem" href="#VarName-serialisation"><span>VarName serialisation</span></a></li><li><a class="tocitem" href="#Abstract-model-functions"><span>Abstract model functions</span></a></li><li><a class="tocitem" href="#Abstract-traces"><span>Abstract traces</span></a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>API</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>API</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://github.com/TuringLang/AbstractPPL.jl" title="View the repository on GitHub"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">GitHub</span></a><a class="docs-navbar-link" href="https://github.com/TuringLang/AbstractPPL.jl/blob/main/docs/src/api.md" title="Edit source on GitHub"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="API"><a class="docs-heading-anchor" href="#API">API</a><a id="API-1"></a><a class="docs-heading-anchor-permalink" href="#API" title="Permalink"></a></h1><h2 id="VarNames"><a class="docs-heading-anchor" href="#VarNames">VarNames</a><a id="VarNames-1"></a><a class="docs-heading-anchor-permalink" href="#VarNames" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="AbstractPPL.VarName" href="#AbstractPPL.VarName"><code>AbstractPPL.VarName</code></a> — <span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">VarName{sym}(optic=identity)</code></pre><p>A variable identifier for a symbol <code>sym</code> and optic <code>optic</code>.</p><p>The Julia variable in the model corresponding to <code>sym</code> can refer to a single value or to a hierarchical array structure of univariate, multivariate or matrix variables. The field <code>lens</code> stores the indices requires to access the random variable from the Julia variable indicated by <code>sym</code> as a tuple of tuples. Each element of the tuple thereby contains the indices of one optic operation.</p><p><code>VarName</code>s can be manually constructed using the <code>VarName{sym}(optic)</code> constructor, or from an optic expression through the <a href="#AbstractPPL.@varname"><code>@varname</code></a> convenience macro.</p><p><strong>Examples</strong></p><pre><code class="language-julia-repl hljs">julia> vn = VarName{:x}(Accessors.IndexLens((Colon(), 1)) ⨟ Accessors.IndexLens((2, )))
0 commit comments