How-to index

Common tasks and how to accomplish them.

How do I minimise a Boolean expression?

  1. Type your expression in the editor, e.g. (A & B) | (A & !B) | (!A & B).
  2. The Simplify section in Result will auto-run and show the minimal SOP result.
  3. Click Apply or press ⌘↵ to paste the result back into the editor.
  4. Optionally click Why? to see the Quine–McCluskey steps that produced the result.

See the Simplify page for details on don't-cares and the rewrite transforms.

How do I find inputs that satisfy a constraint?

  1. Type your expression. In the Inputs section, choose 0, 1, or dc to inspect a constrained result.
  2. Use Truth Table to find Boolean input rows with Out = 1. For integer predicates, use SMT/Z3 simplification or compare the rule with 0 in Equiv Diff to check for a contradiction. Put required bounds in the expression.
  3. For integer predicate expressions, use integer literals and wait for Z3 to load (the header pill shows "Solver: SMT ✓").

See the Solver page for backend details and the equivalence diff feature.

How do I debug a feature-flag policy?

  1. Write the policy as a predicate expression:
    can_purchase = logged_in & email_verified & (age >= 18) & (region in {CA, US, UK}) & !banned;
  2. The left panel shows Bindings, Inputs (boolean variables), and Predicate Variables (typed constraints).
  3. Fix specific variables in the Inputs panel to test a particular user scenario (e.g. set banned = 0, logged_in = 1).
  4. The Result summary shows how the chosen constraints affect the output. The full Truth Table shows Boolean combinations; predicate columns may include combinations that are impossible for the underlying values.
  5. Use the Simplify panel to see if the policy can be expressed more simply.
  6. Add more bindings to model a multi-stage policy:
    can_purchase = logged_in & email_verified & (age >= 18) & (region in {CA, US, UK}) & !banned;
    eligible_for_discount = can_purchase & (loyalty_years >= 2) & !pending_return;

How do I share a worksheet?

  1. Click Share (or open command search with ⌘K or Ctrl+K and search "Share").
  2. The modal shows a URL encoding the current expression. Click Copy.
  3. Anyone with the URL can open it and see the same expression loaded in Logic Studio.

Share links open the expression and its annotations. See Export & Sharing for the fields carried by the link.

How do I use predicates with sets and comparisons?

  1. Write comparisons directly in the expression:
    (age >= 18) & (tier in {gold, platinum})
  2. Logic Studio parses each comparison as a predicate atom and shows it in the Predicate Variables section.
  3. Click the + button next to a variable to specify its type (number, enum, string) and value range. These annotations describe value buckets. Put required integer bounds in the expression.
  4. Use not-in for exclusion: (country not-in {IR, KP}).
  5. To solve semantics-aware constraints (e.g. "is age < 18 AND age >= 18 always false?"), wait for Z3 to load.

See the Predicates page for operator reference and limitations.

How do I read the Show-all DAG?

  1. Write a multi-binding program:
    authenticated = token_valid & !expired;
    authorized = authenticated & (role in {admin, editor});
    can_write = authorized & !read_only;
  2. In the Graph tab, click Show all in the target bar above the canvas.
  3. All three bindings appear in a single DAG. Each binding's root is labelled. Shared atoms are shared nodes.
  4. Use the minimap and pan/zoom to navigate large DAGs.

See the Graph page for details.

How do I import or export to code?

Export:

  1. Click the Export tab.
  2. Select a language (JavaScript, Python, C, SQL, GitHub Actions, Lisp).
  3. Click Copy to get the code for your expression.

Or expand the Import/Export section in the left panel for a combined import/export view.

Import:

  1. In the Import/Export section, select the source language.
  2. Paste your code into the import textarea.
  3. Click Import. Logic Studio parses the code and loads the expression into the editor.

See Export & Sharing for supported import formats.

How do I generate test cases?

  1. Write your expression in the editor.
  2. Click the Coverage tab.
  3. Select a coverage strategy from the dropdown (Branch, MC/DC, Pairwise, or Prime Implicant).
  4. Click Generate.
  5. Read the vectors and coverage details for the selected criterion.
  6. Select a language tab and click Copy to get the test vectors as code.

See the Coverage page for strategy definitions and limitations.