Skip to content

Commit 7b393de

Browse files
committed
Add fancy block macro
1 parent 5b5dd7d commit 7b393de

File tree

1 file changed

+29
-59
lines changed

1 file changed

+29
-59
lines changed

typst/hw4.typ

Lines changed: 29 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,17 @@
6767
]
6868
]
6969

70+
// Fancy block
71+
#let Block(body, ..args) = {
72+
block(
73+
body,
74+
inset: (x: 1em),
75+
stroke: (left: 3pt + gray),
76+
outset: (y: 3pt, left: -3pt),
77+
..args,
78+
)
79+
}
80+
7081

7182
#Box(align: right)[
7283
#set text(fill: blue.darken(20%))
@@ -77,11 +88,7 @@
7788
]
7889
]
7990

80-
#block(
81-
inset: (left: 1em),
82-
stroke: (left: 3pt + gray),
83-
outset: (y: 3pt, left: -3pt),
84-
)[
91+
#Block[
8592
The cosmos, as Stanisław Lem's heroes have discovered, is full of logical puzzles.
8693

8794
In this assignment, you encounter problems that arise from their adventures: logical contradictions that plague Captain Pirx, truth-telling paradoxes that confound Ijon Tichy, and formal reasoning challenges that challenge even the ingenious constructors Trurl and Klapaucius.
@@ -146,11 +153,7 @@ For each dispatch: symbolize the argument, determine validity via truth table, a
146153

147154
At Orbital Station Cygnus-7, Ijon Tichy visits the *Emporium of Synthetic Companions*, where the proprietor Minik enforces strict regulations on robotic pet purchases:
148155

149-
#block(
150-
inset: (left: 1em),
151-
stroke: (left: 3pt + gray),
152-
outset: (y: 3pt, left: -3pt),
153-
)[
156+
#Block[
154157
*Regulation 1:* If you purchase exactly one of the Giraffoid or Elephandroid, you must also purchase a Simianoid. (Solitary mega-fauna develop existential melancholy.)
155158

156159
*Regulation 2:* Neither the Elephandroid nor the Simianoid may be purchased unless the Giraffoid is also purchased. (The Giraffoid serves as social anchor.)
@@ -205,11 +208,7 @@ Let $A$, $B$, $C$, $D$, $E$ denote "member world voted yes."
205208
At the Interstellar Navigation Academy, a scandal erupts: a *Quantum Cheat-Leaf* (a banned mnemonic device) is discovered near the examination hall.
206209
Tichy interrogates three cadets who took the same exam.
207210

208-
#block(
209-
inset: (left: 1em),
210-
stroke: (left: 3pt + gray),
211-
outset: (y: 3pt, left: -3pt),
212-
)[
211+
#Block[
213212
*Ivanko:* "I didn't use it. Sidorik used it. Petryn used it too."
214213

215214
*Petryn:* "Ivanko used it. I didn't use it. About Sidorik, I cannot say."
@@ -231,11 +230,7 @@ Let $I$, $P$, $S$ denote "Ivanko / Petryn / Sidorik used the Cheat-Leaf."
231230

232231
Aboard the research vessel *Asymptote*, Tichy investigates a reactor incident by interviewing three crew members.
233232

234-
#block(
235-
inset: (left: 1em),
236-
stroke: (left: 3pt + gray),
237-
outset: (y: 3pt, left: -3pt),
238-
)[
233+
#Block[
239234
- *Knyazev* gives an initial testimony.
240235
- *Faraonov* says: "Knyazev's testimony is false."
241236
- *Tsaryov* states: "Faraonov is lying."
@@ -262,10 +257,13 @@ Can you identify which person (if any) is a knight?
262257
Dr. Arkonada discovers three vaults in the Solaric Archives: Gold, Silver, and Lead.
263258
One contains the legendary *Crystallized Theorem*, the others are empty.
264259
Each vault bears an inscription:
260+
#Block[
261+
*Gold vault*: "The Theorem is not here."
265262

266-
- *Gold vault*: "The Theorem is not here."
267-
- *Silver vault*: "The Theorem is in the Gold vault."
268-
- *Lead vault*: "The Theorem is here."
263+
*Silver vault*: "The Theorem is in the Gold vault."
264+
265+
*Lead vault*: "The Theorem is here."
266+
]
269267

