Ejemplo n.º 1
0
        private TriggerAnnotation AnnotateMatchExpr(MatchExpr expr)
        {
            var pts = CollectExportedCandidates(expr);
            // collects that argument boundvar of matchcaseexpr
            var variables = expr.Cases.Select(e => e.Arguments).
                            Aggregate(new List <BoundVar>(), (acc, e) => TriggerUtils.MergeAlterFirst(acc, e));
            // remove terms that mentions argument boundvar of matchcaseexpr
            var terms = new List <TriggerTerm>();

            foreach (var term in pts)
            {
                if (!(variables.All(x => term.Variables.Contains(x))))
                {
                    terms.Add(term);
                }
            }
            return(new TriggerAnnotation(true, CollectVariables(expr), terms));
        }