Direct definition (operator): Difference between revisions
m (Text replacement - "Direct definition (Iverson)" to "Direct definition (notation)") |
m (Marshall moved page Direct definition (NARS) to Direct definition (operator): Also appears in Iverson publications) |
(No difference)
|
Revision as of 02:01, 8 March 2024
- The Del glyph
∇
is more commonly used for dfn recursion or to indicate a defined function.
∇
|
Direct definition (∇
), in NARS, is a primitive dyadic operator that defines an anonymous function based on source strings. Its left operand is the source for the function's dyadic case and the right is the source for the monadic case. One of these operands may be replaced with a Jot (using this operator as an operand as with Outer Product) to indicate an undefined case and create a strictly monadic or dyadic function.
The format of a source string is similar to that used in Iverson's direct definition, with several small differences. Multiple expressions can be used if separated by ⋄
. ⍺
and ⍵
indicate the left and right arguments, and _
is added to indicate recursion. Conditions are still indicated with colons :
, but the mechanism is extended: rather than a boolean condition placed between false and true cases, it's placed first, and returns a scalar or vector of natural numbers. Each number indicates one of the following groups of statements (separated by further :
s and numbered starting at 0), and these groups will then be evaluated, with the result of the last evaluated expression returned from the function as a whole.
External links