ATOMIC AI MATHEMATICS AND RANDOM SPEC RULE: This document defines the complete and binding mathematics, arithmetic, and randomness system of the Atomic language. RULE: Only the functions listed in this document exist. RULE: No additional mathematical or random functions exist. RULE: All rules defined here are mandatory. GENERAL MATHEMATICAL RULES RULE: Mathematical expressions follow standard mathematical operator precedence. RULE: Decimal numbers are supported. RULE: Mathematical operations may appear inside expressions. RULE: All mathematical functions listed in this document return a value. RULE: Returned values must be stored in a variable. RULE: Mathematical functions cannot be used inside arguments of other functions. RULE: Angles are expressed in degrees. RULE: Symbolic mathematical function syntax is FORBIDDEN. RULE: The use of sin(), cos(), tan(), log(), sqrt(), or similar symbolic forms is FORBIDDEN. RULE: Mathematical functions do not exist unless explicitly defined as "ottieni" functions. RULE: Mathematical functions are FORBIDDEN inside expressions, arguments, or text. RULE: The result of any mathematical function must be obtained via an "ottieni" function and stored in a variable before being used. RULE: Any inference, generation, or use of symbolic mathematical functions is FORBIDDEN. ARITHMETIC OPERATORS RULE: Atomic supports standard arithmetic operators. RULE: The following arithmetic operators exist: + addition - subtraction * multiplication / division ^ exponentiation RULE: Arithmetic operators work on numeric values. RULE: Decimal numbers are supported. ORDER OF OPERATIONS RULE: Expressions follow standard mathematical precedence rules. RULE: The order of evaluation is: 1. Parentheses ( ) 2. Exponentiation (^) 3. Multiplication (*) and Division (/) 4. Addition (+) and Subtraction (-) RULE: Operators with the same precedence level are evaluated from left to right. RULE: Parentheses may be nested. RULE: Parentheses override the default order of operations. EXPRESSION RULES RULE: Arithmetic expressions may be assigned to variables. RULE: Arithmetic expressions may be used inside conditions. RULE: Arithmetic expressions may combine: numeric literals variables constants arithmetic operators parentheses RULE: Function calls cannot appear inside arithmetic expressions. VECTOR COMPONENTS nome_variabile = ottieni la componente x del vettore dato angolo e lunghezza --> (ANGOLO:) (LUNGHEZZA:) RULE: This function returns the X component of a vector. nome_variabile = ottieni la componente y del vettore dato angolo e lunghezza --> (ANGOLO:) (LUNGHEZZA:) RULE: This function returns the Y component of a vector. ROUNDING AND NUMERIC TRANSFORMATION nome_variabile = ottieni l'arrotondamento per difetto di --> (VALORE:) RULE: This function returns the value rounded down. nome_variabile = ottieni il valore intero di --> (VALORE:) RULE: This function returns the integer part of the value. nome_variabile = ottieni il valore decimale di --> (VALORE:) RULE: This function returns the decimal part of the value. nome_variabile = ottieni il valore assoluto di --> (VALORE:) RULE: This function returns the absolute value. nome_variabile = ottieni il segno di --> (VALORE:) RULE: This function returns the sign of the value. LOGARITHMS AND ROOTS nome_variabile = ottieni il logaritmo naturale di --> (VALORE:) RULE: This function returns the natural logarithm. nome_variabile = ottieni il logaritmo in base 2 di --> (VALORE:) RULE: This function returns the base-2 logarithm. nome_variabile = ottieni il logaritmo in base 10 di --> (VALORE:) RULE: This function returns the base-10 logarithm. nome_variabile = ottieni il logaritmo in base n di --> (VALORE:) (BASE:) RULE: This function returns the logarithm using the specified base. nome_variabile = ottieni la radice quadrata di --> (VALORE:) RULE: This function returns the square root. TRIGONOMETRY nome_variabile = ottieni il seno di --> (VALORE:) RULE: This function returns the sine of the angle. nome_variabile = ottieni il coseno di --> (VALORE:) RULE: This function returns the cosine of the angle. nome_variabile = ottieni la tangente di --> (VALORE:) RULE: This function returns the tangent of the angle. POWER AND MODULAR OPERATIONS nome_variabile = ottieni potenza modulare di --> (VALORE:) RULE: This function exists as defined. nome_variabile = ottieni potenza modulare di--> (VALORE:) (ESPONENTE:) (DIVISORE:) RULE: This function returns the modular exponentiation result. AGGREGATION AND INTERPOLATION nome_variabile = ottieni il massimo tra --> (VALORE 1:) (VALORE 2:) (VALORE 3:) (VALORE 4:) (VALORE 5:) (VALORE 6:) (VALORE 7:) (VALORE 8:) RULE: This function returns the maximum value. nome_variabile = ottieni la media tra --> (VALORE 1:) (VALORE 2:) (VALORE 3:) (VALORE 4:) (VALORE 5:) (VALORE 6:) (VALORE 7:) (VALORE 8:) RULE: This function returns the average value. nome_variabile = ottieni l'interpolazione linerare tra --> (VALORE 1:) (VALORE 2:) (VALORE 3:) RULE: This function returns a linearly interpolated value. nome_variabile = ottieni il valore limitato della variabile tra --> (VALORE 1:) (VALORE 2:) (VARIABILE:) RULE: This function clamps the variable between the specified values. GEOMETRIC RELATIONSHIPS nome_variabile = ottieni distanza tra due punti --> (X 1:) (Y 1:) (X 2:) (Y 2:) RULE: This function returns the distance between two points. nome_variabile = ottieni direzione tra due punti --> (X 1:) (Y 1:) (X 2:) (Y 2:) RULE: This function returns the direction angle between two points. DIVISION OPERATIONS nome_variabile = ottieni il resto della divisione tra --> (DIVIDENDO:) (DIVISORE:) RULE: This function returns the remainder of the division. nome_variabile = ottieni il quoziente della divisione tra --> (DIVIDENDO:) (DIVISORE:) RULE: This function returns the quotient of the division. RANDOM FUNCTIONS nome_variabile = ottieni uno a caso di questi valori --> (VALORE 1:) (VALORE 2:) (VALORE 3:) (VALORE 4:) (VALORE 5:) (VALORE 6:) (VALORE 7:) (VALORE 8:) RULE: This function returns one randomly selected value. nome_variabile = ottieni un valore compreso tra questi --> (VALORE 1:) (VALORE 2:) RULE: This function returns a random numeric value within the range. nome_variabile = ottieni un valore intero compreso tra questi --> (VALORE 1:) (VALORE 2:) RULE: This function returns a random integer within the range. MATHS FUNCTIONS nome_variabile = ottieni la componente x del vettore dato angolo e lunghezza --> (ANGOLO:) (LUNGHEZZA:) nome_variabile = ottieni la componente y del vettore dato angolo e lunghezza --> (ANGOLO:) (LUNGHEZZA:) nome_variabile = ottieni l'arrotondamento per difetto di --> (VALORE:) nome_variabile = ottieni potenza modulare di --> (VALORE:) nome_variabile = ottieni il valore intero di --> (VALORE:) nome_variabile = ottieni il valore decimale di --> (VALORE:) nome_variabile = ottieni il valore assoluto di --> (VALORE:) nome_variabile = ottieni il segno di --> (VALORE:) nome_variabile = ottieni il logaritmo naturale di --> (VALORE:) nome_variabile = ottieni il logaritmo in base 2 di --> (VALORE:) nome_variabile = ottieni il logaritmo in base 10 di --> (VALORE:) nome_variabile = ottieni il logaritmo in base n di --> (VALORE:) (BASE:) nome_variabile = ottieni la radice quadrata di --> (VALORE:) nome_variabile = ottieni il seno di --> (VALORE:) nome_variabile = ottieni il coseno di --> (VALORE:) nome_variabile = ottieni la tangente di --> (VALORE:) nome_variabile = ottieni potenza modulare di--> (VALORE:) (ESPONENTE:) (DIVISORE:) nome_variabile = ottieni il massimo tra --> (VALORE 1:) (VALORE 2:) (VALORE 3:) (VALORE 4:) (VALORE 5:) (VALORE 6:) (VALORE 7:) (VALORE 8:) nome_variabile = ottieni la media tra --> (VALORE 1:) (VALORE 2:) (VALORE 3:) (VALORE 4:) (VALORE 5:) (VALORE 6:) (VALORE 7:) (VALORE 8:) nome_variabile = ottieni l'interpolazione linerare tra --> (VALORE 1:) (VALORE 2:) (VALORE 3:) nome_variabile = ottieni il valore limitato della variabile tra --> (VALORE 1:) (VALORE 2:) (VARIABILE:) nome_variabile = ottieni distanza tra due punti --> (X 1:) (Y 1:) (X 2:) (Y 2:) nome_variabile = ottieni direzione tra due punti --> (X 1:) (Y 1:) (X 2:) (Y 2:) nome_variabile = ottieni il resto della divisione tra --> (DIVIDENDO:) (DIVISORE:) nome_variabile = ottieni il quoziente della divisione tra --> (DIVIDENDO:) (DIVISORE:) RANDOM FUNCTIONS nome_variabile = ottieni uno a caso di questi valori --> (VALORE 1:) (VALORE 2:) (VALORE 3:) (VALORE 4:) (VALORE 5:) (VALORE 6:) (VALORE 7:) (VALORE 8:) nome_variabile = ottieni un valore compreso tra questi --> (VALORE 1:) (VALORE 2:) nome_variabile = ottieni un valore intero compreso tra questi --> (VALORE 1:) (VALORE 2:) FORMAL CLOSURE RULE: The mathematics and randomness system of Atomic is limited to the functions listed in this document. RULE: Any mathematical or random function not listed here: does not exist must not be inferred must not be generated