Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to .NET Core #778

Closed
wants to merge 62 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
64deded
Add boogie as a git submodule
keyboardDrummer Aug 6, 2020
468ce7d
Reference Boogie dependencies through the .csproj files
keyboardDrummer Aug 6, 2020
246e239
Remove boogie from github actions workflow
keyboardDrummer Aug 6, 2020
0b8738a
Update to boogie 2.4.21
keyboardDrummer Aug 6, 2020
18f3905
Checkout dafny with submodules
keyboardDrummer Aug 6, 2020
6ffc3ef
Change casing in Basetypes project reference
keyboardDrummer Aug 7, 2020
3086de8
Another Basetypes capitalization fix
keyboardDrummer Aug 7, 2020
3c8fcfe
Update SMTLib references to use csproj
keyboardDrummer Aug 7, 2020
36c8778
Updated projects
keyboardDrummer Aug 7, 2020
b7d65ef
Project build for .NET core
keyboardDrummer Aug 7, 2020
0d1c4ff
Remove unused file
keyboardDrummer Aug 7, 2020
481c064
Bring back commented out DafnyServer code
keyboardDrummer Aug 7, 2020
c682beb
Remove syntax changes
keyboardDrummer Aug 7, 2020
3a7bc6d
Remove syntax changes v2
keyboardDrummer Aug 7, 2020
f399e60
Remove syntax changes v3
keyboardDrummer Aug 7, 2020
6d2fa9c
Update github actions to dotnet
keyboardDrummer Aug 7, 2020
c1e2d00
Add workaround for GitVersionTask issue
keyboardDrummer Aug 7, 2020
2dd03e8
Create a branch for boogie
keyboardDrummer Aug 7, 2020
2660f06
Revert "Create a branch for boogie"
keyboardDrummer Aug 7, 2020
2008463
Create a branch for boogie
keyboardDrummer Aug 7, 2020
56804d9
Remove shallow clone
keyboardDrummer Aug 7, 2020
2b47d64
Place DafnyDriver output in binaries
keyboardDrummer Aug 7, 2020
74c28d5
Try to force the build of Dafny.exe
keyboardDrummer Aug 7, 2020
0af7424
Try dotnet publish to get Dafny.exe
keyboardDrummer Aug 7, 2020
dc6775b
Fix build yaml
keyboardDrummer Aug 7, 2020
cbf7d0a
Fix output path directory
keyboardDrummer Aug 7, 2020
3e9e071
Another attempt at getting Dafny.exe
keyboardDrummer Aug 7, 2020
8ed40e0
Output fixes
keyboardDrummer Aug 7, 2020
7d32448
Use dotnet run instead of mono
keyboardDrummer Aug 7, 2020
5d88994
Single quotes
keyboardDrummer Aug 7, 2020
cdeadf5
Fix lit file
keyboardDrummer Aug 7, 2020
99ddb96
Another lit fix
keyboardDrummer Aug 7, 2020
838ea65
Better path handling
keyboardDrummer Aug 7, 2020
6039d1d
Small fixes
keyboardDrummer Aug 8, 2020
a304ec0
Remove files added by accident
keyboardDrummer Aug 8, 2020
a01b5fd
Move env variable to higher level
keyboardDrummer Aug 8, 2020
09799b4
Set 'MSBUILDSINGLELOADCONTEXT' in lit
keyboardDrummer Aug 8, 2020
c159b59
Do not build when running
keyboardDrummer Aug 8, 2020
02ba758
Copy DafnyRuntime.cs to output directory
keyboardDrummer Aug 8, 2020
0113b63
Turn off test using dafny.msbuild
keyboardDrummer Aug 8, 2020
e294d69
Weak attempt at fixing the CSharp compiler
keyboardDrummer Aug 8, 2020
099afa1
Support hasMain
keyboardDrummer Aug 8, 2020
c67b058
Enable immutable collections and in memory CSharp compile
keyboardDrummer Aug 8, 2020
a05bde7
Make numerics work, refactor code
keyboardDrummer Aug 8, 2020
c8823c6
C# compilation fixes
keyboardDrummer Aug 8, 2020
e7a6d91
Refactoring
keyboardDrummer Aug 8, 2020
caff632
Fix syntax tree addition
keyboardDrummer Aug 8, 2020
af69ad9
Add mscorlib reference and Server fix
keyboardDrummer Aug 8, 2020
1c5e82b
Fix assembly file loading
keyboardDrummer Aug 9, 2020
3ecf274
Fix lit run on Windows and set DafnyServer to exe type
keyboardDrummer Aug 9, 2020
0e76265
Fix output path DafnyServer
keyboardDrummer Aug 9, 2020
b104fdd
Add mscorlib reference
keyboardDrummer Aug 9, 2020
1259b2f
Use a temporary path to output the assembly
keyboardDrummer Aug 10, 2020
fd9291b
Code cleanup
keyboardDrummer Aug 10, 2020
109db31
Remove accidentaly added file
keyboardDrummer Aug 10, 2020
53ceb57
Resolve DafnyRuntime having the wrong assembly name
keyboardDrummer Aug 10, 2020
8b4dbed
Enable adding root to library path
keyboardDrummer Aug 11, 2020
af7aead
Fix dynamic assembly loading
keyboardDrummer Aug 12, 2020
74dc2a0
Merge remote-tracking branch 'origin/master' into dotnetCore
keyboardDrummer Aug 12, 2020
8199632
Change output dir to respect targetFileName
keyboardDrummer Aug 13, 2020
9ec527e
Protect against empty targetFilename
keyboardDrummer Aug 13, 2020
9ae93b8
Merge branch 'master' into dotnetCore
keyboardDrummer Aug 13, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
jobs:
build:

