@nakafa/aksara-contracts 8.10.0 → 8.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/visual/biology/binomial.d.ts +139 -0
- package/dist/visual/biology/binomial.js +46 -0
- package/dist/visual/biology/bone.d.ts +141 -0
- package/dist/visual/biology/bone.js +46 -0
- package/dist/visual/biology/chromosome.d.ts +139 -0
- package/dist/visual/biology/chromosome.js +42 -0
- package/dist/visual/biology/control.d.ts +17 -0
- package/dist/visual/biology/control.js +21 -0
- package/dist/visual/biology/denature.d.ts +159 -0
- package/dist/visual/biology/denature.js +74 -0
- package/dist/visual/biology/drawing.d.ts +151 -0
- package/dist/visual/biology/drawing.js +69 -0
- package/dist/visual/biology/enzyme.d.ts +145 -0
- package/dist/visual/biology/enzyme.js +54 -0
- package/dist/visual/biology/equipment.d.ts +140 -0
- package/dist/visual/biology/equipment.js +64 -0
- package/dist/visual/biology/gametogenesis.d.ts +145 -0
- package/dist/visual/biology/gametogenesis.js +83 -0
- package/dist/visual/biology/implantation.d.ts +138 -0
- package/dist/visual/biology/implantation.js +44 -0
- package/dist/visual/biology/joint.d.ts +140 -0
- package/dist/visual/biology/joint.js +47 -0
- package/dist/visual/biology/key.d.ts +141 -0
- package/dist/visual/biology/key.js +58 -0
- package/dist/visual/biology/kingdom.d.ts +142 -0
- package/dist/visual/biology/kingdom.js +82 -0
- package/dist/visual/biology/lactase.d.ts +147 -0
- package/dist/visual/biology/lactase.js +48 -0
- package/dist/visual/biology/limb.d.ts +139 -0
- package/dist/visual/biology/limb.js +44 -0
- package/dist/visual/biology/lipid.d.ts +144 -0
- package/dist/visual/biology/lipid.js +43 -0
- package/dist/visual/biology/locomotion.d.ts +141 -0
- package/dist/visual/biology/locomotion.js +48 -0
- package/dist/visual/biology/menstrual.d.ts +148 -0
- package/dist/visual/biology/menstrual.js +65 -0
- package/dist/visual/biology/metamorphosis.d.ts +140 -0
- package/dist/visual/biology/metamorphosis.js +34 -0
- package/dist/visual/biology/placenta.d.ts +139 -0
- package/dist/visual/biology/placenta.js +52 -0
- package/dist/visual/biology/planes.d.ts +145 -0
- package/dist/visual/biology/planes.js +62 -0
- package/dist/visual/biology/protein.d.ts +142 -0
- package/dist/visual/biology/protein.js +41 -0
- package/dist/visual/biology/saturation.d.ts +149 -0
- package/dist/visual/biology/saturation.js +40 -0
- package/dist/visual/biology/secretion.d.ts +149 -0
- package/dist/visual/biology/secretion.js +79 -0
- package/dist/visual/biology/spill.d.ts +165 -0
- package/dist/visual/biology/spill.js +58 -0
- package/dist/visual/biology/sugar.d.ts +152 -0
- package/dist/visual/biology/sugar.js +59 -0
- package/dist/visual/biology/taxon.d.ts +138 -0
- package/dist/visual/biology/taxon.js +50 -0
- package/dist/visual/biology/twins.d.ts +144 -0
- package/dist/visual/biology/twins.js +60 -0
- package/dist/visual/biology/vernacular.d.ts +141 -0
- package/dist/visual/biology/vernacular.js +57 -0
- package/dist/visual/biology/vertebra.d.ts +141 -0
- package/dist/visual/biology/vertebra.js +59 -0
- package/dist/visual/biology/waste.d.ts +140 -0
- package/dist/visual/biology/waste.js +57 -0
- package/dist/visual/biology/water.d.ts +152 -0
- package/dist/visual/biology/water.js +54 -0
- package/dist/visual/card.d.ts +11 -0
- package/dist/visual/card.js +17 -1
- package/dist/visual/catalog.d.ts +5345 -498
- package/dist/visual/catalog.js +66 -0
- package/dist/visual/mathematics/argument.d.ts +226 -0
- package/dist/visual/mathematics/argument.js +150 -0
- package/dist/visual/mathematics/counterexample.d.ts +340 -0
- package/dist/visual/mathematics/counterexample.js +157 -0
- package/package.json +1 -1
package/dist/visual/catalog.js
CHANGED
|
@@ -5,19 +5,50 @@ import { mathVisuals } from "#contracts/visual/base/math";
|
|
|
5
5
|
import { mediaVisuals } from "#contracts/visual/base/media";
|
|
6
6
|
import { biologyVisuals } from "#contracts/visual/biology";
|
|
7
7
|
import { bacteriaVisuals } from "#contracts/visual/biology/bacteria";
|
|
8
|
+
import { binomialVisuals } from "#contracts/visual/biology/binomial";
|
|
8
9
|
import { bloodVisuals } from "#contracts/visual/biology/blood";
|
|
10
|
+
import { boneVisuals } from "#contracts/visual/biology/bone";
|
|
9
11
|
import { cellVisuals } from "#contracts/visual/biology/cell";
|
|
12
|
+
import { chromosomeVisuals } from "#contracts/visual/biology/chromosome";
|
|
10
13
|
import { climateVisuals } from "#contracts/visual/biology/climate";
|
|
14
|
+
import { denatureVisuals } from "#contracts/visual/biology/denature";
|
|
15
|
+
import { drawingVisuals } from "#contracts/visual/biology/drawing";
|
|
11
16
|
import { ecologyVisuals } from "#contracts/visual/biology/ecology";
|
|
17
|
+
import { enzymeVisuals } from "#contracts/visual/biology/enzyme";
|
|
18
|
+
import { equipmentVisuals } from "#contracts/visual/biology/equipment";
|
|
19
|
+
import { gametogenesisVisuals } from "#contracts/visual/biology/gametogenesis";
|
|
12
20
|
import { heartVisuals } from "#contracts/visual/biology/heart";
|
|
21
|
+
import { implantationVisuals } from "#contracts/visual/biology/implantation";
|
|
22
|
+
import { jointVisuals } from "#contracts/visual/biology/joint";
|
|
23
|
+
import { keyVisuals } from "#contracts/visual/biology/key";
|
|
24
|
+
import { kingdomVisuals } from "#contracts/visual/biology/kingdom";
|
|
25
|
+
import { lactaseVisuals } from "#contracts/visual/biology/lactase";
|
|
26
|
+
import { limbVisuals } from "#contracts/visual/biology/limb";
|
|
27
|
+
import { lipidVisuals } from "#contracts/visual/biology/lipid";
|
|
28
|
+
import { locomotionVisuals } from "#contracts/visual/biology/locomotion";
|
|
29
|
+
import { menstrualVisuals } from "#contracts/visual/biology/menstrual";
|
|
30
|
+
import { metamorphosisVisuals } from "#contracts/visual/biology/metamorphosis";
|
|
13
31
|
import { mitochondrionVisuals } from "#contracts/visual/biology/mitochondrion";
|
|
14
32
|
import { muscleVisuals } from "#contracts/visual/biology/muscle";
|
|
15
33
|
import { neuronVisuals } from "#contracts/visual/biology/neuron";
|
|
16
34
|
import { paddyVisuals } from "#contracts/visual/biology/paddy";
|
|
17
35
|
import { physiologyVisuals } from "#contracts/visual/biology/physiology";
|
|
36
|
+
import { placentaVisuals } from "#contracts/visual/biology/placenta";
|
|
37
|
+
import { planesVisuals } from "#contracts/visual/biology/planes";
|
|
18
38
|
import { plantVisuals } from "#contracts/visual/biology/plant";
|
|
39
|
+
import { proteinVisuals } from "#contracts/visual/biology/protein";
|
|
40
|
+
import { saturationVisuals } from "#contracts/visual/biology/saturation";
|
|
41
|
+
import { secretionVisuals } from "#contracts/visual/biology/secretion";
|
|
42
|
+
import { spillVisuals } from "#contracts/visual/biology/spill";
|
|
43
|
+
import { sugarVisuals } from "#contracts/visual/biology/sugar";
|
|
19
44
|
import { synapseVisuals } from "#contracts/visual/biology/synapse";
|
|
45
|
+
import { taxonVisuals } from "#contracts/visual/biology/taxon";
|
|
46
|
+
import { twinsVisuals } from "#contracts/visual/biology/twins";
|
|
47
|
+
import { vernacularVisuals } from "#contracts/visual/biology/vernacular";
|
|
48
|
+
import { vertebraVisuals } from "#contracts/visual/biology/vertebra";
|
|
20
49
|
import { vesselVisuals } from "#contracts/visual/biology/vessel";
|
|
50
|
+
import { wasteVisuals } from "#contracts/visual/biology/waste";
|
|
51
|
+
import { waterVisuals } from "#contracts/visual/biology/water";
|
|
21
52
|
import { yeastVisuals } from "#contracts/visual/biology/yeast";
|
|
22
53
|
import { atomVisuals } from "#contracts/visual/chemistry/atom";
|
|
23
54
|
import { balanceVisuals } from "#contracts/visual/chemistry/balance";
|
|
@@ -31,8 +62,10 @@ import { periodicVisuals } from "#contracts/visual/chemistry/periodic";
|
|
|
31
62
|
import { rateVisuals } from "#contracts/visual/chemistry/rate";
|
|
32
63
|
import { reactionVisuals } from "#contracts/visual/chemistry/reaction";
|
|
33
64
|
import { titrationVisuals } from "#contracts/visual/chemistry/titration";
|
|
65
|
+
import { argumentVisuals } from "#contracts/visual/mathematics/argument";
|
|
34
66
|
import { chanceVisuals } from "#contracts/visual/mathematics/chance";
|
|
35
67
|
import { chartVisuals } from "#contracts/visual/mathematics/charts";
|
|
68
|
+
import { counterexampleVisuals } from "#contracts/visual/mathematics/counterexample";
|
|
36
69
|
import { functionVisuals } from "#contracts/visual/mathematics/function";
|
|
37
70
|
import { geometryVisuals } from "#contracts/visual/mathematics/geometry";
|
|
38
71
|
import { journeyVisuals } from "#contracts/visual/mathematics/journey";
|
|
@@ -95,8 +128,10 @@ export function visualCatalog(rich) {
|
|
|
95
128
|
...particleVisuals(rich),
|
|
96
129
|
...periodicVisuals(rich),
|
|
97
130
|
...reactionVisuals(rich),
|
|
131
|
+
...argumentVisuals(rich),
|
|
98
132
|
...chanceVisuals(rich),
|
|
99
133
|
...chartVisuals(rich),
|
|
134
|
+
...counterexampleVisuals(rich),
|
|
100
135
|
...functionVisuals(rich),
|
|
101
136
|
...geometryVisuals(rich),
|
|
102
137
|
...journeyVisuals(rich),
|
|
@@ -123,6 +158,37 @@ export function visualCatalog(rich) {
|
|
|
123
158
|
...muscleVisuals(rich),
|
|
124
159
|
...yeastVisuals(rich),
|
|
125
160
|
...paddyVisuals(rich),
|
|
161
|
+
...equipmentVisuals(rich),
|
|
162
|
+
...wasteVisuals(rich),
|
|
163
|
+
...spillVisuals(rich),
|
|
164
|
+
...drawingVisuals(rich),
|
|
165
|
+
...planesVisuals(rich),
|
|
166
|
+
...vertebraVisuals(rich),
|
|
167
|
+
...jointVisuals(rich),
|
|
168
|
+
...limbVisuals(rich),
|
|
169
|
+
...locomotionVisuals(rich),
|
|
170
|
+
...boneVisuals(rich),
|
|
171
|
+
...waterVisuals(rich),
|
|
172
|
+
...sugarVisuals(rich),
|
|
173
|
+
...proteinVisuals(rich),
|
|
174
|
+
...lipidVisuals(rich),
|
|
175
|
+
...chromosomeVisuals(rich),
|
|
176
|
+
...vernacularVisuals(rich),
|
|
177
|
+
...taxonVisuals(rich),
|
|
178
|
+
...kingdomVisuals(rich),
|
|
179
|
+
...binomialVisuals(rich),
|
|
180
|
+
...keyVisuals(rich),
|
|
181
|
+
...gametogenesisVisuals(rich),
|
|
182
|
+
...menstrualVisuals(rich),
|
|
183
|
+
...implantationVisuals(rich),
|
|
184
|
+
...placentaVisuals(rich),
|
|
185
|
+
...twinsVisuals(rich),
|
|
186
|
+
...metamorphosisVisuals(rich),
|
|
187
|
+
...enzymeVisuals(rich),
|
|
188
|
+
...secretionVisuals(rich),
|
|
189
|
+
...denatureVisuals(rich),
|
|
190
|
+
...saturationVisuals(rich),
|
|
191
|
+
...lactaseVisuals(rich),
|
|
126
192
|
...balanceVisuals(rich),
|
|
127
193
|
...bondingVisuals(rich),
|
|
128
194
|
...discoveryVisuals(rich),
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
|
+
/** The argument labs, where an argument is checked for its form. */
|
|
4
|
+
export declare function argumentVisuals<E>(rich: RichSlot<E>): {
|
|
5
|
+
ArgumentChainLab: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
6
|
+
readonly description: RichSlot<E>;
|
|
7
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
8
|
+
readonly marks?: readonly [{
|
|
9
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
10
|
+
} | {
|
|
11
|
+
readonly attrs: {
|
|
12
|
+
readonly href: string;
|
|
13
|
+
};
|
|
14
|
+
readonly type: "link";
|
|
15
|
+
} | {
|
|
16
|
+
readonly attrs: {
|
|
17
|
+
readonly variant: "success" | "warning" | null;
|
|
18
|
+
};
|
|
19
|
+
readonly type: "highlight";
|
|
20
|
+
}, ...({
|
|
21
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
22
|
+
} | {
|
|
23
|
+
readonly attrs: {
|
|
24
|
+
readonly href: string;
|
|
25
|
+
};
|
|
26
|
+
readonly type: "link";
|
|
27
|
+
} | {
|
|
28
|
+
readonly attrs: {
|
|
29
|
+
readonly variant: "success" | "warning" | null;
|
|
30
|
+
};
|
|
31
|
+
readonly type: "highlight";
|
|
32
|
+
})[]];
|
|
33
|
+
readonly text: string;
|
|
34
|
+
readonly type: "text";
|
|
35
|
+
} | {
|
|
36
|
+
readonly attrs: {
|
|
37
|
+
readonly latex: string;
|
|
38
|
+
};
|
|
39
|
+
readonly marks?: readonly [{
|
|
40
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
41
|
+
} | {
|
|
42
|
+
readonly attrs: {
|
|
43
|
+
readonly href: string;
|
|
44
|
+
};
|
|
45
|
+
readonly type: "link";
|
|
46
|
+
} | {
|
|
47
|
+
readonly attrs: {
|
|
48
|
+
readonly variant: "success" | "warning" | null;
|
|
49
|
+
};
|
|
50
|
+
readonly type: "highlight";
|
|
51
|
+
}, ...({
|
|
52
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
53
|
+
} | {
|
|
54
|
+
readonly attrs: {
|
|
55
|
+
readonly href: string;
|
|
56
|
+
};
|
|
57
|
+
readonly type: "link";
|
|
58
|
+
} | {
|
|
59
|
+
readonly attrs: {
|
|
60
|
+
readonly variant: "success" | "warning" | null;
|
|
61
|
+
};
|
|
62
|
+
readonly type: "highlight";
|
|
63
|
+
})[]];
|
|
64
|
+
readonly type: "mathInline";
|
|
65
|
+
}, ...({
|
|
66
|
+
readonly marks?: readonly [{
|
|
67
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
68
|
+
} | {
|
|
69
|
+
readonly attrs: {
|
|
70
|
+
readonly href: string;
|
|
71
|
+
};
|
|
72
|
+
readonly type: "link";
|
|
73
|
+
} | {
|
|
74
|
+
readonly attrs: {
|
|
75
|
+
readonly variant: "success" | "warning" | null;
|
|
76
|
+
};
|
|
77
|
+
readonly type: "highlight";
|
|
78
|
+
}, ...({
|
|
79
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
80
|
+
} | {
|
|
81
|
+
readonly attrs: {
|
|
82
|
+
readonly href: string;
|
|
83
|
+
};
|
|
84
|
+
readonly type: "link";
|
|
85
|
+
} | {
|
|
86
|
+
readonly attrs: {
|
|
87
|
+
readonly variant: "success" | "warning" | null;
|
|
88
|
+
};
|
|
89
|
+
readonly type: "highlight";
|
|
90
|
+
})[]];
|
|
91
|
+
readonly text: string;
|
|
92
|
+
readonly type: "text";
|
|
93
|
+
} | {
|
|
94
|
+
readonly attrs: {
|
|
95
|
+
readonly latex: string;
|
|
96
|
+
};
|
|
97
|
+
readonly marks?: readonly [{
|
|
98
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
99
|
+
} | {
|
|
100
|
+
readonly attrs: {
|
|
101
|
+
readonly href: string;
|
|
102
|
+
};
|
|
103
|
+
readonly type: "link";
|
|
104
|
+
} | {
|
|
105
|
+
readonly attrs: {
|
|
106
|
+
readonly variant: "success" | "warning" | null;
|
|
107
|
+
};
|
|
108
|
+
readonly type: "highlight";
|
|
109
|
+
}, ...({
|
|
110
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
111
|
+
} | {
|
|
112
|
+
readonly attrs: {
|
|
113
|
+
readonly href: string;
|
|
114
|
+
};
|
|
115
|
+
readonly type: "link";
|
|
116
|
+
} | {
|
|
117
|
+
readonly attrs: {
|
|
118
|
+
readonly variant: "success" | "warning" | null;
|
|
119
|
+
};
|
|
120
|
+
readonly type: "highlight";
|
|
121
|
+
})[]];
|
|
122
|
+
readonly type: "mathInline";
|
|
123
|
+
})[]], E, never, never>>;
|
|
124
|
+
readonly title: RichSlot<E>;
|
|
125
|
+
readonly conclusion: Schema.Union<readonly [Schema.Struct<{
|
|
126
|
+
readonly statement: Schema.Union<readonly [Schema.Struct<{
|
|
127
|
+
readonly kind: Schema.Literal<"all">;
|
|
128
|
+
readonly predicate: Schema.Trimmed;
|
|
129
|
+
readonly subject: Schema.Trimmed;
|
|
130
|
+
}>, Schema.Struct<{
|
|
131
|
+
readonly kind: Schema.Literal<"member">;
|
|
132
|
+
readonly member: Schema.Trimmed;
|
|
133
|
+
readonly set: Schema.Trimmed;
|
|
134
|
+
}>, Schema.Struct<{
|
|
135
|
+
readonly antecedent: Schema.Trimmed;
|
|
136
|
+
readonly consequent: Schema.Trimmed;
|
|
137
|
+
readonly kind: Schema.Literal<"conditional">;
|
|
138
|
+
}>, Schema.Struct<{
|
|
139
|
+
readonly kind: Schema.Literal<"claim">;
|
|
140
|
+
readonly negated: Schema.Boolean;
|
|
141
|
+
readonly statement: Schema.Trimmed;
|
|
142
|
+
}>]>;
|
|
143
|
+
readonly text: Schema.Trimmed;
|
|
144
|
+
readonly truth: Schema.Boolean;
|
|
145
|
+
}>, Schema.Literal<"open">]>;
|
|
146
|
+
readonly hand: Schema.NonEmptyArray<Schema.Struct<{
|
|
147
|
+
readonly statement: Schema.Union<readonly [Schema.Struct<{
|
|
148
|
+
readonly kind: Schema.Literal<"all">;
|
|
149
|
+
readonly predicate: Schema.Trimmed;
|
|
150
|
+
readonly subject: Schema.Trimmed;
|
|
151
|
+
}>, Schema.Struct<{
|
|
152
|
+
readonly kind: Schema.Literal<"member">;
|
|
153
|
+
readonly member: Schema.Trimmed;
|
|
154
|
+
readonly set: Schema.Trimmed;
|
|
155
|
+
}>, Schema.Struct<{
|
|
156
|
+
readonly antecedent: Schema.Trimmed;
|
|
157
|
+
readonly consequent: Schema.Trimmed;
|
|
158
|
+
readonly kind: Schema.Literal<"conditional">;
|
|
159
|
+
}>, Schema.Struct<{
|
|
160
|
+
readonly kind: Schema.Literal<"claim">;
|
|
161
|
+
readonly negated: Schema.Boolean;
|
|
162
|
+
readonly statement: Schema.Trimmed;
|
|
163
|
+
}>]>;
|
|
164
|
+
readonly text: Schema.Trimmed;
|
|
165
|
+
readonly truth: Schema.Boolean;
|
|
166
|
+
}>>;
|
|
167
|
+
readonly premises: Schema.Tuple<readonly [Schema.Union<readonly [Schema.Struct<{
|
|
168
|
+
readonly statement: Schema.Union<readonly [Schema.Struct<{
|
|
169
|
+
readonly kind: Schema.Literal<"all">;
|
|
170
|
+
readonly predicate: Schema.Trimmed;
|
|
171
|
+
readonly subject: Schema.Trimmed;
|
|
172
|
+
}>, Schema.Struct<{
|
|
173
|
+
readonly kind: Schema.Literal<"member">;
|
|
174
|
+
readonly member: Schema.Trimmed;
|
|
175
|
+
readonly set: Schema.Trimmed;
|
|
176
|
+
}>, Schema.Struct<{
|
|
177
|
+
readonly antecedent: Schema.Trimmed;
|
|
178
|
+
readonly consequent: Schema.Trimmed;
|
|
179
|
+
readonly kind: Schema.Literal<"conditional">;
|
|
180
|
+
}>, Schema.Struct<{
|
|
181
|
+
readonly kind: Schema.Literal<"claim">;
|
|
182
|
+
readonly negated: Schema.Boolean;
|
|
183
|
+
readonly statement: Schema.Trimmed;
|
|
184
|
+
}>]>;
|
|
185
|
+
readonly text: Schema.Trimmed;
|
|
186
|
+
readonly truth: Schema.Boolean;
|
|
187
|
+
}>, Schema.Literal<"open">]>, Schema.Union<readonly [Schema.Struct<{
|
|
188
|
+
readonly statement: Schema.Union<readonly [Schema.Struct<{
|
|
189
|
+
readonly kind: Schema.Literal<"all">;
|
|
190
|
+
readonly predicate: Schema.Trimmed;
|
|
191
|
+
readonly subject: Schema.Trimmed;
|
|
192
|
+
}>, Schema.Struct<{
|
|
193
|
+
readonly kind: Schema.Literal<"member">;
|
|
194
|
+
readonly member: Schema.Trimmed;
|
|
195
|
+
readonly set: Schema.Trimmed;
|
|
196
|
+
}>, Schema.Struct<{
|
|
197
|
+
readonly antecedent: Schema.Trimmed;
|
|
198
|
+
readonly consequent: Schema.Trimmed;
|
|
199
|
+
readonly kind: Schema.Literal<"conditional">;
|
|
200
|
+
}>, Schema.Struct<{
|
|
201
|
+
readonly kind: Schema.Literal<"claim">;
|
|
202
|
+
readonly negated: Schema.Boolean;
|
|
203
|
+
readonly statement: Schema.Trimmed;
|
|
204
|
+
}>]>;
|
|
205
|
+
readonly text: Schema.Trimmed;
|
|
206
|
+
readonly truth: Schema.Boolean;
|
|
207
|
+
}>, Schema.Literal<"open">]>]>;
|
|
208
|
+
readonly labels: Schema.Struct<{
|
|
209
|
+
readonly conclusion: Schema.Trimmed;
|
|
210
|
+
readonly fallacies: Schema.$Record<Schema.Literals<readonly ["consequent", "antecedent", "middle"]>, RichSlot<E>>;
|
|
211
|
+
readonly form: RichSlot<E>;
|
|
212
|
+
readonly forms: Schema.$Record<Schema.Literals<readonly ["I", "II", "III"]>, RichSlot<E>>;
|
|
213
|
+
readonly hand: Schema.Trimmed;
|
|
214
|
+
readonly no: RichSlot<E>;
|
|
215
|
+
readonly premises: Schema.Tuple<readonly [Schema.Trimmed, Schema.Trimmed]>;
|
|
216
|
+
readonly sound: RichSlot<E>;
|
|
217
|
+
readonly truth: RichSlot<E>;
|
|
218
|
+
readonly unfollowed: RichSlot<E>;
|
|
219
|
+
readonly unlinked: RichSlot<E>;
|
|
220
|
+
readonly valid: RichSlot<E>;
|
|
221
|
+
readonly viewLabel: Schema.Trimmed;
|
|
222
|
+
readonly yes: RichSlot<E>;
|
|
223
|
+
}>;
|
|
224
|
+
readonly showVerdict: Schema.optionalKey<Schema.Boolean>;
|
|
225
|
+
}>, "figure">;
|
|
226
|
+
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { Array as Arr, Schema } from "effect";
|
|
2
|
+
import { byIds, cardFields, TextSchema } from "#contracts/visual/card";
|
|
3
|
+
import { answerAt, figure } from "#contracts/visual/entry";
|
|
4
|
+
/** The textbook's three valid forms of argument, and the fallacies that look like them. */
|
|
5
|
+
const ARGUMENT_FORMS = ["I", "II", "III"];
|
|
6
|
+
const ARGUMENT_FALLACIES = ["consequent", "antecedent", "middle"];
|
|
7
|
+
/** The most cards the hand holds, the longest card text, and the longest slot name. */
|
|
8
|
+
const HAND_LIMIT = 3;
|
|
9
|
+
const CARD_TEXT_LIMIT = 100;
|
|
10
|
+
const SLOT_NAME_LIMIT = 12;
|
|
11
|
+
/**
|
|
12
|
+
* What one card says, in the shapes the three forms are built from: "All A
|
|
13
|
+
* are B" (`all`), "c is A" (`member`), "If p, then q" (`conditional`), and
|
|
14
|
+
* "p is true" or "Not p is true" (`claim`). The names are the lesson's own
|
|
15
|
+
* ids for its sets and statements, never shown: two cards that speak of one
|
|
16
|
+
* set or one statement use one name.
|
|
17
|
+
*/
|
|
18
|
+
const StatementSchema = Schema.Union([
|
|
19
|
+
Schema.Struct({
|
|
20
|
+
kind: Schema.Literal("all"),
|
|
21
|
+
predicate: TextSchema,
|
|
22
|
+
subject: TextSchema,
|
|
23
|
+
}),
|
|
24
|
+
Schema.Struct({
|
|
25
|
+
kind: Schema.Literal("member"),
|
|
26
|
+
member: TextSchema,
|
|
27
|
+
set: TextSchema,
|
|
28
|
+
}),
|
|
29
|
+
Schema.Struct({
|
|
30
|
+
antecedent: TextSchema,
|
|
31
|
+
consequent: TextSchema,
|
|
32
|
+
kind: Schema.Literal("conditional"),
|
|
33
|
+
}),
|
|
34
|
+
Schema.Struct({
|
|
35
|
+
kind: Schema.Literal("claim"),
|
|
36
|
+
negated: Schema.Boolean,
|
|
37
|
+
statement: TextSchema,
|
|
38
|
+
}),
|
|
39
|
+
]);
|
|
40
|
+
/** One card: the words the learner reads, what they say, and whether that is true. */
|
|
41
|
+
const ArgumentCardSchema = Schema.Struct({
|
|
42
|
+
statement: StatementSchema,
|
|
43
|
+
text: TextSchema.check(Schema.isMaxLength(CARD_TEXT_LIMIT)),
|
|
44
|
+
truth: Schema.Boolean,
|
|
45
|
+
});
|
|
46
|
+
/** A slot of the chain: a card the lesson places, or `open` for the learner to fill from the hand. */
|
|
47
|
+
const ArgumentSlotSchema = Schema.Union([
|
|
48
|
+
ArgumentCardSchema,
|
|
49
|
+
Schema.Literal("open"),
|
|
50
|
+
]);
|
|
51
|
+
/** The chain's three slots and the hand the learner fills the open ones from. */
|
|
52
|
+
const ArgumentChainSchema = Schema.Struct({
|
|
53
|
+
conclusion: ArgumentSlotSchema,
|
|
54
|
+
hand: Schema.NonEmptyArray(ArgumentCardSchema).check(Schema.isMaxLength(HAND_LIMIT)),
|
|
55
|
+
premises: Schema.Tuple([ArgumentSlotSchema, ArgumentSlotSchema]),
|
|
56
|
+
});
|
|
57
|
+
/** A slot's name on its brass plate. */
|
|
58
|
+
const SlotNameSchema = TextSchema.check(Schema.isMaxLength(SLOT_NAME_LIMIT));
|
|
59
|
+
const sameStatement = Schema.toEquivalence(StatementSchema);
|
|
60
|
+
/** Every card a single slot can take, paired with the hand left after placing it. */
|
|
61
|
+
function picksFor(slot, hand) {
|
|
62
|
+
return slot === "open"
|
|
63
|
+
? Arr.map(hand, (card, index) => [card, Arr.remove(hand, index)])
|
|
64
|
+
: [[slot, hand]];
|
|
65
|
+
}
|
|
66
|
+
/** Every way the hand fills the open slots, one card to a slot and no card twice, with the placed cards kept. */
|
|
67
|
+
function dealsOf([firstSlot, secondSlot, thirdSlot], hand) {
|
|
68
|
+
return Arr.flatMap(picksFor(firstSlot, hand), ([first, afterFirst]) => Arr.flatMap(picksFor(secondSlot, afterFirst), ([second, afterSecond]) => Arr.map(picksFor(thirdSlot, afterSecond), ([conclusion]) => [first, second, conclusion])));
|
|
69
|
+
}
|
|
70
|
+
/** Whether a statement is general: a rule about every member or every case. */
|
|
71
|
+
function isGeneral(statement) {
|
|
72
|
+
return statement.kind === "all" || statement.kind === "conditional";
|
|
73
|
+
}
|
|
74
|
+
/** Whether two statements say one thing and its opposite. */
|
|
75
|
+
function contradicts(left, right) {
|
|
76
|
+
return (left.kind === "claim" &&
|
|
77
|
+
right.kind === "claim" &&
|
|
78
|
+
left.statement === right.statement &&
|
|
79
|
+
left.negated !== right.negated);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Whether a full chain is one the lab can judge: valid only through form I,
|
|
83
|
+
* II or III, or invalid. Two general premises chain into a valid argument the
|
|
84
|
+
* lab does not teach, premises that contradict each other prove anything, and
|
|
85
|
+
* a conclusion that repeats a premise follows trivially; none of these may
|
|
86
|
+
* be dealt.
|
|
87
|
+
*/
|
|
88
|
+
function isJudgeable([first, second, conclusion]) {
|
|
89
|
+
return !((isGeneral(first.statement) && isGeneral(second.statement)) ||
|
|
90
|
+
contradicts(first.statement, second.statement) ||
|
|
91
|
+
sameStatement(conclusion.statement, first.statement) ||
|
|
92
|
+
sameStatement(conclusion.statement, second.statement));
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Whether the learner has a slot to fill and a card for each open slot, the
|
|
96
|
+
* hand's cards read differently, and every chain the hand can deal is one
|
|
97
|
+
* the lab can judge.
|
|
98
|
+
*/
|
|
99
|
+
function isDealable({ conclusion, hand, premises, }) {
|
|
100
|
+
const slots = [
|
|
101
|
+
premises[0],
|
|
102
|
+
premises[1],
|
|
103
|
+
conclusion,
|
|
104
|
+
];
|
|
105
|
+
const open = Arr.filter(slots, (slot) => slot === "open").length;
|
|
106
|
+
const texts = Arr.map(hand, ({ text }) => text);
|
|
107
|
+
return (open > 0 &&
|
|
108
|
+
hand.length >= open &&
|
|
109
|
+
Arr.dedupe(texts).length === texts.length &&
|
|
110
|
+
Arr.every(dealsOf(slots, hand), isJudgeable));
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Props of `ArgumentChainLab`: an argument built from cards on a rail, two
|
|
114
|
+
* `premises` and a `conclusion` joined by two chain links. Each slot holds a
|
|
115
|
+
* card the lesson places, or is `open` for the learner to fill from the
|
|
116
|
+
* `hand`, whose cards the toolbar deals in. With `showVerdict`, each link
|
|
117
|
+
* locks when the step holds and breaks where the argument fails, a seal marks
|
|
118
|
+
* each false card, and the footer names the form or the fallacy and reads
|
|
119
|
+
* whether the argument is valid, its premises true and the argument sound,
|
|
120
|
+
* so it is answer state.
|
|
121
|
+
*/
|
|
122
|
+
function argumentChainLab(rich) {
|
|
123
|
+
return figure(Schema.Struct({
|
|
124
|
+
...cardFields(rich),
|
|
125
|
+
...ArgumentChainSchema.fields,
|
|
126
|
+
labels: Schema.Struct({
|
|
127
|
+
conclusion: SlotNameSchema,
|
|
128
|
+
fallacies: byIds(ARGUMENT_FALLACIES, rich),
|
|
129
|
+
form: rich,
|
|
130
|
+
forms: byIds(ARGUMENT_FORMS, rich),
|
|
131
|
+
hand: TextSchema,
|
|
132
|
+
no: rich,
|
|
133
|
+
premises: Schema.Tuple([SlotNameSchema, SlotNameSchema]),
|
|
134
|
+
sound: rich,
|
|
135
|
+
truth: rich,
|
|
136
|
+
unfollowed: rich,
|
|
137
|
+
unlinked: rich,
|
|
138
|
+
valid: rich,
|
|
139
|
+
viewLabel: TextSchema,
|
|
140
|
+
yes: rich,
|
|
141
|
+
}),
|
|
142
|
+
showVerdict: Schema.optionalKey(Schema.Boolean),
|
|
143
|
+
}).check(Schema.makeFilter(isDealable, {
|
|
144
|
+
message: "Expected an open slot, a hand with a different card for each open slot, and no deal the lab cannot judge: two general premises, contradicting premises, or a conclusion that repeats a premise.",
|
|
145
|
+
})), answerAt(["showVerdict"]));
|
|
146
|
+
}
|
|
147
|
+
/** The argument labs, where an argument is checked for its form. */
|
|
148
|
+
export function argumentVisuals(rich) {
|
|
149
|
+
return { ArgumentChainLab: argumentChainLab(rich) };
|
|
150
|
+
}
|