Documents et Arche › Correspondance avec Arche

Documents et Arche

Cette page n’est pas encore traduite : voici la version anglaise.

How arche-lang maps to Arche

What each declaration becomes in the Arche project archec build writes.

arche-lang Arche project
system X { … } x.yaml model file (listed in models.yaml); its children are the canvas's root components
top-level component D a template in templates.yaml, copied into every part x: D (instance values override, lists merge by id)
port, fn, var, memory, states, nested requirement ports, functions, variables, memory, stateMachine, requirements on the component
a.p -> b.q { carries M; latency 1ms } links with icd.messages and timing
canvas X { part at x, y; part size w, h } (or at on a part) each component's position and size
purpose "…" the component's mainFunctions
message, type/enum/struct, const messages.yaml, data-types.yaml, variables.yaml
requirement, actor, mission requirements.yaml, actors.yaml, missions.yaml
satisfies, verified-by, derives, allocated-to, trace … traces.yaml, with Arche element addresses (car.yaml#adcu:fn/plan)
test-plan, scenario, simulation testplans.yaml, scenarios.yaml, simulation.yaml
cores N, core id, os, ram, isa, freq on a component nature: hardware, cores: [{id, name, type}], hardware: {os, ram, …} — a target threads run on
deployment → binary … on cpu → process → thread / isr processes.yaml, threads.yaml (tasks.yaml on an RTOS / bare-metal processor), and thread: on every part a thread runs
thread period + step fn an rt.timer beside the part, ticking a tick-<thread> port that calls fn
route a.p -> b.q over bus { priority 3 } the link's timing.bus, priority and the bus bitrate (a shared medium in simulation)
port / link buffer queue + depth N + overflow, buffer sample link timing.queue / drop (a sample is a queue of one that keeps the newest)
kind, layer, tag, color, port-type kinds.yaml, layers.yaml, tags.yaml/tag-types.yaml, colors.yaml, types.yaml — used-but-undeclared entries are added for you
package p { … } nothing of its own: names are qualified in the source (p.X), ids stay global in Arche
interface I { messages …; fn op() }, port provides I / requires I a port type with messages, operations, extends in types.yaml; the ports' provides / requires
part w: Wheel[4], component D(n: int32 = 8) four components w_0 … w_3; each instance's parameter values as variables
parameter, variant (+ variants a, b), study, viewpoint parameters.yaml, variants.yaml (+ variants: on components and links), studies.yaml, viewpoints.yaml
budget power 150W an Arche budget: a variable with rollup: sum (or max), the draws as same-named variables beneath
hazard, safety-goal safety.yaml (hazards, safetyGoals); failure-mode and gate are checked and typeset, not written
decision a requirement of category decision, with derives / satisfies traces
process … { lanes …; a: act; a -> b : x } a scenario with one sequence
equation der(x) = …, solver 1ms the component's equations and solver, integrated by Arche's simulator (RK4)
raw "file.yaml" ```yaml …``` that file, verbatim — for anything the language does not model yet

Every build validates the generated YAML against schemas/arche-project.schema.json before writing anything. Both examples load in Arche with 0 errors from Arche's own checker (arche-cli check), and their test plans pass in Arche's simulator (arche-cli test: 3/3 for the car, 1/1 for the patterns).

Arche runs behaviour as Python. A ```arche body is checked by archec and written into the project as the Python it means (wait 10ms → await wait(ms(10)), send p MSG { … } → send(self.p, MSG(...)), f() → await self.f(), goto State → await goto("State")). A ```python body is written as it is; the linter checks the parts it can see from the model: calls to functions without a body, missing await.