# Abstract syntax Tree & Symbolic Execution

## The Algorithm

{% hint style="success" %}

* Create a process (pc = 0, state = \[])
* Add the process (pc, state) to the domain system D
* While D not empty:
  * Remove process (pc, state) from system
  * Execute it until the next <mark style="color:blue;">branching point</mark> (điểm nhánh)
  * If both paths are <mark style="color:blue;">feasible</mark> (khả thi):
    * add both to D
  * if just one is feasible:
    * add the feasible path to D
    * add the negation of the not feasible path to D
      {% endhint %}

## Considerations

{% hint style="success" %}

* Loops
* conditional branches
* Nonlinear control flow
* Environment interaction
* Dynamic memory allocation
  {% endhint %}

{% hint style="info" %}
Tại sao lại là SymExec?

* Làm thế nào để kích hoạt path X hoặc condition Y? Tình huống: là tôi tìm thấy một lỗi, tôi có thể gây ra nó theo cách thủ công không? Làm như thế nào? Need: xác định path và những điều kiện nào về khả năng tiếp cận lỗi.
* SymExec: theo dõi tất cả các ràng buộc và giải quyết chúng \* chuyển đổi từ một tập hợp các ràng buộc thành các giá trị mà chúng tôi có thể sử dụng để gây ra lỗi.
  {% endhint %}


---

# 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://viettaliii.gitbook.io/home/education/reverse-engineering/symbolic-analysis/angr-and-symbolic-execution/abstract-syntax-tree-and-symbolic-execution.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.
