From 2dee3e291a6bdfe7be46e82470194f015fa027d7 Mon Sep 17 00:00:00 2001 From: the lemons Date: Fri, 28 Apr 2023 14:13:47 -0500 Subject: revise relation operator semantics --- readme.md | 185 +++++++++++++++++++++++++++++++------------------------------- 1 file 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: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. -- cgit v1.2.3