@staticmethod
def _fix_trace(trace: list, func: str, var: str):
    """
        The main goal here is to get rid of repetitive paths (not exactlly
        similar) but they "certinally" give the same solution.
        * There are still many more paths that must be detected and removed!
        path is 1-D list
        Rules:
            1- No repetition in two adjacent conected var
            2- if func == cv:
                crop the left side of the cv
            3- if var == cv:
                crop the right side of the cv
            4- once everything is cleand, remove redundent paths

        """
    npath = []
    ocv = None
    for b in range(0, len(trace) - 2, 2):
        l = trace[b]
        cv = trace[b + 1]
        r = trace[b + 2]
        if cv == func:
            if not npath:
                npath.append(r)
            else:
                break
        elif cv == var:
            if not npath:
                npath.append(l)
            else:
                npath[-1] = l
            break
        elif cv == ocv:
            npath[-1] = r
        elif cv != ocv:
            if npath and npath[-1] == l:
                npath += [cv, r]
            else:
                npath += [l, cv, r]
        ocv = cv
    if len(npath) == 2:
        npath.pop()
    return npath
