# ISA

[Execution Layer](/fhe-computer/architectural-layers/execution-layer.md) functions as a multiprocessor, where the computational cores are represented by heterogeneous nodes, referred to as actors. These actors are heterogeneous because they may vary in two key aspects:&#x20;

* the subset of instructions they support
* the specific implementations they use for those

This design provides the flexibility to accommodate a wide range of actors with diverse computational capabilities, enabling scalability and specialization.

The Instruction Set Architecture (ISA) of the FHE Computer defines a canonical set of instructions supported by Execution Layer. The instructions are the part of an executable program, stored on [Application Layer](/fhe-computer/architectural-layers/application-layer.md) and executed on Execution Layer. Actors in the FHE Computer can implement arbitrary subset of instructions.&#x20;

This approach allows specialization; for instance, some actors may focus exclusively on specific operations, such as encrypted arithmetic for a particular FHE scheme, while others may implement more general-purpose functionality. Importantly, the system guarantees that, for every instruction in the canonical instruction set, there is at least one actor capable of executing it at any given time.

To support this heterogeneous and extensible model, the ISA adopts a declarative approach. Inspired by the [MLIR](https://mlir.llvm.org), instructions are organized into logical groups called dialects, which categorize operations based on their purpose and domain. Each instruction specifies its required inputs and expected outputs but does not prescribe the exact implementation. This abstraction allows actors to optimize execution based on their capabilities while adhering to a standardized interface.

The instruction set is modularly organized into dialects, ensuring clarity, extensibility, and specialization. Each dialect groups a set of related instructions, facilitating straightforward management and seamless extension. Dialects are hierarchically structured, allowing sub-dialects to be nested within parent dialects. This approach supports fine-grained categorization and flexibility in defining operations across various computational domains.

There are 4 top level dialects:&#x20;

* **arith**
* **tensor**
* **fhe**
* **polycircuit**

{% hint style="info" %}
Full list of instructions can be found in [Whitepaper](https://github.com/fairmath/research/blob/main/Decentralized%20FHE%20Computer.pdf).
{% endhint %}

For instance, the top level `fhe` dialect includes sub-dialects such as `fhe.bgv` and `fhe.ckks` which define instructions specific to the BGV and CKKS encryption schemes, respectively. At the meantime `fhe` dialect defines unified data types, such as `RLWECiphertext`, `RLWEPlaintext` that shared across sub-dialects. While different encryption schemes may utilize different encoding techniques, we would like to provide some universal layer for FHE schemes based on the same math problem, like (R)LWE. T


---

# 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.fairmath.xyz/fhe-computer/isa.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.
