aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthe lemons <citrons@mondecitronne.com>2023-04-28 14:13:47 -0500
committerthe lemons <citrons@mondecitronne.com>2023-04-28 14:13:47 -0500
commit2dee3e291a6bdfe7be46e82470194f015fa027d7 (patch)
treeede35cae71dfd82afbc5a9b6dfe60b0ccc123cff
parenta2b461500a8b9a25a2b7ec4f51d08dc96991b49b (diff)
revise relation operator semantics
-rw-r--r--readme.md185
1 files changed, 94 insertions, 91 deletions
diff --git a/readme.md b/readme.md
index d1b155a..a0ea9e8 100644
--- a/readme.md
+++ b/readme.md
@@ -20,45 +20,55 @@ alpha = ? [a-z][A-Z] ? ;
num = ? [0-9] ? ;
ws = { ? whitespace characters ? } ;
-literal = alpha , { alpha } | num , { num } | quote | lambda ;
+name = alpha , { alpha }
-binop = ? binary operator, see § binary operators ? ;
-unop = ? unary operator, see § unary operators ? ;
+literal = name | num , { num } | quote | lambda ;
+
+relop = [ "\" ] , ? relation operator, see § relation operators ? ;
+binop = ? binary operator, see § other operators ? ;
+unop = ? unary operator, see § other operators ? ;
operation = unop , ws , expr
- | ( literal | "(" , ws, expr , ")", ws ) , binop , ws , expr ;
+ | ( literal | "(" , ws, expr , ")", ws ) , ( binop | relop ) , ws , expr ;
+
+assignment = name , ws , "::=" , ws , expr , ws | ":_" , ws , expr , ws ;
-expr = literal | operation | "(" , ws , expr , ")" , ws
+expr = assignment | literal | operation | "(" , ws , expr , ")" , ws ;
-document = ws , { expr }
+document = ws , { expr | assignment } ;
-quote char = "\\" , ? any character ? | ? any character except double quotes ?
-normal quote = "\"" , { quote char } , "\""
+quote char = "\\" , ? any character ? | ? any character except double quotes ? ;
+normal quote = "\"" , { quote char } , "\"" ;
-bracket quote = "[" , document , "]"
+bracket quote = "[" , document , "]" ;
-quote = normal quote | bracket quote
+quote = normal quote | bracket quote ;
-lambda = "{" , document , "}"
+lambda = "{" , document , "}" ;
```
## the meaning of a noun
the meaning of literal nouns (which are not quotations or numbers) is determined thusly (in this exact order):
1. if the meaning of the literal noun, is defined in this standard's noun list, then the meaning of the noun is according to the list.
-2. if the meaning of the literal noun has been defined previously via the `::=` operator, then the meaning of the noun is according to that definition. the scope of definition and usage must be considered. see § lambdas.
+2. if the meaning of the literal noun has been defined previously via assignment (`::=`), then the meaning of the noun is according to that definition. the scope of definition and usage must be considered. see § lambdas.
3. the meaning of the literal noun must be determined from context, e.g. it is the name of a person.
it is recommended that nonstandard nouns (nouns defined via step #2 or #3) are initially capitalized to distinguish them from standard nouns, which will never be capitalized. however, this is just proposed convention and is not required to conform to the standard.
numerical literal nouns refer to the numbers themselves, such that, for instance, `2#_g` would mean "two people".
+## assignment
+an assignment expression `Name::=A` redefines the name supplied (`Name`) such that its value is `A` the remainder of the document after its appearance or for other applicable documents. `:_A` is equivalent to `X::=A`.
+
+the value of an assignment expression is `z` as defined in the word list.
+
## the meaning of a sentence
a sentence consists of a single expression. each expression evaluates to a noun, and so to find the meaning of a sentence, the expression is evaluated. if the expression's meaning is X, then the meaning of the sentence is "there exists X".
-CR makes no distinction between statements such as "the/a person who is thinking exists" and "the/a person is thinking". both would be:
+CR makes no distinction between statements such as "the someone's thought exists" and "the/a person is thinking". both would be:
```
-g>:f
+*g>:f
```
the meaning of a CR document is determined by evaluating its sentences in order.
@@ -84,116 +94,109 @@ the inner lambda `{Y}` is able to access a definition from its outer lambda afte
if a nonlambda is supplied as an operand whose operator assumes it to be a lambda, this is an error.
-## binary operators
-the binary operators, when used, evaluate to their definitions below.
-
-the two operands are denoted as `x` and `y` in these definitions. they are the first and second operands respectively. `*_x` or `*_y` are to be intepreted as "(an) instance(s) of `x`" or "(an) instance(s) of `y`".
-### `=`
-`x` which is the same thing as `y`
+## relation operators
+a binary operator expresses relation between the value of its left-hand side, `X` and its right-hand side, `Y`. the value of a binary operator expression expressing some relation `R` is "`Y` which have/has relation `R` to `X`". however, when `\` is prepended to the operator, the meaning is changed to "`X` to which `Y` have/has relation `R`". for instance, while `B>_A` means "`A` via `B`", `B\>_A` means "`B` which `A` is via".
-### `==`
-`x` which is completely identical to `y`
+in the following definition `*A` is to be interpreted as "some specific instance(s) of `A`".
-### `::=`
-the noun `z`, as defined in the word list; *define or redefine* `x`*'s name in the present scope to have the value of* `y`
+### `X=Y`
+`X` is the same thing as `Y`
-### `>`
-`x` which causes `*_y`
+### `X==Y`
+`X` is identical to `Y`
-### `>:`
-`x` which manifests `*_y`, embodying it (intentionally)
+### `X>Y`
+`X` causes `*Y`
-### `>_`
-`y` which is via `x`
+### `X>:Y`
+`X` is manifesting `*Y`, embodying it (intentionally)
-### `<`
-`x` which directly affects `y`
+### `X>_Y`
+`Y` is via `X`
-### `&`
-`x` and `y`
-
-### `^`
-`x` xor `y`
-
-### `|`
-`x` or `y`
+### `X<Y`
+`X` directly affects `Y`
### `?`
-`y` which exists if `x` exists
-
-### `?_`
-a hypothetical `y` which exists according to/in the perspective of `*_x`
+`Y` exists if `X` exists
### `/`
-`y` which is located in/on/at `*_x`
+`Y` which is located in/on/at `*X`
+
+### `X%Y`
+`Y` concerns/pertains to/is about `X`
+
+### `X~Y`
+`Y` is similar to/like/as `X`
-### `%`
-`y` which concerns/pertains to/is about `x`
+### `X$Y`
+`Y` is the conduit of/embodies `X`
-### `~`
-`y` which is similar to/like/as `x`
+### `X#_Y`
+the number of `Y` is `X`
-### `$`
-`y` which is the conduit of/embodies `x`
+### `X*/Y`
+`Y` is composed of `X`
-### `#_`
-`x` number of `y`
+### `X\Y`
+`Y` is subject to the conditions `X`
-### `*`
-`y` composed of `x`
+## `X?/Y`
+`Y` exists according to/in the perspective of `*X`
-### `\`
-`y` subject to the conditions `x`
+# other operators
+the following operators evaluate as defined:
-### `@`
-the result of the application of the lambda `y` to the argument `x`. see § lambdas.
+### `X@Y`
+the result of the application of the lambda `Y` to the argument `X`. see § lambdas.
-### `@,`
-a list containing the list `y`'s values with the lambda `x` applied to them, in order.
+### `X@,Y`
+a list containing the list `Y`'s values with the lambda `X` applied to them, in order.
-### `@*`
-all results of the lambda `y` applied to each instance of `x`
+### `X@/Y`
+all results of the lambda `Y` applied to each instance of `X`
-### `,`
-a list containing `x` followed by the elements of list `y`
+### `X,Y`
+a list containing `X` followed by the elements of list `Y`
-## unary operators
-the unary operators, when used, evaluate to their definitions below.
+### `X&Y`
+`X` and `Y`
-the operand to the unary operator is denoted as `x` in these defintions. `*_x` is to be interpred as "(an) instance(s) of `x`".
+### `X^Y`
+`X` xor `Y`
-### `*_`
-some specific instance(s) of `x`
+### `X|Y`
+`X` and/or `Y`
-### `*:`
-all instances of `x`
+### `*X`
+some specific instance(s) of `X`
-### `&_`
-`y` where `x` is an instance of `y`; *such that* `&_*_x` *is equivalent to* `x`
+### `*:X`
+all instances of `X`
-### `!`
-nothing that is `x` or `*_x`
+### `&:X`
+the category which `X` identifies member(s) of; *such that* `&:*X` *is equivalent to* `X`
-### `!!:`
-`x`; *this operator emphasizes* `x` *in the sentence*
+### `!X`
+nothing that is `X` or `*X`
-### `?:`
-a hypothetical/possible `x`
+### `!!:X`
+`X`; *this operator emphasizes* `X` *in the sentence*
-### `?/`
-the truth value of the statetment "there exists `x`"
+### `?:X`
+the truth value of the statetment "there exists `X`"
-### `#`
-the amount of `x` which exist; *or, if* `x` *is a list*: the amount of items in list `x`
+### `?;X`
+a hypothetical/possible `X`
-### `&,`
-all of the elements of list `x`
+### `#X`
+the amount of `X` which exist; *or, if* `X` *is a list*: the amount of items in list `X`
-### `:_`
-`z`, as defined in the word list; *this operator is equivalent to* `x::=X`
+### `&,X`
+all of the elements of list `X`
-## clarification: the meaning of `*_x`
-the difference between `*_x` and `x` can be thought of like this: if `x` is "dog"/"dogs", then `*_x` is "some dogs" or "a dog". the difference becomes quite relevant when one performs definitions.
+## clarification: the meaning of `*X`
+the difference between `*X` and `X` can be thought of like this: if `X` is "dog"/"dogs", then `*X` is "some dogs" or "a dog". the difference becomes quite relevant when one performs definitions.
-if one makes the definition `X::=a`, then `X` is exactly the same thing as `a`. any usage of `X` would be identical to using `a`, which means that this definition wouldn't be very useful. instead, you can define `X` as an instance of `a` and then make statements about it, for instance `X::=*_a i>:X` would mean that `X` is a specific something, and that something is something you did.
+if one makes the definition `X::=a`, then `X` is exactly the same thing as `a`. any usage of `X` would be identical to using `a`, which means that this definition wouldn't be very useful. instead, you can define `X` as an instance of `a` and then make statements about it, for instance `X::=*a i>:X` would mean that `X` is a specific something, and that something is something you did.