An
(abstract-alternation tree) → alternation
Function:
(defun abstract-alternation (tree) (declare (xargs :guard (treep tree))) (b* (((fun (fail)) (abstract-fail)) ((unless (tree-case tree :nonleaf)) (fail)) (treess (tree-nonleaf->branches tree)) ((unless (and (consp treess) (consp (cdr treess)))) (fail)) (trees-concatenation (car treess)) (trees-concatenations (cadr treess)) ((unless (consp trees-concatenation)) (fail)) (tree-concatenation (car trees-concatenation)) (concatenation (abstract-concatenation tree-concatenation)) (concatenations (abstract-alt-rest trees-concatenations))) (cons concatenation concatenations)))