+ } title="Diverse graph generation">
+ Refinery provides a framework for the automated generation of graphs.
+
+ } title="Model with uncertainty" even>
+ Partial modeling allows us to explicitly represent unknown or
+ uncertain knowledge in our models. The Refinery framework enables us
+ to explore design alternatives systematically.
+
+ } title="Formal logic reasoning">
+ Refinery combines the mathematical precision of formal logic
+ structures with the expressiveness of graph-based models. Underlying
+ solver algorithms ensure formal correctness and completeness of
+ generation processes.
+
+
+
+ }
+ title="Advanced web-based editor"
+ offset={2}
+ even
+ >
+ Designers are supported with state-of-the-art web-based editors with
+ advanced IDE features and visualization techniques. The framework can
+ be applied as a simple command-line interface program or deployed on
+ the cloud.
+
+ } title="Powerful graph algorithms">
+ Refinery is equipped with powerful algorithms such as incremental
+ query evaluation, efficient graph isomorphism checking, and
+ version-controlled data structures to solve various modeling and graph
+ processing problems.
+
+
+ }
+ title={
+ <>
+ Execution time analysis for data-driven{' '}
+ critical systems
+ >
+ }
+ href="https://doi.org/10.1145/3471904"
+ />
+ }
+ title={
+ <>
+ Generative architectures with assured resilience
+ >
+ }
+ href="https://doi.org/10.1145/3550355.3552448"
+ />
+ }
+ title={
+ <>
+ Video game map generator with model-based{' '}
+ techniques
+ >
+ }
+ href="https://doi.org/10.1145/3417990.3422001"
+ />
+
+ >
+ );
+}
diff --git a/subprojects/docs/src/components/UseCases/uc1.svg b/subprojects/docs/src/components/UseCases/uc1.svg
new file mode 100644
index 000000000..2b5504e58
--- /dev/null
+++ b/subprojects/docs/src/components/UseCases/uc1.svg
@@ -0,0 +1 @@
+
diff --git a/subprojects/docs/src/components/UseCases/uc1.svg.license b/subprojects/docs/src/components/UseCases/uc1.svg.license
new file mode 100644
index 000000000..15aca74df
--- /dev/null
+++ b/subprojects/docs/src/components/UseCases/uc1.svg.license
@@ -0,0 +1,4 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
+
diff --git a/subprojects/docs/src/components/UseCases/uc2.svg b/subprojects/docs/src/components/UseCases/uc2.svg
new file mode 100644
index 000000000..8aec8169f
--- /dev/null
+++ b/subprojects/docs/src/components/UseCases/uc2.svg
@@ -0,0 +1 @@
+
diff --git a/subprojects/docs/src/components/UseCases/uc2.svg.license b/subprojects/docs/src/components/UseCases/uc2.svg.license
new file mode 100644
index 000000000..15aca74df
--- /dev/null
+++ b/subprojects/docs/src/components/UseCases/uc2.svg.license
@@ -0,0 +1,4 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
+
diff --git a/subprojects/docs/src/components/UseCases/uc3.svg b/subprojects/docs/src/components/UseCases/uc3.svg
new file mode 100644
index 000000000..cd4633173
--- /dev/null
+++ b/subprojects/docs/src/components/UseCases/uc3.svg
@@ -0,0 +1 @@
+
diff --git a/subprojects/docs/src/components/UseCases/uc3.svg.license b/subprojects/docs/src/components/UseCases/uc3.svg.license
new file mode 100644
index 000000000..15aca74df
--- /dev/null
+++ b/subprojects/docs/src/components/UseCases/uc3.svg.license
@@ -0,0 +1,4 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
+
diff --git a/subprojects/docs/src/components/UseCases/uc4.svg b/subprojects/docs/src/components/UseCases/uc4.svg
new file mode 100644
index 000000000..fa647e00a
--- /dev/null
+++ b/subprojects/docs/src/components/UseCases/uc4.svg
@@ -0,0 +1 @@
+
diff --git a/subprojects/docs/src/components/UseCases/uc4.svg.license b/subprojects/docs/src/components/UseCases/uc4.svg.license
new file mode 100644
index 000000000..15aca74df
--- /dev/null
+++ b/subprojects/docs/src/components/UseCases/uc4.svg.license
@@ -0,0 +1,4 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
+
diff --git a/subprojects/docs/src/components/UseCases/uc5.svg b/subprojects/docs/src/components/UseCases/uc5.svg
new file mode 100644
index 000000000..1b7d769d2
--- /dev/null
+++ b/subprojects/docs/src/components/UseCases/uc5.svg
@@ -0,0 +1 @@
+
diff --git a/subprojects/docs/src/components/UseCases/uc5.svg.license b/subprojects/docs/src/components/UseCases/uc5.svg.license
new file mode 100644
index 000000000..15aca74df
--- /dev/null
+++ b/subprojects/docs/src/components/UseCases/uc5.svg.license
@@ -0,0 +1,4 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
+
diff --git a/subprojects/docs/src/components/UseCases/uc6.svg b/subprojects/docs/src/components/UseCases/uc6.svg
new file mode 100644
index 000000000..063d89a83
--- /dev/null
+++ b/subprojects/docs/src/components/UseCases/uc6.svg
@@ -0,0 +1 @@
+
diff --git a/subprojects/docs/src/components/UseCases/uc6.svg.license b/subprojects/docs/src/components/UseCases/uc6.svg.license
new file mode 100644
index 000000000..15aca74df
--- /dev/null
+++ b/subprojects/docs/src/components/UseCases/uc6.svg.license
@@ -0,0 +1,4 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
+
diff --git a/subprojects/docs/src/components/Video/cover-background.png b/subprojects/docs/src/components/Video/cover-background.png
new file mode 100644
index 000000000..11369ae37
Binary files /dev/null and b/subprojects/docs/src/components/Video/cover-background.png differ
diff --git a/subprojects/docs/src/components/Video/cover-background.png.license b/subprojects/docs/src/components/Video/cover-background.png.license
new file mode 100644
index 000000000..50ad65f2c
--- /dev/null
+++ b/subprojects/docs/src/components/Video/cover-background.png.license
@@ -0,0 +1,9 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
+
+Modified image based on "Low Angle Shot of Manufacturing Plant under Blue Sky"
+available under the CC-1.0 license at
+https://www.pexels.com/photo/low-angle-shot-of-manufacturing-plant-under-blue-sky-257700/
+Original image "Bulgaria, Vratsa, Abandoned image. Free for use." by "2427999" also available at
+https://pixabay.com/photos/bulgaria-vratsa-abandoned-industry-1351947/
diff --git a/subprojects/docs/src/components/Video/cover.svg b/subprojects/docs/src/components/Video/cover.svg
new file mode 100644
index 000000000..632175d9c
--- /dev/null
+++ b/subprojects/docs/src/components/Video/cover.svg
@@ -0,0 +1 @@
+
diff --git a/subprojects/docs/src/components/Video/cover.svg.license b/subprojects/docs/src/components/Video/cover.svg.license
new file mode 100644
index 000000000..b80566a0e
--- /dev/null
+++ b/subprojects/docs/src/components/Video/cover.svg.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/src/components/Video/index.module.css b/subprojects/docs/src/components/Video/index.module.css
new file mode 100644
index 000000000..4fbd1b80c
--- /dev/null
+++ b/subprojects/docs/src/components/Video/index.module.css
@@ -0,0 +1,79 @@
+/*
+ * SPDX-FileCopyrightText: 2024 The Refinery Authors
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+
+:global(.videocolor) {
+ fill: var(--ifm-color-primary);
+}
+
+:global(.videohighlight) {
+ fill: var(--refinery-highlight);
+}
+
+[data-theme='dark'] :global(.videocolor) {
+ fill: var(--ifm-color-primary-darker);
+}
+
+.video__container {
+ position: relative;
+ width: 100%;
+ height: auto;
+ aspect-ratio: 560/315;
+ box-shadow: var(--ifm-global-shadow-lw);
+ transition: box-shadow var(--ifm-button-transition-duration) var(--ifm-transition-timing-default);
+}
+
+.video__container:hover,
+.video__container:focus-within {
+ box-shadow: var(--ifm-global-shadow-md);
+}
+
+.video,
+.video__button,
+.video__image,
+.video__svg,
+.video__svg > svg {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+}
+
+.video__svg text {
+ font-family: var(--ifm-font-family-base);
+}
+
+.video__button {
+ margin: 0;
+ padding: 0;
+ border: none;
+ cursor: pointer;
+ background-size: cover;
+}
+
+.video__cover {
+ z-index: 1;
+}
+
+:global(.videoplay) {
+ fill: rgb(255 255 255 / 40%);
+ transition: fill var(--ifm-button-transition-duration) var(--ifm-transition-timing-default);
+}
+
+.video__container:hover :global(.videoplay),
+.video__container:focus-within :global(.videoplay) {
+ fill: rgb(255 255 255 / 70%);
+}
+
+:global(.videotitle) * {
+ fill: #303846;
+ transition: fill var(--ifm-button-transition-duration) var(--ifm-transition-timing-default);
+}
+
+.video__container:hover :global(.videotitle) *,
+.video__container:focus-within :global(.videotitle) * {
+ fill: #21252b;
+}
diff --git a/subprojects/docs/src/components/Video/index.tsx b/subprojects/docs/src/components/Video/index.tsx
new file mode 100644
index 000000000..bd36eaa42
--- /dev/null
+++ b/subprojects/docs/src/components/Video/index.tsx
@@ -0,0 +1,62 @@
+/*
+ * SPDX-FileCopyrightText: 2024 The Refinery Authors
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+
+import { useState } from 'react';
+
+import coverBackground from './cover-background.png?sizes[]=1920&sizes[]=1288&sizes[]=1108&&sizes[]=644&sizes[]=322&placeholder=true&rl';
+import Cover from './cover.svg';
+import styles from './index.module.css';
+
+export default function Video() {
+ const [started, setStarted] = useState(false);
+ return (
+ <>
+
Check out the intro video
+
+
+ {started ? (
+
+ ) : (
+
+ )}
+
+
+ >
+ );
+}
diff --git a/subprojects/docs/src/css/custom.css b/subprojects/docs/src/css/custom.css
new file mode 100644
index 000000000..30384369d
--- /dev/null
+++ b/subprojects/docs/src/css/custom.css
@@ -0,0 +1,142 @@
+/*
+ * SPDX-FileCopyrightText: 2024 The Refinery Authors
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+
+@import '@fontsource-variable/open-sans/wdth.css';
+@import '@fontsource-variable/open-sans/wdth-italic.css';
+@import '@fontsource-variable/jetbrains-mono/wght.css';
+@import '@fontsource-variable/jetbrains-mono/wght-italic.css';
+
+@import './sr-only.css';
+
+:root {
+ --ifm-font-family-base: 'Open Sans Variable',
+ 'Open Sans',
+ 'Roboto',
+ 'Helvetica',
+ 'Arial',
+ sans-serif;
+ --ifm-font-family-monospace: 'JetBrains Mono Variable',
+ 'JetBrains Mono',
+ 'Cascadia Code',
+ 'Fira Code',
+ monospace;
+ --ifm-code-font-size: 95%;
+ --ifm-background-surface-color: #f5f5f5;
+ --refinery-outer-border-color: rgb(0 0 0 / 0.21);
+ --ifm-font-color-base: #19202b;
+ --ifm-color-content-secondary: #696c77;
+ --ifm-color-primary: #038a99;
+ --ifm-color-primary-dark: #037c8a;
+ --ifm-color-primary-darker: #037582;
+ --ifm-color-primary-darkest: #02616b;
+ --ifm-color-primary-light: #0398a8;
+ --ifm-color-primary-lighter: #039fb0;
+ --ifm-color-primary-lightest: #04b3c7;
+ --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
+ --ifm-blockquote-color: var(--ifm-color-content-secondary);
+ --ifm-card-background-color: #fff;
+ /* elevation=4 shadow from Material UI. */
+ --ifm-global-shadow-md: 0px 2px 4px -1px rgba(0,0,0,0.2),
+ 0px 4px 5px 0px rgba(0,0,0,0.14),
+ 0px 1px 10px 0px rgba(0,0,0,0.12) !important;
+ /* elevation=8 shadow from Material UI. */
+ --ifm-global-shadow-tl: 0px 5px 5px -3px rgba(0,0,0,0.2),
+ 0px 8px 10px 1px rgba(0,0,0,0.14),
+ 0px 3px 14px 2px rgba(0,0,0,0.12) !important;
+ --refinery-highlight: #ca1243;
+}
+
+[data-theme='dark'] {
+ --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
+ --ifm-background-color: #21252b !important;
+ --ifm-background-surface-color: #282c34 !important;
+ --refinery-outer-border-color: transparent;
+ --ifm-font-color-base: #ebebff !important;
+ --ifm-color-content-secondary: #abb2bf !important;
+ --ifm-color-primary: #56b6c2;
+ --ifm-color-primary-dark: #43acb9;
+ --ifm-color-primary-darker: #3fa2af;
+ --ifm-color-primary-darkest: #348690;
+ --ifm-color-primary-light: #6bbfc9;
+ --ifm-color-primary-lighter: #75c3cd;
+ --ifm-color-primary-lightest: #94d1d8;
+ --ifm-card-background-color: var(--ifm-background-surface-color) !important;
+ --refinery-highlight: #e06c75;
+}
+
+code {
+ font-feature-settings: 'liga', 'calt';
+}
+
+.navbar {
+ --ifm-navbar-background-color: var(--ifm-background-surface-color) !important;
+ --ifm-navbar-shadow: 0 1px var(--refinery-outer-border-color) !important;
+}
+
+[data-theme='dark'] .navbar {
+ --ifm-navbar-shadow: var(--ifm-global-shadow-lw) !important;
+}
+
+.button, .navbar__link, .footer__link-item {
+ text-transform: uppercase;
+ font-variation-settings: 'wdth' 87.5;
+}
+
+.button--play::before {
+ content: '▶';
+ display: inline-block;
+ transform: translatey(-0.1em);
+ padding-right: 1ch;
+}
+
+.button, .navbar__link {
+ font-weight: 600;
+}
+
+.navbar__link--try-now {
+ color: var(--ifm-color-primary);
+ background: rgb(3 138 153 / 12%);
+ transition: background var(--ifm-button-transition-duration) var(--ifm-transition-timing-default);
+}
+
+.navbar__inner .navbar__link--try-now {
+ margin: 0 0.75rem 0 0.5rem;
+ padding: 0.25rem 1.25rem;
+ border-radius: 50em;
+}
+
+.navbar__link--try-now:hover,
+.navbar__link--try-now:active {
+ color: var(--ifm-color-primary);
+ background: rgb(3 138 153 / 16%);
+}
+
+[data-theme="dark"] .navbar__link--try-now {
+ background: rgb(86 182 194 / 16%);
+}
+
+[data-theme="dark"] .navbar__link--try-now:hover,
+[data-theme="dark"] .navbar__link--try-now:active {
+ background: rgb(86 182 194 / 24%);
+}
+
+.menu {
+ --ifm-menu-color: var(--ifm-color-content-secondary) !important;
+}
+
+.footer {
+ --ifm-footer-background-color: var(--ifm-background-surface-color) !important;
+ --ifm-footer-link-color: var(--ifm-color-content-secondary) !important;
+ box-shadow: 0 -1px var(--refinery-outer-border-color);
+}
+
+.hero__title {
+ font-weight: 800;
+}
+
+.markdown svg {
+ max-width: 100%;
+}
diff --git a/subprojects/docs/src/css/sr-only.css b/subprojects/docs/src/css/sr-only.css
new file mode 100644
index 000000000..dbd65fd3d
--- /dev/null
+++ b/subprojects/docs/src/css/sr-only.css
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2010–2021 Kitty Giraudel
+ *
+ * SPDX-License-Identifier: MIT
+ *
+ * This snippet was copied from
+ * https://kittygiraudel.com/snippets/sr-only-class/
+ */
+
+.sr-only {
+ border: 0 !important;
+ clip: rect(1px, 1px, 1px, 1px) !important;
+ -webkit-clip-path: inset(50%) !important;
+ clip-path: inset(50%) !important;
+ height: 1px !important;
+ overflow: hidden !important;
+ margin: -1px !important;
+ padding: 0 !important;
+ position: absolute !important;
+ width: 1px !important;
+ white-space: nowrap !important;
+}
diff --git a/subprojects/docs/src/develop/contributing/commands.md b/subprojects/docs/src/develop/contributing/commands.md
new file mode 100644
index 000000000..abfea7041
--- /dev/null
+++ b/subprojects/docs/src/develop/contributing/commands.md
@@ -0,0 +1,172 @@
+---
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+SPDX-License-Identifier: EPL-2.0
+sidebar_position: 1
+title: Build commands
+---
+
+# Building from the command line
+
+## Gradle commands
+
+We use [Gradle](https://gradle.org/) to manage the compilation and tests of Refinery.
+
+Java code is built directly by Gradle.
+We use the [frontend-gradle-plugin](https://siouan.github.io/frontend-gradle-plugin/) to manage a [Node.js](https://nodejs.org/en) and [Yarn](https://yarnpkg.com/) installation, which in turn is used to build TypeScript code (including this documentation website).
+Typically, Yarn commands are issued by Gradle and you don't need to work with the TypeScript build system directly if you're only working on the Java parts of Refinery.
+
+### `build`
+
+```bash posix2windows
+./gradlew build
+```
+
+Compile all code, run all tests, and produce all build artifacts.
+
+You should run this command before submitting a [Pull request](https://github.com/graphs4value/refinery/pulls) to make sure that all code builds and tests pass on your local machine.
+This will also be run by GitHub Actions for each commit or pull requests.
+
+### `publishToMavenLocal`
+
+
+```bash posix2windows
+./gradlew publishToMavenLocal
+```
+
+Publishes the Refinery Java artifacts to the [Maven local repository](https://www.baeldung.com/maven-local-repository).
+
+Build tools, such as Gradle, will be able to consume such artifacts, which enables you to use the latest version of Refinery -- possibly including your own modification -- in other Java projects.
+
+For example, in Gradle, you may set
+
+```kotlin title="build.gradle.kts"
+repositories {
+ mavenLocal()
+}
+
+dependencies {
+ implementation("tools.refinery:refinery-generator:0.0.0-SNAPSHOT")
+}
+```
+
+to add a dependency on Refinery to your Java project.
+
+### `serve`
+
+```bash posix2windows
+./gradlew serve
+```
+
+Starts the Refinery backend and web interface on port 1312.
+
+This task is ideal for running the Refinery backend if you don't intend to work on the frontend.
+The Refinery frontend TypeScript projects is automatically built before the server starts.
+The server will use the latest build output of the frontend as static assets.
+
+The behavior of this task is influenced by the same [environmental variables](/learn/docker#environmental-variables) as the Refinery [Docker container](/learn/docker).
+However, the default value of `REFINERY_LISTEN_PORT` is `1312`.
+
+### `serveBackend`
+
+```bash posix2windows
+./gradlew serveBackend
+```
+
+Starts the Refinery backend on port 1312.
+
+This task is ideal for running the Refinery backend if you're working on the frontend.
+No static assets will be build.
+You'll need to use [`yarnw frontend dev`](#frontend-dev)
+
+Like [`gradlew serve`](#serve), the behavior of this task is influenced by the same [environmental variables](/learn/docker#environmental-variables) as the Refinery [Docker container](/learn/docker).
+However, the default value of `REFINERY_LISTEN_PORT` is `1312`.
+
+## Yarn commands
+
+We provide a `yarnw` wrapper script to invoke the Yarn distribution installed by frontend-gradle-plugin directly.
+The following commands can only be run once [`gradlew build`](#build) has installed the necessary Node.js and Yarn packages.
+
+### `docs dev`
+
+```bash posix2windows
+./yarn docs dev
+```
+
+Builds and serves this documentation in development mode on port 3000.
+Saved changes to most documentation sources are immediately reflected in the browse without reloading.
+
+You can set the port with the `-p` option, e.g. to use port 1313, use
+
+```bash posix2windows
+./yarn docs dev -p 1313
+```
+
+:::note
+
+Running this command for the first time may generate error messages like
+```
+ERROR failed to read input source map: failed to parse inline source map url
+```
+which can be safely ignored.
+
+:::
+
+### `frontend dev`
+
+```bash posix2windows
+./yarn frontend dev
+```
+
+Builds and serves the refinery frontend on port 1313.
+Saved changes to most source files are immediately reflected in the browser without reload.
+
+Before running this command, you need to start [`gradlew serveBackend`](#servebackend) to provide a backend for the frontend to connect to.
+The development server of the frontend will proxy all WebSocket connections to the backend.
+
+The following environmental variables influence the behavior of this command:
+
+#### `REFINERY_LISTEN_HOST`
+
+Hostname to listen at for incoming HTTP connections.
+
+**Default value:** `localhost`
+
+#### `REFINERY_LISTEN_PORT`
+
+TCP port to listen at for incoming HTTP connections.
+
+**Default value:** `1313`
+
+#### `REFINERY_BACKEND_HOST`
+
+Hostname of the Refinery backend.
+
+This should match the `REFINERY_LISTEN_HOST` passed to [`gradlew serveBackend`](#servebackend).
+
+**Default value:** `127.0.0.1` (connect to `localhost` over IPv4 only)
+
+#### `REFINERY_LISTEN_PORT`
+
+TCP port of the Refinery backend.
+
+This should match the `REFINERY_LISTEN_PORT` passed to [`gradlew serveBackend`](#servebackend).
+
+**Default value:** `1312`
+
+#### `REFINERY_PUBLIC_HOST`
+
+Publicly visible hostname of the Refinery instance.
+
+If you use a reverse proxy in front of the development server, you must set this variable.
+Otherwise, connections to the development server will fail due to cross-origin protection.
+
+**Default value:** equal to `REFINERY_LISTEN_HOST`
+
+#### `REFINERY_PUBLIC_PORT`
+
+Publicly visible port of the Refinery instance.
+
+If you use a reverse proxy in front of the development server, you must set this variable.
+Otherwise, connections to the development server will fail due to cross-origin protection.
+
+**Default value:** equal to `REFINERY_LISTEN_PORT`
diff --git a/subprojects/docs/src/develop/contributing/ide-setup.md b/subprojects/docs/src/develop/contributing/ide-setup.md
new file mode 100644
index 000000000..742035e0c
--- /dev/null
+++ b/subprojects/docs/src/develop/contributing/ide-setup.md
@@ -0,0 +1,94 @@
+---
+SPDX-FileCopyrightText: 2021-2023 The Refinery Authors
+SPDX-License-Identifier: EPL-2.0
+sidebar_position: 2
+title: IDE setup
+---
+
+# Setting up the development environment
+
+## IntelliJ IDEA
+
+We prefer [IntelliJ IDEA](https://www.jetbrains.com/idea/) as a Java development environment.
+No special preparations should be necessary for importing the project as a Gradle project into IDEA:
+
+1. See the [required tools](/develop/contributing#required-tools) for compiling Refinery about obtaining the required JDK version. You'll also need a version of IntelliJ IDEA that supports **Java 21** (version **2023.3** or later).
+
+2. Clone the project git repository and open it in IntelliJ IDEA. Make sure to _open_ the project instead of creating a _new_ one in the same directory.
+
+3. IntelliJ IDEA should build and index the project. If there are errors, it is likely that the `JAVA_HOME` was incorrectly set:
+ * In _Project Structure > Project settings > Project > SDK_, a Java 21 compatible JDK should be selected.
+ * In _Project Structure > Project settings > Project > Language level_, either _SDK default_ or _21_ should be selected.
+ * Make sure that each module in _Project Structure > Project settings > Module_ uses the _Project default_ language level in _Sources > Language level_ and the _Project SDK_ in _Dependencies > Module SDK._
+ * In _Settings > Gradle settings > Gralde Projects > Gradle_, the _Distribution_ should be set to _Wrapper_ and the _Gradle JVM_ should be set to _Project SDK._
+
+4. We recommend installing the latest _SonarLint_ plugin in _Settings > Plugins_ to get real-time code quality analysis in your IDE.
+
+:::note
+
+You'll need [Eclipse](#eclipse) to edit Xtext (`*.xtext`) and MWE2 (`*.mwe2`) files and Ecore class diagrams (`*.aird`, `*.ecore`, `*.genmodel`).
+If you do not plan on making changes to such files, feel free to skip the Eclipse installation steps below.
+
+You'll also need [VS Code](#vs-code) to edit the TypeScript code in Refinery.
+
+:::
+
+## Eclipse
+
+1. See the [required tools](/develop/contributing#required-tools) for compiling Refinery about obtaining the required JDK version.
+
+2. Download and extract the [Eclipse IDE for Java and DSL Developers 2023-12](https://www.eclipse.org/downloads/packages/release/2023-12/r/eclipse-ide-java-and-dsl-developers) package.
+
+3. Launch Eclipse and create a new workspace.
+
+4. Open _Help > Eclipse Marketplace_ and install the following software:
+ * _EclEmma Java Code Coverage_
+ * _EcoreTools : Ecore Diagram Editor_
+ * _Sirius_ (ignore the warning during installation about the solution _Sirius_ not being available)
+ * _SonarLint_
+
+5. Open _Window > Preferences_ and set the following preferences:
+ * _General > Workspace > Text file encoding_ should be _UTF-8_.
+ * _General > Workspace > New text file line delimiter_ should be _Unix_.
+ * Add the JDK 21 to _Java > Installed JREs_.
+ * Make sure JDK 21 is selected for _JavaSE-21_ at _Java > Installed JREs > Execution Environments_.
+ * Set _Gradle > Java home_ to the `JAVA_HOME` directory (the directory which contains the `bin` directory) of JDK 21. Here, Buildship will show a yellow warning sign, which can be safely ignored.
+ * Set _Java > Compiler > JDK Compliance > Compiler compliance level_ to _21_.
+
+6. Clone the project Git repository but _do not_ import it into Eclipse yet.
+
+7. Open a new terminal and run
+ ```bash posix2windows
+ ./gradlew prepareEclipse
+ ```
+ in the cloned repository.
+ * This should complete without any compilation errors.
+ * To troubleshoot any error, see the [instructions about compiling Refinery](/develop/contributing#compiling).
+
+8. Select _File > Import... > Gradle > Existing Gradle Project_ and import the cloned repository in Eclipse.
+ * Make sure to select the root of the repository (containing this file) as the _Project root directory_ and that the _Gradle distribution_ is _Gradle wrapper_.
+ * If you have previously imported the project into Eclipse, this step will likely fail. In that case, you should remove the projects from Eclipse, run `git clean -fxd` in the repository, and start over from step 8.
+
+## VS Code
+
+We recommend [VSCodium](https://github.com/VSCodium/vscodium) or [Visual Studio Code](https://code.visualstudio.com/) to work with the parts of Refinery that are written is TypeScript.
+
+1. See the [required tools](/develop/contributing#required-tools) for compiling Refinery about obtaining the required JDK version. You'll also need a version of IntelliJ IDEA that supports **Java 21** (version **2023.3** or later).
+
+2. Install the following VS Code extensions:
+ * _EditorConfig for VS Code_ [[Open VSX](https://open-vsx.org/extension/EditorConfig/EditorConfig)] [[Extension Marketplace](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig)]
+ * _ZipFS - a zip file system_ [[Open VSX](https://open-vsx.org/extension/arcanis/vscode-zipfs)] [[Extension Marketplace](https://marketplace.visualstudio.com/items?itemName=arcanis.vscode-zipfs)]
+ * _ESLint_ [[Open VSX](https://open-vsx.org/extension/dbaeumer/vscode-eslint)] [[Extension Marketplace](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)]
+ * _XState VSCode_ [[Open VSX](https://open-vsx.org/extension/statelyai/stately-vscode)] [[Extension Marketplace](https://marketplace.visualstudio.com/items?itemName=statelyai.stately-vscode)]
+
+3. Clone the project Git repository but _do not_ import it into VS Code yet.
+
+4. Run
+ ```bash posix2windows
+ ./gradlew installFrontend
+ ```
+ to install all required Node.js tooling.
+
+5. Open the repository with _Open Folder…_ in VS Code.
+ * When asked, select that you _Trust_ the folder.
+ * When asked, enable using the TypeScript and ESLint tooling specified in the repository.
diff --git a/subprojects/docs/src/develop/contributing/index.md b/subprojects/docs/src/develop/contributing/index.md
new file mode 100644
index 000000000..aa0bdb2fd
--- /dev/null
+++ b/subprojects/docs/src/develop/contributing/index.md
@@ -0,0 +1,59 @@
+---
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+SPDX-License-Identifier: EPL-2.0
+sidebar_position: 1
+title: Contributing
+---
+
+import TabItem from '@theme/TabItem';
+import Tabs from '@theme/Tabs';
+
+# Contributing to Refinery
+
+You can clone the refinery repository from GitHub at https://github.com/graphs4value/refinery.
+If you want to contribute code, we recommend [forking](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) the repository on GitHub so that you can submit a [pull request](https://github.com/graphs4value/refinery/pulls) later.
+
+## Required tools
+
+Refinery is written in Java and TypeScript. To build Refinery, you'll need a **Java 21** compatible **Java Development Kit (JDK).** We recommend the [Adoptium Java 21 JDK](https://adoptium.net/) or the [Amazon Corretto Java 21 JDK](https://aws.amazon.com/corretto/).
+
+## Compiling Refinery {#compiling}
+
+To build Refinery, run the command
+```bash posix2windows
+./gradlew build
+```
+in the cloned repository.
+
+This should complete without any compilation errors.
+
+If you get any errors about the JVM version, check whether the `JAVA_HOME` environment variable is set to the location of **JDK 21**. You can query the variable with
+
+
+ ```bash
+ echo $JAVA_HOME
+ ```
+
+
+ ```bash
+ echo $Env:JAVA_HOME
+ ```
+
+
+To set the `JAVA_HOME` environmental variable, use
+
+
+ ```bash
+ export JAVA_HOME=/java/path/here
+ ```
+
+
+ ```bash
+ $Env:JAVA_HOME="C:\java\path\here"
+ ```
+
+
+
+If the build fails with a `Host name must not be empty` error, you [might need to remove the empty proxy configuration from your global `gradle.properties` file](https://stackoverflow.com/a/62128323).
+
+For further information, see the [supported build commands](/develop/contributing/commands) and the [instructions for setting up an IDE](/develop/contributing/ide-setup).
diff --git a/subprojects/docs/src/develop/index.md b/subprojects/docs/src/develop/index.md
new file mode 100644
index 000000000..4537889e7
--- /dev/null
+++ b/subprojects/docs/src/develop/index.md
@@ -0,0 +1,13 @@
+---
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+SPDX-License-Identifier: EPL-2.0
+sidebar_position: 0
+---
+
+# Programming guide
+
+:::warning
+
+Under construction
+
+:::
diff --git a/subprojects/docs/src/develop/javadoc.md b/subprojects/docs/src/develop/javadoc.md
new file mode 100644
index 000000000..225e9de09
--- /dev/null
+++ b/subprojects/docs/src/develop/javadoc.md
@@ -0,0 +1,42 @@
+---
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+SPDX-License-Identifier: EPL-2.0
+description: API documentation for Refinery components automatically generated by Javadoc
+sidebar_position: 999
+---
+
+# Javadoc
+
+Here you can find API documentation for Refinery components automatically generated by Javadoc. We recommend reading the [Programming guide](/develop) first to understand how to use these components.
+
+# Refinery
+
+* [`tools.refinery:refinery-generator`](pathname://refinery-generator)
+* [`tools.refinery:refinery-generator-cli`](pathname://refinery-generator-cli)
+* [`tools.refinery:refinery-language`](pathname://refinery-language)
+* [`tools.refinery:refinery-language-ide`](pathname://refinery-language-ide)
+* [`tools.refinery:refinery-language-model`](pathname://refinery-language-model)
+* [`tools.refinery:refinery-language-semantics`](pathname://refinery-language-semantics)
+* [`tools.refinery:refinery-language-web`](pathname://refinery-language-web)
+* [`tools.refinery:refinery-logic`](pathname://refinery-logic)
+* [`tools.refinery:refinery-store`](pathname://refinery-store)
+* [`tools.refinery:refinery-store-dse`](pathname://refinery-store-dse)
+* [`tools.refinery:refinery-store-dse-visualization`](pathname://refinery-store-dse-visualization)
+* [`tools.refinery:refinery-store-query`](pathname://refinery-store-query)
+* [`tools.refinery:refinery-store-query-interpreter`](pathname://refinery-store-query-interpreter)
+* [`tools.refinery:refinery-store-reasoning`](pathname://refinery-store-reasoning)
+* [`tools.refinery:refinery-store-reasoning-scope`](pathname://refinery-store-reasoning-scope)
+* [`tools.refinery:refinery-store-reasoning-smt`](pathname://refinery-store-reasoning-smt)
+
+# Interpreter
+
+:::note
+
+The _Refinery Interpreter_ is modified version of [VIATRA™](https://eclipse.dev/viatra/) specifically for use in Refinery. If you're interested in learning about [VIATRA™](https://eclipse.dev/viatra/), we recommend the [VIATRA™ documentation](https://eclipse.dev/viatra/documentation/index.html) and [source code](https://github.com/eclipse-viatra/org.eclipse.viatra) instead. Eclipse®, VIATRA™ and ‘Eclipse VIATRA™’ are trademarks of Eclipse Foundation, Inc.
+
+:::
+
+* [`tools.refinery.interpreter:refinery-interpreter`](pathname://refinery-interpreter)
+* [`tools.refinery.interpreter:refinery-interpreter-localsearch`](pathname://refinery-interpreter-localsearch)
+* [`tools.refinery.interpreter:refinery-interpreter-rete`](pathname://refinery-interpreter-rete)
+* [`tools.refinery.interpreter:refinery-interpreter-rete-recipes`](pathname://refinery-interpreter-rete-recipes)
diff --git a/subprojects/docs/src/learn/docker.md b/subprojects/docs/src/learn/docker.md
new file mode 100644
index 000000000..0df87da8c
--- /dev/null
+++ b/subprojects/docs/src/learn/docker.md
@@ -0,0 +1,175 @@
+---
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+SPDX-License-Identifier: EPL-2.0
+sidebar_position: 100
+sidebar_label: Docker
+---
+
+# Running in Docker
+
+:::note
+
+Refinery can run as a cloud-based _Graph Solver as a Service_ without local installation.
+If you're just looking to try Refinery, our [online demo](https://refinery.services/) provides a seamless experience without installation.
+
+:::
+
+:::info
+
+Installing Refinery as a Docker container can support more advanced use cases, such as when generating models with more resources or a longer timeout.
+
+:::
+
+To generate larger models with a longer timeout, you can use our [Docker container](https://github.com/graphs4value/refinery/pkgs/container/refinery) on either `amd64` or `arm64` machines:
+
+```shell
+docker run --rm -it -p 8888:8888 ghcr.io/graphs4value/refinery
+```
+
+Once Docker pulls and starts the container, you can navigate to http://localhost:8888 to open the model generation interface and start editing.
+
+Alternatively, you can follow the [instructions to set up a local development environment](/develop/contributing) and compile and run Refinery from source.
+
+## Updating
+
+To take advantage of the latest updates, you can simply re-pull our Docker container from the GitHub Container Registry:
+
+```shell
+docker pull ghcr.io/graphs4value/refinery
+```
+
+Restart the container to make sure that you're running the last pulled version.
+
+## Environmental variables
+
+The Docker container supports the following environmental variables to customize its behavior.
+Customizing these variable should only be needed if you want to _increase resource limits_ or _expose you Refinery instance over the network_ for others.
+
+Notes for **local-only instances** are highlighted with the :arrow_right: arrow emoji.
+
+Important security notices for **public instances** are highlighted with the :warning: warning emoji.
+
+### Networking
+
+#### `REFINERY_LISTEN_HOST`
+
+Hostname to listen at for incoming HTTP connections.
+
+**Default value:** `0.0.0.0` (accepts connections on any IP address)
+
+#### `REFINERY_LISTEN_PORT`
+
+TCP port to listen at for incoming HTTP connections.
+
+Refinery doesn't support HTTPS connections out of the box, so there's no point in setting this to `443`. Use a [reverse proxy](https://en.wikipedia.org/wiki/Reverse_proxy) instead if you wish to expose Refinery to encrypted connections.
+
+If you change this value, don't forget to adjust the `-p 8888:8888` option of the `docker run` command to [expose](https://docs.docker.com/reference/cli/docker/container/run/#publish) the selected port.
+
+**Default value:** `8888`
+
+#### `REFINERY_PUBLIC_HOST`
+
+Publicly visible hostname of the Refinery instance.
+
+:arrow_right: For installations only accessed locally (i.e., `localhost:8888`) without any reverse proxy, you can safely leave this empty.
+
+:warning: You should set this to the publicly visible hostname of your Refinery instance if you wish to expose Refinery over the network. Most likely, this will be the hostname of a reverse proxy that terminates TLS connections. Our online demo sets this to [refinery.services](https://refinery.services/).
+
+**Default value:** _empty_
+
+#### `REFINERY_PUBLIC_PORT`
+
+Publicly visible port of the Refinery instance.
+
+:arrow_right: For installations only accessed locally (i.e., `localhost:8888`), this value is ignored because `REFINERY_PUBLC_HOST` is not set.
+
+**Default value:** `443`
+
+#### `REFINERY_ALLOWED_ORIGINS`
+
+Comma-separated list of allowed origins for incoming WebSocket connections. If this variable is empty, all incoming WebSocket connections are accepted.
+
+:arrow_right: For installations only accessed locally (i.e., `localhost:8888`) without any reverse proxy, you can safely leave this empty.
+
+:warning: The value inferred from `REFINERY_PUBLIC_HOST` and `REFINERY_PUBLIC_PORT` should be suitable for instances exposed over the network. For security reasons, public instances should never leave this empty.
+
+**Default value:** equal to `REFINERY_PUBLIC_HOST:REFINERY_PUBLIC_PORT` if they are both set, _empty_ otherwise
+
+### Timeouts
+
+#### `REFINERY_SEMANTICS_TIMEOUT_MS`
+
+Timeout for partial model semantics calculation in milliseconds.
+
+:arrow_right: Increase this if you have a slower machine and the editor times out before showing a preview of your partial model in the _Graph_ or _Table_ views.
+
+:warning: Increasing this timeout may increase server load. Excessively large timeout may allow users to overload you server by entering extremely complex partial models.
+
+**Default value:** `1000`
+
+#### `REFINERY_SEMANTICS_WARMUP_TIMEOUT_MS`
+
+Timeout for partial model semantics calculation in milliseconds when the server first start.
+
+Due to various initialization tasks, the first partial model semantics generation may take longer the `REFINERY_SEMANTICS_TIMEOUT_MS` and display a timeout error. This setting increases the timeout for the first generation, leading to seamless use even after server start (especially in auto-scaling setups).
+
+**Default value:** equal to 2 × `REFINERY_SEMANTICS_TIMEOUT`
+
+#### `REFINERY_MODEL_GENERATION_TIMEOUT_SEC`
+
+Timeout for model generation in seconds.
+
+:arrow_right: Adjust this value if you're generating very large models (> 10000 nodes) and need more time to complete a generation. Note that some _unsatisfiable_ model generation problems cannot be detected by Refinery and will result in model generation running for an arbitrarily long time without producing any solution.
+
+:warning: Long running model generation will block a [_model generation thread_](#refinery_model_generation_thread_count). Try to balance the number of threads and the timeout to avoid exhausting system resources, but keep the wait time for a free model generation thread for users reasonably short. Auto-scaling to multiple instances may help with bursty demand.
+
+**Default value:** `600` (10 minutes)
+
+### Threading
+
+:warning: Excessively large values may overload the server. Make sure that _all_ Refinery threads can run at the same time to avoid thread starvation.
+
+#### `REFINERY_XTEXT_THREAD_COUNT`
+
+Number of threads used for non-blocking text editing operations. A value of `0` allows an _unlimited_ number of threads by running each semantics calculation in a new thread.
+
+:warning: Excessively large values may overload the server. Make sure that _all_ Refinery threads can run at the same time to avoid thread starvation.
+
+**Default value:** `1`
+
+#### `REFINERY_XTEXT_LOCKING_THREAD_COUNT`
+
+Number of threads used for text editing operations that lock the document. A value of `0` allows an _unlimited_ number of threads by running each semantics calculation in a new thread.
+
+
+**Default value:** equal to `REFINERY_XTEXT_THREAD_COUNT`
+
+#### `REFINERY_XTEXT_SEMANTICS_THREAD_COUNT`
+
+Number of threads used for model semantics calculation. A value of `0` allows an _unlimited_ number of threads by running each semantics calculation in a new thread.
+
+Must be at least as large as `REFINERY_XTEXT_THREAD_COUNT`.
+
+:warning: Excessively large values may overload the server. Make sure that _all_ Refinery threads can run at the same time to avoid thread starvation.
+
+**Default value:** equal to `REFINERY_XTEXT_THREAD_COUNT`
+
+#### `REFINERY_MODEL_GENERATION_THREAD_COUNT`
+
+Number of threads used for model semantics calculation. A value of `0` allows an _unlimited_ number of threads by running each semantics calculation in a new thread.
+
+:warning: Excessively large values may overload the server. Make sure that _all_ Refinery threads can run at the same time to avoid thread starvation. Each model generation task may also demand a large amount of memory in addition to CPU time.
+
+**Default value:** equal to `REFINERY_XTEXT_THREAD_COUNT`
+
+### Libraries
+
+#### `REFINERY_LIBRARY_PATH`
+
+Modules (`.refinery` files) in this directory or colon-separated list of directories will be exposed to user via Refinery's `import` mechanism.
+
+:arrow_right: Use this in conjunction with the [mount volume (-v)](https://docs.docker.com/reference/cli/docker/container/run/#volume) option of `docker run` to work with multi-file projects in Refinery.
+
+:warning: Make sure you only expose files that you want to make public. It's best to expose a directory that contains nothing other that `.refinery` files to minimize potential information leaks.
+
+**Default value:** _empty_ (no directories are exposed)
diff --git a/subprojects/docs/src/learn/index.md b/subprojects/docs/src/learn/index.md
new file mode 100644
index 000000000..bb28df574
--- /dev/null
+++ b/subprojects/docs/src/learn/index.md
@@ -0,0 +1,11 @@
+---
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+SPDX-License-Identifier: EPL-2.0
+sidebar_position: 0
+---
+
+# Introduction
+
+Various software and systems engineering scenarios rely on the systematic construction of consistent graph models. However, **automatically generating a diverse set of consistent graph models** for complex domain specifications is challenging. First, the graph generation problem must be specified with mathematical precision. Moreover, graph generation is a computationally complex task, which necessitates specialized logic solvers.
+
+**Refinery is a novel open-source software framework** to automatically synthesize a diverse set of consistent domain-specific graph models. The framework offers an expressive high-level specification language using partial models to succinctly formulate a wide range of graph generation challenges. It also provides a modern cloud-based architecture for a scalable _Graph Solver as a Service,_ which uses logic reasoning rules to efficiently synthesize a diverse set of solutions to graph generation problems by partial model refinement. Applications include system-level architecture synthesis, test generation for modeling tools or traffic scenario synthesis for autonomous vehicles.
diff --git a/subprojects/docs/src/learn/language/_category_.yml b/subprojects/docs/src/learn/language/_category_.yml
new file mode 100644
index 000000000..f5a6f8966
--- /dev/null
+++ b/subprojects/docs/src/learn/language/_category_.yml
@@ -0,0 +1,10 @@
+# SPDX-FileCopyrightText: 2024 The Refinery Authors
+#
+# SPDX-License-Identifier: EPL-2.0
+
+position: 2
+label: Language reference
+link:
+ type: generated-index
+ slug: /language
+ description: Learn more about the Refinery partial modeling language!
diff --git a/subprojects/docs/src/learn/language/classes/ContainmentInstance.svg b/subprojects/docs/src/learn/language/classes/ContainmentInstance.svg
new file mode 100644
index 000000000..197f4b48c
--- /dev/null
+++ b/subprojects/docs/src/learn/language/classes/ContainmentInstance.svg
@@ -0,0 +1,227 @@
+
+
\ No newline at end of file
diff --git a/subprojects/docs/src/learn/language/classes/ContainmentInstance.svg.license b/subprojects/docs/src/learn/language/classes/ContainmentInstance.svg.license
new file mode 100644
index 000000000..b80566a0e
--- /dev/null
+++ b/subprojects/docs/src/learn/language/classes/ContainmentInstance.svg.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/src/learn/language/classes/InvalidInstance.svg b/subprojects/docs/src/learn/language/classes/InvalidInstance.svg
new file mode 100644
index 000000000..fb9dd37de
--- /dev/null
+++ b/subprojects/docs/src/learn/language/classes/InvalidInstance.svg
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+invalid
+
+Region
+
+
+State
+
+
+
+
+
\ No newline at end of file
diff --git a/subprojects/docs/src/learn/language/classes/InvalidInstance.svg.license b/subprojects/docs/src/learn/language/classes/InvalidInstance.svg.license
new file mode 100644
index 000000000..b80566a0e
--- /dev/null
+++ b/subprojects/docs/src/learn/language/classes/InvalidInstance.svg.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/src/learn/language/classes/MultiplicityConstraintsInstance.svg b/subprojects/docs/src/learn/language/classes/MultiplicityConstraintsInstance.svg
new file mode 100644
index 000000000..b28c295a7
--- /dev/null
+++ b/subprojects/docs/src/learn/language/classes/MultiplicityConstraintsInstance.svg
@@ -0,0 +1,229 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+v1
+
+Vertex
+
+
+
+
+
+
+
+
+
+outgoingTransition
+
+
+
+
+
+
+source
+
+
+
+
+
+t1
+
+Transition
+
+
+
+
+
+
+
+source
+
+
+
+
+outgoingTransition
+
+
+
+
+t2
+
+Transition
+
+
+
+
+
+
+
+
+v2
+
+Vertex
+
+
+outgoingTransition::invalidMultiplicity
+
+
+
+
+
+
+
+t3
+
+Transition
+
+
+
+
+
+
+
+
+
+
+
+source
+
+
+
+
+
+
+outgoingTransition
+
+
+
+
+
+
+t4
+
+Transition
+
+
+
+
+
+
+
+
+
+v3
+
+Vertex
+
+
+
+outgoingTransition::invalidMultiplicity
+
+
+
+
+
+
+
+
+source
+
+
+
+
+
+
+outgoingTransition
+
+
+
+
+
+
+t5
+
+Transition
+
+
+
+
+
+
+
+
+
+outgoingTransition
+
+
+
+
+
+
+t6
+
+Transition
+
+
+
+
+
+
+
+
+
+outgoingTransition
+
+
+
+
+
+
+t7
+
+Transition
+
+
+
+
+
+
+
+
+
+outgoingTransition
+
+
+
+
+
+
+source
+
+
+
+
+
+
+source
+
+
+
+
+
+
+source
+
+
+
\ No newline at end of file
diff --git a/subprojects/docs/src/learn/language/classes/MultiplicityConstraintsInstance.svg.license b/subprojects/docs/src/learn/language/classes/MultiplicityConstraintsInstance.svg.license
new file mode 100644
index 000000000..b80566a0e
--- /dev/null
+++ b/subprojects/docs/src/learn/language/classes/MultiplicityConstraintsInstance.svg.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/src/learn/language/classes/NewObjectsSimple.svg b/subprojects/docs/src/learn/language/classes/NewObjectsSimple.svg
new file mode 100644
index 000000000..95ba8def7
--- /dev/null
+++ b/subprojects/docs/src/learn/language/classes/NewObjectsSimple.svg
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+Region::new
+
+Region
+
+
+
+
+
+
+
+
+
+
+State::new
+
+
+
+
+State
+
+
\ No newline at end of file
diff --git a/subprojects/docs/src/learn/language/classes/NewObjectsSimple.svg.license b/subprojects/docs/src/learn/language/classes/NewObjectsSimple.svg.license
new file mode 100644
index 000000000..b80566a0e
--- /dev/null
+++ b/subprojects/docs/src/learn/language/classes/NewObjectsSimple.svg.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/src/learn/language/classes/NewObjectsWithInheritance.svg b/subprojects/docs/src/learn/language/classes/NewObjectsWithInheritance.svg
new file mode 100644
index 000000000..cdf365f0b
--- /dev/null
+++ b/subprojects/docs/src/learn/language/classes/NewObjectsWithInheritance.svg
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+Region::new
+
+Region
+
+
+
+
+
+
+
+
+
+State::new
+
+CompositeElement
+
+
+Vertex
+
+
+RegularState
+
+
+State
+
+
+
+
+
+
\ No newline at end of file
diff --git a/subprojects/docs/src/learn/language/classes/NewObjectsWithInheritance.svg.license b/subprojects/docs/src/learn/language/classes/NewObjectsWithInheritance.svg.license
new file mode 100644
index 000000000..b80566a0e
--- /dev/null
+++ b/subprojects/docs/src/learn/language/classes/NewObjectsWithInheritance.svg.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/src/learn/language/classes/ReferencesOppositeInstance.svg b/subprojects/docs/src/learn/language/classes/ReferencesOppositeInstance.svg
new file mode 100644
index 000000000..56a4d956c
--- /dev/null
+++ b/subprojects/docs/src/learn/language/classes/ReferencesOppositeInstance.svg
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+v1
+
+Vertex
+
+
+
+
+
+
+
+
+source
+
+
+
+
+v2
+
+Vertex
+
+
+
+
+
+
+
+t1
+
+Transition
+
+
+
+
+
+
+
+outgoingTransition
+
+
+
+
+target
+
+
+
+
+incomingTransition
+
+
\ No newline at end of file
diff --git a/subprojects/docs/src/learn/language/classes/ReferencesOppositeInstance.svg.license b/subprojects/docs/src/learn/language/classes/ReferencesOppositeInstance.svg.license
new file mode 100644
index 000000000..b80566a0e
--- /dev/null
+++ b/subprojects/docs/src/learn/language/classes/ReferencesOppositeInstance.svg.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/src/learn/language/classes/ReferencesOppositeSelf.svg b/subprojects/docs/src/learn/language/classes/ReferencesOppositeSelf.svg
new file mode 100644
index 000000000..81ab4a0cb
--- /dev/null
+++ b/subprojects/docs/src/learn/language/classes/ReferencesOppositeSelf.svg
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+Person::new
+
+Person
+
+
+
+
+
+
+
+
+
+friend
+
+
+
\ No newline at end of file
diff --git a/subprojects/docs/src/learn/language/classes/ReferencesOppositeSelf.svg.license b/subprojects/docs/src/learn/language/classes/ReferencesOppositeSelf.svg.license
new file mode 100644
index 000000000..b80566a0e
--- /dev/null
+++ b/subprojects/docs/src/learn/language/classes/ReferencesOppositeSelf.svg.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/src/learn/language/classes/ReferencesSimple.svg b/subprojects/docs/src/learn/language/classes/ReferencesSimple.svg
new file mode 100644
index 000000000..fac748159
--- /dev/null
+++ b/subprojects/docs/src/learn/language/classes/ReferencesSimple.svg
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+Vertex::new
+
+Vertex
+
+
+
+
+
+
+
+
+
+Transition::new
+
+Transition
+
+
+
+
+
+
+
+
+
+source
+
+
+
+
+
+
+target
+
+
+
\ No newline at end of file
diff --git a/subprojects/docs/src/learn/language/classes/ReferencesSimple.svg.license b/subprojects/docs/src/learn/language/classes/ReferencesSimple.svg.license
new file mode 100644
index 000000000..b80566a0e
--- /dev/null
+++ b/subprojects/docs/src/learn/language/classes/ReferencesSimple.svg.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/src/learn/language/classes/index.md b/subprojects/docs/src/learn/language/classes/index.md
new file mode 100644
index 000000000..73108039c
--- /dev/null
+++ b/subprojects/docs/src/learn/language/classes/index.md
@@ -0,0 +1,212 @@
+---
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+SPDX-License-Identifier: EPL-2.0
+description: Metamodeling in Refinery
+sidebar_position: 0
+---
+
+# Classes and references
+
+Refinery supports _metamodeling_ to describe the desired structure of generated models.
+
+The metamodeling facilities are inspired by object-oriented software and the [Eclipse Modeling Foundation](https://eclipse.dev/modeling/emf/) (EMF) Core, a lightweight framework for data models.
+The textual syntax in Refinery for defining metamodels is largely compatible with [Xcore](https://wiki.eclipse.org/Xcore), a textual syntax for EMF metamodels.
+
+## Classes
+
+Classes are declared with the `class` keyword.
+
+Like in many programming languages, class members are specified between curly braces `{}`.
+If a class has no members, the declaration may be terminated with a `.` instead.
+
+```refinery
+% Class with no members.
+class Region {}
+
+% Alternative syntax without curly braces.
+class State.
+```
+
+By default, a _new object_ is added to the partial model to represent the instances of a class.
+For example, the new objects `Region::new` and `State::new` represent potential instances of the classes `Region` and `State`, respectively:
+
+import NewObjectsSimple from './NewObjectsSimple.svg';
+
+
+
+As you can see, no new objects represent potential nodes that are instanceof of both `Region` and `State`.
+In fact, such instances are not permitted at all.
+Each node must the instance of a _single most-specific class:_
+
+import InvalidInstance from './InvalidInstance.svg';
+
+
+
+### Inheritance
+
+Like in object-oriented programming languages, classes may declare _superclasses_ with the `extends` keyword.
+The inheritance hierarchy may not contain any cycles (a class cannot be a superclass of itself), but _multiple inheritance_ is allowed.
+
+Classes that can't be instantiated directly (i.e., a subclass must be instantiated instead) can be marked with the `abstract` keyword.
+Such classes do not have a _new object,_ since there are no direct instances to represent.
+
+```refinery
+abstract class CompositeElement.
+class Region.
+abstract class Vertex.
+abstract class RegularState extends Vertex.
+class State extends RegularState, CompositeElement.
+```
+
+Notice that the new object `State::new` is an instance of `CompositeElement`, `Vertex`, `RegularState`, and `State` as well.
+
+import NewObjectsWithInheritance from './NewObjectsWithInheritance.svg';
+
+
+
+## References
+
+The graph structure of model generated by Refinery is determined by the _references_ of the metamodel, which will appear as labeled edges between nodes (class instances).
+
+References are declared as class members by providing the _target type,_ and optional _multiplicity,_ and the name of the reference:
+
+```refinery
+class Vertex.
+class Transition {
+ Vertex[1] source
+ Vertex[1] target
+}
+```
+
+import ReferencesSimple from './ReferencesSimple.svg';
+
+
+
+You may add the `refers` keyword for compatibility with [Xcore](https://wiki.eclipse.org/Xcore). The following specification is equivalent:
+
+```refinery
+class Vertex.
+class Transition {
+ refers Vertex[1] source
+ refers Vertex[1] target
+}
+```
+
+### Opposite constraints
+
+The `opposite` keywords specifies that two references are in an _opposite_ relationship, i.e., if one reference is present in a direction, the other must be present between the same nodes in the opposite direction.
+
+```
+class Vertex {
+ Transition[] outgoingTransition opposite source
+ Transition[] incomingTransition opposite target
+}
+class Transition {
+ Vertex[1] source opposite outgoingTransition
+ Vertex[1] target opposite incomingTransition
+}
+```
+
+import ReferencesOppositeInstance from './ReferencesOppositeInstance.svg';
+
+
+
+Opposites must be declared in pairs: it is a specification error to declare the `opposite` for one direction but not the other.
+
+Unlike in EMF, references that are the `opposite` of themselves are also supported.
+These must always be present in both directions between two nodes.
+Thus, they correspond to undirected graph edges.
+
+```refinery
+class Person {
+ Person[] friend opposite friend
+}
+```
+
+import ReferencesOppositeSelf from './ReferencesOppositeSelf.svg';
+
+
+
+### Multiplicity
+
+_Multiplicity constrains_ can be provided after the reference type in square braces.
+They specify how many _outgoing_ references should exist for any given instance of the class.
+
+:::info
+
+To control the number of _incoming_ references, add an `opposite` reference with multiplicity constraint.
+
+:::
+
+A multiplicity constraint is of the form `[n..m]`, where the non-negative integer `n` is the _lower_ bound of outgoing references,
+and `m` is a positive integer or `*` corresponding to the _upper_ bound of outgoing references.
+The value of `*` represent a reference with _unbounded_ upper multiplicity.
+
+If `n` = `m`, the shorter form `[n]` may be used.
+The bound `[0..*]` may be abbreviated as `[]`.
+If the multiplicity constraint is omitted, the bound `[0..1]` is assumed.
+
+---
+
+In the following model, the node `v1` satisfies all multiplicity constraints of `outgoingTransition`.
+The node `v2` violates the lower bound constraint, while `v3` violates the upper bound constraint.
+All `Transition` instances satisfy the multiplicity constrains associated with `source`.
+
+```refinery
+class Vertex {
+ Transition[2..3] outgoingTransition opposite source
+}
+class Transition {
+ Vertex[1] source opposite outgoingTransition
+}
+```
+
+import MultiplicityConstraintsInstance from './MultiplicityConstraintsInstance.svg';
+
+
+
+### Containment hierarchy
+
+To structure models and ensure their connectedness, Refinery supports _containment_ constraints.
+
+References may be marked as _containment_ references with the `contains` keyword.
+
+Classes that are the _target type_ of at least one _containment_ reference are considered `contained`.
+An instance of a `contained` class must have exactly 1 incoming containment reference.
+Instances of classes that are not `contained` must _not_ have any incoming containment references.
+
+Containment references have to form a _forest_, i.e., they must not contain any cycles.
+The _roots_ of the forest are instances of classes that are not `contained`, while `contained` classes for the internal nodes and leaves of the trees.
+
+Opposites of _containment_ references have to be marked with the `container` keyword.
+They must not specify any multiplicity constraint, since the multiplicity is already implied by the containment hierarchy.
+
+---
+
+In the following model, the instances of `Region` are the roots of the containment hierarchy.
+The classes `Vertex` are `Transition` are both considered `contained`.
+
+```refinery
+class Region {
+ contains Vertex[] vertices opposite region
+}
+
+class Vertex {
+ container Region region opposite vertices
+ contains Transition[] outgoingTransition opposite source
+ Transition[] incomingTransition opposite target
+}
+
+class Transition {
+ container Vertex source opposite outgoingTransition
+ Vertex[1] target opposite incomingTransition
+}
+```
+
+Containment edges are show with **thick** lines:
+
+import ContainmentInstance from './ContainmentInstance.svg';
+
+
+
+Containment edges form trees, while non-containment references, such as `target`, may point across the containment hierarchy.
diff --git a/subprojects/docs/src/learn/language/logic/AssertionsError.svg b/subprojects/docs/src/learn/language/logic/AssertionsError.svg
new file mode 100644
index 000000000..8ddc65f30
--- /dev/null
+++ b/subprojects/docs/src/learn/language/logic/AssertionsError.svg
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+v1
+
+
+
+Vertex
+
+
+State
+
+
+
+
\ No newline at end of file
diff --git a/subprojects/docs/src/learn/language/logic/AssertionsError.svg.license b/subprojects/docs/src/learn/language/logic/AssertionsError.svg.license
new file mode 100644
index 000000000..b80566a0e
--- /dev/null
+++ b/subprojects/docs/src/learn/language/logic/AssertionsError.svg.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/src/learn/language/logic/AssertionsExample.svg b/subprojects/docs/src/learn/language/logic/AssertionsExample.svg
new file mode 100644
index 000000000..26b3d1fff
--- /dev/null
+++ b/subprojects/docs/src/learn/language/logic/AssertionsExample.svg
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+Region::new
+
+Region
+
+
+
+
+
+
+
+
+
+State::new
+
+Vertex
+
+
+State
+
+
+
+
+
+
+
+
+
+vertices
+
+
+
+
+
+
+
+v1
+
+Vertex
+
+
+State
+
+
+
+
+
+
+
+
+r1
+
+Region
+
+
+
+
+
+
+
+v2
+
+Vertex
+
+
+
+
+
+
+
+
+vertices
+
+
+
+
+
+
+
+
+
+
+
+vertices
+
+
+
+
+
+vertices
+
+
\ No newline at end of file
diff --git a/subprojects/docs/src/learn/language/logic/AssertionsExample.svg.license b/subprojects/docs/src/learn/language/logic/AssertionsExample.svg.license
new file mode 100644
index 000000000..b80566a0e
--- /dev/null
+++ b/subprojects/docs/src/learn/language/logic/AssertionsExample.svg.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/src/learn/language/logic/DefaultAssertions.svg b/subprojects/docs/src/learn/language/logic/DefaultAssertions.svg
new file mode 100644
index 000000000..2ab002bf5
--- /dev/null
+++ b/subprojects/docs/src/learn/language/logic/DefaultAssertions.svg
@@ -0,0 +1,129 @@
+
+
+
+
+
+
+
+
+
+
+State::new
+
+Vertex
+
+
+State
+
+
+
+
+
+
+
+
+
+
+
+r1
+
+Region
+
+
+
+
+
+
+
+
+
+vertices
+
+
+
+
+
+
+v1
+
+Vertex
+
+
+State
+
+
+
+
+
+
+
+
+
+vertices
+
+
+
+
+
+
+r2
+
+Region
+
+
+
+
+
+
+
+
+
+v2
+
+Vertex
+
+
+State
+
+
+
+
+
+
+
+
+
+vertices
+
+
+
+
+v3
+
+Vertex
+
+
+State
+
+
+
+
+
+
+
+
+r3
+
+Region
+
+
+
+
+
+
+
+
+vertices
+
+
+
\ No newline at end of file
diff --git a/subprojects/docs/src/learn/language/logic/DefaultAssertions.svg.license b/subprojects/docs/src/learn/language/logic/DefaultAssertions.svg.license
new file mode 100644
index 000000000..b80566a0e
--- /dev/null
+++ b/subprojects/docs/src/learn/language/logic/DefaultAssertions.svg.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/src/learn/language/logic/MultiObjects.svg b/subprojects/docs/src/learn/language/logic/MultiObjects.svg
new file mode 100644
index 000000000..a52325755
--- /dev/null
+++ b/subprojects/docs/src/learn/language/logic/MultiObjects.svg
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+node [1]
+
+
+
+exists
+
+
+
+
+
+
+
+equals
+
+
+
+
+
+
+removable [0..1]
+
+
+
+exists
+
+
+
+
+
+
+
+equals
+
+
+
+
+
+
+multi [1..*]
+
+exists
+
+
+
+
+
+
+
+
+
+equals
+
+
+
+
+
+
+removableMulti [0..*]
+
+exists
+
+
+
+
+
+
+
+
+
+equals
+
+
+
\ No newline at end of file
diff --git a/subprojects/docs/src/learn/language/logic/MultiObjects.svg.license b/subprojects/docs/src/learn/language/logic/MultiObjects.svg.license
new file mode 100644
index 000000000..b80566a0e
--- /dev/null
+++ b/subprojects/docs/src/learn/language/logic/MultiObjects.svg.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/src/learn/language/logic/ObjectScopes.svg b/subprojects/docs/src/learn/language/logic/ObjectScopes.svg
new file mode 100644
index 000000000..440dfb192
--- /dev/null
+++ b/subprojects/docs/src/learn/language/logic/ObjectScopes.svg
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+Region::new [0..70]
+
+Region
+
+
+
+
+
+
+
+
+
+State::new [0..120]
+
+Vertex
+
+
+State
+
+
+
+
+
+
+
+Vertex::new [0..120]
+
+Vertex
+
+
+
+
+
+
+
+
+
+vertices
+
+
+
+
+
+
+
+
+vertices
+
+
+
\ No newline at end of file
diff --git a/subprojects/docs/src/learn/language/logic/ObjectScopes.svg.license b/subprojects/docs/src/learn/language/logic/ObjectScopes.svg.license
new file mode 100644
index 000000000..b80566a0e
--- /dev/null
+++ b/subprojects/docs/src/learn/language/logic/ObjectScopes.svg.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/src/learn/language/logic/StrongerObjectScopes.svg b/subprojects/docs/src/learn/language/logic/StrongerObjectScopes.svg
new file mode 100644
index 000000000..6f9880652
--- /dev/null
+++ b/subprojects/docs/src/learn/language/logic/StrongerObjectScopes.svg
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+Region::new [0..70]
+
+Region
+
+
+
+
+
+
+
+
+
+State::new [20]
+
+Vertex
+
+
+State
+
+
+
+
+
+
+
+Vertex::new [30..100]
+
+Vertex
+
+
+
+
+
+
+
+
+
+vertices
+
+
+
+
+
+
+
+
+vertices
+
+
+
\ No newline at end of file
diff --git a/subprojects/docs/src/learn/language/logic/StrongerObjectScopes.svg.license b/subprojects/docs/src/learn/language/logic/StrongerObjectScopes.svg.license
new file mode 100644
index 000000000..b80566a0e
--- /dev/null
+++ b/subprojects/docs/src/learn/language/logic/StrongerObjectScopes.svg.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/src/learn/language/logic/index.md b/subprojects/docs/src/learn/language/logic/index.md
new file mode 100644
index 000000000..e366e9b81
--- /dev/null
+++ b/subprojects/docs/src/learn/language/logic/index.md
@@ -0,0 +1,256 @@
+---
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+SPDX-License-Identifier: EPL-2.0
+description: Four-valued logic abstraction
+sidebar_position: 1
+---
+
+# Partial modeling
+
+Refinery allow precisely expressing _unknown,_ _uncertain_ or even _contradictory_ information using [four-valued logic](https://en.wikipedia.org/wiki/Four-valued_logic#Belnap).
+During model generation, unknown aspects of the partial model get _refined_ into concrete (true or false) facts until the generated model is completed, or a contradiction is reached.
+
+The _Belnap--Dunn four-valued logic_ supports the following truth values:
+
+* `true` values correspond to facts known about the model, e.g., that a node is the instance of a given class or there is a reference between two nodes.
+* `false` values correspond to facts that are known not to hold, e.g., that a node is _not_ an instance of a given class or there is _no_ reference between two nodes.
+* `unknown` values express uncertain properties and design decisions yet to be made. During model refinement, `unknown` values are gradually replaced with `true` and `false` values until a consistent and concrete model is derived.
+* `error` values represent contradictions and validation failures in the model. One a model contains an error value, it can't be refined into a consistent model anymore.
+
+## Assertions
+
+_Assertions_ express facts about a partial model. An assertion is formed by a _symbol_ and an _argument list_ of _nodes_ in parentheses.
+Possible symbols include [classes](../classes/#classes), [references](../classes/#references), and [predicates](../predicates).
+Nodes appearing in the argument list are automatically added to the model.
+
+A _negative_ assertion with a `false` truth value is indicated by prefixing it with `!`.
+
+---
+
+Consider the following metamodel:
+
+```refinery
+class Region {
+ contains Vertex[] vertices
+}
+class Vertex.
+class State extends Vertex.
+```
+
+Along with the following set of assertions:
+
+```refinery
+Region(r1).
+Vertex(v1).
+Vertex(v2).
+!State(v2).
+vertices(r1, v1).
+vertices(r1, v2).
+!vertices(Region::new, v1).
+!vertices(Region::new, v2).
+```
+
+import AssertionsExample from './AssertionsExample.svg';
+
+
+
+It is `true` that `r1` is an instance of the class `Region`, while `v1` and `v2` are instances of the class `Vertex`.
+We also assert that `v2` is _not_ an instance of the class `State`, but it is unknown whether `v1` is an instance of the class `State`.
+Types that are `unknown` are shown in a lighter color and with an outlined icon.
+
+It is `true` that there is a `vertices` reference between `r1` and `v1`, as well as `r1` and `v2`, but there is no such reference from `Region::new` to the same vertices.
+As no information is provided, it is `unknown` whether `State::new` is a vertex of any `Region` instance.
+References that are `unknown` are shown in a lighter color and with a dashed line.
+
+### Propagation
+
+Refinery can automatically infer some facts about the partial model based on the provided assertions by information _propagation._
+The set of assertions in the [example above](#assertions) is equivalent to the following:
+
+```refinery
+vertices(r1, v1).
+vertices(r1, v2).
+!State(v2).
+```
+
+By the type constraints of the `vertices` reference, Refinery can infer that `r1` is a `Region` instance and `v1` and `v2` are `Vertex` instances.
+Since `State` is a subclass of `Vertex`, it is still unknown whether `v1` is a `State` instance,
+but `v2` is explicitly forbidden from being such by the negative assertion `!State(v2)`.
+We may omit `!vertices(Region::new, v1)` and `!vertices(Region::new, v2)`, since `v1` and `v2` may be a target of only one [containment](../classes/#containment-hierarchy) reference.
+
+Contradictory assertions lead to `error` values in the partial model:
+
+```refinery
+State(v1).
+!Vertex(v1).
+```
+
+import AssertionsError from './AssertionsError.svg';
+
+
+
+### Default assertions
+
+Assertions marked with the `default` keyword have _lower priority_ that other assertions.
+They may contain wildcard arguments `*` to specify information about _all_ nodes in the graph.
+However, they can be overridden by more specific assertions that are not marked with the `default` keyword.
+
+---
+
+To make sure that the reference `vertices` is `false` everywhere except where explicitly asserted, we may add a `default` assertion:
+
+```refinery
+default !vertices(*, *).
+vertices(r1, v1).
+vertices(r2, v2).
+vertices(r3, v3).
+?vertices(r1, State::new).
+```
+
+import DefaultAssertions from './DefaultAssertions.svg';
+
+
+
+We can prefix an assertion with `?` to explicitly assert that some fact about the partial model is `unknown`.
+This is useful for overriding negative `default` assertions.
+
+## Multi-objects
+
+The special symbols `exists` and `equals` control the _number of graph nodes_ represented by an object in a partial model.
+
+By default, `exists` is `true` for all objects.
+An object `o` with `?exists(o)` (i.e., `exists(o)` explicitly set to `unknown`) may be _removed_ from the partial model.
+Therefore, it represents _at least 0_ graph nodes.
+
+By default, `equals` is `true` for its _diagonal_, i.e., we have `equals(o, o)` for all object `o`.
+For off-diagonal pairs, i.e., `(p, q)` with `p` not equal to `q`, we always have `!equals(p, q)`: distinct objects can never be _merged._
+If we set a _diagonal_ entry to `unknown` by writing `?equals(o, o)`, the object `o` becomes a **multi-object:** it can be freely _split_ into multiple graph nodes.
+Therefore, multi-objects represent _possibly more than 1_ graph nodes.
+
+| `exists(o)` | `equals(o, o)` | Number of nodes | Description |
+|:-:|:-:|-:|:-|
+| `true` | `true` | `1` | graph node |
+| `unknown` | `true` | `0..1` | removable graph node |
+| `true` | `unknown` | `1..*` | multi-object |
+| `unknown` | `unknown` | `0..*` | removable multi-object |
+
+In the Refinery web UI, `?exists(o)` is represented with a _dashed_ border, while `?equals(o, o)`
+
+```refinery
+node(node).
+
+node(removable).
+?exists(removable).
+
+node(multi).
+?equals(multi, multi).
+
+node(removableMulti).
+?exists(removableMulti).
+?equals(removableMulti, removableMulti).
+```
+
+import MultiObjects from './MultiObjects.svg';
+
+
+
+import TuneIcon from '@material-icons/svg/svg/tune/baseline.svg';
+import LabelIcon from '@material-icons/svg/svg/label/baseline.svg';
+import LabelOutlineIcon from '@material-icons/svg/svg/label/outline.svg';
+
+:::info
+
+You may use the _filter panel_ icon in Refinery to toggle the visibility of special symbols like `exists` and `equals`.
+You may either show _both true and unknown_ values or _just true_ values.
+The _object scopes_ toggle will also show the number of graph nodes represented by an object in square brackets after its name, like in the figure above.
+:::
+
+By default, a **new object** `C::new` is added for each non-`abstract` [class](../classes#classes) `C` with `?exists(C::new)` and `?equals(C::new, C::new)`.
+This multi-object represents all potential instances of the class.
+To assert that no new instances of `C` should be added to the generated model, you may write `!exists(C::new)`.
+
+You may use the `multi` keyword to quickly defined a (removable) multi-object:
+
+```refinery
+multi removableMulti.
+% This is equivalent to:
+% ?exists(removableMulti).
+% ?equals(removableMulti, removableMulti).
+```
+
+## Type scopes
+
+_Type scopes_ offer finer-grained control over the number of graph nodes in the generated model (as represented by the multi-objects) that `exists` or `equals` assertions.
+
+A _type scope constraint_ is formed by a unary symbol (a [class](../classes/#classes) or a [predicate](../predicates) with a single parameter) and _scope range._
+Ranges have a form similar to [multiplicity constraints](../classes#multiplicity): a range `n..m` indicates a lower bound of `n` and an upper bound of `m`.
+While an upper bound of `*` indicates a possibly unbounded number of objects, generated models will always be finite.
+Like for multiplicity constraints, the case `n..n` can be abbreviated as `n`.
+
+The number of nodes in the generated model can be controlled using the `node` special symbol.
+For example, we may write the following to generate a model with at least 100 at and most 120 nodes:
+
+```refinery
+scope node = 100..200.
+```
+
+A `scope` declaration may prescribe type scope constraint for any number of symbols, separated by `,`.
+Multiple `scope` declarations are also permitted.
+Multiple ranges provided for the same symbol will be intersected, i.e., they influence the generated model simultaneously.
+
+In other words,
+```
+scope Region = 10, State = 80..120.
+scope State = 100..150.
+% Equivalent to:
+scope Region = 10, State = 100..120.
+```
+
+The _object scopes_ option in the _filter panel_ may help in exploring the effects of object scopes.
+
+---
+
+Consider the example
+
+```refinery
+class Region {
+ contains Vertex[] vertices
+}
+class Vertex.
+class State extends Vertex.
+scope node = 100..120, Vertex = 50..*.
+```
+
+import ObjectScopes from './ObjectScopes.svg';
+
+
+
+Notice that Refinery could determine that there can be no more than 70 `Region` instances in the generated model, since at least 50 of the `100..120` nodes in the model must be `Vertex` instances.
+However, since `State` is a subclass of `Vertex` (i.e., `State::new` is also an instance of `Vertex`), the range `50..*` is shared between both `Vertex::new` and `State::new`, resulting in both representing `0..120` nodes.
+Nevertheless, every generated model will obey the scope constraint exactly, i.e., will have between 100 and 120 node, at least 50 of which are `Vertex` instances.
+
+By providing more information, Refinery can determine more precise ranges for multi-objects.
+For example, we may strengthen the scope constraints as follows:
+
+```refinery
+scope node = 100..120, Vertex = 50..*, State = 20.
+```
+
+import StrongerObjectScopes from './StrongerObjectScopes.svg';
+
+
+
+### Incremental scopes
+
+We may specify an _incremental_ object scope with the `+=` operator to determine the number of new instances to be added to the model.
+This is only allowed for symbol that are classes with no subclasses, as it directly influences the number of nodes represented by the corresponding `::new` object.
+
+For example, to ensure that between 5 and 7 `State` instances are added to the model, we may write:
+
+```refinery
+State(s1).
+State(s2).
+scope State += 5..7.
+```
+
+Since `s1` and `s2` are also instances of the `State` class, the generated concrete model will have between 7 and 9 `State` instances altogether.
diff --git a/subprojects/docs/src/learn/language/predicates/DerivedFeature.svg b/subprojects/docs/src/learn/language/predicates/DerivedFeature.svg
new file mode 100644
index 000000000..be9465b87
--- /dev/null
+++ b/subprojects/docs/src/learn/language/predicates/DerivedFeature.svg
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+transition1
+
+Transition
+
+
+
+
+
+
+
+
+
+vertex1
+
+Vertex
+
+
+
+
+
+
+
+
+
+source
+
+
+
+
+
+
+vertex2
+
+Vertex
+
+
+
+
+
+
+
+
+
+target
+
+
+
+
+
+
+outgoingTransition
+
+
+
+
+
+
+
+incomingTransition
+
+
+
+
+neighbors
+
+
+
+
\ No newline at end of file
diff --git a/subprojects/docs/src/learn/language/predicates/DerivedFeature.svg.license b/subprojects/docs/src/learn/language/predicates/DerivedFeature.svg.license
new file mode 100644
index 000000000..b80566a0e
--- /dev/null
+++ b/subprojects/docs/src/learn/language/predicates/DerivedFeature.svg.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/src/learn/language/predicates/index.md b/subprojects/docs/src/learn/language/predicates/index.md
new file mode 100644
index 000000000..261054c1d
--- /dev/null
+++ b/subprojects/docs/src/learn/language/predicates/index.md
@@ -0,0 +1,284 @@
+---
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+SPDX-License-Identifier: EPL-2.0
+description: Model queries and model validation
+sidebar_position: 2
+---
+
+# Graph predicates
+
+Graph predicates are logic expressions that can be used to query for interesting model fragments, as well as for validating the consistency of models. They are evaluated on partial models according to [four-valued logic](../logic) semantics.
+
+Predicates in Refinery are written in [Disjunctive Normal Form](https://en.wikipedia.org/wiki/Disjunctive_normal_form) (DNF) as an _OR_ of _ANDs_, i.e., a _disjunction_ of _clauses_ formed as a _conjunction_ of positive or negated logic _literals._
+This matches the syntax and semantics of logical query languages, such as [Datalog](https://en.wikipedia.org/wiki/Datalog), and logical programming languages, such as [Prolog](https://en.wikipedia.org/wiki/Prolog).
+
+import Link from '@docusaurus/Link';
+
+
+Example metamodel
+
+In the examples on this page, we will use the following metamodel as illustration:
+
+```refinery
+abstract class CompositeElement {
+ contains Region[] regions
+}
+
+class Region {
+ contains Vertex[] vertices opposite region
+}
+
+abstract class Vertex {
+ container Region region opposite vertices
+ contains Transition[] outgoingTransition opposite source
+ Transition[] incomingTransition opposite target
+}
+
+class Transition {
+ container Vertex source opposite outgoingTransition
+ Vertex[1] target opposite incomingTransition
+}
+
+abstract class Pseudostate extends Vertex.
+
+abstract class RegularState extends Vertex.
+
+class Entry extends Pseudostate.
+
+class Exit extends Pseudostate.
+
+class Choice extends Pseudostate.
+
+class FinalState extends RegularState.
+
+class State extends RegularState, CompositeElement.
+
+class Statechart extends CompositeElement.
+```
+
+
+ Try in Refinery
+
+
+
+
+[Assertions](../logic/#assertions) about graph predicates can prescribe where the predicate should (for positive assertions) or should not (for negative assertions) hold.
+When generating consistent models
+
+## Atoms
+
+An _atom_ is formed by a _symbol_ and _argument list_ of variables.
+Possible symbols include [classes](../classes/#classes), [references](../classes/#references), and [predicates](../predicates).
+We may write a basic graph query as a conjunction (AND) of atoms.
+
+The `pred` keyword defines a graph predicate. After the _predicate name_, a _parameter list_ of variables is provided. The atoms of the graph predicate are written after the `<->` operator, and a full stop `.` terminates the predicate definition.
+
+The following predicate `entryInRegion` will match pairs of `Region` instances `r` and `Entry` instances `e` such that `e` is a vertex in `r`.
+
+```refinery
+pred entryInRegion(r, e) <->
+ Region(r),
+ vertices(r, e),
+ Entry(e).
+```
+
+We may write unary symbols that act as _parameter types_ directly in the parameter list. The following definition is equivalent to the previous one:
+
+```refinery
+pred entryInRegion(Region r, Entry e) <->
+ vertices(r, e).
+```
+
+import TableIcon from '@material-icons/svg/svg/table_chart/baseline.svg';
+
+:::info
+
+You may display the result of graph predicate matching in the _table view_ of the Refinery web UI.
+
+:::
+
+## Quantification
+
+Variables not appearing in the parameter list are _existentially quantified._
+
+The following predicate matches `Region` instances with two entries:
+
+```refinery
+pred multipleEntriesInRegion(Region r) <->
+ entryInRegion(r, e1),
+ entryInRegion(r, e2),
+ e1 != e2.
+```
+
+Existentially quantified variables that appear only once in the predicate should be prefixed with `_`. This shows that the variable is intentionally used only once (as opposite to the second reference to the variable being omitted by mistake).
+
+```refinery
+pred regionWithEntry(Region r) <->
+ entryInRegion(r, _e).
+```
+
+Alternatively, you may use a single `_` whenever a variable occurring only once is desired. Different occurrences of `_` are considered distinct variables.
+
+```refinery
+pred regionWithEntry(Region r) <->
+ entryInRegion(r, _).
+```
+
+## Negation
+
+Negative literals are written by prefixing the corresponding atom with `!`.
+
+Inside negative literals, quantification is _universal:_ the literal matches if there is no assignment of the variables solely appearing in it that satisfies the corresponding atom.
+
+The following predicate matches `Region` instances that have no `Entry`:
+
+```refinery
+pred regionWithoutEntry(Region r) <->
+ !entryInRegion(r, _).
+```
+
+In a graph predicate, all parameter variables must be _positively bound,_ i.e., appear in at least one positive literal (atom).
+Negative literals may further constrain the predicate match one it has been established by the positive literals.
+
+## Object equality
+
+The operators `a == b` and `a != b` correspond to the literals `equals(a, b)` and `!equals(a, b)`, respectively.
+See the section about [multi-objects](../logic/#multi-objects) for more information about the `equals` symbol.
+
+## Transitive closure
+
+The `+` operator forms the [transitive closure](https://en.wikipedia.org/wiki/Transitive_closure) of symbols with exactly 2 parameters.
+The transitive closure `r+(a, b)` holds if either `r(a, b)` is `true`, or there is a sequence of objects `c1`, `c2`, …, `cn` such that `r(a, c1)`, `r(c1, c2)`, `r(c2, c3)`, …, `r(cn, b)`.
+In other words, there is a path labelled with `r` in the graph from `a` to `b`.
+
+Transitive closure may express queries about graph reachability:
+
+```refinery
+pred neighbors(Vertex v1, Vertex v2) <->
+ Transition(t),
+ source(t, v1),
+ target(t, v2).
+
+pred cycle(Vertex v) <->
+ neighbors+(v, v).
+```
+
+## Disjunction
+
+Disjunction (OR) of _clauses_ formed by a conjunction (AND) of literals is denoted by `;`.
+
+```refinery
+pred regionWithInvalidNumberOfEntries(Region r) <->
+ !entryInRegion(r, _)
+;
+ entryInRegion(r, e1),
+ entryInRegion(r, e2),
+ e1 != e2.
+```
+
+Every clause of a disjunction must bind every parameter variable of the graph predicate _positively._
+_Type annotations_ on parameter are applied in all clauses.
+Therefore, the previous graph pattern is equivalent to the following:
+
+```refinery
+pred regionWithInvalidNumberOfEntries(r) <->
+ Region(r),
+ !entryInRegion(r, _)
+;
+ Region(r),
+ entryInRegion(r, e1),
+ entryInRegion(r, e2),
+ e1 != e2.
+```
+
+## Derived features
+
+Graph predicates may act as _derived types_ and _references_ in metamodel.
+
+A graph predicate with exactly 1 parameters can be use as if it was a class: you may use it as a [_parameter type_](#atoms) in other graph patterns, as a _target type_ of a (non-containment) [reference](../classes/#references), or in a [_scope constraint_](../logic#type-scopes).
+
+_Derived references_ are graph predicates with exactly 2 parameters, which correspond the source and target node of the reference.
+
+import TuneIcon from '@material-icons/svg/svg/tune/baseline.svg';
+import LabelIcon from '@material-icons/svg/svg/label/baseline.svg';
+import LabelOutlineIcon from '@material-icons/svg/svg/label/outline.svg';
+
+:::info
+
+You may use the _filter panel_ icon in Refinery to toggle the visibility of graph predicates with 1 or 2 parameters.
+You may either show _both true and unknown_ values or _just true_ values.
+
+:::
+
+---
+
+For example, we may replace the reference `neighbors` in the class `Vertex`:
+
+```refinery
+class Vertex {
+ Vertex[] neighbors
+}
+```
+
+with the graph predicate `neighbors` as follows:
+
+
+```refinery
+class Vertex {
+ contains Transition[] outgoingTransition opposite source
+ Transition[] incomingTransition opposite target
+}
+
+class Transition {
+ container Vertex source opposite outgoingTransition
+ Vertex[1] target opposite incomingTransition
+}
+
+pred neighbors(Vertex v1, Vertex v2) <->
+ Transition(t),
+ source(t, v1),
+ target(t, v2).
+```
+
+Since `neighbors` is now computed based on the `Transition` instances and their `source` and `target` references present in the model, the assertion
+
+```refinery
+neighbors(vertex1, vertex2).
+```
+
+will only be satisfied if a corresponding node `transition1` is present in the generated model that also satisfies
+
+```refinery
+Transition(transition1).
+source(transition1, vertex1).
+target(transition1, vertex2).
+```
+
+import DerivedFeature from './DerivedFeature.svg';
+
+
+
+## Error predicates
+
+A common use-case for graph predicates is _model validation_, where a predicate highlights _errors_ in the model.
+Such predicates are called _error predicates._
+In a consistent generated model, an error predicates should have no matches.
+
+You can declare error predicates with the `error` keyword:
+
+```refinery
+error regionWithoutEntry(Region r) <->
+ !entryInRegion(r, _).
+```
+
+This is equivalent to asserting that the error predicate is `false` everywhere:
+
+```refinery
+pred regionWithoutEntry(Region r) <->
+ !entryInRegion(r, _).
+
+!regionWithoutEntry(*).
+```
diff --git a/subprojects/docs/src/learn/tutorials/_category_.yml b/subprojects/docs/src/learn/tutorials/_category_.yml
new file mode 100644
index 000000000..adf8293fa
--- /dev/null
+++ b/subprojects/docs/src/learn/tutorials/_category_.yml
@@ -0,0 +1,11 @@
+# SPDX-FileCopyrightText: 2024 The Refinery Authors
+#
+# SPDX-License-Identifier: EPL-2.0
+
+position: 1
+label: Tutorials
+link:
+ type: generated-index
+ slug: /tutorials
+ title: Tutorial overview
+ description: Try Refinery in practical partial modeling challenges!
diff --git a/subprojects/docs/src/learn/tutorials/file-system/fig1.svg b/subprojects/docs/src/learn/tutorials/file-system/fig1.svg
new file mode 100644
index 000000000..1e20393a0
--- /dev/null
+++ b/subprojects/docs/src/learn/tutorials/file-system/fig1.svg
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+FileSystem::new
+
+FileSystem
+
+
+
+
+
+
+
+
+
+File::new
+
+File
+
+
+
+
+
+
+
+
+
+root
+
+
+
+
+
+
+Dir::new
+
+File
+
+
+Dir
+
+
+
+
+
+
+
+
+
+root
+
+
+
+
+
+
+element
+
+
+
+
+
+
+element
+
+
+
diff --git a/subprojects/docs/src/learn/tutorials/file-system/fig1.svg.license b/subprojects/docs/src/learn/tutorials/file-system/fig1.svg.license
new file mode 100644
index 000000000..b80566a0e
--- /dev/null
+++ b/subprojects/docs/src/learn/tutorials/file-system/fig1.svg.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/src/learn/tutorials/file-system/fig2.svg b/subprojects/docs/src/learn/tutorials/file-system/fig2.svg
new file mode 100644
index 000000000..6375bfd60
--- /dev/null
+++ b/subprojects/docs/src/learn/tutorials/file-system/fig2.svg
@@ -0,0 +1,145 @@
+
+
+
+
+
+
+
+
+FileSystem::new
+
+FileSystem
+
+
+
+
+
+
+
+
+
+File::new
+
+File
+
+
+
+
+
+
+
+
+
+root
+
+
+
+
+
+
+Dir::new
+
+File
+
+
+Dir
+
+
+
+
+
+
+
+
+
+root
+
+
+
+
+
+
+
+element
+
+
+
+
+resources
+
+File
+
+
+Dir
+
+
+
+
+
+
+
+
+
+
+
+element
+
+
+
+
+root
+
+
+
+
+
+
+
+
+element
+
+
+
+
+
+
+element
+
+
+
+
+
+
+img
+
+File
+
+
+Dir
+
+
+
+
+
+
+
+
+
+element
+
+
+
+
+
+
+element
+
+
+
+
+
+
+element
+
+
+
diff --git a/subprojects/docs/src/learn/tutorials/file-system/fig2.svg.license b/subprojects/docs/src/learn/tutorials/file-system/fig2.svg.license
new file mode 100644
index 000000000..b80566a0e
--- /dev/null
+++ b/subprojects/docs/src/learn/tutorials/file-system/fig2.svg.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/src/learn/tutorials/file-system/fig3.svg b/subprojects/docs/src/learn/tutorials/file-system/fig3.svg
new file mode 100644
index 000000000..0d020a71f
--- /dev/null
+++ b/subprojects/docs/src/learn/tutorials/file-system/fig3.svg
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+
+
+FileSystem::new
+
+FileSystem
+exists
+
+
+
+
+
+
+
+
+
+
+
+File::new
+
+File
+exists
+
+
+
+
+
+
+
+
+
+equals
+
+
+
+
+
+
+Dir::new
+
+File
+exists
+
+
+
+
+Dir
+
+
+
+
+
+
+
+
+
+
+equals
+
+
+
+
+
+
+resources
+
+File
+exists
+
+
+
+
+Dir
+
+
+
+
+
+
+
+equals
+
+
+
+
+
+
+
+
+equals
+
+
+
+
+
+
+img
+
+File
+exists
+
+
+
+
+Dir
+
+
+
+
+
+
+
+
+
+
+equals
+
+
+
diff --git a/subprojects/docs/src/learn/tutorials/file-system/fig3.svg.license b/subprojects/docs/src/learn/tutorials/file-system/fig3.svg.license
new file mode 100644
index 000000000..b80566a0e
--- /dev/null
+++ b/subprojects/docs/src/learn/tutorials/file-system/fig3.svg.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/src/learn/tutorials/file-system/fig4.svg b/subprojects/docs/src/learn/tutorials/file-system/fig4.svg
new file mode 100644
index 000000000..d6701bdde
--- /dev/null
+++ b/subprojects/docs/src/learn/tutorials/file-system/fig4.svg
@@ -0,0 +1,131 @@
+
+
+
+
+
+
+
+
+FileSystem::new
+
+FileSystem
+
+
+
+
+
+
+
+
+
+File::new
+
+File
+
+
+
+
+
+
+
+
+
+Dir::new
+
+File
+
+
+
+Dir
+
+
+
+
+
+
+root
+
+
+
+
+
+
+
+
+
+resources
+
+File
+
+
+
+Dir
+
+
+
+
+
+
+
+
+root
+
+
+
+
+
+
+element
+
+
+
+
+
+
+
+element
+
+
+
+
+
+
+img
+
+File
+invalidContainer
+
+
+
+
+
+
+
+
+
+root
+
+
+
+
+
+element
+
+
+
+
+
+
+
+element
+
+
+
+
+
+
+
+element
+
+
+
diff --git a/subprojects/docs/src/learn/tutorials/file-system/fig4.svg.license b/subprojects/docs/src/learn/tutorials/file-system/fig4.svg.license
new file mode 100644
index 000000000..b80566a0e
--- /dev/null
+++ b/subprojects/docs/src/learn/tutorials/file-system/fig4.svg.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/src/learn/tutorials/file-system/index.md b/subprojects/docs/src/learn/tutorials/file-system/index.md
new file mode 100644
index 000000000..365d0fba2
--- /dev/null
+++ b/subprojects/docs/src/learn/tutorials/file-system/index.md
@@ -0,0 +1,209 @@
+---
+SPDX-FileCopyrightText: 2023-2024 The Refinery Authors
+SPDX-License-Identifier: EPL-2.0
+description: Introduction to classes, references, and error predicates
+sidebar_position: 0
+sidebar_label: File system
+---
+
+# File system tutorial
+
+The goal of this tutorial is to give a brief overview of the partial modeling and model generation features of the Refinery framework. The running example will be the modeling of files, directories, and repositories.
+
+## Partial models
+
+### Types and relations
+
+- First, let us introduce some basic types: `Dir`, `File`, and `FileSystem`, along with the relations between them: `element` and `root`. There is a `scope` expression at the end, which we will ignore for now.
+
+```refinery
+class FileSystem {
+ contains File[1] root
+}
+
+class File.
+
+class Dir extends File {
+ contains File[] element
+}
+
+scope node = 10.
+```
+
+import Link from '@docusaurus/Link';
+
+
+ Try in Refinery
+
+
+- Notice that the syntax is essentially identical to [Xcore](https://wiki.eclipse.org/Xcore).
+- Review the partial model visualization. You should get something like this:
+
+import Fig1 from './fig1.svg';
+
+
+
+- Add some statements about a partial model:
+
+```refinery
+class FileSystem {
+ contains File[1] root
+}
+
+class File.
+
+class Dir extends File {
+ contains File[] element
+}
+
+Dir(resources).
+element(resources, img).
+File(img).
+
+scope node = 10.
+```
+
+import Fig2 from './fig2.svg';
+
+
+
+### Partial models
+
+- Notice that the instance model elements are coexisting with ```::new``` nodes representing the prototypes of newly created objects.
+
+- Check the disabled `equals` and `exist` predicates. check the visual annotation of those predicates in the visualization (dashed line, shadow).
+
+import Fig3 from './fig3.svg';
+
+
+
+### Information merging
+
+- For the object `img`, we didn't specify if it is a directory or not. Therefore, it will typically be a folder.
+
+- If we want to state that img is not a directory, we need to a negative statement:
+
+```refinery
+!Dir(img).
+```
+
+- Statements are merged with respect to the refinement relation of 4-valued logic.
+
+- If we add, a statement both negatively and positively, it will create an inconsistency:
+
+```refinery
+element(resources, img).
+!element(resources, img).
+```
+
+- Inconsistent models parts in a partial model typically make the problem trivially unsatisfiable.
+
+import Fig4 from './fig4.svg';
+
+
+
+- However, the model can be saved if the inconsistent part may not exist...
+
+```refinery
+!File(File::new).
+```
+
+### Default values
+
+- A large amount of statements can be expressed by using `*`.
+- The `default` keyword defines lower priority statements that need to be considered unless other statement specifies otherwise. No information merging is happening.
+
+## Constraints
+
+Let's extend the metamodel with a new class `SymLink`:
+
+```refinery
+class FileSystem {
+ contains File[1] root
+}
+
+class File.
+
+class Dir extends File {
+ contains File[0..10] element
+}
+
+class SymLink extends File {
+ File[1] target
+}
+
+Dir(resources).
+element(resources, img).
+element(resources, link).
+target(link, img).
+
+scope node = 10.
+```
+
+- Add some simple constraints:
+
+```refinery
+% Simple constraints:
+pred hasReference(f) <-> target(_, f).
+error pred selfLoop(s) <-> target(s, s).
+target(x,x).
+```
+
+- There are no empty directories in a git repository, so let's forbid them!
+
+```refinery
+error pred emptyDir(d) <-> Dir(d), !element(d,_).
+```
+
+- End result:
+
+```refinery
+class FileSystem {
+ contains File[1] root
+}
+
+class File.
+
+class Dir extends File {
+ contains File[0..10] element
+}
+
+class SymLink extends File {
+ File[1] target
+}
+
+Dir(resources).
+element(resources, img).
+!Dir(img).
+element(resources, link).
+target(link,img).
+
+% Simple constraints:
+pred hasReference(f) <-> target(_, f).
+error pred selfLoop(s) <-> target(s, s).
+
+% Object equality with ==:
+error pred emptyDir(d) <-> Dir(d), !element(d, _).
+pred importantFile(f) <-> target(l1, f), target(l2, f), l1 != l2.
+
+% Transitive closure, and
+pred containsFile(fs, file) <->
+ FileSystem(fs),
+ root(fs, file)
+;
+ FileSystem(fs),
+ root(fs, rootDir),
+ element+(rootDir, file).
+
+% Predicate reuse
+error conflictBetweenTwoFileSystem(fs1, fs2, l, t) <->
+ containsFile(fs1, l),
+ containsFile(fs2, t),
+ fs1 != fs2,
+ target(l, t).
+
+scope node = 40..50, FileSystem = 2, importantFile = 1..*.
+```
diff --git a/subprojects/docs/src/pages/index.module.css b/subprojects/docs/src/pages/index.module.css
new file mode 100644
index 000000000..367b78ed4
--- /dev/null
+++ b/subprojects/docs/src/pages/index.module.css
@@ -0,0 +1,41 @@
+/*
+ * SPDX-FileCopyrightText: 2024 The Refinery Authors
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+
+.page {
+ margin-bottom: 2rem;
+}
+
+.buttons {
+ display: flex;
+ flex-direction: row;
+ flex-wrap: wrap;
+ gap: 1rem;
+}
+
+.section {
+ padding: 2rem 0;
+}
+
+@media (max-width: 576px) {
+ .hero, .section {
+ padding-top: 2rem;
+ padding-bottom: 2rem;
+ }
+
+ .button {
+ flex-grow: 1;
+ }
+}
+
+.section__title {
+ text-align: center;
+ margin-bottom: var(--ifm-leading);
+}
+
+.section--video {
+ padding: 4rem 0;
+ background: var(--ifm-background-surface-color);
+}
diff --git a/subprojects/docs/src/pages/index.tsx b/subprojects/docs/src/pages/index.tsx
new file mode 100644
index 000000000..cb0bfeb81
--- /dev/null
+++ b/subprojects/docs/src/pages/index.tsx
@@ -0,0 +1,243 @@
+/*
+ * SPDX-FileCopyrightText: 2024 The Refinery Authors
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+
+import Link from '@docusaurus/Link';
+import Layout from '@theme/Layout';
+import clsx from 'clsx';
+
+import styles from './index.module.css';
+
+import Features from '@site/src/components/Features';
+import UseCases from '@site/src/components/UseCases';
+import Video from '@site/src/components/Video';
+
+function Hero() {
+ return (
+
+
+
Refinery
+
+ An efficient graph solver for generating well-formed models
+
+
+ K. Marussy, A. Ficsor, O. Semeráth, D. Varró: “Refinery: Graph
+ Solver as a Service” ICSE 2024 Demonstrations
+
+
+
Partial model specification language
+
+
+ K. Marussy, O. Semeráth, A. Babikian, D. Varró:{' '}
+
+ A Specification Language for Consistent Model Generation based on
+ Partial Models.
+ {' '}
+ J. Object Technol. 19(3): 3:1-22 (2020)
+
+
+
Diverse and realistic graph generation
+
+
+ O. Semeráth, R. Farkas, G. Bergmann, D. Varró:{' '}
+
+ Diversity of graph models and graph generators in mutation
+ testing.
+ {' '}
+ Int. J. Softw. Tools Technol. Transf. 22(1): 57-78 (2020)
+
+
+ O. Semeráth, A. Babikian, B. Chen, C. Li, K. Marussy, G. Szárnyas,
+ D. Varró:{' '}
+
+ Automated generation of consistent, diverse and structurally
+ realistic graph models.
+ {' '}
+ Softw. Syst. Model. 20(5): 1713-1734 (2021)
+
+
+
+
+
Consistent graph generation techniques
+
+
+ O. Semeráth, A. Nagy, D. Varró: “A graph solver for the
+ automated generation of consistent domain-specific models.”{' '}
+ ICSE 2018: 969-980
+
+
+ K. Marussy, O. Semeráth, D. Varró:{' '}
+
+ Automated Generation of Consistent Graph Models With Multiplicity
+ Reasoning.
+ {' '}
+ IEEE Trans. Softw. Eng. 48(5): 1610-1629 (2022)
+
+
+ A. Babikian, O. Semeráth, A. Li, K. Marussy, D. Varró:{' '}
+
+ Automated generation of consistent models using qualitative
+ abstractions and exploration strategies.
+ {' '}
+ Softw. Syst. Model. 21(5): 1763-1787 (2022)
+
+
+
Correctness proofs
+
+
+ D. Varró, O. Semeráth, G. Szárnyas, Á. Horváth: “Towards the
+ Automated Generation of Consistent, Diverse, Scalable and Realistic
+ Graph Models.”{' '}
+ Graph Transformation, Specifications, and Nets 2018:
+ 285-312
+
+
+
+ );
+}
diff --git a/subprojects/docs/src/pages/license.md b/subprojects/docs/src/pages/license.md
new file mode 100644
index 000000000..3ce07e471
--- /dev/null
+++ b/subprojects/docs/src/pages/license.md
@@ -0,0 +1,100 @@
+---
+SPDX-FileCopyrightText: 2017, Eclipse.org Foundation, Inc.
+SPDX-License-Identifier: LicenseRef-EPL-Steward
+title: License
+---
+
+# Eclipse Public License - v 2.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+## 1. DEFINITIONS
+
+“Contribution” means:
+
+ * a) in the case of the initial Contributor, the initial content Distributed under this Agreement, and
+ * b) in the case of each subsequent Contributor:
+ * i) changes to the Program, and
+ * ii) additions to the Program;
+ where such changes and/or additions to the Program originate from and are Distributed by that particular Contributor. A Contribution “originates” from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include changes or additions to the Program that are not Modified Works.
+
+“Contributor” means any person or entity that Distributes the Program.
+
+“Licensed Patents” mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+“Program” means the Contributions Distributed in accordance with this Agreement.
+
+“Recipient” means anyone who receives the Program under this Agreement or any Secondary License (as applicable), including Contributors.
+
+“Derivative Works” shall mean any work, whether in Source Code or other form, that is based on (or derived from) the Program and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship.
+
+“Modified Works” shall mean any work in Source Code or other form that results from an addition to, deletion from, or modification of the contents of the Program, including, for purposes of clarity any new file in Source Code form that contains any contents of the Program. Modified Works shall not include works that contain only declarations, interfaces, types, classes, structures, or files of the Program solely in each case in order to link to, bind by name, or subclass the Program or Modified Works thereof.
+
+“Distribute” means the acts of a) distributing or b) making available in any manner that enables the transfer of a copy.
+
+“Source Code” means the form of a Program preferred for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+“Secondary License” means either the GNU General Public License, Version 2.0, or any later versions of that license, including any exceptions or additional permissions as identified by the initial Contributor.
+
+## 2. GRANT OF RIGHTS
+
+ * a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, Distribute and sublicense the Contribution of such Contributor, if any, and such Derivative Works.
+ * b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in Source Code or other form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
+ * c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to Distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
+ * d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+ * e) Notwithstanding the terms of any Secondary License, no Contributor makes additional grants to any Recipient (other than those set forth in this Agreement) as a result of such Recipient's receipt of the Program under the terms of a Secondary License (if permitted under the terms of Section 3).
+
+## 3. REQUIREMENTS
+
+3.1 If a Contributor Distributes the Program in any form, then:
+
+ * a) the Program must also be made available as Source Code, in accordance with section 3.2, and the Contributor must accompany the Program with a statement that the Source Code for the Program is available under this Agreement, and informs Recipients how to obtain it in a reasonable manner on or through a medium customarily used for software exchange; and
+ * b) the Contributor may Distribute the Program under a license different than this Agreement, provided that such license:
+ * i) effectively disclaims on behalf of all other Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+ * ii) effectively excludes on behalf of all other Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
+ * iii) does not attempt to limit or alter the recipients' rights in the Source Code under section 3.2; and
+ * iv) requires any subsequent distribution of the Program by any party to be under a license that satisfies the requirements of this section 3.
+
+3.2 When the Program is Distributed as Source Code:
+
+ * a) it must be made available under this Agreement, or if the Program (i) is combined with other material in a separate file or files made available under a Secondary License, and (ii) the initial Contributor attached to the Source Code the notice described in Exhibit A of this Agreement, then the Program may be made available under the terms of such Secondary Licenses, and
+ * b) a copy of this Agreement must be included with each copy of the Program.
+
+3.3 Contributors may not remove or alter any copyright, patent, trademark, attribution notices, disclaimers of warranty, or limitations of liability (‘notices’) contained within the Program from any copy of the Program which they Distribute, provided that Contributors may add their own appropriate notices.
+
+## 4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor (“Commercial Contributor”) hereby agrees to defend and indemnify every other Contributor (“Indemnified Contributor”) against any losses, damages and costs (collectively “Losses”) arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
+
+## 5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+## 6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+## 7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be Distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to Distribute the Program (including its Contributions) under the new version.
+
+Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. Nothing in this Agreement is intended to be enforceable by any entity that is not a Contributor or Recipient. No third-party beneficiary rights are created under this Agreement.
+
+## Exhibit A – Form of Secondary Licenses Notice
+
+“This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: \{name license(s), version(s), and exceptions or additional permissions here\}.”
+
+> Simply including a copy of this Agreement, including this Exhibit A is not sufficient to license the Source Code under Secondary Licenses.
+>
+> If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice.
+>
+> You may add additional accurate notices of copyright ownership.
+
diff --git a/subprojects/docs/src/plugins/loadersPlugin.ts b/subprojects/docs/src/plugins/loadersPlugin.ts
new file mode 100644
index 000000000..8b52667c9
--- /dev/null
+++ b/subprojects/docs/src/plugins/loadersPlugin.ts
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2016, Jeremy Stucki
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ * Copyright (c) 2024 The Refinery Authors
+ *
+ * SPDX-License-Identifier: BSD-3-Clause AND MIT AND EPL-2.0
+ */
+
+import type { Plugin } from '@docusaurus/types';
+// @ts-expect-error No typings available for `responsive-loader`.
+import sharp from 'responsive-loader/sharp';
+
+export default function loadersPlugin(): Plugin {
+ return {
+ name: 'refinery-loaders-plugin',
+ configureWebpack(config, isServer) {
+ let svgoDisabled = false;
+ const rules = [...(config.module?.rules ?? [])];
+ rules.forEach((rule) => {
+ // Compare with
+ // https://github.com/facebook/docusaurus/blob/73016d4936164ba38d4b86ec2aa8c168b5904a21/packages/docusaurus-utils/src/webpackUtils.ts#L128-L166
+ if (
+ typeof rule !== 'object' ||
+ rule === null ||
+ !('test' in rule) ||
+ !(rule.test instanceof RegExp) ||
+ !rule.test.test('.svg') ||
+ !('oneOf' in rule)
+ ) {
+ return;
+ }
+ const {
+ oneOf: [svgLoader],
+ } = rule;
+ if (
+ typeof svgLoader !== 'object' ||
+ svgLoader === null ||
+ !('use' in svgLoader) ||
+ typeof svgLoader.use !== 'object' ||
+ svgLoader.use === null ||
+ !(0 in svgLoader.use)
+ ) {
+ return;
+ }
+ // Skip SVGR when importing SVG files with ?url.
+ svgLoader.resourceQuery = { not: /[?&]url$/ };
+ const {
+ use: [loader],
+ } = svgLoader;
+ if (
+ typeof loader !== 'object' ||
+ loader === null ||
+ !('options' in loader)
+ ) {
+ return;
+ }
+
+ loader.options = {
+ ...(typeof loader.options === 'object' ? loader.options : {}),
+ svgo: true,
+ svgoConfig: {
+ plugins: [
+ {
+ name: 'preset-default',
+ params: {
+ overrides: {
+ removeTitle: false,
+ removeViewBox: false,
+ // Disable SVGO, because it interferes styling figures exported from Refinery with CSS.
+ inlineStyles: false,
+ cleanupIds: false,
+ },
+ },
+ },
+ ],
+ },
+ };
+ svgoDisabled = true;
+ });
+ if (!svgoDisabled) {
+ throw new Error('Failed to disable SVGO.');
+ }
+ return {
+ mergeStrategy: {
+ 'module.rules': 'replace',
+ },
+ module: {
+ rules: [
+ // Configuration based on
+ // https://github.com/dazuaz/responsive-loader/blob/ef2c806fcd36f06f6be8a0b97e09f40c3d86d3ac/README.md
+ {
+ test: /\.(png|jpe?g)$/,
+ resourceQuery: /[?&]rl$/,
+ use: [
+ {
+ loader: 'responsive-loader',
+ options: {
+ /* eslint-disable-next-line @typescript-eslint/no-unsafe-assignment --
+ * No typings available for `responsive-loader`.
+ */
+ adapter: sharp,
+ format: 'webp',
+ // See
+ // https://github.com/facebook/docusaurus/blob/c745021b01a8b88d34e1d772278d7171ad8acdf5/packages/docusaurus-plugin-ideal-image/src/index.ts#L62-L66
+ emitFile: !isServer,
+ name: 'assets/images/[name].[hash:hex:7].[width].[ext]',
+ },
+ },
+ ],
+ },
+ ...rules,
+ ],
+ },
+ };
+ },
+ };
+}
diff --git a/subprojects/docs/src/plugins/remarkPosix2Windows.ts b/subprojects/docs/src/plugins/remarkPosix2Windows.ts
new file mode 100644
index 000000000..784802f29
--- /dev/null
+++ b/subprojects/docs/src/plugins/remarkPosix2Windows.ts
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ * Copyright (c) 2024 The Refinery Authors
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * This file is based on
+ * https://github.com/facebook/docusaurus/blob/e4ecffe41878728acff55a8370bd7440706c02f7/packages/docusaurus-remark-plugin-npm2yarn/src/index.ts
+ * but was changed to conver shell commands to POSIX to Windows syntax.
+ */
+
+import type { Code, Literal } from 'mdast';
+import type { MdxjsEsm, MdxJsxFlowElement } from 'mdast-util-mdx';
+import type { Transformer } from 'unified';
+import type { Node, Parent } from 'unist';
+import { visit } from 'unist-util-visit';
+
+function isLiteral(node: Node): node is Literal {
+ return node.type === 'mdxjsEsm';
+}
+
+function isTabImport(node: Node): boolean {
+ return isLiteral(node) && node.value.includes('@theme/Tabs');
+}
+
+function isParent(node: Node): node is Parent {
+ return 'children' in node && Array.isArray(node.children);
+}
+
+function isCode(node: Node): node is Code {
+ return node.type === 'code';
+}
+
+function isPosix2Windows(node: Node): node is Code {
+ return isCode(node) && node.meta === 'posix2windows';
+}
+
+function createTabItem(
+ code: string,
+ node: Code,
+ value: string,
+ label: string,
+): MdxJsxFlowElement {
+ return {
+ type: 'mdxJsxFlowElement',
+ name: 'TabItem',
+ attributes: [
+ {
+ type: 'mdxJsxAttribute',
+ name: 'value',
+ value,
+ },
+ {
+ type: 'mdxJsxAttribute',
+ name: 'label',
+ value: label,
+ },
+ ],
+ children: [
+ {
+ type: node.type,
+ lang: node.lang,
+ value: code,
+ },
+ ],
+ };
+}
+
+function transformNode(node: Code): MdxJsxFlowElement[] {
+ const posixCode = node.value;
+ const windowsCode = posixCode.replaceAll(
+ /(^\w*)\.\//gm,
+ (_substring, prefix: string) => `${prefix}.\\`,
+ );
+ return [
+ {
+ type: 'mdxJsxFlowElement',
+ name: 'Tabs',
+ attributes: [
+ {
+ type: 'mdxJsxAttribute',
+ name: 'groupId',
+ value: 'posix2windows',
+ },
+ ],
+ children: [
+ createTabItem(posixCode, node, 'posix', 'Linux or macOS'),
+ createTabItem(windowsCode, node, 'windows', 'Windows (PowerShell)'),
+ ],
+ },
+ ];
+}
+
+function createImportNode(): MdxjsEsm {
+ return {
+ type: 'mdxjsEsm',
+ value:
+ "import Tabs from '@theme/Tabs'\nimport TabItem from '@theme/TabItem'",
+ data: {
+ estree: {
+ type: 'Program',
+ body: [
+ {
+ type: 'ImportDeclaration',
+ specifiers: [
+ {
+ type: 'ImportDefaultSpecifier',
+ local: { type: 'Identifier', name: 'Tabs' },
+ },
+ ],
+ source: {
+ type: 'Literal',
+ value: '@theme/Tabs',
+ raw: "'@theme/Tabs'",
+ },
+ },
+ {
+ type: 'ImportDeclaration',
+ specifiers: [
+ {
+ type: 'ImportDefaultSpecifier',
+ local: { type: 'Identifier', name: 'TabItem' },
+ },
+ ],
+ source: {
+ type: 'Literal',
+ value: '@theme/TabItem',
+ raw: "'@theme/TabItem'",
+ },
+ },
+ ],
+ sourceType: 'module',
+ },
+ },
+ };
+}
+
+export default function remarkPosix2Windows(): Transformer {
+ return (root) => {
+ let transformed = false;
+ let alreadyImported = false;
+ visit(root, (node) => {
+ if (isTabImport(node)) {
+ alreadyImported = true;
+ }
+ if (isParent(node)) {
+ let index = 0;
+ while (index < node.children.length) {
+ const child = node.children[index];
+ if (child !== undefined && isPosix2Windows(child)) {
+ const result = transformNode(child);
+ node.children.splice(index, 1, ...result);
+ index += result.length;
+ transformed = true;
+ } else {
+ index += 1;
+ }
+ }
+ }
+ });
+ if (transformed && !alreadyImported) {
+ if (isParent(root)) {
+ root.children.unshift(createImportNode());
+ } else {
+ throw new Error("Cannot import '@theme/Tabs'");
+ }
+ }
+ };
+}
diff --git a/subprojects/docs/src/plugins/swcMinifyPlugin.ts b/subprojects/docs/src/plugins/swcMinifyPlugin.ts
new file mode 100644
index 000000000..ecac654b2
--- /dev/null
+++ b/subprojects/docs/src/plugins/swcMinifyPlugin.ts
@@ -0,0 +1,41 @@
+/*
+ * SPDX-FileCopyrightText: 2024 The Refinery Authors
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+
+import type { Plugin } from '@docusaurus/types';
+import TerserPlugin from 'terser-webpack-plugin';
+
+/**
+ * A Docusarus plugin that replaces the built-in Javascript minifier with swc.
+ *
+ * See
+ * https://github.com/facebook/docusaurus/issues/4765#issuecomment-1679863984
+ * but we use swc instead of esbuild.
+ *
+ * @returns The Docusarus plugin.
+ */
+export default function swcMinifyPlugin(): Plugin {
+ return {
+ name: 'refinery-swc-minify-plugin',
+ configureWebpack: (config) => ({
+ mergeStrategy: {
+ 'optimization.minimizer': 'replace',
+ },
+ optimization: {
+ minimizer:
+ config.optimization?.minimizer?.map((plugin) => {
+ // `instanceof` seems to be broken, because a different version of
+ // `TerserPlguin` is coming from Docusaurus than the one we import.
+ if (plugin?.constructor.name === TerserPlugin.name) {
+ return new TerserPlugin({
+ minify: TerserPlugin.swcMinify,
+ });
+ }
+ return plugin;
+ }) ?? [],
+ },
+ }),
+ };
+}
diff --git a/subprojects/docs/src/types.d.ts b/subprojects/docs/src/types.d.ts
new file mode 100644
index 000000000..658763e7c
--- /dev/null
+++ b/subprojects/docs/src/types.d.ts
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2016, Jeremy Stucki
+ * Copyright (c) 2024 The Refinery Authors
+ *
+ * SPDX-License-Identifier: BSD-3-Clause AND EPL-2.0
+ *
+ * Typings for `ResponsiveImageOutput` copied from
+ * https://github.com/dazuaz/responsive-loader/blob/ef2c806fcd36f06f6be8a0b97e09f40c3d86d3ac/README.md
+ */
+
+declare module '*?url' {
+ const url: string;
+ export default url;
+}
+
+declare module '*&url' {
+ const url: string;
+ export default url;
+}
+
+interface ResponsiveImageOutput {
+ src: string;
+ srcSet: string;
+ placeholder: string | undefined;
+ images: { path: string; width: number; height: number }[];
+ width: number;
+ height: number;
+ toString: () => string;
+}
+
+declare module '*?rl' {
+ const src: ResponsiveImageOutput;
+ export default src;
+}
+
+declare module '*&rl' {
+ const src: ResponsiveImageOutput;
+ export default src;
+}
diff --git a/subprojects/docs/static/.nojekyll b/subprojects/docs/static/.nojekyll
new file mode 100644
index 000000000..cfd3d41b2
--- /dev/null
+++ b/subprojects/docs/static/.nojekyll
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: CC0-1.0
diff --git a/subprojects/docs/static/CNAME b/subprojects/docs/static/CNAME
new file mode 100644
index 000000000..4e43c2cdc
--- /dev/null
+++ b/subprojects/docs/static/CNAME
@@ -0,0 +1 @@
+refinery.tools
\ No newline at end of file
diff --git a/subprojects/docs/static/CNAME.license b/subprojects/docs/static/CNAME.license
new file mode 100644
index 000000000..f1dad64a9
--- /dev/null
+++ b/subprojects/docs/static/CNAME.license
@@ -0,0 +1,4 @@
+SPDX-FileCopyrightText: 2021 The Refinery Authors
+
+SPDX-License-Identifier: CC0-1.0
+
diff --git a/subprojects/docs/static/apple-touch-icon.png b/subprojects/docs/static/apple-touch-icon.png
new file mode 100644
index 000000000..de8549e7f
Binary files /dev/null and b/subprojects/docs/static/apple-touch-icon.png differ
diff --git a/subprojects/docs/static/apple-touch-icon.png.license b/subprojects/docs/static/apple-touch-icon.png.license
new file mode 100644
index 000000000..e5db6ccdf
--- /dev/null
+++ b/subprojects/docs/static/apple-touch-icon.png.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2021-2023 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/static/favicon-96x96.png b/subprojects/docs/static/favicon-96x96.png
new file mode 100644
index 000000000..353fe18a7
Binary files /dev/null and b/subprojects/docs/static/favicon-96x96.png differ
diff --git a/subprojects/docs/static/favicon-96x96.png.license b/subprojects/docs/static/favicon-96x96.png.license
new file mode 100644
index 000000000..e5db6ccdf
--- /dev/null
+++ b/subprojects/docs/static/favicon-96x96.png.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2021-2023 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/static/favicon.png b/subprojects/docs/static/favicon.png
new file mode 100644
index 000000000..18e676364
Binary files /dev/null and b/subprojects/docs/static/favicon.png differ
diff --git a/subprojects/docs/static/favicon.png.license b/subprojects/docs/static/favicon.png.license
new file mode 100644
index 000000000..e5db6ccdf
--- /dev/null
+++ b/subprojects/docs/static/favicon.png.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2021-2023 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/static/favicon.svg b/subprojects/docs/static/favicon.svg
new file mode 100644
index 000000000..b5d1d2174
--- /dev/null
+++ b/subprojects/docs/static/favicon.svg
@@ -0,0 +1 @@
+
diff --git a/subprojects/docs/static/favicon.svg.license b/subprojects/docs/static/favicon.svg.license
new file mode 100644
index 000000000..e5db6ccdf
--- /dev/null
+++ b/subprojects/docs/static/favicon.svg.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2021-2023 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/static/icon-192x192.png b/subprojects/docs/static/icon-192x192.png
new file mode 100644
index 000000000..2417b8df1
Binary files /dev/null and b/subprojects/docs/static/icon-192x192.png differ
diff --git a/subprojects/docs/static/icon-192x192.png.license b/subprojects/docs/static/icon-192x192.png.license
new file mode 100644
index 000000000..a73a33646
--- /dev/null
+++ b/subprojects/docs/static/icon-192x192.png.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2021-2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/static/icon-512x512.png b/subprojects/docs/static/icon-512x512.png
new file mode 100644
index 000000000..22f553c69
Binary files /dev/null and b/subprojects/docs/static/icon-512x512.png differ
diff --git a/subprojects/docs/static/icon-512x512.png.license b/subprojects/docs/static/icon-512x512.png.license
new file mode 100644
index 000000000..a73a33646
--- /dev/null
+++ b/subprojects/docs/static/icon-512x512.png.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2021-2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/static/icon-any.svg b/subprojects/docs/static/icon-any.svg
new file mode 100644
index 000000000..9b51b7582
--- /dev/null
+++ b/subprojects/docs/static/icon-any.svg
@@ -0,0 +1 @@
+
diff --git a/subprojects/docs/static/icon-any.svg.license b/subprojects/docs/static/icon-any.svg.license
new file mode 100644
index 000000000..a73a33646
--- /dev/null
+++ b/subprojects/docs/static/icon-any.svg.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2021-2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/static/logo-dark.svg b/subprojects/docs/static/logo-dark.svg
new file mode 100644
index 000000000..8f9af60d0
--- /dev/null
+++ b/subprojects/docs/static/logo-dark.svg
@@ -0,0 +1 @@
+
diff --git a/subprojects/docs/static/logo-dark.svg.license b/subprojects/docs/static/logo-dark.svg.license
new file mode 100644
index 000000000..a73a33646
--- /dev/null
+++ b/subprojects/docs/static/logo-dark.svg.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2021-2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/static/logo.svg b/subprojects/docs/static/logo.svg
new file mode 100644
index 000000000..43d302e33
--- /dev/null
+++ b/subprojects/docs/static/logo.svg
@@ -0,0 +1 @@
+
diff --git a/subprojects/docs/static/logo.svg.license b/subprojects/docs/static/logo.svg.license
new file mode 100644
index 000000000..a73a33646
--- /dev/null
+++ b/subprojects/docs/static/logo.svg.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2021-2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/static/manifest.webmanifest b/subprojects/docs/static/manifest.webmanifest
new file mode 100644
index 000000000..52e608a30
--- /dev/null
+++ b/subprojects/docs/static/manifest.webmanifest
@@ -0,0 +1,35 @@
+{
+ "name": "Refinery Documentation",
+ "short_name": "Refinery Docs",
+ "description": "An efficient graph solver for generating well-formed models",
+ "theme_color": "#f5f5f5",
+ "start_url": ".",
+ "display": "standalone",
+ "background_color": "#282c34",
+ "icons": [
+ {
+ "src": "icon-192x192.png",
+ "sizes": "192x192",
+ "type": "image/png",
+ "purpose": "any maskable"
+ },
+ {
+ "src": "icon-512x512.png",
+ "sizes": "512x512",
+ "type": "image/png",
+ "purpose": "any maskable"
+ },
+ {
+ "src": "icon-any.svg",
+ "sizes": "any",
+ "type": "image/svg+xml",
+ "purpose": "any maskable"
+ },
+ {
+ "src": "mask-icon.svg",
+ "sizes": "any",
+ "type": "image/svg+xml",
+ "purpose": "monochrome"
+ }
+ ]
+}
diff --git a/subprojects/docs/static/manifest.webmanifest.license b/subprojects/docs/static/manifest.webmanifest.license
new file mode 100644
index 000000000..b80566a0e
--- /dev/null
+++ b/subprojects/docs/static/manifest.webmanifest.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2024 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/static/mask-icon.svg b/subprojects/docs/static/mask-icon.svg
new file mode 100644
index 000000000..86052c6e2
--- /dev/null
+++ b/subprojects/docs/static/mask-icon.svg
@@ -0,0 +1 @@
+
diff --git a/subprojects/docs/static/mask-icon.svg.license b/subprojects/docs/static/mask-icon.svg.license
new file mode 100644
index 000000000..e5db6ccdf
--- /dev/null
+++ b/subprojects/docs/static/mask-icon.svg.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2021-2023 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/static/papers/icse24-demo.pdf b/subprojects/docs/static/papers/icse24-demo.pdf
new file mode 100644
index 000000000..7b092e853
Binary files /dev/null and b/subprojects/docs/static/papers/icse24-demo.pdf differ
diff --git a/subprojects/docs/static/papers/icse24-demo.pdf.license b/subprojects/docs/static/papers/icse24-demo.pdf.license
new file mode 100644
index 000000000..93208f909
--- /dev/null
+++ b/subprojects/docs/static/papers/icse24-demo.pdf.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2024 Kristóf Marussy, Attila Ficsor, Oszkár Semeráth, Dániel Varró
+
+SPDX-License-Identifier: CC-BY-4.0
diff --git a/subprojects/docs/static/robots.txt b/subprojects/docs/static/robots.txt
new file mode 100644
index 000000000..1cf41da7b
--- /dev/null
+++ b/subprojects/docs/static/robots.txt
@@ -0,0 +1,8 @@
+# SPDX-FileCopyrightText: 2024 The Refinery Authors
+#
+# SPDX-License-Identifier: CC0-1.0
+
+Sitemap: https://refinery.tools/sitemap.xml
+
+User-agent: *
+Allow: /
diff --git a/subprojects/docs/static/screenshot.png b/subprojects/docs/static/screenshot.png
new file mode 100644
index 000000000..5dfd12418
Binary files /dev/null and b/subprojects/docs/static/screenshot.png differ
diff --git a/subprojects/docs/static/screenshot.png.license b/subprojects/docs/static/screenshot.png.license
new file mode 100644
index 000000000..ff75bc7cc
--- /dev/null
+++ b/subprojects/docs/static/screenshot.png.license
@@ -0,0 +1,3 @@
+SPDX-FileCopyrightText: 2023 The Refinery Authors
+
+SPDX-License-Identifier: EPL-2.0
diff --git a/subprojects/docs/tsconfig.json b/subprojects/docs/tsconfig.json
new file mode 100644
index 000000000..5b32bb0ed
--- /dev/null
+++ b/subprojects/docs/tsconfig.json
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ * Copyright (c) 2024 The Refinery Authors
+ *
+ * SPDX-License-Identifier: MIT AND EPL-2.0
+ *
+ * FIle based on
+ * https://github.com/facebook/docusaurus/blob/73016d4936164ba38d4b86ec2aa8c168b5904a21/packages/docusaurus-tsconfig/tsconfig.json
+ * but copied instead of adding an `extends` declaration to let SonarQube see its contents.
+ */
+{
+ "extends": "../../tsconfig.base.json",
+ "compilerOptions": {
+ "jsx": "preserve",
+ "module": "esnext",
+ "moduleResolution": "bundler",
+ "lib": ["DOM", "DOM.Iterable", "ES2022"],
+ "types": [
+ "node",
+ "@docusaurus/module-type-aliases",
+ "@docusaurus/theme-classic"
+ ],
+ "baseUrl": ".",
+ "paths": {
+ "@site/*": ["./*"]
+ }
+ },
+ "include": ["."],
+ "exclude": [
+ ".docusaurus",
+ ".yarn",
+ "build"
+ ]
+}
diff --git a/subprojects/frontend/.gitignore b/subprojects/frontend/.gitignore
new file mode 100644
index 000000000..52a177c51
--- /dev/null
+++ b/subprojects/frontend/.gitignore
@@ -0,0 +1,6 @@
+# SPDX-FileCopyrightText: 2021-2023 The Refinery Authors
+#
+# SPDX-License-Identifier: CC0-1.0
+
+dev-dist/
+*.typegen.ts
diff --git a/subprojects/frontend/build.gradle.kts b/subprojects/frontend/build.gradle.kts
index ac2c1817d..10a138b1d 100644
--- a/subprojects/frontend/build.gradle.kts
+++ b/subprojects/frontend/build.gradle.kts
@@ -1,5 +1,5 @@
/*
- * SPDX-FileCopyrightText: 2021-2023 The Refinery Authors
+ * SPDX-FileCopyrightText: 2021-2024 The Refinery Authors
*
* SPDX-License-Identifier: EPL-2.0
*/
@@ -25,40 +25,34 @@ val productionAssets: Configuration by configurations.creating {
isCanBeResolved = false
}
-val sourcesWithoutTypes = fileTree("src") {
+val sourcesWithoutTypes: FileCollection = fileTree("src") {
exclude("**/*.typegen.ts")
}
val sourcesWithTypes: FileCollection = fileTree("src") + fileTree("types")
-val buildScripts: FileCollection = fileTree("config") + files(
- rootProject.file(".eslintrc.cjs"),
- rootProject.file("prettier.config.cjs"),
- "vite.config.ts",
+val installationState: FileCollection = files(
+ rootProject.file("yarn.lock"),
+ rootProject.file("package.json"),
+ "package.json",
)
-val installationState = files(
- rootProject.file("yarn.lock"),
- rootProject.file("package.json"),
- "package.json",
-)
-
-val sharedConfigFiles: FileCollection = installationState + files(
- rootProject.file("tsconfig.base.json"),
- "tsconfig.json",
- "tsconfig.node.json",
- "tsconfig.shared.json",
-)
+val assembleConfigFiles: FileCollection = installationState + files(
+ rootProject.file("tsconfig.base.json"),
+ "tsconfig.json",
+ "tsconfig.node.json",
+ "tsconfig.shared.json",
+ "vite.config.ts",
+) + fileTree("config")
-val assembleConfigFiles = sharedConfigFiles + file("vite.config.ts") + fileTree("config") {
- include("**/*.ts")
-}
-
-val assembleSources = sourcesWithTypes + fileTree("public") + file("index.html")
+val assembleSources: FileCollection = sourcesWithTypes + fileTree("public") + files("index.html")
-val assembleFiles = assembleSources + assembleConfigFiles
+val assembleFiles: FileCollection = assembleSources + assembleConfigFiles
-val lintingFiles: FileCollection = sourcesWithTypes + buildScripts + sharedConfigFiles
+val lintingFiles: FileCollection = sourcesWithTypes + assembleConfigFiles + files(
+ rootProject.file(".eslintrc.cjs"),
+ rootProject.file("prettier.config.cjs"),
+)
tasks {
val generateXStateTypes by registering(RunYarn::class) {
@@ -112,16 +106,6 @@ tasks {
dependsOn(lintFrontend)
}
- register("serveFrontend") {
- dependsOn(installFrontend)
- dependsOn(generateXStateTypes)
- inputs.files(assembleFiles)
- outputs.dir(viteOutputDir.map { it.dir("development") })
- script.set("run serve")
- group = "run"
- description = "Start a Vite dev server with hot module replacement."
- }
-
clean {
delete("dev-dist")
delete(fileTree("src") {
diff --git a/subprojects/frontend/index.html b/subprojects/frontend/index.html
index 8992d5380..e4271aad3 100644
--- a/subprojects/frontend/index.html
+++ b/subprojects/frontend/index.html
@@ -14,7 +14,6 @@
-