lawsynth/crates/lawsynth-world
caelum0x 7a06febeb6 chore(release): inherit repository metadata on all crates
Crates inherited version/license/edition from [workspace.package] but not
`repository`, so every crate published without a repository link. Add
`repository.workspace = true` uniformly, completing the
description+version+license+repository metadata `cargo publish` and crates.io
expect. No build impact.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-06 13:08:47 +03:00
..
2026-08-16 21:04:23 +03:00
2026-08-16 21:04:23 +03:00

lawsynth-world

Typed executable World IR for continuous and discrete models. A world combines named variables, parameters, laws, events, and intervention metadata before a simulator compiles it.

Use

use lawsynth_core::Identifier;
use lawsynth_expr::parse;
use lawsynth_world::{ContinuousLaw, Parameter, Variable, VariableRole, World};

let x = Identifier::new("x")?;
let world = World::new(
    vec![Variable::new(x.clone(), VariableRole::State)],
    vec![Parameter::new(Identifier::new("rate")?, 0.5)],
    vec![ContinuousLaw::new(x, parse("rate * x")?)],
)?;
assert_eq!(world.laws().len(), 1);
# Ok::<(), Box<dyn std::error::Error>>(())

Construction validates unique roles, parameter names, and law targets. lawsynth-world stores the model; numerical integration belongs to lawsynth-sim and discovery belongs to lawsynth-discovery.