Phaseline by VERIFYGet the checker
Tutorial Syntax

Phaseline syntax

Write a guarantee, run it, and compare what the next version would do.

Write an observer

A rule declares what the answer depends on. A separate .phase program declares what the observer can read. Use question to name a guarantee, observe for fields already visible (or none), offer for each additional field and the cost of reading it, and budget for available observation units. Run analyze with the edition, observer and a JSON file containing the possible histories.

question excursion
observe mean_reading
offer peak_reading cost 3
budget 3

Edit this program and see the two histories it must distinguish.

One declaration per line

Write guarantee, a stable name, when and a condition. A name starts with a lowercase letter and may contain lowercase letters, digits and underscores, up to 40 characters.

guarantee save_draft when signed_in
guarantee offer_resume when save_draft

signed_in is an input fact. save_draft is a guarantee defined in this edition. The second line uses its value. The checker follows that dependency when comparing the two editions.

Write a condition

A fact or guarantee name
Use a Boolean input or the name of another guarantee in this edition. Circular references are rejected.
true and false
Make an outcome apply in every case or in none.
Composed conditions
Use not, and and or, in that order of precedence. Parentheses group an expression. An optional unless applies to the whole expression before it. A later declaration may be referenced by name.
Quantities with units
Declare a field with fact seat_count in seats from billing.seats owner billing_ops missing hold_dependents. Write seat_count >= 10 seats. The operators are <, <=, =, >= and >. The units on both sides must agree. Custom quantities are whole numbers from 0 through 9,007,199,254,740,991. The built-in purchase amount supports 1 through 999,999,999 US cents.
unless
Add a Boolean exception, as in guarantee send_reminder when subscribed unless paused. When paused is true the guarantee does not apply.

Edit and run your first program · See the parsed object

Declare where a fact comes from

fact embargoed from rights_register.embargo owner rights_officer missing hold_dependents
guarantee lesson_notes when true
guarantee worked_examples when true unless embargoed
guarantee list_examples when worked_examples

The first line names a Boolean input, its record field and its custodian. If that record is missing or contradictory, the reader considers both possible values. Here it can release the notes immediately. The worked examples and their listing both wait for the rights officer. A known false embargo releases both.

Evidence declarations bind Boolean or whole-unit inputs. Give each record field and custodian a single stable fact name. A rename or a change of units across editions requires an explicit migration; the public checker holds that comparison. The reader checks records for the named subject, event time, source, owner and review cutoff. Its caller must authenticate the custodian and supply the correct subject, event time and review time. The local lesson uses synthetic identities. Run it with your own records.

How much can one check cover?

An edition accepts up to 128 named guarantees and 10,000 source characters. The checker follows each guarantee’s dependencies, then checks both Boolean values and each integer interval where a comparison can change. Independent guarantees do not multiply one another’s cases. The operation stops explicitly above 65,536 combinations for one guarantee or 1,000,000 across guarantees. A refusal leaves the result unknown.

Run a subscription contract with missing records · Reproduce the bounds and correctness checks

Compare a numeric threshold

For refund rules, this example uses order_total with > or >= and a whole number of USD_cents. The unit makes the boundary exact. Try changing whether the boundary itself counts.

Loading the interpreter…

Change > to >= and run it again. The interpreter finds the first refund whose approval changes. The receipt guarantee still applies. A condition can also use another guarantee: guarantee issue_receipt when manager_approval makes the receipt follow the approval rule.

To withhold credit while accepting the return, write guarantee issue_store_credit when return_eligible unless final_sale. The guarantee before when names the outcome you are changing. Try the credit-only edit · Read its source.

In the store-credit example, unless final_sale uses a fact recorded about the purchase. The credit guarantee follows eligibility. See what the store served · Download the exception source

Download the source · Edit the shop’s actual wording in the simulator · See the three-tool comparison

Run the same source locally

Extract the Phaseline kit, then run this from that folder with Node 22 or newer.

node phase.mjs compare counter-refunds.phase counter-refunds-v2.phase

State across actions

A named guarantee defines an answer at one point in time. To ask which differences matter across future actions, supply that guarantee and a finite transition table to retain. Read the input format.