- Let
fbe a function thenforf(?)orf(x?)can be used to refer to the function itself whilef(x)refers to the output offapplied tox. - The above is needed so that
? \.natural.+./ ?refers to the operator itself whilex \.natural.+./ yrefers to the output of the operator. - Otherwise, if
*is an operator in scope then"*"and? * ?both refers to the operator itself. :=is used to define things. Only:=is needed and not:=,:==, and:-as was previously thought because what the:=refers to is determined from the context. Only:=is provided, to make it easier for people to write text.- A
specifies:orwhere:can have any:=except things of the formf(x) := ...that should be in asatisfying:. - A
when:can have a:=only if it is of the formx... := y...,x := y. That is, it cannot containf(x) := ...or expressions likex := \realorx := 1 + \sin(y). - An item of the form
f(x)specifies a function - An item of the form
f[x, y]specifies thatfis an expression that depends on the symbolsxandy :->and:=>items are needed to specify if an alias represents a specification alias or an expression alias because it cannot be determined from context. This is becausex is \somethingcan be a predicate or a type description.- In
written:only symbols in aDescribes:orDefines:section can be referenced. Not symbols that are inputs to the Describes or Defines. - In IDs: The form
x{i := 1...n},x...andx{i := 1...}(as well asx{(i,j) := (1,1) ... (m,n)}etc.) specifies thatxis variadic with indexior (i,jin the other example). This is similar to howf(x)specifiesfis functional withxrepresenting the input symbol. This form is not allowed in expressions. The index must start at 1 and making the 1 explicit makes the form more clear and is forward facing in case I want to support other starting indices. - In expressions:
x...orx{1...}orx{1...n}is used to specify the sequence of values of a variadic symbol. Thus one writesx... := y...orx{1...n} := y{1...n}. One cannot writex{2...(n-1)}(i.e. use a starting index other than 1 or an ending index other thannin places where:=andisis used. Though those can be used in computational places). - The index
iinx{i}cannot be specified asi is .... It is apositiveIntand the specification of what apositiveIntis inSpecify:positiveInt:is used to determine if a symbol can be usedjcan be used inx{j}. - The positiveInt symbols support using 1,2,... as starting indices and
-to subtract from ending indices. So one can writex{1...(n-1)}orx{2...n}. This is used, for example to recursively define\real.sum:of{x{i := 1...n}}. - Variadic symbols do not support nesting. That is,
x{i{j}}is not supported. This is because I don't see a strong use case for this, but will reconsider in the future if one comes up. - Double check this, but perhaps a positiveInt symbol can only be used in a
matchingconstruct and not anif:then:elseconstruct since positiveInts are special symbols that the system knows has arithmetic. - A signature takes into account the number of arguments and whether a group is curly parens, round parens, or uses square parens. Also,
[]{}forms cannot appear by themselves in expressions. Thus\f[x]{x + 1}and\g[x]{x : x is \real}are possible but\f{x |-> x + 1}and\g{[x]{x : x is \real}}is not allowed. Thus signatures are of the form\a.b.c{2}:x{3}:y[2]{:}:z[2]{:|}:w[2]{|}:a[2]{-}where[]{:|}describes a[]{x : x | x}form[]{:}describes a[]{x : x}form[]{|}describes a[]{x | x}form and[]{-}describes a[x]{x}form. "..."is used for shortcuts for example"ra" == "real.analysis". Then one can write\"ra".continuous.functioninstead of\real.analysis.continuous.function. Note that if one writes\"a.b.c"that is the equivalent of\"a"."b"."c".