From 957dca57f9e7427c463311847be4a18411b200c3 Mon Sep 17 00:00:00 2001 From: Rob Simmons Date: Thu, 23 Nov 2023 16:41:59 -0500 Subject: [PATCH] Editor links to docs now --- .../src/content/docs/docs/language/constraints.md | 14 +++++++------- index.html | 4 +--- src/web/Config.tsx | 15 ++++++++++++++- src/web/dusa.css | 12 +++++++++--- 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/docs/src/content/docs/docs/language/constraints.md b/docs/src/content/docs/docs/language/constraints.md index 3c51cec..10d9e40 100644 --- a/docs/src/content/docs/docs/language/constraints.md +++ b/docs/src/content/docs/docs/language/constraints.md @@ -2,20 +2,20 @@ title: Constraints --- -Constraints are critical to understanding solutions in Dusa. A solution in Dusa must +Constraints are critical to understanding solutions in Dusa. A solution in Dusa must have four properties: 1. Whenever the premises of a closed rule are satisfied, one of the mutually exclusive conclusions must be present in the solution. 2. Whenever all the premises of an open rule are satisfied, either one of the mutually - exclusive conclusions must be present in the solution, or else the addition of any + exclusive conclusions must be present in the solution, or else the addition of any mutually exclusive conclusion must violate a functional constraint. 3. There must be no way to satisfy all the premises of any `#forbid` constraint. 4. There must be some way to satisfy all the premises of every `#demand` constraint. ## Functional constraints -Functional constraints are at the core of Dusa. Choices in rules expand the search +Functional constraints are at the core of Dusa. Choices in rules expand the search space of solutions, and constraints trim the search space back down. If any attribute is forced to take two distinct values, the solution is invalidated. @@ -33,7 +33,7 @@ rejected. ## Forbid constraints -If all the premises to any `#forbid` declaration can be simultaneously satisfied, the +If all the premises to any `#forbid` declaration can be simultaneously satisfied, the database is invalidated. species is { bear, bird }. @@ -43,7 +43,7 @@ database is invalidated. This program again has only one solution, containing the facts `species is bear` and `name is yogi`. Positing that the species is bird won't cause a functional constraint -to fail, but it will cause the solution to contain `name is tweety` to be derived, +to fail, but it will cause the solution to contain `name is tweety` to be derived, which is rejected by the constraint. ### Syntactic sugar @@ -68,7 +68,7 @@ every `#demand` declaration can be simultaneously satisfied. name is tweety :- species is bird. #demand name is yogi. -Once again, this program again has only one solution, containing the facts +Once again, this program again has only one solution, containing the facts `species is bear` and `name is yogi`. If the name is not Yogi, the database will be rejected, and so we will not see any solutions with birds, who can only be named tweety. @@ -89,4 +89,4 @@ accepting the solution only if an alterantive value is derived. required 2 is { unsatisfied? }. required 1 is satisfied :- . required 2 is satisfied :- . - #forbid required _ is unsatisfied. \ No newline at end of file + #forbid required _ is unsatisfied. diff --git a/index.html b/index.html index fed61f1..544b1a8 100644 --- a/index.html +++ b/index.html @@ -22,9 +22,7 @@
- +
diff --git a/src/web/Config.tsx b/src/web/Config.tsx index 8c40341..15f9a6f 100644 --- a/src/web/Config.tsx +++ b/src/web/Config.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { MoonIcon, Share1Icon, SunIcon } from '@radix-ui/react-icons'; +import { MoonIcon, QuestionMarkCircledIcon, Share1Icon, SunIcon } from '@radix-ui/react-icons'; import { ICON_SIZE } from './constants'; import * as Tooltip from '@radix-ui/react-tooltip'; const LS_THEME = 'dusa-theme'; @@ -25,6 +25,19 @@ export default function Config(props: Props) { return ( <> +
+ + + + + + View the docs + + +
+
diff --git a/src/web/dusa.css b/src/web/dusa.css index 70c9475..24c5080 100644 --- a/src/web/dusa.css +++ b/src/web/dusa.css @@ -91,9 +91,11 @@ main { } .dk-config { - display: grid; - align-items: end; - padding-bottom: var(--dk-small-padding); + display: flex; + flex-direction: column; + height: 100%; + padding-block: var(--dk-small-padding); + align-items: stretch; } .dk-config div { @@ -102,6 +104,10 @@ main { gap: var(--dk-medium-padding); } +.dk-config div.top-config { + flex-grow: 1; +} + .dk-config button { height: var(--dk-button-size); border: 0;