Exemplo n.º 1
0
        /// <summary>
        /// Merge two guarded lists together.
        /// </summary>
        /// <param name="guard">The guard.</param>
        /// <param name="list1">The first list.</param>
        /// <param name="list2">The second list.</param>
        /// <returns></returns>
        private GuardedList <TModel, TVar, TBool, TBitvec, TInt, TString> Merge(
            TBool guard,
            GuardedList <TModel, TVar, TBool, TBitvec, TInt, TString> list1,
            GuardedList <TModel, TVar, TBool, TBitvec, TInt, TString> list2)
        {
            var newGuard  = this.Solver.Ite(guard, list1.Guard, list2.Guard);
            var newValues = ImmutableList <SymbolicValue <TModel, TVar, TBool, TBitvec, TInt, TString> > .Empty;

            for (int i = 0; i < list1.Values.Count; i++)
            {
                var v1 = list1.Values[i];
                var v2 = list2.Values[i];
                newValues = newValues.Add(v1.Merge(guard, v2));
            }

            return(new GuardedList <TModel, TVar, TBool, TBitvec, TInt, TString>(newGuard, newValues));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Map the guard over a list.
        /// </summary>
        /// <param name="guard">The guard.</param>
        /// <param name="list">The list.</param>
        /// <returns></returns>
        private GuardedList <TModel, TVar, TBool, TBitvec, TInt, TString> MapGuard(TBool guard, GuardedList <TModel, TVar, TBool, TBitvec, TInt, TString> list)
        {
            var newGuard = this.Solver.And(guard, list.Guard);

            return(new GuardedList <TModel, TVar, TBool, TBitvec, TInt, TString>(newGuard, list.Values));
        }