Пример #1
0
        private SymGraph(TADomain topValue, TADomain bottomValue, bool _)
        {
            this.egraph_id  = egraphIdGenerator++;
            this.const_root = FreshSymbol();

            TermMap = DoubleImmutableMap <SymValue, TFunc, SymValue> .Empty(SymValue.GetUniqueKey);

            MultiEdgeMap = DoubleImmutableMap <SymValue, MultiEdge <TFunc, TADomain>, Sequence <SymValue> > .Empty(SymValue.GetUniqueKey);

            this.abs_map = ImmutableIntKeyMap <SymValue, TADomain> .Empty(SymValue.GetUniqueKey);

            this.forw_map = ImmutableIntKeyMap <SymValue, SymValue> .Empty(SymValue.GetUniqueKey);

            EqualTermsMap = ImmutableIntKeyMap <SymValue, Sequence <SymGraphTerm <TFunc> > > .Empty(SymValue.GetUniqueKey);

            EqualMultiTermsMap = ImmutableIntKeyMap <SymValue, SymGraphTerm <TFunc> > .Empty(SymValue.GetUniqueKey);

            this.BottomPlaceHolder = FreshSymbol();
            this.abs_map           = this.abs_map.Add(this.BottomPlaceHolder, bottomValue);
            this.is_immutable      = false;
            this.history_size      = 1;
            this.Parent            = null;
            this.root_graph        = this;
            Updates = null;
            this.UnderlyingTopValue      = topValue;
            this.underlying_bottom_value = bottomValue;
        }
Пример #2
0
        public void Eliminate(TFunc function, SymValue arg)
        {
            SymValue value = Find(arg);
            DoubleImmutableMap <SymValue, TFunc, SymValue> newTermMap = TermMap.Remove(value, function);

            if (newTermMap == TermMap)
            {
                return;
            }
            TermMap = newTermMap;
            AddEliminateEdgeUpdate(value, function);
        }
Пример #3
0
        public void AddMapping(SymValue v1, SymValue v2, SymValue result)
        {
            if (v1 != null && v2 != null)
            {
                this.mappings = this.mappings.Add(v1, v2, result);
            }
            else if (v2 == null)
            {
                this.visited_key1 = this.visited_key1.Add(v1);
            }
            else
            {
                this.visited_key1 = this.visited_key1.Add(v2);
            }

            AddMergeTriple(v1, v2, result);
        }
Пример #4
0
        public MergeInfo(SymGraph <TFunc, TADomain> result,
                         SymGraph <TFunc, TADomain> g1,
                         SymGraph <TFunc, TADomain> g2, bool widen)
        {
            this.mappings = DoubleImmutableMap <SymValue, SymValue, SymValue> .Empty(SymValue.GetUniqueKey);

            this.visited_key1 = ImmutableSet <SymValue> .Empty(SymValue.GetUniqueKey);

            this.visited_multi_edges = new HashSet <Tuple <SymValue, SymValue, MultiEdge <TFunc, TADomain> > > ();
            this.pending_counts      = new DoubleDictionary <SymValue, SymValue, int> ();
            this.manifested          = new HashSet <SymValue> ();

            this.LastCommonVariable = result.IdGenerator;
            this.Widen  = widen;
            this.Result = result;
            this.Graph1 = g1;
            this.Graph2 = g2;

            this.Changed = false;
        }