270268
Ancient texts warn: "You cannot trust all the inscriptions, nor can you dismiss them entirely."
271269

@@ -320,12 +318,8 @@ Tichy arrives at Echoworld, a planet of perfect symmetry where every fact about
320318
A vast archive records which travelers have visited which worlds.
321319
Tichy must decode the archive's formal notation.
322320

323-
*Predicates over the domain "all planets and travelers":*
324-
#block(
325-
inset: (left: 1em),
326-
stroke: (left: 3pt + gray),
327-
outset: (y: 3pt, left: -3pt),
328-
)[
321+
Predicates over the domain "all planets and travelers":
322+
#Block[
329323
- $P(x)$: "$x$ is a planet"
330324
- $I(x)$: "$x$ is inhabited"
331325
- $V(x, y)$: "$x$ has visited $y$"
@@ -348,11 +342,7 @@ Translate each English statement into FOL.
348342
The archive contains two interpretations of "Only inhabited planets are worth visiting."
349343

350344
The Archive Keeper and her assistant disagree on which is correct:
351-
#block(
352-
inset: (left: 1em),
353-
stroke: (left: 3pt + gray),
354-
outset: (y: 3pt, left: -3pt),
355-
)[
345+
#Block[
356346
*Keeper:* $forall x . thin (I(x) imply W(x))$
357347

358348
*Assistant:* $forall x . thin (W(x) imply I(x))$
@@ -366,11 +356,7 @@ Explain why the difference matters in practice.
366356

367357
Two ancient inscriptions appear in the archive, each describing a different visitation pattern.
368358
Translate them to English, paying close attention to how quantifier order changes the meaning:
369-
#block(
370-
inset: (left: 1em),
371-
stroke: (left: 3pt + gray),
372-
outset: (y: 3pt, left: -3pt),
373-
)[
359+
#Block[
374360
*Inscription A:* $exists x forall y . thin V(y, x)$
375361

376362
*Inscription B:* $forall x exists y . thin V(y, x)$
@@ -573,11 +559,7 @@ For each chamber, Tichy must: translate the inscriptions into propositional logi
573559

574560
=== Chamber 1: The Disjunction
575561

576-
#block(
577-
inset: (left: 1em),
578-
stroke: (left: 3pt + gray),
579-
outset: (y: 3pt, left: -3pt),
580-
)[
562+
#Block[
581563
_Constraint:_ Exactly one inscription is true, and exactly one is false.
582564

583565
*Door A:* "In this room there is a lady, and in the other room there is a tiger."
@@ -587,11 +569,7 @@ For each chamber, Tichy must: translate the inscriptions into propositional logi
587569

588570
=== Chamber 2: The Conjunction
589571

590-
#block(
591-
inset: (left: 1em),
592-
stroke: (left: 3pt + gray),
593-
outset: (y: 3pt, left: -3pt),
594-
)[
572+
#Block[
595573
_Constraint:_ Both inscriptions have the same truth value (either both true or both false).
596574

597575
*Door A:* "At least one of these rooms contains a lady."
@@ -601,11 +579,7 @@ For each chamber, Tichy must: translate the inscriptions into propositional logi
601579

602580
=== Chamber 3: The Implication
603581

604-
#block(
605-
inset: (left: 1em),
606-
stroke: (left: 3pt + gray),
607-
outset: (y: 3pt, left: -3pt),
608-
)[
582+
#Block[
609583
_Constraint:_ Both inscriptions have the same truth value (either both true or both false).
610584

611585
*Door A:* "If there is no tiger in this room, then there is a lady in the other room."
@@ -619,11 +593,7 @@ For each chamber, Tichy must: translate the inscriptions into propositional logi
619593
Captain Pirx analyzes communications among four field agents: *Bilion*, *Stevok*, *Tomix*, *Johnon*.
620594
Cryptanalysts reconstructed these constraints:
621595

622-
#block(
623-
inset: (x: 1em),
624-
stroke: (left: 3pt + gray),
625-
outset: (y: 3pt, left: -3pt),
626-
)[
596+
#Block[
627597
- If Bilion contacted Stevok, then Tomix did not contact Stevok.
628598
- Bilion contacted Stevok iff Johnon contacted at least one of them (Bilion or Stevok).
629599
- If Johnon contacted Stevok, then Bilion did not contact Stevok.

0 commit comments

Comments
 (0)