env:
MSBUILDSINGLELOADCONTEXT: 1 # Workaround for GitVersionTask issue: https://github.com/dotnet/sdk/issues/10878
runs-on: ${{ matrix.os }}

strategy:
Expand All @@ -22,33 +24,30 @@ jobs:
uses: nuget/setup-nuget@v1
- name: Manually sync certs
run: cert-sync /etc/ssl/certs/ca-certificates.crt
- name: Add msbuild to PATH
if: matrix.os == 'windows-latest'
uses: microsoft/setup-msbuild@v1.0.0
- name: Checkout Boogie
uses: actions/checkout@v2
with:
repository: boogie-org/boogie
ref: v2.4.21
path: boogie
- name: Nuget Restore Boogie
run: nuget restore boogie/Source/Boogie.sln
- name: Build Boogie
run: msbuild boogie/Source/Boogie.sln
- name: Checkout Dafny
uses: actions/checkout@v2
with:
submodules: recursive
path: dafny
- name: Get Z3
if: matrix.os != 'windows-latest'
run: |
wget https://github.com/Z3Prover/z3/releases/download/z3-4.8.4/z3-4.8.4.d6df51951f4c-x64-ubuntu-14.04.zip
unzip z3*.zip && rm *.zip
cp -r z3* dafny/Binaries/z3
- name: Nuget Restore Dafny
run: nuget restore dafny/Source/Dafny.sln
- name: Enable Boogie's GitVersionTask dependency to build
# GitVersionTask does not work on headless git repositories
# GitVersionTask does not work on shallow git repositories
run: |
git checkout -b gitVersionTaskBranch
git fetch --unshallow
working-directory: dafny/Source/boogie
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x' # SDK Version to use; x will use the latest version of the 3.1 channel
- name: Build Dafny
run: msbuild dafny/Source/Dafny.sln
run: dotnet build dafny/Source/Dafny.sln
- uses: actions/setup-python@v1
- name: Upgrade outdated pip
run: python -m pip install --upgrade pip
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Binaries/DafnyServer.exe
Binaries/DafnyRuntime.cs
Binaries/export/
Binaries/mono_crash*
Binaries/*

Package/

Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "Source/boogie"]
path = Source/boogie
url = https://github.com/boogie-org/boogie.git
590 changes: 518 additions & 72 deletions Source/Dafny.sln

Large diffs are not rendered by default.

217 changes: 92 additions & 125 deletions Source/Dafny/Compiler-Csharp.cs

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions Source/Dafny/DafnyMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using Bpl = Microsoft.Boogie;
using System.Reflection;
using DafnyAssembly;
using Mono.Cecil;

namespace Microsoft.Dafny {

Expand All @@ -37,17 +36,20 @@ public DafnyFile(string filePath) {
var extension = Path.GetExtension(filePath);
if (extension != null) { extension = extension.ToLower(); }

if (!Path.IsPathRooted(filePath))
filePath = Path.GetFullPath(filePath);

if (extension == ".dfy" || extension == ".dfyi") {
isPrecompiled = false;
SourceFileName = filePath;
} else if (extension == ".dll") {
isPrecompiled = true;
var asm = AssemblyDefinition.ReadAssembly(filePath);
var asm = Assembly.LoadFile(filePath);
string sourceText = null;
foreach (var adata in asm.CustomAttributes) {
if (adata.Constructor.DeclaringType.Name == "DafnySourceAttribute") {
foreach (var args in adata.ConstructorArguments) {
if (args.Type.FullName == "System.String") {
if (args.ArgumentType.FullName == "System.String") {
sourceText = (string)args.Value;
}
}
Expand Down
246 changes: 25 additions & 221 deletions Source/Dafny/DafnyPipeline.csproj
Original file line number Diff line number Diff line change
@@ -1,222 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{FE44674A-1633-4917-99F4-57635E6FA740}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.Dafny</RootNamespace>
<AssemblyName>DafnyPipeline</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<CodeContractsAssemblyMode>0</CodeContractsAssemblyMode>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\InterimKey.snk</AssemblyOriginatorKeyFile>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NO_ENABLE_IRONDAFNY</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeContractsEnableRuntimeChecking>True</CodeContractsEnableRuntimeChecking>
<CodeContractsRuntimeOnlyPublicSurface>False</CodeContractsRuntimeOnlyPublicSurface>
<CodeContractsRuntimeThrowOnFailure>True</CodeContractsRuntimeThrowOnFailure>
<CodeContractsRuntimeCallSiteRequires>False</CodeContractsRuntimeCallSiteRequires>
<CodeContractsRunCodeAnalysis>False</CodeContractsRunCodeAnalysis>
<CodeContractsNonNullObligations>False</CodeContractsNonNullObligations>
<CodeContractsBoundsObligations>False</CodeContractsBoundsObligations>
<CodeContractsArithmeticObligations>False</CodeContractsArithmeticObligations>
<CodeContractsPointerObligations>False</CodeContractsPointerObligations>
<CodeContractsContainerAnalysis>False</CodeContractsContainerAnalysis>
<CodeContractsRedundantAssumptions>False</CodeContractsRedundantAssumptions>
<CodeContractsRunInBackground>True</CodeContractsRunInBackground>
<CodeContractsShowSquigglies>False</CodeContractsShowSquigglies>
<CodeContractsUseBaseLine>False</CodeContractsUseBaseLine>
<CodeContractsEmitXMLDocs>False</CodeContractsEmitXMLDocs>
<CodeContractsCustomRewriterAssembly>
</CodeContractsCustomRewriterAssembly>
<CodeContractsCustomRewriterClass>
</CodeContractsCustomRewriterClass>
<CodeContractsLibPaths>
</CodeContractsLibPaths>
<CodeContractsExtraRewriteOptions>
</CodeContractsExtraRewriteOptions>
<CodeContractsExtraAnalysisOptions>
</CodeContractsExtraAnalysisOptions>
<CodeContractsBaseLineFile>
</CodeContractsBaseLineFile>
<CodeContractsRuntimeCheckingLevel>None</CodeContractsRuntimeCheckingLevel>
<CodeContractsReferenceAssembly>DoNotBuild</CodeContractsReferenceAssembly>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<CodeContractsRuntimeSkipQuantifiers>False</CodeContractsRuntimeSkipQuantifiers>
<CodeContractsEnumObligations>False</CodeContractsEnumObligations>
<CodeContractsCacheAnalysisResults>False</CodeContractsCacheAnalysisResults>
<CodeContractsAnalysisWarningLevel>0</CodeContractsAnalysisWarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NO_ENABLE_IRONDAFNY</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Checked|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Checked\</OutputPath>
<DefineConstants>TRACE;DEBUG;NO_ENABLE_IRONDAFNY</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
<CodeContractsEnableRuntimeChecking>True</CodeContractsEnableRuntimeChecking>
<CodeContractsRuntimeOnlyPublicSurface>False</CodeContractsRuntimeOnlyPublicSurface>
<CodeContractsRuntimeThrowOnFailure>True</CodeContractsRuntimeThrowOnFailure>
<CodeContractsRuntimeCallSiteRequires>False</CodeContractsRuntimeCallSiteRequires>
<CodeContractsRuntimeSkipQuantifiers>False</CodeContractsRuntimeSkipQuantifiers>
<CodeContractsRunCodeAnalysis>False</CodeContractsRunCodeAnalysis>
<CodeContractsNonNullObligations>False</CodeContractsNonNullObligations>
<CodeContractsBoundsObligations>False</CodeContractsBoundsObligations>
<CodeContractsArithmeticObligations>False</CodeContractsArithmeticObligations>
<CodeContractsEnumObligations>False</CodeContractsEnumObligations>
<CodeContractsRedundantAssumptions>False</CodeContractsRedundantAssumptions>
<CodeContractsRunInBackground>True</CodeContractsRunInBackground>
<CodeContractsShowSquigglies>False</CodeContractsShowSquigglies>
<CodeContractsUseBaseLine>False</CodeContractsUseBaseLine>
<CodeContractsEmitXMLDocs>False</CodeContractsEmitXMLDocs>
<CodeContractsCustomRewriterAssembly />
<CodeContractsCustomRewriterClass />
<CodeContractsLibPaths />
<CodeContractsExtraRewriteOptions />
<CodeContractsExtraAnalysisOptions />
<CodeContractsBaseLineFile />
<CodeContractsCacheAnalysisResults>False</CodeContractsCacheAnalysisResults>
<CodeContractsRuntimeCheckingLevel>Full</CodeContractsRuntimeCheckingLevel>
<CodeContractsReferenceAssembly>Build</CodeContractsReferenceAssembly>
<CodeContractsAnalysisWarningLevel>0</CodeContractsAnalysisWarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="BoogieBasetypes">
<HintPath>..\..\..\boogie\Binaries\BoogieBasetypes.dll</HintPath>
</Reference>
<Reference Include="BoogieCore">
<HintPath>..\..\..\boogie\Binaries\BoogieCore.dll</HintPath>
</Reference>
<Reference Include="BoogieParserHelper">
<HintPath>..\..\..\boogie\Binaries\BoogieParserHelper.dll</HintPath>
</Reference>
<PackageReference Include="Mono.Cecil" Version="0.11.2" />
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>4.8</RequiredTargetFramework>
</Reference>
<Reference Include="System.Numerics" />
</ItemGroup>
<ItemGroup>
<Compile Include="Cloner.cs" />
<Compile Include="Compiler-Csharp.cs" />
<Compile Include="Compiler-go.cs" />
<Compile Include="Compiler-js.cs" />
<Compile Include="Compiler-cpp.cs" />
<Compile Include="Compiler-java.cs" />
<Compile Include="Reporting.cs" />
<Compile Include="Triggers\QuantifiersCollection.cs" />
<Compile Include="Triggers\QuantifierSplitter.cs" />
<Compile Include="Triggers\TriggerExtensions.cs" />
<Compile Include="Triggers\QuantifiersCollector.cs" />
<Compile Include="Triggers\TriggersCollector.cs" />
<Compile Include="Triggers\TriggerUtils.cs" />
<Compile Include="Util.cs" />
<Compile Include="Compiler.cs" />
<Compile Include="BigIntegerParser.cs" />
<Compile Include="DafnyAst.cs" />
<Compile Include="DafnyMain.cs" />
<Compile Include="DafnyOptions.cs" />
<Compile Include="Printer.cs" />
<Compile Include="RefinementTransformer.cs" />
<Compile Include="Resolver.cs" />
<Compile Include="Rewriter.cs" />
<Compile Include="SccGraph.cs" />
<Compile Include="Translator.cs" />
<Compile Include="..\version.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="cce.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Dafny.atg" />
</ItemGroup>
<ItemGroup>
<Compile Include="Parser.cs" Visible="False" />
<Compile Include="Scanner.cs" Visible="False" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DafnyRuntime\DafnyRuntime.csproj">
<Project>{3e2944e9-3e1d-4e03-a881-fb04a7a6ed67}</Project>
<Name>DafnyRuntime</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup>
<CodeContractsInstallDir Condition="'$(CodeContractsInstallDir)'==''">C:\Program Files (x86)\Microsoft\Contracts\</CodeContractsInstallDir>
</PropertyGroup>
<Import Condition="'$(CodeContractsImported)' != 'true' AND '$(DontImportCodeContracts)' != 'true' AND Exists($(CodeContractsInstallDir))" Project="$(CodeContractsInstallDir)MsBuild\v14.0\Microsoft.CodeContracts.targets" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Library</OutputType>
<AssemblyName>DafnyPipeline</AssemblyName>
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<DefineConstants>TRACE</DefineConstants>
<PackageVersion>1.1.0</PackageVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.7.0" />
<PackageReference Include="System.Runtime.Numerics" Version="4.3.0" />
<PackageReference Include="System.Collections.Immutable" Version="1.7.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\boogie\Source\Basetypes\Basetypes-NetCore.csproj" />
<ProjectReference Include="..\boogie\Source\Core\Core-NetCore.csproj" />
<ProjectReference Include="..\boogie\Source\ParserHelper\ParserHelper-NetCore.csproj" />
<ProjectReference Include="..\DafnyRuntime\DafnyRuntime.csproj" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions Source/Dafny/Translator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7605,7 +7605,7 @@ void CheckWellformedWithResult(Expression expr, WFOptions options, Bpl.Expr resu

// Cannot use the datatype's formals, so we substitute the inferred type args:
var su = new Dictionary<TypeParameter, Type>();
foreach (var p in dtv.Ctor.EnclosingDatatype.TypeArgs.Zip(dtv.InferredTypeArgs)) {
foreach (var p in LinqExtender.Zip(dtv.Ctor.EnclosingDatatype.TypeArgs, dtv.InferredTypeArgs)) {
su[p.Item1] = p.Item2;
}
Type ty = Resolver.SubstType(formal.Type, su);
Expand Down Expand Up @@ -17549,11 +17549,11 @@ bool TrSplitExpr(Expression expr, List<SplitExprInfo/*!*/>/*!*/ splits, bool pos
private bool CanSafelyInline(FunctionCallExpr fexp, Function f) {
var visitor = new TriggersExplorer();
visitor.Visit(f);
return f.Formals.Zip(fexp.Args).All(formal_concrete => CanSafelySubstitute(visitor.TriggerVariables, formal_concrete.Item1, formal_concrete.Item2));
return LinqExtender.Zip(f.Formals, fexp.Args).All(formal_concrete => CanSafelySubstitute(visitor.TriggerVariables, formal_concrete.Item1, formal_concrete.Item2));
}

// Using an empty set of old expressions is ok here; the only uses of the triggersCollector will be to check for trigger killers.
Triggers.TriggersCollector triggersCollector = new Triggers.TriggersCollector(new Dictionary<Expression, HashSet<OldExpr>>());
Triggers.TriggersCollector triggersCollector = new Triggers.TriggersCollector(new Dictionary<Expression, HashSet<OldExpr>>());

private bool CanSafelySubstitute(ISet<IVariable> protectedVariables, IVariable variable, Expression substitution) {
return !(protectedVariables.Contains(variable) && triggersCollector.IsTriggerKiller(substitution));
Expand Down
2 changes: 1 addition & 1 deletion Source/Dafny/Util.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static List<A> Concat<A>(List<A> xs, List<A> ys) {
}

public static Dictionary<A,B> Dict<A,B>(IEnumerable<A> xs, IEnumerable<B> ys) {
return Dict<A,B>(xs.Zip(ys));
return Dict<A,B>(LinqExtender.Zip(xs, ys));
}

public static Dictionary<A,B> Dict<A,B>(IEnumerable<Tuple<A,B>> xys) {
Expand Down
Loading