
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
The maximum value of the function $f(x) = A \sin(\omega x - \frac{\pi}{6}) + 1$ $(A > 0, \omega > 0)$ is $3$, and the distance between adjacent symmetry axes of its graph is $\frac{\pi}{2}$.
(1) Find the analytical expression of the function $f(x)$ and its monotonically decreasing interval when $x \in [0, \pi]$;
(2) Given $a \in (0, \frac{\pi}{2})$, if $f(\frac{a}{2}) = 2$, find the value of $a$.

Present the answer in LaTex format: \boxed{Your answer}
user