Skip to content

Problem with inequality of sequences #629

@PBHTasche

Description

@PBHTasche

Silicon seems to not be able to prove inequality of sequences if the first elements are equal. If I first reason about the elements individually, then the reasoning about the sequences passes as well. This is similar to issue #601, but still seems to be a problem. Like with that issue, Carbon does verify the example.

// This passes
method test_seq_unequal()
{
  assert Seq(false, false) != Seq(true, true)
}

// This fails
method test_seq_semiequal()
{
  assert Seq(true, false) != Seq(true, true)
}

// This passes
method test_seq_elemwise()
{
  var s1: Seq[Bool] := Seq(true, true)
  var s2: Seq[Bool] := Seq(true, false)

  assert s1[0] != s2[0] || s1[1] != s2[1]
  assert s1 != s2
}

The Silicon version I use is Silicon 1.1-SNAPSHOT (4c705143).

Update: From what we can tell, it seems to be an issue with the axiomatisation of sequence equality, specifically the triggers in the extensional_seq_equality axiom. Accessing the unequal item in one of the sequences allows verification to pass:

// This passes
method test_seq_semiequal()
{
  var b: Bool
  b := Seq(true, false)[1]
  assert Seq(true, false) != Seq(true, true)
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions