Exemplo n.º 1
0
 public Vars(FunctionalDependencies constraintFundeps)
 {
     _trace             = new List <string>();
     _constraintFundeps = constraintFundeps;
     _constraints       = new List <term>();
     _bindings          = new Dictionary <atom, term>();
 }
Exemplo n.º 2
0
 private Vars(
     List <string> trace,
     FunctionalDependencies cfundeps,
     List <term> constraints,
     Dictionary <atom, term> bindings
     )
 {
     _trace             = trace;
     _constraintFundeps = cfundeps;
     _constraints       = constraints;
     _bindings          = bindings;
 }
Exemplo n.º 3
0
        // OPTIMIZATION: Use heap.
        // We use a sortedset instead of a queue because lower clue IDs can't depend on greater clue IDs
        // This handily avoids Painter's Algorithm issues *and* deduplicates IDs! Magic.

        public Inferrer(FunctionalDependencies fundeps)
        {
            _clueIdGen         = new SymbolGenerator();
            _constraintFundeps = fundeps;

            _clueKind          = new Dictionary <ClueId, atom>();
            _clueSource        = new Dictionary <ClueId, ClueSource>();
            _clueConstant      = new Dictionary <ClueId, ClueConstant>();
            _clueDependsOn     = new Dictionary <ClueId, ClueId[]>();
            _cluesDependingOn  = new Dictionary <ClueId, HashSet <ClueId> >();
            _clueBestKnownType = new Dictionary <ClueId, free <type> >();
            _clueErrors        = new Dictionary <ClueId, List <InferenceError> >();
            _cluesToUpdate     = new SortedSet <ClueId>(new ClueIdComparer());

            _rules = new List <InferenceRule <ClueConstant> >();
        }