コード例 #1
0
        public static IType Infer(InferenceState initial, ITerm term)
        {
            var inference = new TypeInference(initial).Infer(term, out var result);

            Console.WriteLine($"Final: {inference}");
            var normalized = inference._state.Context.Normalize().Apply(result);

            return(normalized);
        }
コード例 #2
0
 private TypeInference(InferenceState inference)
 {
     this._state = inference;
 }
コード例 #3
0
 private TypeInference(FreshVariableStream fresh, IImmutableList <IContextEntry> context)
 {
     this._state = new InferenceState(fresh, context);
 }
コード例 #4
0
 private TypeInference()
 {
     this._state = new InferenceState(new FreshVariableStream(), ImmutableList <IContextEntry> .Empty);
 }