
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
Given the parametric equations of line $l$ as $\begin{cases} x=-1-\frac{\sqrt{2}}{2}t \\ y=1+\frac{\sqrt{2}}{2}t \end{cases}$ ($t$ is the parameter), the pole is at the coordinate origin, and the positive $x$-axis is the polar axis. Establish a polar coordinate system. The polar equation of curve $C$ is $\rho =4\sin \theta$.

(1) Write the Cartesian equation of line $l$ and curve $C$;

(2) If line $l$ intersects curve $C$ at points $A$ and $B$, find the length of segment $AB$.

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