Installation

pip install speclogician

Getting started

SpecLogician stores an evolving State made of StateInstances. Each change creates a new instance, and you can inspect the history.

This guide uses the CLI style you’ve been building:

  • speclogician ch ... for applying typed changes
  • speclogician view ... for inspecting the state

1) Define a base model (state/action)

You start by defining what a state and action look like.

speclogician ch base-edit --src "type state = int\ntype action = int"

This makes the “shape of the world” explicit and stable.

2) Add predicates

Predicates describe properties of state or action. They’re used by scenarios.

speclogician ch pred-add --pred-type state --pred-name pred_eq_ten --pred-src "s = 10"
speclogician ch pred-add --pred-type action --pred-name act_gt_state --pred-src "a > s"

3) Add transitions

Scenarios are local, declarative behavior slices.

speclogician ch scenario-add sc1 --given pred_eq_ten --when act_gt_state --then step1

4) Add scenarios

Add a scenario (given/when/then)

speclogician ch scenario-add sc1 --given pred_eq_ten --when act_gt_state --then step1

5) Inspect what you built

speclogician view domain
speclogician view scenarios
speclogician view spec
speclogician view instances

That’s it: you now have an incremental formal model that can grow by small, typed edits.