Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dafny-lang/dafny Loading
base: 4a5d40b
Choose a base ref
...
head repository: dafny-lang/dafny Loading
compare: 7929556
Choose a head ref
  • 11 commits
  • 82 files changed
  • 6 contributors

Commits on Dec 2, 2021

  1. fix: Set/forall comprehensions with subtyping for issue #697 (#1522)

    This PR is a quick fix for issues #697 and #698.
    
    The problem: Unsound comprehensions with subset types.
    
    For-comprehensions, Exist-comprehensions, Map-comprehensions and Set-comprehensions had a problem when encountering subset types: Dafny was not emiting the code of the subset constraint, to ensure that the constraint of the comprehension is not executed with undesirable data.
    The solution implemented in this PR:
    Added field [ConstraintIsCompilable](https://github.com/dafny-lang/dafny/pull/1522/files#diff-7d845d452486b0b59700ca5c133f2648f76d44616148081d51efffe32dbc6e7aR2680) for SubsetTypeDecl expressions.
    If a comprehension uses a subsettype whose ConstraintIsCompilable is false, will raise two errors, the second one indicating why it is not compilable
    In the compiler, the function [MaybeInjectSubsetConstraint](https://github.com/dafny-lang/dafny/pull/1522/files#diff-998a9162635a910ca366a26c8f679ea96d6bbb3f703a52ca1487fd19599de49dR4743) which injects the guard code for for-comprehensions, exists-comprehensions, map-comprehensions and set-comprehensions.
    
    How I tested it.
    
    I added 8 tests:
    
    git-issues/git-issue-697.dfy: A set comprehension with compilable subset constraint that did not compile correctly and used to crash at execution. Now it compiles and does not crash.
    git-issues/git-issue-697b.dfy: A map comprehension with compilable subset constraint that did not compile correctly and used to crash at execution. Now it compiles and does not crash.
    git-issues/git-issue-697c.dfy: A set comprehension, a map comprehension and a forall comprehension with ghost subset constraint that used to compile and crash at execution. Now it does not compiles and raises six errors.
    git-issues/git-issue-697d.dfy: A set comprehension with ghost & compilable subset constraint that used to compile and crash at execution. Now it compiles and does not crash.
    git-issues/git-issue-697e.dfy: A forall comprehension with only inferred ghost subset constraint. It used to compile and crash at execution time. Now it compiles and does not crash.
    git-issues/git-issue-697f.dfy: A ghost subset constraint that is never used in comprehensions. It used to compile and continues to compile, ensuring this PR does not break this existing desirable behavior.
    git-issues/git-issue-698.dfy: A forall comprehension with compilable subset constraint that did not compile correctly and used to crash at execution. Now it compiles and does not crash.
    git-issues/git-issue-698b.dfy: An exist comprehension with compilable subset constraint that did not compile correctly and used to crash at execution. Now it compiles and does not crash.
    MikaelMayer committed Dec 2, 2021
    Configuration menu
    Copy the full SHA
    37d38f0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0bf9558 View commit details
    Browse the repository at this point in the history
  3. chore: Enable csharp_prefer_braces (#1621)

    Previously we relied on enforcing this at review time. This PR adds a warning in the IDE and fixes all current violations. dotnet-format can only enforce this when analysing a whole project, which is surprisingly expensive (30s), so we don't make changes to the pre-commit hook at this time.
    dotnet tool run dotnet-format -s error -w Source/Dafny.sln
    
    Also moved .editorconfig so it affects all files (including the `.cs` files under `Test`).
    fabiomadge committed Dec 2, 2021
    Configuration menu
    Copy the full SHA
    0e8d973 View commit details
    Browse the repository at this point in the history

Commits on Dec 7, 2021

  1. Move customBoogie references one level higher (#1633)

    * Move customBoogie references one level higher
    
    * Update msbuild build file
    
    Co-authored-by: Remy Willems <>
    keyboardDrummer committed Dec 7, 2021
    Configuration menu
    Copy the full SHA
    1165d51 View commit details
    Browse the repository at this point in the history

Commits on Dec 8, 2021

  1. Python compiler (#1599)

    Adding a Python Compiler which can pass the test IKnowThisMuchIs.dfy.
    prvshah51 committed Dec 8, 2021
    Configuration menu
    Copy the full SHA
    69410e8 View commit details
    Browse the repository at this point in the history
  2. chore: Enable dotnet_style_parentheses_in_other_binary_operators (#…

    …1627)
    
    add `dotnet_style_parentheses_in_other_binary_operators` as a warning and fix violations
    fabiomadge committed Dec 8, 2021
    Configuration menu
    Copy the full SHA
    c7792c2 View commit details
    Browse the repository at this point in the history

Commits on Dec 10, 2021

  1. feat: Prevent changes unrelated to a proof from changing the verifica…

    …tion behavior of the proof (#1612)
    
    In DafnyOptions.cs, turn on Boogie's `Prune` and `NormaliseNames` option, and turn off `EmitDebugInformation`, to increase verification stability. Use `uses` clauses on constants and functions, both in DafnyPrelude.bpl and in generated Boogie declarations, and the `include_dep` attribute on axioms, to ensure not too much is pruned. More information on these Boogie features can be found in the PRs that introduce them: boogie-org/boogie#450, boogie-org/boogie#452, boogie-org/boogie#453, boogie-org/boogie#454, boogie-org/boogie#464
    
    In follow-up PRs, we will replace all `include_dep` with `uses` clauses, since they allow more but still correct pruning.
    
    This PR also updates the test `SchorrWaite.dfy` to make it more stable. Changes stolen from #1620
    keyboardDrummer committed Dec 10, 2021
    Configuration menu
    Copy the full SHA
    b6d7ae8 View commit details
    Browse the repository at this point in the history

Commits on Dec 13, 2021

  1. feat: Variance on datatypes for C# (#1578)

    Resolves #1499, by introducing a new interface above the existing abstract class containing shared functionality for the constructors, along with new tests. (See the updated comment for `CompileDatatypeBase`) We don't provide an implementation of `DowncastCopy` in this PR.
    fabiomadge committed Dec 13, 2021
    Configuration menu
    Copy the full SHA
    929fee8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c8e5320 View commit details
    Browse the repository at this point in the history

Commits on Dec 14, 2021

  1. Configuration menu
    Copy the full SHA
    42e228d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7929556 View commit details
    Browse the repository at this point in the history
Loading