Beispiel #1
0
 private static DafnyProgramVerifier CreateVerifier(IServiceProvider serviceProvider)
 {
     return(DafnyProgramVerifier.Create(
                serviceProvider.GetRequiredService <ILogger <DafnyProgramVerifier> >(),
                serviceProvider.GetRequiredService <IOptions <VerifierOptions> >()
                ));
 }
 private static IServiceCollection WithDafnyLanguage(this IServiceCollection services)
 {
     return(services
            .AddSingleton <IDafnyParser>(serviceProvider => DafnyLangParser.Create(serviceProvider.GetRequiredService <ILogger <DafnyLangParser> >()))
            .AddSingleton <ISymbolResolver, DafnyLangSymbolResolver>()
            .AddSingleton <IProgramVerifier>(serviceProvider => DafnyProgramVerifier.Create(serviceProvider.GetRequiredService <ILogger <DafnyProgramVerifier> >()))
            .AddSingleton <ISymbolTableFactory, SymbolTableFactory>()
            .AddSingleton <IDiagnosticPublisher, DiagnosticPublisher>());
 }