# Rule Language (RuLA)

- [What is RuLa?](https://docs.atfinity.io/rule-language/what-is-the-rule-language.md)
- [Declarations](https://docs.atfinity.io/rule-language/declarations.md)
- [is](https://docs.atfinity.io/rule-language/declarations/is-ontology-role.md)
- [is with where](https://docs.atfinity.io/rule-language/declarations/is-with-where.md)
- [is all](https://docs.atfinity.io/rule-language/declarations/is-all-ontology-role.md)
- [is all with min max](https://docs.atfinity.io/rule-language/declarations/is-all-with-min-max.md)
- [Role Choices](https://docs.atfinity.io/rule-language/declarations/role-choices.md)
- [Expressions](https://docs.atfinity.io/rule-language/expressions.md)
- [Variables](https://docs.atfinity.io/rule-language/variables.md)
- [Types and Data Structures](https://docs.atfinity.io/rule-language/data-types.md)
- [Strings](https://docs.atfinity.io/rule-language/data-types/strings.md)
- [Numbers](https://docs.atfinity.io/rule-language/data-types/numbers.md)
- [Lists](https://docs.atfinity.io/rule-language/data-types/lists.md)
- [Dictionaries](https://docs.atfinity.io/rule-language/data-types/dictionaries.md)
- [Operators](https://docs.atfinity.io/rule-language/operators.md)
- [Boolean Operators](https://docs.atfinity.io/rule-language/operators/boolean-operators.md)
- [=](https://docs.atfinity.io/rule-language/operators/boolean-operators/equal.md)
- [!=](https://docs.atfinity.io/rule-language/operators/boolean-operators/not-equal.md)
- [>](https://docs.atfinity.io/rule-language/operators/boolean-operators/greater-than.md)
- [>=](https://docs.atfinity.io/rule-language/operators/boolean-operators/greater-than-or-equal.md)
- [<](https://docs.atfinity.io/rule-language/operators/boolean-operators/less-than.md)
- [<=](https://docs.atfinity.io/rule-language/operators/boolean-operators/less-than-or-equal.md)
- [and](https://docs.atfinity.io/rule-language/operators/boolean-operators/and.md)
- [and then](https://docs.atfinity.io/rule-language/operators/boolean-operators/and-then.md)
- [not](https://docs.atfinity.io/rule-language/operators/boolean-operators/not.md)
- [or](https://docs.atfinity.io/rule-language/operators/boolean-operators/or.md)
- [or else](https://docs.atfinity.io/rule-language/operators/boolean-operators/or-else.md)
- [matches (~=)](https://docs.atfinity.io/rule-language/operators/boolean-operators/matches.md)
- [Date Operators](https://docs.atfinity.io/rule-language/operators/date-operators.md)
- [NOW](https://docs.atfinity.io/rule-language/operators/date-operators/now.md)
- [TODAY](https://docs.atfinity.io/rule-language/operators/date-operators/today.md)
- [IS\_DATE](https://docs.atfinity.io/rule-language/operators/date-operators/is_date.md)
- [FORMAT\_DATE](https://docs.atfinity.io/rule-language/operators/date-operators/format_date.md)
- [FORMAT\_DATETIME](https://docs.atfinity.io/rule-language/operators/date-operators/format_datetime.md)
- [DAYS](https://docs.atfinity.io/rule-language/operators/date-operators/days.md)
- [WEEKDAYS](https://docs.atfinity.io/rule-language/operators/date-operators/weekdays.md)
- [DAYS\_BETWEEN](https://docs.atfinity.io/rule-language/operators/date-operators/days_between.md)
- [HOURS\_BETWEEN](https://docs.atfinity.io/rule-language/operators/date-operators/hours_between.md)
- [DAYS\_SPENT\_IN\_STATE](https://docs.atfinity.io/rule-language/operators/date-operators/days_spent_in_state.md)
- [HOURS\_SPENT\_IN\_STATE](https://docs.atfinity.io/rule-language/operators/date-operators/hours_spent_in_state.md)
- [ADD\_DAYS](https://docs.atfinity.io/rule-language/operators/date-operators/add_days.md)
- [ADD\_WEEKDAYS](https://docs.atfinity.io/rule-language/operators/date-operators/add_weekdays.md)
- [ADD\_MONTHS](https://docs.atfinity.io/rule-language/operators/date-operators/add_months.md)
- [ADD\_YEARS](https://docs.atfinity.io/rule-language/operators/date-operators/add_years-3.md)
- [SUBTRACT\_YEARS](https://docs.atfinity.io/rule-language/operators/date-operators/subtract_years.md)
- [AFTER](https://docs.atfinity.io/rule-language/operators/date-operators/after.md)
- [AFTER\_EQUAL](https://docs.atfinity.io/rule-language/operators/date-operators/after_equal.md)
- [BEFORE](https://docs.atfinity.io/rule-language/operators/date-operators/before.md)
- [BEFORE\_EQUAL](https://docs.atfinity.io/rule-language/operators/date-operators/before_equal.md)
- [DATE\_EQUAL](https://docs.atfinity.io/rule-language/operators/date-operators/date_equal.md)
- [DATETIME\_EQUAL](https://docs.atfinity.io/rule-language/operators/date-operators/datetime_equal.md)
- [DAYS\_AGO](https://docs.atfinity.io/rule-language/operators/date-operators/days_ago.md)
- [MONTHS\_AGO](https://docs.atfinity.io/rule-language/operators/date-operators/months_ago.md)
- [YEARS\_AGO](https://docs.atfinity.io/rule-language/operators/date-operators/years-ago.md)
- [QUARTER\_OF](https://docs.atfinity.io/rule-language/operators/date-operators/quarter_of.md)
- [IS\_WEEKEND](https://docs.atfinity.io/rule-language/operators/date-operators/is_weekend.md)
- [IS\_WEEKDAY](https://docs.atfinity.io/rule-language/operators/date-operators/is_weekday.md)
- [Known Operators](https://docs.atfinity.io/rule-language/operators/unknown-operators.md)
- [unknown](https://docs.atfinity.io/rule-language/operators/unknown-operators/unknown.md)
- [known](https://docs.atfinity.io/rule-language/operators/unknown-operators/not-unknown.md)
- [SNEAKY](https://docs.atfinity.io/rule-language/operators/unknown-operators/sneaky.md)
- [AVG\_OF\_ANY](https://docs.atfinity.io/rule-language/operators/unknown-operators/avg_of_any.md)
- [LIST\_OF\_ANY](https://docs.atfinity.io/rule-language/operators/unknown-operators/list_of_any.md)
- [MAX\_OF\_ANY](https://docs.atfinity.io/rule-language/operators/unknown-operators/max_of_any.md)
- [MIN\_OF\_ANY](https://docs.atfinity.io/rule-language/operators/unknown-operators/min_of_any.md)
- [SUM\_OF\_ANY](https://docs.atfinity.io/rule-language/operators/unknown-operators/sum_of_any.md)
- [CONCAT\_OF\_ANY](https://docs.atfinity.io/rule-language/operators/unknown-operators/concat_of_any.md)
- [UNION\_OF\_ANY](https://docs.atfinity.io/rule-language/operators/unknown-operators/union_of_any.md)
- [JOIN\_OF\_ANY](https://docs.atfinity.io/rule-language/operators/unknown-operators/join_of_any.md)
- [List Operators](https://docs.atfinity.io/rule-language/operators/list-operators.md)
- [\[ , \] (create)](https://docs.atfinity.io/rule-language/operators/list-operators/list.md)
- [\[\] (access)](https://docs.atfinity.io/rule-language/operators/list-operators/access.md)
- [in](https://docs.atfinity.io/rule-language/operators/list-operators/in.md)
- [not in](https://docs.atfinity.io/rule-language/operators/list-operators/not-in.md)
- [contains](https://docs.atfinity.io/rule-language/operators/list-operators/contains.md)
- [contains any](https://docs.atfinity.io/rule-language/operators/list-operators/contains-any.md)
- [contains only](https://docs.atfinity.io/rule-language/operators/list-operators/contains-only.md)
- [COUNT](https://docs.atfinity.io/rule-language/operators/list-operators/count.md)
- [SORT](https://docs.atfinity.io/rule-language/operators/list-operators/sort.md)
- [CUSTOM\_MAX](https://docs.atfinity.io/rule-language/operators/list-operators/custom_max.md)
- [REVERSE](https://docs.atfinity.io/rule-language/operators/list-operators/reverse.md)
- [FIRST\_ELEMENT](https://docs.atfinity.io/rule-language/operators/list-operators/first_element.md)
- [LAST\_ELEMENT](https://docs.atfinity.io/rule-language/operators/list-operators/last_element.md)
- [ALL](https://docs.atfinity.io/rule-language/operators/list-operators/all.md)
- [ANY](https://docs.atfinity.io/rule-language/operators/list-operators/any.md)
- [SOME](https://docs.atfinity.io/rule-language/operators/list-operators/some.md)
- [FLATTEN](https://docs.atfinity.io/rule-language/operators/list-operators/flatten.md)
- [UNION (or |)](https://docs.atfinity.io/rule-language/operators/list-operators/union.md)
- [SET\_DIFFERENCE](https://docs.atfinity.io/rule-language/operators/list-operators/set_difference.md)
- [INTERSECTION](https://docs.atfinity.io/rule-language/operators/list-operators/intersection.md)
- [map()](https://docs.atfinity.io/rule-language/operators/list-operators/map.md)
- [MAP](https://docs.atfinity.io/rule-language/operators/list-operators/map-1.md)
- [filter()](https://docs.atfinity.io/rule-language/operators/list-operators/filter.md)
- [FILTER](https://docs.atfinity.io/rule-language/operators/list-operators/filter-1.md)
- [FILTER\_FALSE](https://docs.atfinity.io/rule-language/operators/list-operators/filter_false.md)
- [FILTER\_UNKNOWN](https://docs.atfinity.io/rule-language/operators/list-operators/filter_unknown.md)
- [SET](https://docs.atfinity.io/rule-language/operators/list-operators/set.md)
- [INDEX\_OF](https://docs.atfinity.io/rule-language/operators/list-operators/index_of.md)
- [APPEND](https://docs.atfinity.io/rule-language/operators/list-operators/append.md)
- [Dictionary Operators](https://docs.atfinity.io/rule-language/operators/dictionary-operators.md)
- [{} (create)](https://docs.atfinity.io/rule-language/operators/dictionary-operators/create.md)
- [Dictionary shorthand](https://docs.atfinity.io/rule-language/operators/dictionary-operators/shorthand.md)
- [\[\] (access)](https://docs.atfinity.io/rule-language/operators/dictionary-operators/access.md)
- [in](https://docs.atfinity.io/rule-language/operators/dictionary-operators/in.md)
- [keys()](https://docs.atfinity.io/rule-language/operators/dictionary-operators/in-1.md)
- [FLATTEN](https://docs.atfinity.io/rule-language/operators/dictionary-operators/in-2.md)
- [to\_dict](https://docs.atfinity.io/rule-language/operators/dictionary-operators/to_dict.md)
- [pick](https://docs.atfinity.io/rule-language/operators/dictionary-operators/pick.md)
- [merge\_dicts (or |)](https://docs.atfinity.io/rule-language/operators/dictionary-operators/merge_dicts.md)
- [Mathematical Operators](https://docs.atfinity.io/rule-language/operators/mathematical-operators.md)
- [+ - / \*](https://docs.atfinity.io/rule-language/operators/mathematical-operators/+.md)
- [%](https://docs.atfinity.io/rule-language/operators/mathematical-operators/+-1.md)
- [\*\*](https://docs.atfinity.io/rule-language/operators/mathematical-operators/+-2.md)
- [//](https://docs.atfinity.io/rule-language/operators/mathematical-operators/+-3.md)
- [AVG](https://docs.atfinity.io/rule-language/operators/mathematical-operators/avg.md)
- [CEIL](https://docs.atfinity.io/rule-language/operators/mathematical-operators/ceil.md)
- [COMB](https://docs.atfinity.io/rule-language/operators/mathematical-operators/comb.md)
- [FLOOR](https://docs.atfinity.io/rule-language/operators/mathematical-operators/floor.md)
- [MAX](https://docs.atfinity.io/rule-language/operators/mathematical-operators/max.md)
- [MIN](https://docs.atfinity.io/rule-language/operators/mathematical-operators/min.md)
- [ROUND](https://docs.atfinity.io/rule-language/operators/mathematical-operators/round.md)
- [ABS](https://docs.atfinity.io/rule-language/operators/mathematical-operators/abs.md)
- [SIGN](https://docs.atfinity.io/rule-language/operators/mathematical-operators/sign.md)
- [SQRT](https://docs.atfinity.io/rule-language/operators/mathematical-operators/sqrt.md)
- [SUM](https://docs.atfinity.io/rule-language/operators/mathematical-operators/sum.md)
- [SUM\_PRODUCT](https://docs.atfinity.io/rule-language/operators/mathematical-operators/sum_product.md)
- [CLAMP](https://docs.atfinity.io/rule-language/operators/mathematical-operators/clamp.md)
- [String Operators](https://docs.atfinity.io/rule-language/operators/string-operators.md)
- [LEN](https://docs.atfinity.io/rule-language/operators/string-operators/len.md)
- [LOWER](https://docs.atfinity.io/rule-language/operators/string-operators/lower.md)
- [UPPER](https://docs.atfinity.io/rule-language/operators/string-operators/upper.md)
- [TRIM](https://docs.atfinity.io/rule-language/operators/string-operators/trim.md)
- [TRIM\_LEFT](https://docs.atfinity.io/rule-language/operators/string-operators/trim_left.md)
- [LEFT](https://docs.atfinity.io/rule-language/operators/string-operators/left.md)
- [RIGHT](https://docs.atfinity.io/rule-language/operators/string-operators/right.md)
- [LEVENSHTEIN](https://docs.atfinity.io/rule-language/operators/string-operators/levenshtein.md)
- [SLICE](https://docs.atfinity.io/rule-language/operators/string-operators/slice.md)
- [REPLACE](https://docs.atfinity.io/rule-language/operators/string-operators/replace.md)
- [REPLACE\_CHARS](https://docs.atfinity.io/rule-language/operators/string-operators/replace_chars.md)
- [STRING\_TO\_JSON](https://docs.atfinity.io/rule-language/operators/string-operators/string_to_json.md)
- [TRANSLATE\_STRING](https://docs.atfinity.io/rule-language/operators/string-operators/translate_string.md)
- [format](https://docs.atfinity.io/rule-language/operators/string-operators/format.md)
- [calculated\_name](https://docs.atfinity.io/rule-language/operators/string-operators/calculated_name.md)
- [CONCAT](https://docs.atfinity.io/rule-language/operators/string-operators/concat.md)
- [markdown\_table](https://docs.atfinity.io/rule-language/operators/string-operators/markdown_table.md)
- [make\_filename](https://docs.atfinity.io/rule-language/operators/string-operators/make_filename.md)
- [JOIN](https://docs.atfinity.io/rule-language/operators/string-operators/join.md)
- [uuid](https://docs.atfinity.io/rule-language/operators/string-operators/uuid.md)
- [SPLIT](https://docs.atfinity.io/rule-language/operators/string-operators/split.md)
- [PAD\_LEFT](https://docs.atfinity.io/rule-language/operators/string-operators/pad_left.md)
- [PAD\_RIGHT](https://docs.atfinity.io/rule-language/operators/string-operators/pad_right.md)
- [STARTS\_WITH](https://docs.atfinity.io/rule-language/operators/string-operators/starts_with.md)
- [ENDS\_WITH](https://docs.atfinity.io/rule-language/operators/string-operators/ends_with.md)
- [FORMAT\_NUMBER](https://docs.atfinity.io/rule-language/operators/string-operators/format_number.md)
- [Special Operators](https://docs.atfinity.io/rule-language/operators/special-operators.md)
- [:=](https://docs.atfinity.io/rule-language/operators/special-operators/assign.md)
- [ensure](https://docs.atfinity.io/rule-language/operators/special-operators/ensure.md)
- [get\_attr](https://docs.atfinity.io/rule-language/operators/special-operators/get_attr.md)
- [GET\_TRANSLATED\_ATTR](https://docs.atfinity.io/rule-language/operators/special-operators/get_translated_attr.md)
- [has\_attr](https://docs.atfinity.io/rule-language/operators/special-operators/has_attr.md)
- [get\_properties](https://docs.atfinity.io/rule-language/operators/special-operators/get-properties-from-instances.md)
- [instances](https://docs.atfinity.io/rule-language/operators/special-operators/instances.md)
- [instances\_exist](https://docs.atfinity.io/rule-language/operators/special-operators/instances_exist.md)
- [is](https://docs.atfinity.io/rule-language/operators/special-operators/is.md)
- [ontology](https://docs.atfinity.io/rule-language/operators/special-operators/ontology.md)
- [Translate (.$)](https://docs.atfinity.io/rule-language/operators/special-operators/translate.md)
- [translate\_string](https://docs.atfinity.io/rule-language/operators/special-operators/translate-1.md)
- [roles](https://docs.atfinity.io/rule-language/operators/special-operators/roles.md)
- [self](https://docs.atfinity.io/rule-language/operators/special-operators/self.md)
- [IS\_UNIQUE\_NAME](https://docs.atfinity.io/rule-language/operators/special-operators/is_unique_name.md)
- [NAME\_AND\_LOG](https://docs.atfinity.io/rule-language/operators/special-operators/name_and_log.md)
- [PICK\_OR\_DEFAULT](https://docs.atfinity.io/rule-language/operators/special-operators/pick_or_default.md)
- [PRETTY\_PRINT](https://docs.atfinity.io/rule-language/operators/special-operators/pretty_print.md)
- [IBAN\_VALID](https://docs.atfinity.io/rule-language/operators/special-operators/iban_valid.md)
- [PHONE\_VALID](https://docs.atfinity.io/rule-language/operators/special-operators/phone_valid.md)
- [COUNTRY\_TO\_ALPHA3](https://docs.atfinity.io/rule-language/operators/special-operators/country_to_alpha3.md)
- [COUNTRY\_TO\_ALPHA2](https://docs.atfinity.io/rule-language/operators/special-operators/country_to_alpha2.md)
- [COUNTRY\_TO\_PHONE\_PREFIX](https://docs.atfinity.io/rule-language/operators/special-operators/country_to_phone_prefix.md)
- [Conditional Expressions](https://docs.atfinity.io/rule-language/conditional-expressions.md)
- [case](https://docs.atfinity.io/rule-language/conditional-expressions/case-when-end.md)
- [if-then-else](https://docs.atfinity.io/rule-language/conditional-expressions/if-...-then-...-else-...-end.md)
- [switch](https://docs.atfinity.io/rule-language/conditional-expressions/switch-expression.md)
- [Comments](https://docs.atfinity.io/rule-language/comments.md)
- [Documents](https://docs.atfinity.io/rule-language/documents.md)
- [Global Constants](https://docs.atfinity.io/rule-language/global-constants.md)
- [CASE](https://docs.atfinity.io/rule-language/global-constants/case-constant.md)
- [OUTCOME\_INSTANCE](https://docs.atfinity.io/rule-language/global-constants/outcome-instance-constant.md)
- [Recipes](https://docs.atfinity.io/rule-language/recipes.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.atfinity.io/rule-language.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
