// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 include "../StandardLibrary/StandardLibrary.dfy" include "../../libraries/src/Collections/Sequences/Seq.dfy" module {:extern "Sets"} Sets { import opened StandardLibrary import Seq method {:extern "SetToOrderedSequence"} ComputeSetToOrderedSequence(s: set>, less: (T, T) -> bool) returns (res: seq>) requires Trichotomous(less) && Transitive(less) ensures res == SetToOrderedSequence(s, less) function method {:extern "SetToOrderedSequence2"} ComputeSetToOrderedSequence2( s: set>, less: (T, T) -> bool ) :(res: seq>) requires Trichotomous(less) && Transitive(less) ensures res == SetToOrderedSequence(s, less) // The seq came from the set ensures Seq.HasNoDuplicates(res) }