From 46e989035fa921a5a32169cc0a9b897ec313cc2e Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Wed, 24 Mar 2021 22:41:38 -0400 Subject: Specify function Undo headers --- docs/spec/grammar.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'docs/spec/grammar.html') diff --git a/docs/spec/grammar.html b/docs/spec/grammar.html index dca88643..46509c05 100644 --- a/docs/spec/grammar.html +++ b/docs/spec/grammar.html @@ -73,9 +73,15 @@ FuncHead = headW? ( F | "𝕊" ) headX | sl | "(" subExpr ")" | brSub | list # subject, | ANY ( "‿" ANY )+ # but not s -_m1Head = headW? Mod1H1 headX + | UndoHead +_m1Head = headW? Mod1H1 headX _m2Head_ = headW? Mod2H1 headX +

Additionally, an inference header doesn't affect evaluation of the function, but describes how an inferred property (Undo) should be computed. Here "˜" and "⁼" are both specific instances of the _ml token.

+
UndoHead = headW? ( F | "𝕊" )      "⁼" headX
+         | headW  ( F | "𝕊" ) "˜"  "⁼" headX
+         |        ( F | "𝕊" ) "˜"? "⁼"
+

A braced block contains bodies, which are lists of statements, separated by semicolons and possibly preceded by headers, which are separated from the body with a colon. Multiple bodies allow different handling for various cases, which are pattern-matched by headers. For an immediate block there are no inputs, so there can only be one possible case and one body. Functions and modifiers allow any number of "matched" bodies, with headers that have arguments, followed by at most two "main" bodies with either no headers or headers without arguments. If there is one main body, it is ambivalent, but two main bodies refer to the monadic and dyadic cases.

BODY     = PROGRAM
 FCase    = ? FuncHead ":" BODY
-- 
cgit v1.2.3