
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
In the Cartesian coordinate system $xOy$, it is known that the line $l_1$ is defined by the parametric equations $\begin{cases}x=t\cos \alpha\\y=t\sin \alpha\end{cases}$ (where $t$ is the parameter), and the line $l_2$ by $\begin{cases}x=t\cos(\alpha + \frac{\pi}{4})\\y=t\sin(\alpha + \frac{\pi}{4})\end{cases}$ (where $t$ is the parameter), with $\alpha\in(0, \frac{3\pi}{4})$. Taking the point $O$ as the pole and the non-negative $x$-axis as the polar axis, a polar coordinate system is established with the same length unit. The polar equation of curve $C$ is $\rho-4\cos \theta=0$.

$(1)$ Write the polar equations of $l_1$, $l_2$ and the rectangular coordinate equation of curve $C$.

$(2)$ Suppose $l_1$ and $l_2$ intersect curve $C$ at points $A$ and $B$ (excluding the coordinate origin), calculate the value of $|AB|$.

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