# rule_expression · FT4 Rell API · Chromia Docs (concept)

> The expression of a single rule. Three statuses of the expression are of interest. We want to know whether a rule is: violated or valid; active or inactive

Source: https://docs.chromia.com/pages/ft4-rell/-f-t4-library/lib.ft4.core.accounts/rule_expression/

STRUCT

# rule\_expression

The expression of a single rule.

Three statuses of the expression are of interest. We want to know whether a rule is:

* violated or valid;
* active or inactive;
* expired or not.

A rule can be **violated**, which means that the given rule condition is currently false.

A rule can also be **inactive**, which means that the given rule condition has never been
true, but will be in the future.

The status of every possible rule expression can either:

* always be "active";
* trigger once, going from "inactive" to "active".

This gives us the definition of expired:
A rule is **expired** if it is both violated and active, meaning that it doesn't allow
the auth descriptor to be used and will never change state.

Examples:

| Rule | active | violated | expired |
| --- | --- | --- | --- |
| "time < 1000" | true | true | true |
| "time < 1e10" | true | false | false |
| "time > 1000" | true | false | false |
| "time > 1e10" | false | true | false |

```signature
struct rule_expression {
 operator: rule_operator;
 variable: rule_variable;
 value: integer;
}
```

`operator: rule_operator;`
:   The operator of the rule, e.g. "greater than"

`variable: rule_variable;`
:   The variable to check for validity, e.g. "timestamp"

`value: integer;`
:   The value the variable should be checked against, e.g. "1000"

[Source](https://gitlab.com/chromaway/ft4-lib/-/blob/development/rell/src/lib/ft4/core/accounts/auth_descriptor_rule_expression.rell#lines-55)

[View this page on docs.chromia.com](https://docs.chromia.com/pages/ft4-rell/-f-t4%20-library/lib.ft4.core.accounts/rule_expression/index.html)Generated API reference, mirrored from the live docs
