Home /Modules/advantage/EXAMPLES.md

EXAMPLES.md

lib/advantage/EXAMPLES.md · 205 line(s) · markdown

artifact; pure; gasoline; preonem: PREONEM.md standard: legislature-grade; evaluated unto time and space

EXAMPLES — Advantage™ Library

This guide is the practical entry point to the Advantage™ Library in lib/advantage/. It maps each subject to its runnable demonstration, gives the command to execute it, and explains what to inspect in the output.

The examples are demonstrations of the package's implemented models. They are not financial, legal, investment, or scientific advice, and the trust-field "physics" is a mathematical modelling analogy rather than a claim that trust is a literal physical field.

1. Run the demonstrations

Run commands from the repository root. The examples below use the committed convenience runtime; for the current release, build and use the source-built SLeeLa runtime as described in the repository's build documentation.

SubjectCommandWhat it demonstrates
Sequitur onion./working-binaries/sleela run lib/advantage/advantage-demo.sleelaDividend, eight ordered layers, user/developer models, iteration, owner bias, update and restitution
Bilateral trade math./working-binaries/sleela run lib/advantage/math/trade-math-demo.sleelaJoint-profit optimum, Nash bargaining split, bilateral newsvendor critical ratio
Trust-field physics./working-binaries/sleela run lib/advantage/physics/physics-demo.sleelaTrust metric, transaction geodesic, announcement contact structure, stochastic trust decay
Vertical integration./working-binaries/sleela run lib/advantage/integration/integration-demo.sleelaRecursive compartments, tier ordering, engineering bays, trials, median tray
Sophistication grading./working-binaries/sleela run lib/advantage/grading/grading-demo.sleelaModule scores, letter/tier ratings, winning/losing/grader/absolute sets
Output routing./working-binaries/sleela run lib/advantage/output/output-demo.sleelaTerminal, CommonRails, socket-frame buffering, and silent capture targets

Each demo has a main() entry point. The runtime's run command auto-links sibling classes in the demo's directory; these examples do not require manually listing each sibling source file.

2. Sequitur onion: a dividend through ordered layers

Source: advantage-demo.sleela

The core model evaluates one dividend relative to a named model. A standard Sequitur contains eight layers, from outer skin to inner core:

  1. dividend — the value being considered.
  2. review — validate the premise.
  3. concerns — expose risks and caveats.
  4. maths — apply quantitative reasoning.
  5. additions — record growth.
  6. subtraction — record costs or losses.
  7. regrouping — reorganize or recover value.
  8. iteration — decide whether to make another pass.

The demo exercises two interfaces over the same engine:

The developer example configures contributions of 0 + 0 - 5 + 20 + 15 - 8 + 3 + 0, yielding a net advantage of 25. The user example configures 30 - 12 + 10 + 2, yielding 30. These are deterministic arithmetic fixtures, not claims about real-world returns.

Dynamic owner adjustment and restoration

The demo also illustrates controlled dynamic alteration:

The sample's baseline advantage is 10; the owner-adjusted result is 26 (a shape gain of 16); restitution returns the advantage to 10 and restores the original model identity. Favoring an owner is a model operation, not a substitute for independent review: it deliberately does not erase risk or validation layers.

3. Bilateral trade economics

Source: math/trade-math-demo.sleela Further reading: MATH.md

The trade subject treats buyer and seller as one coordinated system:

The demo's documented hand-check anchors are:

CheckExpected result
Joint-profit optimal quantity Q*20
Integrated surplus Pi_total800
Nash bargaining price60
Buyer / seller split400 / 400
Centralized critical ratio80/95 ≈ 0.8421

These values validate the sample parameter set; they are not universal market outcomes.

4. Trust-field modelling

Source: physics/physics-demo.sleela Further reading: PHYSICS.md

This subject explores trust and announcements through mathematical analogies:

Read the equations and assumptions in PHYSICS.md before interpreting outputs. The model is a formal analogy and does not establish an empirically validated physical law of trust.

5. Vertical integration

Source: integration/integration-demo.sleela

The integration subject represents a value chain as an ordered stack of recursive compartments. Each compartment can carry a kind, capacity/space, meaning, relevance, and child compartments. The demo covers:

Use this subject to prototype a structured value-chain model. Treat its capacity, relevance, and sophistication scores as model outputs whose definitions and input assumptions must be reviewed for each application.

6. Sophistication grading

Source: grading/grading-demo.sleela

The grading circuit rates individual modules and named sets:

A module's grade is only as meaningful as the rubric, score normalization, and thresholds supplied to the circuit. The grader is an organizational instrument, not an objective certification authority.

7. Output routing

Source: output/output-demo.sleela

The output seam separates a module's reporting API from its destination:

The socket demonstration validates frame construction and buffering; the SLeeLa run environment does not itself provide a live socket transport. A native host must perform the actual forwarding.

8. Suggested learning sequence

For a first-time reader:

  1. Run advantage-demo.sleela and compare the two model interfaces.
  2. Read DEFINITIONS.md to learn the vocabulary.
  3. Run trade-math-demo.sleela and check its numerical anchors against MATH.md.
  4. Explore vertical integration and grading as composable higher-level structures.
  5. Read PHYSICS.md before running the trust-field analogy.
  6. Finish with the output demo to see how models can report through different sinks.