Skip to main content
Quick reference for the QWED-Logic Domain Specific Language.

Overview

QWED-Logic is an S-expression based DSL for expressing logical constraints. It’s verified by the Z3 SMT solver for mathematical correctness.
Why S-expressions? They’re unambiguous, easy to parse, and map directly to Z3 constraints.

Basic syntax

All expressions are enclosed in parentheses. The operator comes first, followed by arguments.

Logical operators

Examples


Comparison operators

Examples


Arithmetic operators

Examples


Quantifiers

Examples


Special types

Boolean literals

Integer constraints

Array/list operations


Complete examples

Example 1: age validation

Python:

Example 2: budget constraint

Example 3: password rules

Example 4: scheduling constraint

Example 5: quadratic equation


Verification results

Reading results


API usage

Python

CLI

HTTP API


Common patterns

Range check

Non-empty string

Mutual exclusion

At most one

Exactly one


Error handling


Grammar (EBNF)


Full specification

See QWED-Logic DSL Specification for the complete formal grammar.