├── .dockerignore ├── .github ├── dependabot.yml ├── docs │ └── gobra.png ├── license-check │ ├── config.json │ └── headers │ │ ├── BSD-3-SIDM.txt │ │ ├── CC0-Windows.txt │ │ ├── CC0.txt │ │ ├── Go.txt │ │ ├── MPLv2-ETH-hashtags.txt │ │ ├── MPLv2-ETH-xml.txt │ │ └── MPLv2-ETH.txt ├── test-and-measure-ram.sh └── workflows │ ├── license-check.yml │ ├── test.yml │ └── update-submodules.yml ├── .gitignore ├── .gitmodules ├── GobraChopper.conf ├── LICENSE ├── README.md ├── bors.toml ├── build.sbt ├── conf └── logback.xml ├── docs ├── licenses │ └── GO.txt └── tutorial.md ├── encoding-sketches └── interfaces.vpr ├── genparser.sh ├── go-semantic-sketches └── interface-invariant-arg-and-return-type.go ├── project ├── build.properties └── plugins.sbt ├── src ├── main │ ├── antlr4 │ │ ├── GoLexer.g4 │ │ ├── GoParser.g4 │ │ ├── GobraLexer.g4 │ │ └── GobraParser.g4 │ ├── java │ │ └── viper │ │ │ └── gobra │ │ │ └── frontend │ │ │ ├── GobraParserBase.java │ │ │ └── LICENSE │ ├── resources │ │ ├── README.md │ │ ├── builtin │ │ │ └── builtin.gobra │ │ ├── noaxioms │ │ │ └── sets.vpr │ │ └── stubs │ │ │ ├── bytes │ │ │ └── bytes.gobra │ │ │ ├── encoding │ │ │ └── binary │ │ │ │ └── binary.gobra │ │ │ ├── errors │ │ │ ├── errors.gobra │ │ │ └── wrap.gobra │ │ │ ├── fmt │ │ │ └── fmt.gobra │ │ │ ├── net │ │ │ ├── ip.gobra │ │ │ ├── iprawsock.gobra │ │ │ ├── net.gobra │ │ │ └── udpsock.gobra │ │ │ ├── strconv │ │ │ ├── atoi.gobra │ │ │ └── itoa.gobra │ │ │ ├── strings │ │ │ └── strings.gobra │ │ │ ├── sync │ │ │ ├── mutex.gobra │ │ │ └── waitgroup.gobra │ │ │ └── time │ │ │ ├── sleep.gobra │ │ │ ├── time.gobra │ │ │ └── zoneinfo.gobra │ └── scala │ │ └── viper │ │ └── gobra │ │ ├── Gobra.scala │ │ ├── ast │ │ ├── frontend │ │ │ ├── Ast.scala │ │ │ ├── AstPattern.scala │ │ │ └── PrettyPrinter.scala │ │ ├── internal │ │ │ ├── Node.scala │ │ │ ├── PrettyPrinter.scala │ │ │ ├── Program.scala │ │ │ ├── Rewritable.scala │ │ │ ├── theory │ │ │ │ ├── Comparability.scala │ │ │ │ └── TypeHead.scala │ │ │ ├── transform │ │ │ │ ├── CGEdgesTerminationTransform.scala │ │ │ │ ├── ConstantPropagation.scala │ │ │ │ ├── InternalTransform.scala │ │ │ │ └── OverflowChecksTransform.scala │ │ │ └── utility │ │ │ │ └── Nodes.scala │ │ └── printing │ │ │ └── PrettyPrinterCombinators.scala │ │ ├── backend │ │ ├── Backend.scala │ │ ├── BackendVerifier.scala │ │ ├── Carbon.scala │ │ ├── Silicon.scala │ │ ├── ViperBackends.scala │ │ ├── ViperServer.scala │ │ └── ViperVerifier.scala │ │ ├── frontend │ │ ├── Config.scala │ │ ├── Desugar.scala │ │ ├── Gobrafier.scala │ │ ├── InformativeErrorListener.scala │ │ ├── PackageResolver.scala │ │ ├── ParseTreeTranslator.scala │ │ ├── Parser.scala │ │ ├── ReportFirstErrorStrategy.scala │ │ ├── Source.scala │ │ ├── TranslationHelpers.scala │ │ └── info │ │ │ ├── ExternalTypeInfo.scala │ │ │ ├── Info.scala │ │ │ ├── InfoDebugPrettyPrinter.scala │ │ │ ├── TypeInfo.scala │ │ │ ├── base │ │ │ ├── BuiltInMemberTag.scala │ │ │ ├── SymbolTable.scala │ │ │ └── Type.scala │ │ │ └── implementation │ │ │ ├── Errors.scala │ │ │ ├── TypeInfoImpl.scala │ │ │ ├── property │ │ │ ├── Addressability.scala │ │ │ ├── Assignability.scala │ │ │ ├── BaseProperty.scala │ │ │ ├── Comparability.scala │ │ │ ├── ConstantEvaluation.scala │ │ │ ├── Convertibility.scala │ │ │ ├── DependencyAnalysis.scala │ │ │ ├── Executability.scala │ │ │ ├── Implements.scala │ │ │ ├── PointsTo.scala │ │ │ ├── StrictAssignMode.scala │ │ │ ├── TypeIdentity.scala │ │ │ ├── TypeMerging.scala │ │ │ └── UnderlyingType.scala │ │ │ ├── resolution │ │ │ ├── AdvancedMemberSet.scala │ │ │ ├── AmbiguityResolution.scala │ │ │ ├── Enclosing.scala │ │ │ ├── LabelResolution.scala │ │ │ ├── MemberPath.scala │ │ │ ├── MemberResolution.scala │ │ │ └── NameResolution.scala │ │ │ └── typing │ │ │ ├── BaseTyping.scala │ │ │ ├── BuiltInMemberTyping.scala │ │ │ ├── ExprTyping.scala │ │ │ ├── IdTyping.scala │ │ │ ├── ImportTyping.scala │ │ │ ├── MemberTyping.scala │ │ │ ├── MiscTyping.scala │ │ │ ├── ProgramTyping.scala │ │ │ ├── StmtTyping.scala │ │ │ ├── TypeTyping.scala │ │ │ └── ghost │ │ │ ├── GhostExprTyping.scala │ │ │ ├── GhostIdTyping.scala │ │ │ ├── GhostMemberTyping.scala │ │ │ ├── GhostMiscTyping.scala │ │ │ ├── GhostStmtTyping.scala │ │ │ ├── GhostTypeTyping.scala │ │ │ └── separation │ │ │ ├── GhostAssignability.scala │ │ │ ├── GhostClassifier.scala │ │ │ ├── GhostLessPrinter.scala │ │ │ ├── GhostSeparation.scala │ │ │ ├── GhostType.scala │ │ │ ├── GhostTyping.scala │ │ │ ├── GhostWellDef.scala │ │ │ └── GoifyingPrinter.scala │ │ ├── reporting │ │ ├── BackTranslator.scala │ │ ├── BacktranslatingReporter.scala │ │ ├── DefaultErrorBackTranslator.scala │ │ ├── DefaultMessageBackTranslator.scala │ │ ├── LogbackOutputHighlighter.scala │ │ ├── Message.scala │ │ ├── Reporter.scala │ │ ├── Source.scala │ │ ├── StatsCollector.scala │ │ ├── VerifierError.scala │ │ └── VerifierResult.scala │ │ ├── theory │ │ └── Addressability.scala │ │ ├── translator │ │ ├── Names.scala │ │ ├── Translator.scala │ │ ├── context │ │ │ ├── Collector.scala │ │ │ ├── CollectorImpl.scala │ │ │ ├── Context.scala │ │ │ ├── ContextImpl.scala │ │ │ ├── DfltTranslatorConfig.scala │ │ │ └── TranslatorConfig.scala │ │ ├── encodings │ │ │ ├── BoolEncoding.scala │ │ │ ├── DomainEncoding.scala │ │ │ ├── FloatEncoding.scala │ │ │ ├── IntEncoding.scala │ │ │ ├── PermissionEncoding.scala │ │ │ ├── PointerEncoding.scala │ │ │ ├── StringEncoding.scala │ │ │ ├── adts │ │ │ │ └── AdtEncoding.scala │ │ │ ├── arrays │ │ │ │ ├── ArrayEncoding.scala │ │ │ │ ├── ExclusiveArrayComponent.scala │ │ │ │ ├── ExclusiveArrayComponentImpl.scala │ │ │ │ ├── SharedArrayComponent.scala │ │ │ │ ├── SharedArrayComponentImpl.scala │ │ │ │ └── SharedArrayEmbedding.scala │ │ │ ├── channels │ │ │ │ └── ChannelEncoding.scala │ │ │ ├── closures │ │ │ │ ├── ClosureDomainEncoder.scala │ │ │ │ ├── ClosureEncoding.scala │ │ │ │ ├── ClosureSpecsEncoder.scala │ │ │ │ └── MethodObjectEncoder.scala │ │ │ ├── combinators │ │ │ │ ├── DefaultEncoding.scala │ │ │ │ ├── Encoding.scala │ │ │ │ ├── FinalTypeEncoding.scala │ │ │ │ ├── LeafTypeEncoding.scala │ │ │ │ ├── SafeTypeEncodingCombiner.scala │ │ │ │ ├── SequentialTypeEncodingCombiner.scala │ │ │ │ ├── TypeEncoding.scala │ │ │ │ └── TypeEncodingCombiner.scala │ │ │ ├── defaults │ │ │ │ ├── DefaultGlobalVarEncoding.scala │ │ │ │ ├── DefaultMethodEncoding.scala │ │ │ │ ├── DefaultPredicateEncoding.scala │ │ │ │ ├── DefaultPureMethodEncoding.scala │ │ │ │ └── DefaultTriggerExprEncoding.scala │ │ │ ├── interfaces │ │ │ │ ├── InterfaceComponent.scala │ │ │ │ ├── InterfaceComponentImpl.scala │ │ │ │ ├── InterfaceEncoding.scala │ │ │ │ ├── InterfaceUtils.scala │ │ │ │ ├── PolymorphValueComponent.scala │ │ │ │ ├── PolymorphValueComponentImpl.scala │ │ │ │ ├── TypeComponent.scala │ │ │ │ └── TypeComponentImpl.scala │ │ │ ├── maps │ │ │ │ ├── MapEncoding.scala │ │ │ │ └── MathematicalMapEncoding.scala │ │ │ ├── options │ │ │ │ └── OptionEncoding.scala │ │ │ ├── preds │ │ │ │ ├── DefuncComponent.scala │ │ │ │ ├── DefuncComponentImpl.scala │ │ │ │ └── PredEncoding.scala │ │ │ ├── programs │ │ │ │ ├── Programs.scala │ │ │ │ └── ProgramsImpl.scala │ │ │ ├── sequences │ │ │ │ └── SequenceEncoding.scala │ │ │ ├── sets │ │ │ │ └── SetEncoding.scala │ │ │ ├── slices │ │ │ │ └── SliceEncoding.scala │ │ │ ├── structs │ │ │ │ ├── ExclusiveStructComponent.scala │ │ │ │ ├── SharedStructComponent.scala │ │ │ │ ├── SharedStructComponentImpl.scala │ │ │ │ └── StructEncoding.scala │ │ │ └── typeless │ │ │ │ ├── AssertionEncoding.scala │ │ │ │ ├── BuiltInEncoding.scala │ │ │ │ ├── CallEncoding.scala │ │ │ │ ├── Comments.scala │ │ │ │ ├── ControlEncoding.scala │ │ │ │ ├── DeferEncoding.scala │ │ │ │ ├── GlobalEncoding.scala │ │ │ │ ├── MemoryEncoding.scala │ │ │ │ ├── OutlineEncoding.scala │ │ │ │ └── TerminationEncoding.scala │ │ ├── library │ │ │ ├── Generator.scala │ │ │ ├── arrays │ │ │ │ ├── Arrays.scala │ │ │ │ └── ArraysImpl.scala │ │ │ ├── conditions │ │ │ │ ├── Conditions.scala │ │ │ │ └── ConditionsImpl.scala │ │ │ ├── embeddings │ │ │ │ └── EmbeddingComponent.scala │ │ │ ├── equality │ │ │ │ ├── Equality.scala │ │ │ │ └── EqualityImpl.scala │ │ │ ├── fields │ │ │ │ ├── Fields.scala │ │ │ │ └── FieldsImpl.scala │ │ │ ├── fixpoints │ │ │ │ ├── Fixpoint.scala │ │ │ │ └── FixpointImpl.scala │ │ │ ├── multiplicity │ │ │ │ ├── SeqMultiplicity.scala │ │ │ │ └── SeqMultiplicityImpl.scala │ │ │ ├── options │ │ │ │ ├── OptionImpl.scala │ │ │ │ └── Options.scala │ │ │ ├── outlines │ │ │ │ ├── Outlines.scala │ │ │ │ └── OutlinesImpl.scala │ │ │ ├── slices │ │ │ │ ├── Slices.scala │ │ │ │ └── SlicesImpl.scala │ │ │ ├── tos │ │ │ │ ├── OptionToSeq.scala │ │ │ │ ├── OptionToSeqImpl.scala │ │ │ │ ├── SeqToMultiset.scala │ │ │ │ ├── SeqToMultisetImpl.scala │ │ │ │ ├── SeqToSet.scala │ │ │ │ └── SeqToSetImpl.scala │ │ │ ├── tuples │ │ │ │ ├── Tuples.scala │ │ │ │ └── TuplesImpl.scala │ │ │ └── unknowns │ │ │ │ ├── UnknownValues.scala │ │ │ │ └── UnknownValuesImpl.scala │ │ ├── transformers │ │ │ ├── AssumeTransformer.scala │ │ │ ├── TerminationDomainTransformer.scala │ │ │ └── ViperTransformer.scala │ │ └── util │ │ │ ├── Comments.scala │ │ │ ├── Core.scala │ │ │ ├── DomainGenerator.scala │ │ │ ├── FunctionGenerator.scala │ │ │ ├── MethodGenerator.scala │ │ │ ├── PartialFunctionCombiner.scala │ │ │ ├── PrimitiveGenerator.scala │ │ │ ├── Registrator.scala │ │ │ ├── TypePatterns.scala │ │ │ ├── ViperUtil.scala │ │ │ ├── ViperWriter.scala │ │ │ └── VprInfo.scala │ │ └── util │ │ ├── Algorithms.scala │ │ ├── BackendAnnotation.scala │ │ ├── ChopperUtil.scala │ │ ├── Computation.scala │ │ ├── Constants.scala │ │ ├── DesugarWriter.scala │ │ ├── GobraExecutionContext.scala │ │ ├── NumBase.scala │ │ ├── OutputUtil.scala │ │ ├── PluginAwareChopper.scala │ │ ├── RoseTree.scala │ │ ├── TaskManager.scala │ │ ├── TypeBounds.scala │ │ └── Violation.scala └── test │ ├── resources │ ├── better_errors │ │ ├── assign │ │ │ ├── const.go │ │ │ ├── const_type.go │ │ │ ├── got_assign_all.go │ │ │ ├── type.go │ │ │ ├── var.go │ │ │ └── var_type.go │ │ └── slices │ │ │ ├── both.go │ │ │ ├── second.go │ │ │ └── third.go │ ├── regressions │ │ ├── examples │ │ │ ├── all_nearest_smaller_values.gobra │ │ │ ├── disableNL.gobra │ │ │ ├── disableNL_success.gobra │ │ │ ├── evaluation │ │ │ │ ├── binary_search_tree.gobra │ │ │ │ ├── binary_tree.gobra │ │ │ │ ├── dense_sparse_matrix.gobra │ │ │ │ ├── dutchflag.gobra │ │ │ │ ├── example-2-1.gobra │ │ │ │ ├── example-2-2.gobra │ │ │ │ ├── heapsort.gobra │ │ │ │ ├── impl_errors │ │ │ │ │ ├── binary_search_tree.gobra │ │ │ │ │ ├── binary_tree.gobra │ │ │ │ │ ├── dense_sparse_matrix.gobra │ │ │ │ │ ├── dutchflag.gobra │ │ │ │ │ ├── example-2-1.gobra │ │ │ │ │ ├── example-2-2.gobra │ │ │ │ │ ├── heapsort.gobra │ │ │ │ │ ├── list_of_interfaces.gobra │ │ │ │ │ ├── pair_insertion_sort.gobra │ │ │ │ │ ├── parallel_search_replace.gobra │ │ │ │ │ ├── parallel_sum.gobra │ │ │ │ │ ├── relaxed_prefix.gobra │ │ │ │ │ ├── visitor_pattern.gobra │ │ │ │ │ └── zune.gobra │ │ │ │ ├── list_of_interfaces.gobra │ │ │ │ ├── pair_insertion_sort.gobra │ │ │ │ ├── parallel_search_replace.gobra │ │ │ │ ├── parallel_sum.gobra │ │ │ │ ├── relaxed_prefix.gobra │ │ │ │ ├── spec_errors │ │ │ │ │ ├── binary_search_tree.gobra │ │ │ │ │ ├── binary_tree.gobra │ │ │ │ │ ├── dense_sparse_matrix.gobra │ │ │ │ │ ├── dutchflag.gobra │ │ │ │ │ ├── example-2-1.gobra │ │ │ │ │ ├── example-2-2.gobra │ │ │ │ │ ├── heapsort.gobra │ │ │ │ │ ├── list_of_interfaces.gobra │ │ │ │ │ ├── pair_insertion_sort.gobra │ │ │ │ │ ├── parallel_search_replace.gobra │ │ │ │ │ ├── parallel_sum.gobra │ │ │ │ │ ├── relaxed_prefix.gobra │ │ │ │ │ ├── visitor_pattern.gobra │ │ │ │ │ └── zune.gobra │ │ │ │ ├── visitor_pattern.gobra │ │ │ │ └── zune.gobra │ │ │ ├── parallel_search_replace_shared.gobra │ │ │ ├── swap.gobra │ │ │ ├── switch.gobra │ │ │ ├── tour │ │ │ │ ├── Test1.gobra │ │ │ │ ├── Test2.gobra │ │ │ │ ├── Test3.gobra │ │ │ │ ├── Test4.gobra │ │ │ │ └── Tree.gobra │ │ │ └── tutorial-examples │ │ │ │ ├── basic-annotations.gobra │ │ │ │ ├── channels.gobra │ │ │ │ ├── comparability.gobra │ │ │ │ ├── concurrency.gobra │ │ │ │ ├── external-interface │ │ │ │ ├── counterImpl │ │ │ │ │ └── counterImpl.gobra │ │ │ │ └── streamInterface │ │ │ │ │ └── counterStream.gobra │ │ │ │ ├── ghost-code.gobra │ │ │ │ ├── interfaces.gobra │ │ │ │ ├── multi-channel.gobra │ │ │ │ ├── mutex.gobra │ │ │ │ ├── permissions.gobra │ │ │ │ ├── predicate.gobra │ │ │ │ ├── quantified-permissions.gobra │ │ │ │ └── total-correctness.gobra │ │ ├── features │ │ │ ├── adts │ │ │ │ ├── fields1.gobra │ │ │ │ ├── match-error1.gobra │ │ │ │ ├── simple-match1.gobra │ │ │ │ ├── simple1.gobra │ │ │ │ ├── stateMachine1.gobra │ │ │ │ ├── termination-fail1.gobra │ │ │ │ └── termination-success1.gobra │ │ │ ├── arrays │ │ │ │ ├── array-capacity-fail1.gobra │ │ │ │ ├── array-capacity-fail2.gobra │ │ │ │ ├── array-capacity-simple1.gobra │ │ │ │ ├── array-capacity-simple2.gobra │ │ │ │ ├── array-convert-fail1.gobra │ │ │ │ ├── array-convert-fail2.gobra │ │ │ │ ├── array-convert-fail3.gobra │ │ │ │ ├── array-convert-fail4.gobra │ │ │ │ ├── array-convert-fail5.gobra │ │ │ │ ├── array-convert-fail6.gobra │ │ │ │ ├── array-convert-simple1.gobra │ │ │ │ ├── array-index-fail1.gobra │ │ │ │ ├── array-index-fail2.gobra │ │ │ │ ├── array-index-fail3.gobra │ │ │ │ ├── array-index-fail4.gobra │ │ │ │ ├── array-index-fail5.gobra │ │ │ │ ├── array-index-fail6.gobra │ │ │ │ ├── array-index-fail7.gobra │ │ │ │ ├── array-index-fail8.gobra │ │ │ │ ├── array-index-simple1.gobra │ │ │ │ ├── array-index-simple2.gobra │ │ │ │ ├── array-index-simple3.gobra │ │ │ │ ├── array-index-simple4.gobra │ │ │ │ ├── array-index-simple5.gobra │ │ │ │ ├── array-index-simple6.gobra │ │ │ │ ├── array-index-simple7.gobra │ │ │ │ ├── array-index-simple8.gobra │ │ │ │ ├── array-index-simple9.gobra │ │ │ │ ├── array-length-fail1.gobra │ │ │ │ ├── array-length-fail2.gobra │ │ │ │ ├── array-length-simple1.gobra │ │ │ │ ├── array-length-simple2.gobra │ │ │ │ ├── array-literal-fail1.gobra │ │ │ │ ├── array-literal-fail10.gobra │ │ │ │ ├── array-literal-fail11.gobra │ │ │ │ ├── array-literal-fail12.gobra │ │ │ │ ├── array-literal-fail13.gobra │ │ │ │ ├── array-literal-fail14.gobra │ │ │ │ ├── array-literal-fail15.gobra │ │ │ │ ├── array-literal-fail3.gobra │ │ │ │ ├── array-literal-fail4.gobra │ │ │ │ ├── array-literal-fail5.gobra │ │ │ │ ├── array-literal-fail6.gobra │ │ │ │ ├── array-literal-fail7.gobra │ │ │ │ ├── array-literal-fail8.gobra │ │ │ │ ├── array-literal-fail9.gobra │ │ │ │ ├── array-literal-simple1.gobra │ │ │ │ ├── array-literal-simple2.gobra │ │ │ │ ├── array-literal-simple3.gobra │ │ │ │ ├── array-ownership-fail1.gobra │ │ │ │ ├── array-ownership-fail2.gobra │ │ │ │ ├── array-ownership-fail3.gobra │ │ │ │ ├── array-ownership-fail4.gobra │ │ │ │ ├── array-ownership-simple1.gobra │ │ │ │ ├── array-type-fail1.gobra │ │ │ │ ├── array-type-fail2.gobra │ │ │ │ ├── array-type-fail3.gobra │ │ │ │ ├── array-type-fail4.gobra │ │ │ │ ├── array-type-fail5.gobra │ │ │ │ ├── array-type-fail7.gobra │ │ │ │ ├── array-type-simple1.gobra │ │ │ │ ├── array-type-simple2.gobra │ │ │ │ ├── array-type-simple3.gobra │ │ │ │ ├── array-type-simple4.gobra │ │ │ │ └── array-type-simple5.gobra │ │ │ ├── assume │ │ │ │ └── assume-simple-01.gobra │ │ │ ├── backendAnnotations │ │ │ │ └── mce-success1.gobra │ │ │ ├── backends │ │ │ │ ├── carbon.gobra │ │ │ │ ├── silicon.gobra │ │ │ │ ├── vs-with-carbon.gobra │ │ │ │ └── vs-with-silicon.gobra │ │ │ ├── blank_identifier │ │ │ │ ├── blank-identifier-fail1.gobra │ │ │ │ ├── blank-identifier-fail2.gobra │ │ │ │ └── blank-identifier1.gobra │ │ │ ├── builtin │ │ │ │ ├── append-fail1.gobra │ │ │ │ ├── append-fail2.gobra │ │ │ │ ├── append-simple1.gobra │ │ │ │ ├── copy-fail1.gobra │ │ │ │ ├── copy-fail2.gobra │ │ │ │ ├── copy-fail3.gobra │ │ │ │ ├── copy-simple1.gobra │ │ │ │ └── copy-simple2.gobra │ │ │ ├── channels │ │ │ │ ├── bar │ │ │ │ │ └── bar.gobra │ │ │ │ ├── channel-fail1.gobra │ │ │ │ ├── channel-fail2.gobra │ │ │ │ ├── channel-fail3.gobra │ │ │ │ ├── channel-fail4.gobra │ │ │ │ ├── channel-fail5.gobra │ │ │ │ ├── channel-fail6.gobra │ │ │ │ ├── channel-fail7.gobra │ │ │ │ ├── channel-fail8.gobra │ │ │ │ ├── channel-fail9.go │ │ │ │ ├── channel-simple-buffered1.gobra │ │ │ │ ├── channel-simple-buffered2.gobra │ │ │ │ ├── channel-simple1.gobra │ │ │ │ ├── channel-simple2.gobra │ │ │ │ ├── channel-simple3.gobra │ │ │ │ ├── channel-simple4.gobra │ │ │ │ ├── channel-simple5.gobra │ │ │ │ ├── channel-simple6.gobra │ │ │ │ ├── channel-simple7.gobra │ │ │ │ ├── channel-simple8.gobra │ │ │ │ ├── channel-simple9.gobra │ │ │ │ ├── foo │ │ │ │ │ └── foo.gobra │ │ │ │ └── multi-channel-simple1.gobra │ │ │ ├── closures │ │ │ │ ├── closures-calldesc1.gobra │ │ │ │ ├── closures-calldesc2.gobra │ │ │ │ ├── closures-calldesc3.gobra │ │ │ │ ├── closures-calldesc4-map.gobra │ │ │ │ ├── closures-fail1-precondition.gobra │ │ │ │ ├── closures-fail2-captured.gobra │ │ │ │ ├── closures-fail3-captured.gobra │ │ │ │ ├── closures-fail4-ghost-args.gobra │ │ │ │ ├── closures-fail5-proofs.gobra │ │ │ │ ├── closures-fail6-proofs.gobra │ │ │ │ ├── closures-proofs-withtermination.gobra │ │ │ │ ├── closures-recursion1-simple.gobra │ │ │ │ ├── closures-recursion2-mutual.gobra │ │ │ │ ├── closures-refine-interface.gobra │ │ │ │ ├── closures-simple1.gobra │ │ │ │ ├── closures-simple2.gobra │ │ │ │ ├── closures-simple3-pure.gobra │ │ │ │ └── closures-termination.gobra │ │ │ ├── conversion │ │ │ │ ├── conversion-fail01.gobra │ │ │ │ └── conversion-simple01.gobra │ │ │ ├── defer │ │ │ │ ├── defer-simple-01.gobra │ │ │ │ ├── defer-simple-02.gobra │ │ │ │ ├── defer-simple-03.gobra │ │ │ │ ├── defer-simple-04.gobra │ │ │ │ └── defer-simple-05.gobra │ │ │ ├── defunc │ │ │ │ ├── defunc-fail1.gobra │ │ │ │ ├── defunc1.gobra │ │ │ │ ├── import-preds.gobra │ │ │ │ ├── includes │ │ │ │ │ └── preds │ │ │ │ │ │ └── predicate.gobra │ │ │ │ ├── mutex1.gobra │ │ │ │ ├── pred-construct-fail1.gobra │ │ │ │ ├── pred-expr-base1.gobra │ │ │ │ ├── waitgroup-fail1.gobra │ │ │ │ └── waitgroup-simple1.gobra │ │ │ ├── domains │ │ │ │ ├── implements-interface-fail01.gobra │ │ │ │ ├── implements-interface-fail02.gobra │ │ │ │ ├── implements-interface-fail03.gobra │ │ │ │ ├── implements-interface-fail04.gobra │ │ │ │ ├── implements-interface-imported-simple01.gobra │ │ │ │ ├── implements-interface-imported-simple01 │ │ │ │ │ └── foo │ │ │ │ │ │ └── foo.gobra │ │ │ │ ├── implements-interface-simple01.gobra │ │ │ │ ├── implements-interface-simple02.gobra │ │ │ │ └── intPair.gobra │ │ │ ├── errors │ │ │ │ ├── bar │ │ │ │ │ └── bar.gobra │ │ │ │ ├── error-fail1.gobra │ │ │ │ ├── error-fail2.gobra │ │ │ │ ├── error-simple1.gobra │ │ │ │ ├── error-simple2.gobra │ │ │ │ └── error-simple3.gobra │ │ │ ├── floats │ │ │ │ ├── floats-fail-01.gobra │ │ │ │ ├── floats-fail-02.gobra │ │ │ │ └── floats-simple-01.gobra │ │ │ ├── fractional_permissions │ │ │ │ ├── fields │ │ │ │ │ ├── fail1.gobra │ │ │ │ │ ├── fail2.gobra │ │ │ │ │ ├── fail3.gobra │ │ │ │ │ ├── simple1.gobra │ │ │ │ │ ├── simple2.gobra │ │ │ │ │ ├── simple3.gobra │ │ │ │ │ ├── wildcard-fail1.gobra │ │ │ │ │ ├── wildcard-simple1.gobra │ │ │ │ │ └── wildcard-simple2.gobra │ │ │ │ ├── perm-fail1.gobra │ │ │ │ ├── perm-fail2.gobra │ │ │ │ ├── perm-simple1.gobra │ │ │ │ └── predicates │ │ │ │ │ ├── fail1.gobra │ │ │ │ │ ├── fail2.gobra │ │ │ │ │ ├── fail3.gobra │ │ │ │ │ ├── simple1.gobra │ │ │ │ │ ├── simple2.gobra │ │ │ │ │ ├── simple3.gobra │ │ │ │ │ ├── wildcard-fail1.gobra │ │ │ │ │ ├── wildcard-simple1.gobra │ │ │ │ │ └── wildcard-simple2.gobra │ │ │ ├── functions │ │ │ │ └── functions-fail1.gobra │ │ │ ├── ghost_field │ │ │ │ ├── ghost-embedding-fail01.gobra │ │ │ │ ├── ghost-embedding-simple01.gobra │ │ │ │ ├── ghost-field-comparison-simple01.gobra │ │ │ │ ├── ghost-field-comparison-simple02.gobra │ │ │ │ ├── ghost-field-fail01.gobra │ │ │ │ ├── ghost-field-ghost-type-fail01.gobra │ │ │ │ ├── ghost-field-ghost-type-simple01.gobra │ │ │ │ ├── ghost-field-interface-fail01.gobra │ │ │ │ ├── ghost-field-interface-simple01.gobra │ │ │ │ ├── ghost-field-map-fail01.gobra │ │ │ │ └── ghost-field-simple01.gobra │ │ │ ├── ghost_members │ │ │ │ ├── ghost-function.gobra │ │ │ │ ├── ghost-method-fail01.gobra │ │ │ │ ├── ghost-method-simple01.gobra │ │ │ │ ├── ghost-method.gobra │ │ │ │ ├── ghost-overflows.gobra │ │ │ │ └── ghost-pure-function.gobra │ │ │ ├── ghost_pointer │ │ │ │ ├── ghost-array-fail01.gobra │ │ │ │ ├── ghost-array-range-fail01.gobra │ │ │ │ ├── ghost-array-range-simple01.gobra │ │ │ │ ├── ghost-array-simple01.gobra │ │ │ │ ├── ghost-fields-fail01.gobra │ │ │ │ ├── ghost-location-fail01.gobra │ │ │ │ ├── ghost-nil-simple01.gobra │ │ │ │ ├── ghost-pointer-receiver-fail01.gobra │ │ │ │ ├── ghost-pointer-receiver-simple01.gobra │ │ │ │ ├── ghost-read-fail01.gobra │ │ │ │ ├── ghost-reference-fail01.gobra │ │ │ │ ├── ghost-reference-fail02.gobra │ │ │ │ ├── ghost-reference-simple01.gobra │ │ │ │ ├── ghost-write-fail01.gobra │ │ │ │ ├── ghost-write-fail02.gobra │ │ │ │ ├── ghost-write-simple01.gobra │ │ │ │ ├── pointer-creation-fail01.gobra │ │ │ │ └── pointer-creation-simple01.gobra │ │ │ ├── ghost_type │ │ │ │ ├── ghost-struct-comparison-fail01.gobra │ │ │ │ ├── ghost-struct-comparison-fail02.gobra │ │ │ │ ├── ghost-struct-comparison-simple01.gobra │ │ │ │ ├── ghost-struct-embedding-fail01.gobra │ │ │ │ ├── ghost-struct-literal-simple01.gobra │ │ │ │ ├── ghost-struct-type-fail01.gobra │ │ │ │ ├── ghost-struct-type-fail02.gobra │ │ │ │ ├── ghost-struct-type-simple01.gobra │ │ │ │ ├── ghost-type-decl-fail01.gobra │ │ │ │ ├── ghost-type-decl-fail02.gobra │ │ │ │ ├── ghost-type-decl-fail03.gobra │ │ │ │ ├── ghost-type-decl-simple01.gobra │ │ │ │ └── ghost-type-decl-simple02.gobra │ │ │ ├── global_consts │ │ │ │ ├── global-const-1.gobra │ │ │ │ ├── global-const-10.gobra │ │ │ │ ├── global-const-2.gobra │ │ │ │ ├── global-const-3.gobra │ │ │ │ ├── global-const-4.gobra │ │ │ │ ├── global-const-5.gobra │ │ │ │ ├── global-const-6.gobra │ │ │ │ ├── global-const-7.gobra │ │ │ │ ├── global-const-8.gobra │ │ │ │ └── global-const-9.gobra │ │ │ ├── globals │ │ │ │ ├── globals-exclusive-simple01.gobra │ │ │ │ ├── globals-exclusive-type-fail01.gobra │ │ │ │ ├── globals-fail01.gobra │ │ │ │ ├── globals-simple01.gobra │ │ │ │ ├── globals-type-fail01.gobra │ │ │ │ ├── globals-type-fail02.gobra │ │ │ │ ├── globals-type-fail03.gobra │ │ │ │ ├── globals-type-fail04.gobra │ │ │ │ ├── globals-type-fail05.gobra │ │ │ │ ├── globals-type-fail06.gobra │ │ │ │ ├── impl-shorthand-fail01.gobra │ │ │ │ ├── impl-shorthand-fail02.gobra │ │ │ │ ├── impl-shorthand-simple01.gobra │ │ │ │ ├── itfAssign │ │ │ │ │ ├── defs │ │ │ │ │ │ └── defs.gobra │ │ │ │ │ └── main.gobra │ │ │ │ └── scion │ │ │ │ │ ├── monotonicset │ │ │ │ │ └── bounded.gobra │ │ │ │ │ ├── path │ │ │ │ │ ├── onehop │ │ │ │ │ │ └── onehop.go │ │ │ │ │ ├── path.go │ │ │ │ │ └── scion │ │ │ │ │ │ └── base.go │ │ │ │ │ └── scion.go │ │ │ ├── go_programs │ │ │ │ ├── fail1.gobra │ │ │ │ └── simple-1.go │ │ │ ├── go_routines │ │ │ │ ├── go-routines-closures-fail1.gobra │ │ │ │ ├── go-routines-closures1.gobra │ │ │ │ ├── go-routines-fail1.gobra │ │ │ │ └── go-routines1.gobra │ │ │ ├── header_only │ │ │ │ ├── main1.gobra │ │ │ │ └── pkg1 │ │ │ │ │ ├── main-fail.gobra │ │ │ │ │ └── main.gobra │ │ │ ├── import │ │ │ │ ├── closure_import │ │ │ │ │ ├── foo │ │ │ │ │ │ └── foo.gobra │ │ │ │ │ └── main.gobra │ │ │ │ ├── constant_import │ │ │ │ │ ├── bar │ │ │ │ │ │ └── bar.gobra │ │ │ │ │ ├── bar2 │ │ │ │ │ │ └── bar2.gobra │ │ │ │ │ ├── bar3 │ │ │ │ │ │ └── bar3.gobra │ │ │ │ │ ├── main.gobra │ │ │ │ │ ├── main2.gobra │ │ │ │ │ └── main3.gobra │ │ │ │ ├── cyclic_import │ │ │ │ │ ├── bar │ │ │ │ │ │ └── bar.gobra │ │ │ │ │ ├── foo │ │ │ │ │ │ └── foo.gobra │ │ │ │ │ └── main.gobra │ │ │ │ ├── error_reporting_import │ │ │ │ │ ├── bar │ │ │ │ │ │ └── bar.gobra │ │ │ │ │ └── main.gobra │ │ │ │ ├── error_reporting_import2 │ │ │ │ │ ├── foo │ │ │ │ │ │ └── foo.gobra │ │ │ │ │ └── main.gobra │ │ │ │ ├── error_reporting_import3 │ │ │ │ │ ├── foo │ │ │ │ │ │ └── foo.gobra │ │ │ │ │ └── main.gobra │ │ │ │ ├── fpredicate_import │ │ │ │ │ ├── bar │ │ │ │ │ │ └── bar.gobra │ │ │ │ │ └── main.gobra │ │ │ │ ├── function_import │ │ │ │ │ ├── bar │ │ │ │ │ │ └── bar.gobra │ │ │ │ │ └── main.gobra │ │ │ │ ├── ghost_member_import │ │ │ │ │ ├── bar │ │ │ │ │ │ └── bar.gobra │ │ │ │ │ └── main.gobra │ │ │ │ ├── import-fail1.gobra │ │ │ │ ├── import-fail2.gobra │ │ │ │ ├── import-fail3.gobra │ │ │ │ ├── import1.gobra │ │ │ │ ├── import2.gobra │ │ │ │ ├── import3.gobra │ │ │ │ ├── invalid_package_clause │ │ │ │ │ ├── invalid_package_clause1.gobra │ │ │ │ │ └── invalid_package_clause2.gobra │ │ │ │ ├── method_import │ │ │ │ │ ├── assert-fail1.gobra │ │ │ │ │ ├── assert-simple1.gobra │ │ │ │ │ ├── assertPkg │ │ │ │ │ │ └── assert.gobra │ │ │ │ │ ├── bar │ │ │ │ │ │ └── bar.gobra │ │ │ │ │ ├── bar2 │ │ │ │ │ │ └── bar2.gobra │ │ │ │ │ ├── main.gobra │ │ │ │ │ └── main2.gobra │ │ │ │ ├── mpredicate_import │ │ │ │ │ ├── bar │ │ │ │ │ │ └── bar.gobra │ │ │ │ │ └── main.gobra │ │ │ │ ├── multi_import │ │ │ │ │ ├── bar │ │ │ │ │ │ └── bar.gobra │ │ │ │ │ ├── foo │ │ │ │ │ │ └── foo.gobra │ │ │ │ │ ├── main1.gobra │ │ │ │ │ ├── main2.gobra │ │ │ │ │ ├── main3.gobra │ │ │ │ │ ├── main4.gobra │ │ │ │ │ └── main5.gobra │ │ │ │ ├── namespace_import │ │ │ │ │ ├── bar │ │ │ │ │ │ └── bar.gobra │ │ │ │ │ └── main.gobra │ │ │ │ ├── omitted_package_name │ │ │ │ │ ├── bar │ │ │ │ │ │ └── bar.gobra │ │ │ │ │ ├── lib │ │ │ │ │ │ └── foo │ │ │ │ │ │ │ └── foo.gobra │ │ │ │ │ └── main.gobra │ │ │ │ ├── parse_error │ │ │ │ │ └── parse_error.gobra │ │ │ │ ├── simple_type_import │ │ │ │ │ ├── bar │ │ │ │ │ │ └── bar.gobra │ │ │ │ │ └── main.gobra │ │ │ │ ├── struct_import │ │ │ │ │ ├── bar │ │ │ │ │ │ └── bar.gobra │ │ │ │ │ └── main.gobra │ │ │ │ ├── unique_qualifiers │ │ │ │ │ ├── bar │ │ │ │ │ │ └── bar.gobra │ │ │ │ │ ├── main1.gobra │ │ │ │ │ ├── main2.gobra │ │ │ │ │ ├── main3.gobra │ │ │ │ │ └── main4.gobra │ │ │ │ └── unqualified_import │ │ │ │ │ ├── functions │ │ │ │ │ ├── bar1 │ │ │ │ │ │ └── bar1.gobra │ │ │ │ │ ├── bar2_1 │ │ │ │ │ │ └── bar2_1.gobra │ │ │ │ │ ├── bar2_2 │ │ │ │ │ │ └── bar2_2.gobra │ │ │ │ │ ├── bar3 │ │ │ │ │ │ └── bar3.gobra │ │ │ │ │ ├── main1.gobra │ │ │ │ │ ├── main2.gobra │ │ │ │ │ └── main3.gobra │ │ │ │ │ └── methods │ │ │ │ │ ├── bar │ │ │ │ │ └── bar.gobra │ │ │ │ │ └── main.gobra │ │ │ ├── integers │ │ │ │ ├── bitwise-operators-const-fail1.gobra │ │ │ │ ├── bitwise-operators-const-simple1.gobra │ │ │ │ ├── bitwise-operators-fail1.gobra │ │ │ │ ├── int-assign-fail1.gobra │ │ │ │ ├── int-bounds1.gobra │ │ │ │ ├── int-bounds2.gobra │ │ │ │ ├── int-lit-bases-fail1.gobra │ │ │ │ ├── int-lit-bases-fail2.gobra │ │ │ │ ├── int-lit-bases-fail3.gobra │ │ │ │ ├── int-lit-bases-fail4.gobra │ │ │ │ ├── int-lit-bases-fail5.gobra │ │ │ │ ├── int-lit-bases-fail6.gobra │ │ │ │ ├── int-lit-bases-simple.gobra │ │ │ │ ├── int-sizes1.gobra │ │ │ │ └── int-sizes2.gobra │ │ │ ├── interfaces │ │ │ │ ├── boxAndUnbox1.gobra │ │ │ │ ├── comparable1.gobra │ │ │ │ ├── counterImpl │ │ │ │ │ └── counterImpl.gobra │ │ │ │ ├── counterStream.gobra │ │ │ │ ├── distributed_interface_case │ │ │ │ │ ├── cell │ │ │ │ │ │ └── cell.gobra │ │ │ │ │ ├── cellImplProof │ │ │ │ │ │ └── cell-impl-proof.gobra │ │ │ │ │ ├── cellMem │ │ │ │ │ │ └── cell-mem.gobra │ │ │ │ │ ├── client.gobra │ │ │ │ │ └── getterSetter │ │ │ │ │ │ └── getter-setter.gobra │ │ │ │ ├── embeddedInterfaces-fail1.gobra │ │ │ │ ├── embeddedInterfaces-fail2.gobra │ │ │ │ ├── embeddedInterfaces-fail3.gobra │ │ │ │ ├── embeddedInterfaces-fail4.gobra │ │ │ │ ├── embeddedInterfaces-fail5.gobra │ │ │ │ ├── embeddedInterfaces-fail6.gobra │ │ │ │ ├── embeddedInterfaces-fail7.gobra │ │ │ │ ├── embeddedInterfaces1.gobra │ │ │ │ ├── embeddedInterfaces2.gobra │ │ │ │ ├── embeddedInterfaces3.gobra │ │ │ │ ├── embeddedInterfaces4.gobra │ │ │ │ ├── embeddedInterfaces5.gobra │ │ │ │ ├── embeddedInterfaces6.gobra │ │ │ │ ├── ghostMembers.gobra │ │ │ │ ├── ghostnessOfImplementation-fail1.gobra │ │ │ │ ├── multipleInterfaces1.gobra │ │ │ │ ├── multipleInterfaces2.gobra │ │ │ │ ├── multipleInterfaces3.gobra │ │ │ │ ├── multipleInterfaces4.gobra │ │ │ │ ├── nonEmptyInterface1.gobra │ │ │ │ ├── nonUniqueInterfaceMembers.gobra │ │ │ │ ├── pointerAndTypeImplementing.gobra │ │ │ │ ├── predicateWithInterfaceParam.gobra │ │ │ │ ├── proofGenFail1.gobra │ │ │ │ ├── proofGenForImport.gobra │ │ │ │ ├── proofGenForImportPkg │ │ │ │ │ └── pkg.gobra │ │ │ │ ├── safeTypeAssertion1.gobra │ │ │ │ └── typeOf1.gobra │ │ │ ├── iota │ │ │ │ ├── iota-fail-01.go │ │ │ │ ├── iota-simple-01.gobra │ │ │ │ └── iota-simple-02.gobra │ │ │ ├── labels │ │ │ │ ├── duplicate-labels.gobra │ │ │ │ └── ghost-label.gobra │ │ │ ├── let │ │ │ │ ├── let_fail1.gobra │ │ │ │ └── let_simple.gobra │ │ │ ├── loops │ │ │ │ ├── loops-break-fail1.gobra │ │ │ │ ├── loops-break-fail2.gobra │ │ │ │ ├── loops-break-label-fail1.gobra │ │ │ │ ├── loops-break-label-fail2.gobra │ │ │ │ ├── loops-break-label1.gobra │ │ │ │ ├── loops-break-label2.gobra │ │ │ │ ├── loops-break1.gobra │ │ │ │ ├── loops-break2.gobra │ │ │ │ ├── loops-continue-fail1.gobra │ │ │ │ ├── loops-continue-fail2.gobra │ │ │ │ ├── loops-continue-fail3.gobra │ │ │ │ ├── loops-continue-fail4.gobra │ │ │ │ ├── loops-continue-label-fail1.gobra │ │ │ │ ├── loops-continue-label-fail2.gobra │ │ │ │ ├── loops-continue-label1.gobra │ │ │ │ ├── loops-continue-label2.gobra │ │ │ │ ├── loops-continue-label3.gobra │ │ │ │ ├── loops-continue-label4.gobra │ │ │ │ ├── loops-continue-label5.gobra │ │ │ │ ├── loops-continue1.gobra │ │ │ │ ├── loops-continue2.gobra │ │ │ │ ├── loops-continue3.gobra │ │ │ │ ├── loops-continue4.gobra │ │ │ │ ├── loops-continue5.gobra │ │ │ │ ├── loops-ghost-fail1.gobra │ │ │ │ ├── loops-ghost-simple1.gobra │ │ │ │ ├── range-fail1.gobra │ │ │ │ ├── range-fail2.gobra │ │ │ │ ├── range-fail3.gobra │ │ │ │ ├── range-fail4.gobra │ │ │ │ ├── range-fail5.gobra │ │ │ │ ├── range-fail6.gobra │ │ │ │ ├── range-fail7.gobra │ │ │ │ ├── range-fail8.gobra │ │ │ │ ├── range1.gobra │ │ │ │ ├── range2.gobra │ │ │ │ ├── range3.gobra │ │ │ │ ├── range_maps-fail1.gobra │ │ │ │ └── range_maps1.gobra │ │ │ ├── make_and_new │ │ │ │ ├── make-fail1.gobra │ │ │ │ ├── make1.gobra │ │ │ │ └── new.gobra │ │ │ ├── maps │ │ │ │ ├── maps-declared-type-simple1.gobra │ │ │ │ ├── maps-fail1.gobra │ │ │ │ ├── maps-fail2.gobra │ │ │ │ ├── maps-fail3.gobra │ │ │ │ ├── maps-nested.gobra │ │ │ │ ├── maps-simple1.gobra │ │ │ │ ├── math-maps-declared-type-simple1.gobra │ │ │ │ ├── math-maps-fail1.gobra │ │ │ │ ├── math-maps-simple1.gobra │ │ │ │ └── math-maps-simple2.gobra │ │ │ ├── multi-assign.gobra │ │ │ ├── multisets │ │ │ │ ├── multiset-cardinality-fail1.gobra │ │ │ │ ├── multiset-cardinality-fail2.gobra │ │ │ │ ├── multiset-cardinality-fail3.gobra │ │ │ │ ├── multiset-cardinality-fail4.gobra │ │ │ │ ├── multiset-cardinality-simple1.gobra │ │ │ │ ├── multiset-contains-fail1.gobra │ │ │ │ ├── multiset-contains-fail2.gobra │ │ │ │ ├── multiset-contains-fail3.gobra │ │ │ │ ├── multiset-contains-fail4.gobra │ │ │ │ ├── multiset-contains-fail5.gobra │ │ │ │ ├── multiset-contains-fail6.gobra │ │ │ │ ├── multiset-contains-simple1.gobra │ │ │ │ ├── multiset-convert-fail1.gobra │ │ │ │ ├── multiset-convert-fail10.gobra │ │ │ │ ├── multiset-convert-fail11.gobra │ │ │ │ ├── multiset-convert-fail12.gobra │ │ │ │ ├── multiset-convert-fail2.gobra │ │ │ │ ├── multiset-convert-fail3.gobra │ │ │ │ ├── multiset-convert-fail4.gobra │ │ │ │ ├── multiset-convert-fail5.gobra │ │ │ │ ├── multiset-convert-fail6.gobra │ │ │ │ ├── multiset-convert-fail7.gobra │ │ │ │ ├── multiset-convert-fail8.gobra │ │ │ │ ├── multiset-convert-fail9.gobra │ │ │ │ ├── multiset-convert-simple1.gobra │ │ │ │ ├── multiset-convert-simple2.gobra │ │ │ │ ├── multiset-convert-simple3.gobra │ │ │ │ ├── multiset-declared-type-simple1.gobra │ │ │ │ ├── multiset-intersection-fail1.gobra │ │ │ │ ├── multiset-intersection-fail2.gobra │ │ │ │ ├── multiset-intersection-fail3.gobra │ │ │ │ ├── multiset-intersection-fail4.gobra │ │ │ │ ├── multiset-intersection-simple1.gobra │ │ │ │ ├── multiset-literal-fail1.gobra │ │ │ │ ├── multiset-literal-fail10.gobra │ │ │ │ ├── multiset-literal-fail11.gobra │ │ │ │ ├── multiset-literal-fail12.gobra │ │ │ │ ├── multiset-literal-fail13.gobra │ │ │ │ ├── multiset-literal-fail2.gobra │ │ │ │ ├── multiset-literal-fail3.gobra │ │ │ │ ├── multiset-literal-fail4.gobra │ │ │ │ ├── multiset-literal-fail5.gobra │ │ │ │ ├── multiset-literal-fail6.gobra │ │ │ │ ├── multiset-literal-fail7.gobra │ │ │ │ ├── multiset-literal-fail8.gobra │ │ │ │ ├── multiset-literal-fail9.gobra │ │ │ │ ├── multiset-literal-simple1.gobra │ │ │ │ ├── multiset-literal-simple2.gobra │ │ │ │ ├── multiset-multiplicity-fail1.gobra │ │ │ │ ├── multiset-multiplicity-fail2.gobra │ │ │ │ ├── multiset-multiplicity-fail3.gobra │ │ │ │ ├── multiset-multiplicity-fail4.gobra │ │ │ │ ├── multiset-multiplicity-simple1.gobra │ │ │ │ ├── multiset-range-fail1.gobra │ │ │ │ ├── multiset-range-fail2.gobra │ │ │ │ ├── multiset-range-fail3.gobra │ │ │ │ ├── multiset-range-fail4.gobra │ │ │ │ ├── multiset-range-fail5.gobra │ │ │ │ ├── multiset-range-fail6.gobra │ │ │ │ ├── multiset-range-simple1.gobra │ │ │ │ ├── multiset-setminus-fail1.gobra │ │ │ │ ├── multiset-setminus-fail2.gobra │ │ │ │ ├── multiset-setminus-fail3.gobra │ │ │ │ ├── multiset-setminus-fail4.gobra │ │ │ │ ├── multiset-setminus-fail5.gobra │ │ │ │ ├── multiset-setminus-simple1.gobra │ │ │ │ ├── multiset-subset-fail1.gobra │ │ │ │ ├── multiset-subset-fail2.gobra │ │ │ │ ├── multiset-subset-fail3.gobra │ │ │ │ ├── multiset-subset-fail4.gobra │ │ │ │ ├── multiset-subset-fail5.gobra │ │ │ │ ├── multiset-subset-fail6.gobra │ │ │ │ ├── multiset-subset-simple1.gobra │ │ │ │ ├── multiset-type-fail1.gobra │ │ │ │ ├── multiset-type-fail2.gobra │ │ │ │ ├── multiset-type-fail3.gobra │ │ │ │ ├── multiset-type-fail4.gobra │ │ │ │ ├── multiset-type-fail5.gobra │ │ │ │ ├── multiset-type-fail6.gobra │ │ │ │ ├── multiset-type-fail7.gobra │ │ │ │ ├── multiset-type-simple1.gobra │ │ │ │ ├── multiset-type-simple2.gobra │ │ │ │ ├── multiset-union-fail1.gobra │ │ │ │ ├── multiset-union-fail2.gobra │ │ │ │ ├── multiset-union-fail3.gobra │ │ │ │ ├── multiset-union-fail4.gobra │ │ │ │ ├── multiset-union-fail5.gobra │ │ │ │ └── multiset-union-simple1.gobra │ │ │ ├── no_semicolons │ │ │ │ ├── examples │ │ │ │ │ ├── infinite_list.gobra │ │ │ │ │ ├── list.gobra │ │ │ │ │ ├── swap.gobra │ │ │ │ │ └── tour │ │ │ │ │ │ ├── Test1.gobra │ │ │ │ │ │ ├── Test2.gobra │ │ │ │ │ │ ├── Test3.gobra │ │ │ │ │ │ ├── Test4.gobra │ │ │ │ │ │ └── Tree.gobra │ │ │ │ ├── keywords.gobra │ │ │ │ ├── multi-assign.gobra │ │ │ │ ├── pointer-identity.gobra │ │ │ │ ├── predicates │ │ │ │ │ └── predicates-simple1.gobra │ │ │ │ ├── semicolon-completion.gobra │ │ │ │ ├── structs │ │ │ │ │ ├── literals.gobra │ │ │ │ │ ├── structs-simple1.gobra │ │ │ │ │ ├── structs-simple2.gobra │ │ │ │ │ └── structs-simple3.gobra │ │ │ │ ├── ternary_operator │ │ │ │ │ ├── ternary-operator1.gobra │ │ │ │ │ ├── ternary-operator2.gobra │ │ │ │ │ └── ternary-operator3.gobra │ │ │ │ └── while1.gobra │ │ │ ├── opaque │ │ │ │ ├── opaque-closure-fail1.gobra │ │ │ │ ├── opaque-fac1.gobra │ │ │ │ ├── opaque-fac2.gobra │ │ │ │ ├── opaque-fac3.gobra │ │ │ │ ├── opaque-function-fail1.gobra │ │ │ │ ├── opaque-interface-fail1.gobra │ │ │ │ ├── opaque-method-fail1.gobra │ │ │ │ ├── opaque-outline-fail1.gobra │ │ │ │ ├── opaque-spec-simple1.gobra │ │ │ │ ├── reveal-conversion-fail1.gobra │ │ │ │ ├── reveal-fail1.gobra │ │ │ │ ├── reveal-fail2.gobra │ │ │ │ └── reveal-predicate-fail1.gobra │ │ │ ├── options │ │ │ │ ├── options-declared-type-simple1.gobra │ │ │ │ ├── options-fail1.gobra │ │ │ │ ├── options-fail2.gobra │ │ │ │ ├── options-fail3.gobra │ │ │ │ ├── options-fail4.gobra │ │ │ │ ├── options-fail5.gobra │ │ │ │ ├── options-fail6.gobra │ │ │ │ ├── options-nested-maps.gobra │ │ │ │ ├── options-simple1.gobra │ │ │ │ ├── options-simple2.gobra │ │ │ │ └── options-simple3.gobra │ │ │ ├── outline │ │ │ │ ├── outline-simple1.gobra │ │ │ │ └── outline-simple2.gobra │ │ │ ├── overflow_checks │ │ │ │ ├── overflow_int32.gobra │ │ │ │ ├── overflow_int64.gobra │ │ │ │ ├── overflow_simple1.go │ │ │ │ └── subexpression_overflow.gobra │ │ │ ├── pointer-identity.gobra │ │ │ ├── predicates │ │ │ │ ├── foldability.gobra │ │ │ │ ├── predicates-simple1.gobra │ │ │ │ └── predicates_ill_formed1.gobra │ │ │ ├── preserves │ │ │ │ └── preserves-simple.gobra │ │ │ ├── purefuncs │ │ │ │ ├── add_trivial.gobra │ │ │ │ ├── quantifier1.gobra │ │ │ │ ├── quantifier2.gobra │ │ │ │ ├── sum_struct-fail.gobra │ │ │ │ ├── sum_struct.gobra │ │ │ │ └── unused-result.gobra │ │ │ ├── quantifiers │ │ │ │ ├── exists-fail1.gobra │ │ │ │ ├── exists-fail2.gobra │ │ │ │ ├── exists-fail3.gobra │ │ │ │ ├── exists-fail4.gobra │ │ │ │ ├── exists-simple1.gobra │ │ │ │ ├── exists-simple2.gobra │ │ │ │ ├── exists-simple3.gobra │ │ │ │ ├── exists-simple4.gobra │ │ │ │ ├── exists-trigger-fail1.gobra │ │ │ │ ├── exists-trigger-fail2.gobra │ │ │ │ ├── exists-trigger-fail3.gobra │ │ │ │ ├── exists-trigger-fail5.gobra │ │ │ │ ├── forall-fail1.gobra │ │ │ │ ├── forall-fail2.gobra │ │ │ │ ├── forall-fail3.gobra │ │ │ │ ├── forall-fail4.gobra │ │ │ │ ├── forall-fail5.gobra │ │ │ │ ├── forall-fail6.gobra │ │ │ │ ├── forall-simple1.gobra │ │ │ │ ├── forall-simple2.gobra │ │ │ │ ├── forall-simple3.gobra │ │ │ │ ├── forall-simple4.gobra │ │ │ │ ├── forall-trigger-fail1.gobra │ │ │ │ ├── forall-trigger-fail2.gobra │ │ │ │ ├── forall-trigger-fail3.gobra │ │ │ │ ├── forall-trigger-fail5.gobra │ │ │ │ ├── forall-trigger-fail6.gobra │ │ │ │ ├── quantperms-fail1.gobra │ │ │ │ ├── quantperms-fail2.gobra │ │ │ │ ├── quantperms-fail3.gobra │ │ │ │ ├── quantperms-fail4.gobra │ │ │ │ ├── quantperms-simple1.gobra │ │ │ │ ├── trigger-simple1.gobra │ │ │ │ ├── trigger-simple2.gobra │ │ │ │ ├── trigger-simple3.gobra │ │ │ │ └── trigger-simple4.gobra │ │ │ ├── refute │ │ │ │ ├── refute-fail-01.gobra │ │ │ │ ├── refute-fail-02.gobra │ │ │ │ └── refute-simple-01.gobra │ │ │ ├── runes │ │ │ │ ├── rune_values.gobra │ │ │ │ └── type-equality.gobra │ │ │ ├── sequences │ │ │ │ ├── seq-append-fail1.gobra │ │ │ │ ├── seq-append-fail2.gobra │ │ │ │ ├── seq-append-simple1.gobra │ │ │ │ ├── seq-contains-fail1.gobra │ │ │ │ ├── seq-contains-fail2.gobra │ │ │ │ ├── seq-contains-fail3.gobra │ │ │ │ ├── seq-contains-fail4.gobra │ │ │ │ ├── seq-contains-fail5.gobra │ │ │ │ ├── seq-contains-simple1.gobra │ │ │ │ ├── seq-convert-fail1.gobra │ │ │ │ ├── seq-convert-fail2.gobra │ │ │ │ ├── seq-convert-fail3.gobra │ │ │ │ ├── seq-convert-simple1.gobra │ │ │ │ ├── seq-declared-type-simple1.gobra │ │ │ │ ├── seq-index-fail1.gobra │ │ │ │ ├── seq-index-fail10.gobra │ │ │ │ ├── seq-index-fail2.gobra │ │ │ │ ├── seq-index-fail3.gobra │ │ │ │ ├── seq-index-fail4.gobra │ │ │ │ ├── seq-index-fail5.gobra │ │ │ │ ├── seq-index-fail6.gobra │ │ │ │ ├── seq-index-fail7.gobra │ │ │ │ ├── seq-index-fail8.gobra │ │ │ │ ├── seq-index-fail9.gobra │ │ │ │ ├── seq-index-simple1.gobra │ │ │ │ ├── seq-index-simple2.gobra │ │ │ │ ├── seq-length-fail1.gobra │ │ │ │ ├── seq-length-fail2.gobra │ │ │ │ ├── seq-length-fail3.gobra │ │ │ │ ├── seq-length-simple1.gobra │ │ │ │ ├── seq-literal-fail1.gobra │ │ │ │ ├── seq-literal-fail2.gobra │ │ │ │ ├── seq-literal-fail3.gobra │ │ │ │ ├── seq-literal-fail5.gobra │ │ │ │ ├── seq-literal-fail6.gobra │ │ │ │ ├── seq-literal-fail7.gobra │ │ │ │ ├── seq-literal-fail8.gobra │ │ │ │ ├── seq-literal-simple1.gobra │ │ │ │ ├── seq-literal-simple2.gobra │ │ │ │ ├── seq-literal-simple3.gobra │ │ │ │ ├── seq-multiplicity-fail1.gobra │ │ │ │ ├── seq-multiplicity-fail2.gobra │ │ │ │ ├── seq-multiplicity-fail3.gobra │ │ │ │ ├── seq-multiplicity-fail4.gobra │ │ │ │ ├── seq-multiplicity-fail5.gobra │ │ │ │ ├── seq-multiplicity-fail6.gobra │ │ │ │ ├── seq-multiplicity-simple1.gobra │ │ │ │ ├── seq-range-fail1.gobra │ │ │ │ ├── seq-range-fail2.gobra │ │ │ │ ├── seq-range-fail3.gobra │ │ │ │ ├── seq-range-simple1.gobra │ │ │ │ ├── seq-slice-fail1.gobra │ │ │ │ ├── seq-slice-fail2.gobra │ │ │ │ ├── seq-slice-fail3.gobra │ │ │ │ ├── seq-slice-fail4.gobra │ │ │ │ ├── seq-slice-fail5.gobra │ │ │ │ ├── seq-slice-fail6.gobra │ │ │ │ ├── seq-slice-simple1.gobra │ │ │ │ ├── seq-type-fail1.gobra │ │ │ │ ├── seq-type-fail2.gobra │ │ │ │ ├── seq-type-fail3.gobra │ │ │ │ ├── seq-type-fail4.gobra │ │ │ │ ├── seq-type-fail5.gobra │ │ │ │ ├── seq-type-simple1.gobra │ │ │ │ ├── seq-type-simple2.gobra │ │ │ │ ├── seq-update-fail1.gobra │ │ │ │ ├── seq-update-fail2.gobra │ │ │ │ ├── seq-update-fail3.gobra │ │ │ │ ├── seq-update-fail4.gobra │ │ │ │ ├── seq-update-fail5.gobra │ │ │ │ ├── seq-update-fail6.gobra │ │ │ │ ├── seq-update-fail7.gobra │ │ │ │ ├── seq-update-fail8.gobra │ │ │ │ └── seq-update-simple1.gobra │ │ │ ├── sets │ │ │ │ ├── set-cardinality-fail1.gobra │ │ │ │ ├── set-cardinality-fail2.gobra │ │ │ │ ├── set-cardinality-fail3.gobra │ │ │ │ ├── set-cardinality-simple1.gobra │ │ │ │ ├── set-contains-fail1.gobra │ │ │ │ ├── set-contains-fail2.gobra │ │ │ │ ├── set-contains-fail3.gobra │ │ │ │ ├── set-contains-simple1.gobra │ │ │ │ ├── set-convert-fail1.gobra │ │ │ │ ├── set-convert-fail10.gobra │ │ │ │ ├── set-convert-fail11.gobra │ │ │ │ ├── set-convert-fail12.gobra │ │ │ │ ├── set-convert-fail2.gobra │ │ │ │ ├── set-convert-fail3.gobra │ │ │ │ ├── set-convert-fail4.gobra │ │ │ │ ├── set-convert-fail5.gobra │ │ │ │ ├── set-convert-fail6.gobra │ │ │ │ ├── set-convert-fail7.gobra │ │ │ │ ├── set-convert-fail8.gobra │ │ │ │ ├── set-convert-fail9.gobra │ │ │ │ ├── set-convert-simple1.gobra │ │ │ │ ├── set-convert-simple2.gobra │ │ │ │ ├── set-declared-type-simple1.gobra │ │ │ │ ├── set-disable-axioms-fail1.gobra │ │ │ │ ├── set-intersection-fail1.gobra │ │ │ │ ├── set-intersection-fail2.gobra │ │ │ │ ├── set-intersection-fail3.gobra │ │ │ │ ├── set-intersection-fail4.gobra │ │ │ │ ├── set-intersection-fail5.gobra │ │ │ │ ├── set-intersection-simple1.gobra │ │ │ │ ├── set-literal-fail1.gobra │ │ │ │ ├── set-literal-fail2.gobra │ │ │ │ ├── set-literal-fail3.gobra │ │ │ │ ├── set-literal-fail4.gobra │ │ │ │ ├── set-literal-fail5.gobra │ │ │ │ ├── set-literal-fail6.gobra │ │ │ │ ├── set-literal-fail7.gobra │ │ │ │ ├── set-literal-fail8.gobra │ │ │ │ ├── set-literal-simple1.gobra │ │ │ │ ├── set-literal-simple2.gobra │ │ │ │ ├── set-multiplicity-fail1.gobra │ │ │ │ ├── set-multiplicity-fail2.gobra │ │ │ │ ├── set-multiplicity-fail3.gobra │ │ │ │ ├── set-multiplicity-fail4.gobra │ │ │ │ ├── set-multiplicity-fail5.gobra │ │ │ │ ├── set-multiplicity-simple1.gobra │ │ │ │ ├── set-range-fail1.gobra │ │ │ │ ├── set-range-fail2.gobra │ │ │ │ ├── set-range-fail3.gobra │ │ │ │ ├── set-range-fail4.gobra │ │ │ │ ├── set-range-fail5.gobra │ │ │ │ ├── set-range-fail6.gobra │ │ │ │ ├── set-range-simple1.gobra │ │ │ │ ├── set-setminus-fail1.gobra │ │ │ │ ├── set-setminus-fail2.gobra │ │ │ │ ├── set-setminus-fail3.gobra │ │ │ │ ├── set-setminus-fail4.gobra │ │ │ │ ├── set-setminus-fail5.gobra │ │ │ │ ├── set-setminus-simple1.gobra │ │ │ │ ├── set-subset-fail1.gobra │ │ │ │ ├── set-subset-fail2.gobra │ │ │ │ ├── set-subset-fail3.gobra │ │ │ │ ├── set-subset-fail4.gobra │ │ │ │ ├── set-subset-fail5.gobra │ │ │ │ ├── set-subset-simple1.gobra │ │ │ │ ├── set-type-fail1.gobra │ │ │ │ ├── set-type-fail2.gobra │ │ │ │ ├── set-type-fail3.gobra │ │ │ │ ├── set-type-fail4.gobra │ │ │ │ ├── set-type-fail5.gobra │ │ │ │ ├── set-type-simple1.gobra │ │ │ │ ├── set-type-simple2.gobra │ │ │ │ ├── set-union-fail1.gobra │ │ │ │ ├── set-union-fail2.gobra │ │ │ │ ├── set-union-fail3.gobra │ │ │ │ ├── set-union-fail4.gobra │ │ │ │ ├── set-union-fail5.gobra │ │ │ │ └── set-union-simple1.gobra │ │ │ ├── slices │ │ │ │ ├── slice-boundschecks1.gobra │ │ │ │ ├── slice-boundschecks2.gobra │ │ │ │ ├── slice-cap-fail1.gobra │ │ │ │ ├── slice-cap-fail2.gobra │ │ │ │ ├── slice-cap-simple1.gobra │ │ │ │ ├── slice-cap-simple2.gobra │ │ │ │ ├── slice-index-fail1.gobra │ │ │ │ ├── slice-index-fail2.gobra │ │ │ │ ├── slice-index-fail3.gobra │ │ │ │ ├── slice-index-simple1.gobra │ │ │ │ ├── slice-init-fail1.gobra │ │ │ │ ├── slice-init-simple1.gobra │ │ │ │ ├── slice-init-simple2.gobra │ │ │ │ ├── slice-init-simple3.gobra │ │ │ │ ├── slice-length-fail1.gobra │ │ │ │ ├── slice-length-fail2.gobra │ │ │ │ ├── slice-length-simple1.gobra │ │ │ │ ├── slice-literal-fail1.gobra │ │ │ │ ├── slice-literal-simple1.gobra │ │ │ │ ├── slice-nil-fail1.gobra │ │ │ │ ├── slice-nil-simple1.gobra │ │ │ │ ├── slice-type-fail1.gobra │ │ │ │ ├── slice-type-fail2.gobra │ │ │ │ ├── slice-type-fail3.gobra │ │ │ │ ├── slice-type-fail4.gobra │ │ │ │ ├── slice-type-fail5.gobra │ │ │ │ ├── slice-type-simple1.gobra │ │ │ │ ├── slice-type-simple2.gobra │ │ │ │ └── slice-type-simple3.gobra │ │ │ ├── strings │ │ │ │ ├── string-conv-fail1.gobra │ │ │ │ ├── string-conv-fail2.gobra │ │ │ │ ├── string-conv-simple1.gobra │ │ │ │ ├── string-slice-fail0.gobra │ │ │ │ ├── string-slice-fail1.gobra │ │ │ │ ├── string-slice-simple0.gobra │ │ │ │ ├── strings-fail0.gobra │ │ │ │ └── strings0.gobra │ │ │ ├── structs │ │ │ │ ├── cyclic-struct-def-check.gobra │ │ │ │ ├── cyclic-struct-def-check │ │ │ │ │ └── pkg.gobra │ │ │ │ ├── cyclic-struct-def-check2.gobra │ │ │ │ ├── literals.gobra │ │ │ │ ├── literals2.gobra │ │ │ │ ├── structs-simple1.gobra │ │ │ │ ├── structs-simple2.gobra │ │ │ │ ├── structs-simple3.gobra │ │ │ │ ├── structs-simple4.gobra │ │ │ │ └── structs-simple5.gobra │ │ │ ├── stubs │ │ │ │ ├── stubs-fail0.gobra │ │ │ │ ├── stubs0.gobra │ │ │ │ ├── stubs1.gobra │ │ │ │ ├── stubs2.gobra │ │ │ │ └── stubs3.gobra │ │ │ ├── switch │ │ │ │ ├── type-switch-fail1.gobra │ │ │ │ └── type-switch-simple1.gobra │ │ │ ├── termination │ │ │ │ ├── termination-fail-01.gobra │ │ │ │ ├── termination-fail-02.gobra │ │ │ │ ├── termination-fail-03.gobra │ │ │ │ ├── termination-import-interface │ │ │ │ │ ├── foo │ │ │ │ │ │ └── foo.gobra │ │ │ │ │ └── main.gobra │ │ │ │ ├── termination-import-members │ │ │ │ │ ├── foo │ │ │ │ │ │ └── foo.gobra │ │ │ │ │ └── main.gobra │ │ │ │ ├── termination-simple-01.gobra │ │ │ │ └── termination-simple-02.gobra │ │ │ ├── ternary_operator │ │ │ │ ├── ternary-operator1.gobra │ │ │ │ ├── ternary-operator2.gobra │ │ │ │ └── ternary-operator3.gobra │ │ │ ├── trusted │ │ │ │ ├── trusted-functions.gobra │ │ │ │ └── trusted-methods.gobra │ │ │ ├── variadic │ │ │ │ ├── variadic-fail1.gobra │ │ │ │ ├── variadic-fail2.gobra │ │ │ │ └── variadic-simple1.gobra │ │ │ ├── wands │ │ │ │ ├── ghost-list.gobra │ │ │ │ ├── list.gobra │ │ │ │ ├── wand-fail-01.gobra │ │ │ │ └── wand-simple-01.gobra │ │ │ └── while1.gobra │ │ └── issues │ │ │ ├── 000002.gobra │ │ │ ├── 000003.gobra │ │ │ ├── 000004.gobra │ │ │ ├── 000005.gobra │ │ │ ├── 000006.gobra │ │ │ ├── 000008.gobra │ │ │ ├── 000009.gobra │ │ │ ├── 000015.gobra │ │ │ ├── 000016.gobra │ │ │ ├── 000018.gobra │ │ │ ├── 000019.gobra │ │ │ ├── 000021.gobra │ │ │ ├── 000022.gobra │ │ │ ├── 000024.gobra │ │ │ ├── 000025.gobra │ │ │ ├── 000026-1.gobra │ │ │ ├── 000026-2.gobra │ │ │ ├── 000027-1.gobra │ │ │ ├── 000027-2.gobra │ │ │ ├── 000028.gobra │ │ │ ├── 000030.gobra │ │ │ ├── 000031.gobra │ │ │ ├── 000033-1.gobra │ │ │ ├── 000033-2.gobra │ │ │ ├── 000033-3.gobra │ │ │ ├── 000033-4.gobra │ │ │ ├── 000033-5.gobra │ │ │ ├── 000034-1.gobra │ │ │ ├── 000034-2.gobra │ │ │ ├── 000035.gobra │ │ │ ├── 000037-1.gobra │ │ │ ├── 000037-2.gobra │ │ │ ├── 000038.gobra │ │ │ ├── 000039.gobra │ │ │ ├── 000042-1.gobra │ │ │ ├── 000042-2.gobra │ │ │ ├── 000043.gobra │ │ │ ├── 000044.gobra │ │ │ ├── 000097-1.gobra │ │ │ ├── 000097-2.gobra │ │ │ ├── 000109.gobra │ │ │ ├── 000114-1.gobra │ │ │ ├── 000114-2.gobra │ │ │ ├── 000121.gobra │ │ │ ├── 000124-1.gobra │ │ │ ├── 000124-2.gobra │ │ │ ├── 000124 │ │ │ └── github.com │ │ │ │ └── gobra │ │ │ │ └── main.gobra │ │ │ ├── 000126.gobra │ │ │ ├── 000128-1.gobra │ │ │ ├── 000128-2.gobra │ │ │ ├── 000129-1.gobra │ │ │ ├── 000129-2.gobra │ │ │ ├── 000129-3.gobra │ │ │ ├── 000129.gobra │ │ │ ├── 000133-1.gobra │ │ │ ├── 000133-2.gobra │ │ │ ├── 000134.gobra │ │ │ ├── 000151.gobra │ │ │ ├── 000155.gobra │ │ │ ├── 000157-1.gobra │ │ │ ├── 000157-2.gobra │ │ │ ├── 000157-3.gobra │ │ │ ├── 000157-4.gobra │ │ │ ├── 000164.gobra │ │ │ ├── 000166.gobra │ │ │ ├── 000166 │ │ │ └── bug │ │ │ │ └── importedFile.gobra │ │ │ ├── 000169.gobra │ │ │ ├── 000169 │ │ │ └── pkg2 │ │ │ │ └── imported.gobra │ │ │ ├── 000176.gobra │ │ │ ├── 000177.gobra │ │ │ ├── 000180.gobra │ │ │ ├── 000182.gobra │ │ │ ├── 000185.gobra │ │ │ ├── 000190.gobra │ │ │ ├── 000190 │ │ │ └── pkg │ │ │ │ └── pkg.gobra │ │ │ ├── 000228-1.gobra │ │ │ ├── 000228-2.gobra │ │ │ ├── 000229.gobra │ │ │ ├── 000232.gobra │ │ │ ├── 000232 │ │ │ └── bug │ │ │ │ └── imported.gobra │ │ │ ├── 000235-1.gobra │ │ │ ├── 000235-2.gobra │ │ │ ├── 000236.gobra │ │ │ ├── 000238.gobra │ │ │ ├── 000249.gobra │ │ │ ├── 000253.gobra │ │ │ ├── 000272.gobra │ │ │ ├── 000272 │ │ │ └── pkg │ │ │ │ └── pkg.gobra │ │ │ ├── 000282.gobra │ │ │ ├── 000299.gobra │ │ │ ├── 000308.gobra │ │ │ ├── 000312.gobra │ │ │ ├── 000316.gobra │ │ │ ├── 000318.gobra │ │ │ ├── 000339.gobra │ │ │ ├── 000341 │ │ │ ├── pkg1 │ │ │ │ └── f1.gobra │ │ │ └── pkg2 │ │ │ │ └── f2.gobra │ │ │ ├── 000344.gobra │ │ │ ├── 000344 │ │ │ └── pkg │ │ │ │ └── bug.gobra │ │ │ ├── 000351.gobra │ │ │ ├── 000351 │ │ │ ├── pkg │ │ │ │ └── f.gobra │ │ │ └── pkg2 │ │ │ │ └── f.gobra │ │ │ ├── 000361.gobra │ │ │ ├── 000362.gobra │ │ │ ├── 000401.gobra │ │ │ ├── 000402.gobra │ │ │ ├── 000408.gobra │ │ │ ├── 000411.gobra │ │ │ ├── 000416.gobra │ │ │ ├── 000416 │ │ │ └── importedImplementationPkg │ │ │ │ ├── importedImplementationPkg.gobra │ │ │ │ └── shape │ │ │ │ └── shape.gobra │ │ │ ├── 000420.gobra │ │ │ ├── 000446.gobra │ │ │ ├── 000475-1.gobra │ │ │ ├── 000475-2.gobra │ │ │ ├── 000475-3.gobra │ │ │ ├── 000477.gobra │ │ │ ├── 000480.gobra │ │ │ ├── 000486.gobra │ │ │ ├── 000489.gobra │ │ │ ├── 000494.gobra │ │ │ ├── 000506-1.gobra │ │ │ ├── 000506-2.gobra │ │ │ ├── 000511.gobra │ │ │ ├── 000519.gobra │ │ │ ├── 000573.go │ │ │ ├── 000576.go │ │ │ ├── 000589.gobra │ │ │ ├── 000620-1.gobra │ │ │ ├── 000620-2.gobra │ │ │ ├── 000620-3.gobra │ │ │ ├── 000621.gobra │ │ │ ├── 000641.gobra │ │ │ ├── 000651.gobra │ │ │ ├── 000655.gobra │ │ │ ├── 000655 │ │ │ └── pkg │ │ │ │ └── f.gobra │ │ │ ├── 000659.gobra │ │ │ ├── 000685.gobra │ │ │ ├── 000686-1.gobra │ │ │ ├── 000686-2.gobra │ │ │ ├── 000686-3.gobra │ │ │ ├── 000686-4.gobra │ │ │ ├── 000686-5.gobra │ │ │ ├── 000686-6.gobra │ │ │ ├── 000695.gobra │ │ │ ├── 000697.gobra │ │ │ ├── 000697 │ │ │ └── pkg │ │ │ │ └── pkg.gobra │ │ │ ├── 000705.gobra │ │ │ ├── 000713.gobra │ │ │ ├── 000745.gobra │ │ │ ├── 000777-1.gobra │ │ │ ├── 000777-2.gobra │ │ │ ├── 000796.gobra │ │ │ ├── 000805.gobra │ │ │ ├── 000828.gobra │ │ │ ├── 000836.gobra │ │ │ ├── 000858.gobra │ │ │ ├── 000861-1.gobra │ │ │ ├── 000861-2.gobra │ │ │ ├── 000861-3.gobra │ │ │ ├── 000866.gobra │ │ │ └── windows-line-ending │ │ │ └── 000225.gobra │ ├── same_package │ │ ├── basic │ │ │ ├── same-package1a.gobra │ │ │ └── same-package1b.gobra │ │ ├── file_local_imports │ │ │ ├── import_not_avail │ │ │ │ ├── bar │ │ │ │ │ └── bar.gobra │ │ │ │ ├── main1.gobra │ │ │ │ └── main2.gobra │ │ │ ├── import_not_avail_unqualified │ │ │ │ ├── bar │ │ │ │ │ └── bar.gobra │ │ │ │ ├── main1.gobra │ │ │ │ └── main2.gobra │ │ │ ├── no_uniqueness_interference │ │ │ │ ├── bar │ │ │ │ │ └── bar.gobra │ │ │ │ ├── main1.gobra │ │ │ │ └── main2.gobra │ │ │ └── no_uniqueness_interference_unqualified │ │ │ │ ├── bar │ │ │ │ └── bar.gobra │ │ │ │ ├── main1.gobra │ │ │ │ └── main2.gobra │ │ ├── pkg_init │ │ │ ├── byte │ │ │ │ ├── byte.go │ │ │ │ └── byte_spec.gobra │ │ │ ├── concfib │ │ │ │ ├── fib.go │ │ │ │ └── fib_spec.gobra │ │ │ ├── fib │ │ │ │ ├── fib.go │ │ │ │ └── fib_spec.gobra │ │ │ ├── import │ │ │ │ └── main.go │ │ │ ├── import1 │ │ │ │ ├── bar │ │ │ │ │ └── bar.gobra │ │ │ │ └── pkg │ │ │ │ │ └── importer.gobra │ │ │ ├── import2 │ │ │ │ ├── bar │ │ │ │ │ └── bar.gobra │ │ │ │ └── pkg │ │ │ │ │ └── importer.gobra │ │ │ ├── invallinstances │ │ │ │ ├── client.go │ │ │ │ └── client_spec.gobra │ │ │ └── names_sequential │ │ │ │ ├── names │ │ │ │ ├── name │ │ │ │ │ ├── name.go │ │ │ │ │ └── name_spec.gobra │ │ │ │ ├── names.go │ │ │ │ └── names_spec.gobra │ │ │ │ └── stdNamesAlt │ │ │ │ ├── stdNamesAlt.go │ │ │ │ └── stdNamesAlt_spec.gobra │ │ └── shareProgramDecls │ │ │ ├── prog1.gobra │ │ │ └── prog2.gobra │ ├── stats_collector │ │ ├── fail │ │ │ └── fail.gobra │ │ ├── main.gobra │ │ ├── pkg1 │ │ │ ├── pkg1.gobra │ │ │ └── subpackage │ │ │ │ └── subpackage.gobra │ │ └── pkg2 │ │ │ ├── pkg2.gobra │ │ │ └── subpackage │ │ │ └── subpackage.gobra │ └── unimplemented_go │ │ ├── controlflow │ │ └── controlflow.go │ │ ├── floats │ │ └── float.go │ │ └── function_literals │ │ └── funclit.go │ └── scala │ └── viper │ └── gobra │ ├── AbstractGobraTests.scala │ ├── BenchmarkTests.scala │ ├── DetailedBenchmarkTests.scala │ ├── GobraPackageTests.scala │ ├── GobraTests.scala │ ├── GobraTutorialTests.scala │ ├── OverallBenchmarkTests.scala │ ├── PluginAwareChopperTests.scala │ ├── ast │ ├── FrontendPrettyPrinterUnitTests.scala │ ├── InternalPrettyPrinterUnitTests.scala │ └── InternalStrategyUnitTests.scala │ ├── erasing │ └── GhostErasureUnitTests.scala │ ├── parsing │ ├── GoParserUnitTests.scala │ ├── GobraParserTests.scala │ ├── GobrafyUnitTests.scala │ ├── ParserTestFrontend.scala │ └── ParserUnitTests.scala │ ├── reporting │ └── StatsCollectorTests.scala │ └── typing │ ├── ExprTypingUnitTests.scala │ ├── MemberTypingUnitTests.scala │ ├── StmtTypingUnitTests.scala │ └── TypeTypingUnitTests.scala └── workflow-container └── Dockerfile /.dockerignore: -------------------------------------------------------------------------------- 1 | **/target 2 | target 3 | silicon 4 | silver 5 | carbon 6 | tmp 7 | .idea 8 | .bsp 9 | .git 10 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | updates: 4 | - package-ecosystem: github-actions 5 | directory: "/" 6 | schedule: 7 | interval: monthly 8 | day: monday 9 | groups: 10 | all: 11 | patterns: 12 | - "*" 13 | -------------------------------------------------------------------------------- /.github/docs/gobra.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/viperproject/gobra/86be72fa11577690d4e8d7685b418be09ac58952/.github/docs/gobra.png -------------------------------------------------------------------------------- /.github/license-check/headers/CC0-Windows.txt: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | -------------------------------------------------------------------------------- /.github/license-check/headers/CC0.txt: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | -------------------------------------------------------------------------------- /.github/license-check/headers/Go.txt: -------------------------------------------------------------------------------- 1 | // Copyright %regexp:\d{4}% The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in https://golang.org/LICENSE 4 | -------------------------------------------------------------------------------- /.github/license-check/headers/MPLv2-ETH-hashtags.txt: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this 3 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) %regexp:\d{4}%-%year% ETH Zurich. 6 | -------------------------------------------------------------------------------- /.github/license-check/headers/MPLv2-ETH-xml.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.github/license-check/headers/MPLv2-ETH.txt: -------------------------------------------------------------------------------- 1 | // This Source Code Form is subject to the terms of the Mozilla Public 2 | // License, v. 2.0. If a copy of the MPL was not distributed with this 3 | // file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 | // 5 | // Copyright (c) %regexp:\d{4}%-%year% ETH Zurich. 6 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "viperserver"] 2 | path = viperserver 3 | url = https://github.com/viperproject/viperserver 4 | -------------------------------------------------------------------------------- /bors.toml: -------------------------------------------------------------------------------- 1 | # This Source Code Form is subject to the terms of the Mozilla Public 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this 3 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 | # 5 | # Copyright (c) 2011-2022 ETH Zurich. 6 | 7 | status = ["check-license-headers", "build-test-deploy-container"] 8 | timeout_sec = 7200 9 | -------------------------------------------------------------------------------- /project/build.properties: -------------------------------------------------------------------------------- 1 | # Any copyright is dedicated to the Public Domain. 2 | # http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | sbt.version = 1.7.2 5 | -------------------------------------------------------------------------------- /project/plugins.sbt: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.8") 5 | addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.3.12") 6 | addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0") 7 | -------------------------------------------------------------------------------- /src/main/java/viper/gobra/frontend/LICENSE: -------------------------------------------------------------------------------- 1 | This Source Code Form is subject to the terms of the Mozilla Public 2 | License, v. 2.0. If a copy of the MPL was not distributed with this 3 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 | 5 | Copyright (c) 2011-2020 ETH Zurich. 6 | -------------------------------------------------------------------------------- /src/main/resources/stubs/fmt/fmt.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | // The purpose of this file is to allow programs to import this package 5 | // without Gobra complaining that the package is empty. 6 | // We do not support members defined in this package. 7 | 8 | package fmt 9 | -------------------------------------------------------------------------------- /src/test/resources/better_errors/assign/const.go: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | //:: ExpectedOutput(parser_error) 7 | const i := 10 -------------------------------------------------------------------------------- /src/test/resources/better_errors/assign/const_type.go: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | //:: ExpectedOutput(parser_error) 7 | const j int := 10 -------------------------------------------------------------------------------- /src/test/resources/better_errors/assign/got_assign_all.go: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | //:: ExpectedOutput(parser_error) 7 | const i := 10 8 | const j int := 10 9 | 10 | type A := int 11 | 12 | func main() { 13 | var a := 10 14 | var b int := 10 15 | } -------------------------------------------------------------------------------- /src/test/resources/better_errors/assign/type.go: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | //:: ExpectedOutput(parser_error) 7 | type A := int -------------------------------------------------------------------------------- /src/test/resources/better_errors/assign/var.go: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | 7 | func var_() { 8 | //:: ExpectedOutput(parser_error) 9 | var a := 10 10 | } -------------------------------------------------------------------------------- /src/test/resources/better_errors/assign/var_type.go: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | func var_type() { 7 | //:: ExpectedOutput(parser_error) 8 | var a int := 10 9 | } -------------------------------------------------------------------------------- /src/test/resources/better_errors/slices/both.go: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | func main() { 7 | var s = [3]int{1,2,3} //@ addressable: s 8 | //:: ExpectedOutput(parser_error) 9 | n := s[1::] 10 | } -------------------------------------------------------------------------------- /src/test/resources/better_errors/slices/second.go: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | func main() { 7 | var s = [3]int{1,2,3} //@ addressable: s 8 | //:: ExpectedOutput(parser_error) 9 | n := s[1::3] 10 | } -------------------------------------------------------------------------------- /src/test/resources/better_errors/slices/third.go: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | func main() { 7 | var s = [3]int{1,2,3} //@ addressable: s 8 | //:: ExpectedOutput(parser_error) 9 | n := s[1:2:] 10 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/examples/disableNL_success.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | requires 0 <= x && x <= 10 7 | requires 0 <= y && y <= 10 8 | ensures 0 <= res && res <= 100 9 | func f(x, y int) (res int) { 10 | return x * y 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-capacity-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | var a [12]int 8 | //:: ExpectedOutput(assert_error:assertion_error) 9 | assert cap(a) == 21 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-capacity-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(a [12]int) { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert cap(a) == 21 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-capacity-simple2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | const N = 23 7 | 8 | func foo() { 9 | var a [N]int 10 | assert cap(a) == N 11 | assert cap(a) == 23 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-convert-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | var a@ [4]int 8 | // currently only exclusive arrays can be converted to sequences 9 | //:: ExpectedOutput(type_error) 10 | ghost xs := seq(a) 11 | } 12 | 13 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-convert-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(a [4]int) { 7 | share a 8 | // currently only exclusive arrays can be converted to sequences 9 | //:: ExpectedOutput(type_error) 10 | ghost xs := seq(a) 11 | } 12 | 13 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-convert-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | // currently only exclusive arrays can be converted to sequences 7 | //:: ExpectedOutput(type_error) 8 | ensures 0 < len(seq(a)) 9 | func foo() (a [4]int) { 10 | share a 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-convert-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | requires len(a) == len(seq(a)) 7 | func foo(a [32]int) { 8 | //:: ExpectedOutput(assert_error:assertion_error) 9 | assert false 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-convert-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | var a [6]int 8 | a[2] = 42 9 | //:: ExpectedOutput(assert_error:assertion_error) 10 | assert seq(a)[2] == 0 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-convert-fail6.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | var a [12]int 8 | // fails: sequences don't have capacities 9 | //:: ExpectedOutput(type_error) 10 | assert cap(a) == cap(seq(a)) 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-index-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(a [4]int) { 7 | //:: ExpectedOutput(type_error) 8 | assert a[2] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-index-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(a [4]int) { 7 | //:: ExpectedOutput(type_error) 8 | n := a[-2] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-index-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(a [4]int) { 7 | //:: ExpectedOutput(type_error) 8 | n := a[2][0] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-index-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | n := ([4]int{1, 2, 3, 4})[16] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-index-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | var a [12]int 8 | //:: ExpectedOutput(assert_error:assertion_error) 9 | assert a[4] != 0 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-index-fail6.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert([3]bool{true, false, true})[1] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-index-fail7.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | requires 4 < i 7 | func foo(i int) { 8 | //:: ExpectedOutput(assignment_error:seq_index_exceeds_length_error) 9 | n := ([4]int{1, 2, 3, 4})[i] 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-index-fail8.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | var a [4]int 8 | // fails: `a` is not addressable 9 | //:: ExpectedOutput(type_error) 10 | assert acc(&a[2]) 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-index-simple8.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func test1() { 7 | var a [4][3]int 8 | b := a[2] 9 | assert b[1] == 0 10 | } 11 | 12 | func test2() { 13 | var a@ [4][3]int 14 | b := a[2] 15 | assert b[1] == 0 16 | } 17 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-length-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | var a [12]int 8 | //:: ExpectedOutput(assert_error:assertion_error) 9 | assert len(a) == 21 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-length-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(a [21]int) { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert len(a) == 12 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-length-simple2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | const N = 42 7 | 8 | func foo() { 9 | var a [N]int 10 | assert len(a) == N 11 | assert len(a) == 42 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-literal-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | a := [1]int{false} 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-literal-fail10.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | ([3]int{1, 2, 3})[1] = 42 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-literal-fail11.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(parser_error) 8 | var a [2][2]int = [...][...] { [2]int { 1, 2 }, [2]int { 3, 4 } } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-literal-fail12.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | a := [2]int{1: 10, 20} 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-literal-fail13.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | a := [1]int{1: 42} 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-literal-fail14.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | a := [2]int{1: 42, 1: 24} 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-literal-fail15.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | const ONE = 1 7 | 8 | func foo() { 9 | //:: ExpectedOutput(type_error) 10 | a := [ONE]int{12, 24} 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-literal-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | a := [2]int{1, 2, 3} 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-literal-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(parser_error) 8 | a := [...][...]bool{} 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-literal-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | requires n == 2 7 | func foo(n int) { 8 | //:: ExpectedOutput(type_error) 9 | a := [n]bool { false, true } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-literal-fail6.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert cap([2][2]int { [2]int { 1, 2 }, [2]int { 3, 4 } }) == 4 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-literal-fail7.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert [3]int { 1, 2, 3 } == [3]int { 3, 2, 1 } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-literal-fail8.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | assert [3]int { 1, 2, 3 } == [4]int { 3, 2, 1, 0 } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-literal-fail9.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | n := ([3]int{1, 2, 3})[5] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-ownership-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func test1() { 7 | var a [4]int 8 | //:: ExpectedOutput(type_error) 9 | assert acc(&a[2]) 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-ownership-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(a [4]int) { 7 | //:: ExpectedOutput(type_error) 8 | assert acc(&a[1]) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-ownership-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | //:: ExpectedOutput(type_error) 7 | requires acc(&a[1]) 8 | func foo(a [4]int) { 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-ownership-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() (a [4]int) { 7 | //:: ExpectedOutput(type_error) 8 | assert acc(&a[2]) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-type-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | // fails: length of `a` must be non-negative 7 | //:: ExpectedOutput(type_error) 8 | func foo(a [-12]int) { 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-type-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(a [12]int) { 7 | var b [42]int 8 | //:: ExpectedOutput(type_error) 9 | b = a 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-type-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | //:: ExpectedOutput(type_error) 7 | requires a == b 8 | func foo(a [1]int, b [2]int) { 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-type-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | // fails: `a` should've been marked as ghost 7 | //:: ExpectedOutput(type_error) 8 | func foo(a [42]seq[bool]) { 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-type-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | const N = -4 7 | 8 | func foo() { 9 | //:: ExpectedOutput(type_error) 10 | var a [N]int 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-type-fail7.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | var a [4]int 8 | //:: ExpectedOutput(type_error) 9 | assert a == seq[int] { 0, 0, 0, 0 } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-type-simple2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func test1() { 7 | var a1 *[42]int 8 | var a2 [42]*int 9 | } 10 | 11 | const N = 12 12 | 13 | func test2() { 14 | var a [N]int 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/arrays/array-type-simple5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type Point struct { 7 | x int 8 | y int 9 | } 10 | 11 | func foo() { 12 | var a [2]Point 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/backends/carbon.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package carbon 5 | 6 | // ##(--backend CARBON) 7 | 8 | // tests whether the carbon backend is operational 9 | 10 | func foo() { 11 | //:: ExpectedOutput(assert_error:assertion_error) 12 | assert false; 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/blank_identifier/blank-identifier-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | func main() { 7 | // blank identifiers are disallowed from appearing on the RHS 8 | // of assignments 9 | //:: ExpectedOutput(type_error) 10 | a := _ + 1 11 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/features/builtin/copy-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package builtin 5 | 6 | func test1() { 7 | var a = []int{0, 1, 2, 3, 4, 5, 6, 7} 8 | var b = []string{"hello", "world"} 9 | 10 | p := perm(1/2) 11 | //:: ExpectedOutput(type_error) 12 | n1 := copy(a, b, p) 13 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/features/channels/bar/bar.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package bar 5 | 6 | requires c.IsChannel() && c.BufferSize() == 0 7 | func useChannel(c chan<- int) 8 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/channels/channel-fail7.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | // redeclaration of built-in member `PredTrue`: 7 | //:: ExpectedOutput(type_error) 8 | pred PredTrue() { 9 | true 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/defer/defer-simple-04.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | pred Mem(x *int) { 7 | acc(x) 8 | } 9 | 10 | ensures Mem(r) 11 | decreases 12 | func f() (r *int) { 13 | x@ := 2 14 | ghost defer fold Mem(&x) 15 | return &x 16 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/features/defunc/includes/preds/predicate.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package preds 5 | 6 | pred PredExample(i int) -------------------------------------------------------------------------------- /src/test/resources/regressions/features/errors/bar/bar.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package bar 5 | 6 | // redeclare interface error: 7 | type error interface { 8 | // currently empty as Gobra does not yet support strings 9 | // Error() string 10 | Test() int 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/fractional_permissions/fields/simple2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type cell struct{ 7 | val int; 8 | } 9 | 10 | const dividend = 1 11 | 12 | requires acc(&x.val, dividend/2) && x.val == 42 13 | func constPerm(x *cell) {} 14 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/fractional_permissions/predicates/simple2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | pred myPred(x *int) { 7 | acc(x) && *x == 42 8 | } 9 | 10 | const dividend = 1 11 | 12 | requires acc(myPred(x), dividend/2) 13 | func constPerm(x *int) {} 14 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/global_consts/global-const-1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | const Answer = 42 7 | 8 | func test() { 9 | assert(Answer == 42) 10 | //:: ExpectedOutput(assert_error:assertion_error) 11 | assert(Answer == 41) 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/global_consts/global-const-10.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type InterfaceState string 7 | 8 | const ( 9 | InterfaceUp InterfaceState = "up" 10 | InterfaceDown InterfaceState = "down" 11 | ) -------------------------------------------------------------------------------- /src/test/resources/regressions/features/global_consts/global-const-2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type cell struct{ 7 | val int; 8 | }; 9 | 10 | //:: ExpectedOutput(type_error) 11 | const Answer = cell{42} 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/global_consts/global-const-3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type cell struct{ 7 | val int; 8 | }; 9 | 10 | //:: ExpectedOutput(type_error) 11 | const Answer = &cell{42} 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/global_consts/global-const-6.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | //:: ExpectedOutput(type_error) 7 | const CYCLE = CYCLE // this is a cyclic constant declaration 8 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/global_consts/global-const-9.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | //:: ExpectedOutput(type_error) 7 | const p perm = perm(1/0) 8 | 9 | const ( 10 | //:: ExpectedOutput(type_error) 11 | i0 = perm(1 / iota) 12 | i1 13 | i2 14 | i3 15 | ) -------------------------------------------------------------------------------- /src/test/resources/regressions/features/globals/globals-type-fail05.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | // Old expressions are disallowed in pkg invariants 5 | //:: ExpectedOutput(type_error) 6 | pkgInvariant old(1) == 1 7 | package pkg 8 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/globals/globals-type-fail06.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | // Calling closures is disallowed in pkg initialization code. 7 | mayInit 8 | func test(f func()) { 9 | //:: ExpectedOutput(type_error) 10 | f() as spec 11 | } 12 | 13 | func spec() -------------------------------------------------------------------------------- /src/test/resources/regressions/features/globals/impl-shorthand-fail01.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type Ifc interface { 7 | f() 8 | } 9 | 10 | type Impl *struct{} 11 | 12 | //:: ExpectedOutput(type_error) 13 | var _ Ifc = Impl(nil) -------------------------------------------------------------------------------- /src/test/resources/regressions/features/globals/impl-shorthand-simple01.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type Ifc interface { 7 | f() 8 | } 9 | 10 | type Impl *struct{} 11 | 12 | func (i Impl) f() { 13 | return 14 | } 15 | 16 | var _ Ifc = Impl(nil) -------------------------------------------------------------------------------- /src/test/resources/regressions/features/globals/itfAssign/defs/defs.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package defs 5 | 6 | type I interface { 7 | decreases 8 | F() 9 | } 10 | 11 | type T interface { 12 | I 13 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/features/go_programs/fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package test 5 | 6 | // verification should succeed as lines starting with `//@` are treated as regular comments in `.gobra` files 7 | //@ ensures false 8 | func test() (res int) { 9 | res = 42 10 | return 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/go_programs/simple-1.go: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package test 5 | 6 | //:: ExpectedOutput(postcondition_error:assertion_error) 7 | //@ ensures false 8 | func test() (res int) { 9 | res = 42 10 | return 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/go_routines/go-routines-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | package main 4 | 5 | func main() { 6 | // go statements must contain a method or function call. 7 | //:: ExpectedOutput(type_error) 8 | go 1 + 2 9 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/features/header_only/pkg1/main.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | // +gobra 5 | // ##(--onlyFilesWithHeader) 6 | package pkg1 7 | 8 | func f(int) int 9 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/constant_import/bar2/bar2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package bar2 5 | 6 | const Answer = 42 7 | const HasAnswer = true 8 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/constant_import/bar3/bar3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package bar3 5 | 6 | const Answer = 42 7 | const HasAnswer = Answer == 42 8 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/constant_import/main.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | // ##(-I ./) 7 | import b "bar" 8 | 9 | func foo() { 10 | assert(b.Answer == 42) 11 | assert b.DoesDeclOrderMatter && b.BoolExprConst 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/cyclic_import/bar/bar.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package bar 5 | 6 | // ##(-I ../) 7 | //:: ExpectedOutput(type_error) 8 | import f "foo" // this is a cyclic import 9 | 10 | ensures res == f.foo() 11 | func bar() (res int) { 12 | f.foo() 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/cyclic_import/foo/foo.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package foo 5 | 6 | // ##(-I ../) 7 | //:: ExpectedOutput(type_error) 8 | import b "bar" // this is a cyclic import 9 | 10 | ensures res == b.bar() 11 | func foo() (res int) { 12 | b.bar() 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/cyclic_import/main.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | // ##(-I ./) 7 | //:: ExpectedOutput(type_error) 8 | import f "foo" // this is a cyclic import 9 | 10 | func main() { 11 | f.foo() 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/error_reporting_import/bar/bar.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package bar 5 | 6 | // try to call an inexistent function 7 | //:: ExpectedOutput(type_error) 8 | ensures res == inexistent() 9 | func bar() (res int){ 10 | // body is ignored anyway 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/error_reporting_import/main.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | // ##(-I ./) 7 | //:: ExpectedOutput(type_error) 8 | import b "bar" 9 | 10 | func foo() { 11 | b.bar() 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/error_reporting_import3/foo/foo.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package foo 5 | 6 | //:: ExpectedOutput(type_error) 7 | type ErroneousType adt { // invalid as this must be a _ghost_ type definition 8 | None {} 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/function_import/bar/bar.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package bar1 5 | 6 | func bar() { } 7 | 8 | func unusedFunc() { } 9 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/function_import/main.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | // ##(-I ./) 7 | import b "bar" 8 | 9 | func foo() { 10 | b.bar() 11 | } 12 | 13 | func foo2() { 14 | go b.bar() 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/import-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | import ( 7 | // the following package does not exist 8 | //:: ExpectedOutput(parser_error) 9 | "nopackagewhatsoever" 10 | ) -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/import3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | type cell struct{ 7 | val int; 8 | }; 9 | 10 | // func (r cell) val() 11 | 12 | //:: ExpectedOutput(type_error) 13 | func test(f cell.val) 14 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/invalid_package_clause/invalid_package_clause1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package clause1 5 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/invalid_package_clause/invalid_package_clause2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package clause2 5 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/method_import/assert-simple1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | // ##(-I ./) 7 | import stubAssert "assertPkg" 8 | 9 | func foo() { 10 | if stubAssert.On { 11 | stubAssert.Must(5 == 5) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/method_import/assertPkg/assert.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package assertPkg // note that assert is a reserved keyword 5 | 6 | const On = true 7 | 8 | preserves condition 9 | func Must(condition bool) 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/multi_import/bar/bar.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package bar 5 | 6 | const Answer = 42 7 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/multi_import/foo/foo.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package foo 5 | 6 | const IsFoo = true 7 | const Answer = 42 8 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/omitted_package_name/lib/foo/foo.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package foo 5 | 6 | const Foo = 42 7 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/parse_error/parse_error.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package parseError 5 | 6 | // package foo has a source file but an invalid preamble, i.e., fails to parse 7 | //:: ExpectedOutput(parser_error) 8 | imp bla "bla" 9 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/simple_type_import/bar/bar.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package bar 5 | 6 | type BarType1 = int 7 | type BarType2 int 8 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/simple_type_import/main.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | // ##(-I ./) 7 | import b "bar" 8 | 9 | func client() { 10 | var b1 b.BarType1 = 5 11 | var b2 b.BarType2 = 10 12 | assert b1 == 5 13 | assert b2 == 10 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/struct_import/bar/bar.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package bar 5 | 6 | type BarCell struct { 7 | val int 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/struct_import/main.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | // ##(-I ./) 7 | import b "bar" 8 | 9 | func client() { 10 | c := b.BarCell{5}; 11 | assert c.val == 5; 12 | d := &b.BarCell{10}; 13 | assert d.val == 10; 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/unique_qualifiers/bar/bar.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package bar 5 | 6 | const Answer = 42 7 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/unqualified_import/functions/bar1/bar1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package bar1 5 | 6 | func bar() { } 7 | 8 | func unusedFunc() { } 9 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/unqualified_import/functions/bar2_1/bar2_1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package bar2_1 5 | 6 | func bar() { } 7 | 8 | func unusedFunc() { } 9 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/unqualified_import/functions/bar2_2/bar2_2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package bar2_2 5 | 6 | func bar() { } 7 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/unqualified_import/functions/bar3/bar3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package bar3 5 | 6 | ensures res == 0 7 | func bar() (res int) { 8 | return 0 9 | } 10 | 11 | func unusedFunc() { } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/import/unqualified_import/functions/main1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main1 5 | 6 | // ##(-I ./) 7 | import . "bar1" 8 | 9 | func foo() { 10 | bar() 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/integers/int-bounds2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | type IntType int 7 | 8 | func main() { 9 | //:: ExpectedOutput(type_error) 10 | id(255 + 1) 11 | } 12 | 13 | func id(x byte) byte { 14 | return x 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/integers/int-lit-bases-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package integers 5 | 6 | // can only parse integer literals if the symbols used match the base of the literal 7 | //:: ExpectedOutput(parser_error) 8 | const BIN1 int8 = 0b21110000 -------------------------------------------------------------------------------- /src/test/resources/regressions/features/integers/int-lit-bases-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package integers 5 | 6 | // can only parse integer literals if the symbols used match the base of the literal 7 | //:: ExpectedOutput(parser_error) 8 | const OCT1 = 09 -------------------------------------------------------------------------------- /src/test/resources/regressions/features/integers/int-lit-bases-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package integers 5 | 6 | // can only parse integer literals if the symbols used match the base of the literal 7 | //:: ExpectedOutput(parser_error) 8 | const OCT2 = 0o9 -------------------------------------------------------------------------------- /src/test/resources/regressions/features/integers/int-lit-bases-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package integers 5 | 6 | // can only parse integer literals if the symbols used match the base of the literal 7 | //:: ExpectedOutput(parser_error) 8 | const HEX1 = 0xfghi -------------------------------------------------------------------------------- /src/test/resources/regressions/features/integers/int-lit-bases-fail6.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package integers 5 | 6 | // if no "0x" prefix is given, then ffff is treated as an identifier 7 | //:: ExpectedOutput(type_error) 8 | const HEX2 = ffff -------------------------------------------------------------------------------- /src/test/resources/regressions/features/interfaces/distributed_interface_case/cellMem/cell-mem.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package cellMem 5 | 6 | // ##(-I ../) 7 | 8 | import "cell" 9 | 10 | pred cellMem(c *cell.cell) { acc(c) } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/interfaces/embeddedInterfaces-fail6.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | 7 | //:: ExpectedOutput(type_error) 8 | type foo interface { 9 | foo 10 | bar 11 | } 12 | 13 | type bar interface { 14 | g() 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/interfaces/embeddedInterfaces6.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type A interface { 7 | pred mem() 8 | } 9 | 10 | type B interface { 11 | A 12 | 13 | requires mem() 14 | f() 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/labels/duplicate-labels.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | l: 9 | //:: ExpectedOutput(type_error) 10 | l: 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/loops/loops-break-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | break 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/loops/loops-break-label-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | for true { 8 | //:: ExpectedOutput(type_error) 9 | break l 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/loops/loops-break-label-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | l: 8 | invariant true 9 | for true { 10 | for true { 11 | break l 12 | } 13 | } 14 | //:: ExpectedOutput(assert_error) 15 | assert false 16 | } 17 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/loops/loops-break-label1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | l: 8 | invariant true 9 | for true { 10 | for true { 11 | break l 12 | } 13 | assert false 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/loops/loops-break1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | for true { 8 | break 9 | } 10 | //:: ExpectedOutput(assert_error) 11 | assert false 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/loops/loops-continue-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | continue 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/loops/loops-continue-label-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | for true { 8 | //:: ExpectedOutput(type_error) 9 | continue l 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/loops/loops-continue1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | for true { 8 | continue 9 | } 10 | assert false 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/loops/loops-continue4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | for true { 8 | continue 9 | } 10 | for true { 11 | continue 12 | } 13 | assert false 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/loops/loops-ghost-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | ghost n := 64 8 | //:: ExpectedOutput(type_error) 9 | for i := 0; i < n; i++ { } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/loops/loops-ghost-simple1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | ghost var n int 8 | invariant n == 0 9 | for i := 0; i < 64; i++ { } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/loops/range-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo_arr() { 7 | x := [4]uint{1, 2, 3, 4} 8 | //:: ExpectedOutput(type_error) 9 | for i, j, k := range x with i0 { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/loops/range-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo_arr() { 7 | x := []uint{1, 2, 3, 4} 8 | //:: ExpectedOutput(no_permission_to_range_expression) 9 | for i, j := range x with i0 { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/loops/range-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo_arr() { 7 | x := [4]uint{1, 2, 3, 4} 8 | var i int 9 | var j int 10 | //:: ExpectedOutput(type_error) 11 | for i, j = range x with i0 { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/loops/range-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo_arr() { 7 | x := [4]uint{1, 2, 3, 4} 8 | var i uint 9 | var j uint 10 | //:: ExpectedOutput(type_error) 11 | for i, j = range x with i0 { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/loops/range-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo_arr() { 7 | x := [4]uint{1, 2, 3, 4} 8 | var i int 9 | var j uint 10 | var k int 11 | //:: ExpectedOutput(type_error) 12 | for i, j, k = range x with i0 { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/loops/range-fail6.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo_arr() { 7 | x := 0 8 | //:: ExpectedOutput(type_error) 9 | for i, j := range x with i0 { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/loops/range-fail7.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | x := [0]int{} 8 | //:: ExpectedOutput(invariant_establishment_error) 9 | invariant false 10 | for i, j := range x with i0 { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/loops/range-fail8.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo_arr() { 7 | x := []uint{} 8 | invariant acc(x) 9 | //:: ExpectedOutput(invariant_establishment_error) 10 | invariant i == 0 11 | for i, j := range x with i0 { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/loops/range_maps-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | x := map[uint]int{1:1, 2:3} 8 | var i int 9 | var j int 10 | //:: ExpectedOutput(type_error) 11 | for i, j = range x with i0 { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/maps/maps-nested.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | ghost 7 | func foo(){ 8 | mm := dict[int](dict[int]int){1 : {2:3}} 9 | assert mm[1][2] == 3 10 | assert 2 in domain(mm[1]) 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multi-assign.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | func foo() { 7 | x, y, z := 1, 2, 3; 8 | y, z, x = z, x, y; 9 | assert x == 2 && y == 3 && z == 1; 10 | }; 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-cardinality-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost m mset[int]) (n int) { 7 | // fails since `n` isn't ghost 8 | //:: ExpectedOutput(type_error) 9 | n = len(m) 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-cardinality-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | // fails: clearly wrong 8 | //:: ExpectedOutput(assert_error:assertion_error) 9 | assert len(mset[int] { 1, 2 } union mset[int] { 2, 3 }) == 3 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-contains-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost x int, ghost m mset[int]) (b bool) { 7 | // fails since `b` is not ghost 8 | //:: ExpectedOutput(type_error) 9 | b = x in m 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-contains-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost x int, ghost y int) { 7 | ghost var n int 8 | 9 | //:: ExpectedOutput(type_error) 10 | n = x in m 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-contains-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost x int, ghost y int, ghost m mset[int]) { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert x in m ==> y in m 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-contains-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert 42 in mset[int] { 1, 2, 3 } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-contains-fail6.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | assert 42 in mset[bool] { true, true, false } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-convert-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost n int) { 7 | //:: ExpectedOutput(type_error) 8 | ghost m := mset(n) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-convert-fail10.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | requires 0 < x # xs 7 | func foo(ghost x int, ghost xs seq[int]) { 8 | //:: ExpectedOutput(assert_error:assertion_error) 9 | assert !(x in mset(xs)) 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-convert-fail11.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert 42 in mset(seq[int] { 1, 2, 3 }) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-convert-fail12.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost xs seq[int]) { 7 | //:: ExpectedOutput(type_error) 8 | ghost m := mset(set(xs)) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-convert-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost s set[bool]) { 7 | // fails for now 8 | //:: ExpectedOutput(type_error) 9 | ghost m := mset(s) 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-convert-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost m1 mset[bool], ghost m2 mset[int]) { 7 | //:: ExpectedOutput(type_error) 8 | ghost m := mset(m1 union m2) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-convert-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | ghost m := mset(mset[int] { false }) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-convert-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert 42 in mset(mset[int] { 1, 2, 2, 3 }) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-convert-fail6.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost x int, ghost m mset[int]) { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert x in m != x in mset(m) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-convert-fail7.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | ghost m := mset(seq[int] { false }) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-convert-fail8.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost xs seq[int]) (ghost m mset[bool]) { 7 | //:: ExpectedOutput(type_error) 8 | m = mset(xs) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-convert-fail9.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost xs seq[int]) { 7 | ghost m := mset(xs) 8 | //:: ExpectedOutput(assert_error:assertion_error) 9 | assert false 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-convert-simple3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func example1(ghost x int, ghost xs seq[int]) { 7 | assert x in set(xs) ==> x in mset(xs) 8 | assert x in mset(xs) ==> x in set(xs) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-intersection-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost m1 mset[int], ghost m2 mset[bool]) { 7 | //:: ExpectedOutput(type_error) 8 | ghost m := m1 intersection m2 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-intersection-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | assert mset[int] { } intersection mset[bool] { } == mset[int] { } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-intersection-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | requires m != mset[int] { } 7 | func foo(ghost m mset[int]) { 8 | //:: ExpectedOutput(assert_error:assertion_error) 9 | assert m intersection m == mset[int] { } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-intersection-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert mset[int] { 1, 2, 2 } intersection mset[int] { 2, 3 } == mset[int] { 2, 2 } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-literal-fail10.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert mset[bool] { true, false } == mset[bool] { true, true, false } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-literal-fail11.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | ghost m := mset[mset[int]] { mset[int] { 1, 2 }, mset[bool] { } } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-literal-fail12.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | // error: multiset literals cannot contain keys 8 | //:: ExpectedOutput(type_error) 9 | ghost m := mset[int] { 0 : 12 } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-literal-fail13.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | ghost m := mset[seq[int]] { { 1 : 10, 0 : 20 } } 8 | //:: ExpectedOutput(assert_error:assertion_error) 9 | assert m == mset[seq[int]] { { 10, 20 } } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-literal-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | // fails: mixing ghost and non-ghost constructs 7 | //:: ExpectedOutput(type_error) 8 | func foo() (m mset[bool]) { 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-literal-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() (ghost m mset[bool]) { 7 | // fails: incompatible multisets 8 | //:: ExpectedOutput(type_error) 9 | m = mset[int] { } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-literal-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | // fails: comparing incomparable multisets 7 | //:: ExpectedOutput(type_error) 8 | requires m1 == m2 9 | func foo(ghost m1 mset[bool], ghost m2 mset[int]) { 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-literal-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost m mset[int]) { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert m == mset[int] { } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-literal-fail6.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() (ghost m mset[int]) { 7 | //:: ExpectedOutput(type_error) 8 | m = mset[bool] { false } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-literal-fail7.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | assert mset[bool] { true } == set[bool] { true } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-literal-fail8.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | assert mset[int] { 42 } == seq[int] { 42 } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-literal-fail9.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | ghost m := mset[int] { 1, 2, 3, false, 4 } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-multiplicity-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost x int, ghost m mset[int]) { 7 | var n int 8 | // fails since `n` isn't ghost 9 | //:: ExpectedOutput(type_error) 10 | n = x # m 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-multiplicity-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost x int, ghost y int, ghost m mset[int]) { 7 | //:: ExpectedOutput(type_error) 8 | ghost n := x # m + y # m 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-range-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | assert mset[1..4] == set[1..4] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-range-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | assert mset[true .. 10] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-range-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert 42 in mset[1..10] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-range-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | assert mset[1..10] ++ mset[10..20] == mset[1..20] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-range-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | assert mset[0..10][0] == 0 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-range-fail6.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | assert mset[0..10][:5] == mset[0..5] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-setminus-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost m1 mset[int], ghost m2 mset[bool]) { 7 | //:: ExpectedOutput(type_error) 8 | ghost m := m1 setminus m2 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-setminus-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | assert mset[int] { } setminus mset[bool] { } == mset[int] { } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-setminus-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | requires m != mset[int] { } 7 | func foo(ghost m mset[int]) { 8 | //:: ExpectedOutput(assert_error:assertion_error) 9 | assert m setminus m == m 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-setminus-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert mset[int] { 1, 2, 2 } setminus mset[int] { 2, 3 } == mset[int] { 1 } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-subset-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost m1 mset[int], ghost m2 mset[bool]) { 7 | //:: ExpectedOutput(type_error) 8 | ghost m := m1 subset m2 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-subset-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | assert mset[bool] { } subset mset[bool] { } == mset[int] { } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-subset-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert mset[int] { 3, 3 } subset mset[int] { 1, 2, 3, 2 } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-subset-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | assert mset[int] { } subset mset[bool] { } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-type-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | // fails: `m` is not marked as ghost 7 | //:: ExpectedOutput(type_error) 8 | func foo(m mset[int]) { 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-type-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | // fails: `m` should've been marked as ghost 8 | //:: ExpectedOutput(type_error) 9 | var m mset[bool] 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-type-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost m mset[int]) (ghost n mset[bool]) { 7 | // fails: type mismatch 8 | //:: ExpectedOutput(type_error) 9 | n = m 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-type-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type Cell struct { 7 | // fails: `m` is a non-ghost field with a ghost type 8 | //:: ExpectedOutput(type_error) 9 | m mset[bool] 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-type-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | // fails: comparing two incomparable multisets 7 | //:: ExpectedOutput(type_error) 8 | ensures m == n 9 | func foo(ghost m mset[int]) (ghost n mset[bool]) { 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-type-fail6.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost m mset[int], ghost s set[int]) { 7 | //:: ExpectedOutput(type_error) 8 | assert m == s 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-type-fail7.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost s seq[int], ghost m mset[int]) { 7 | //:: ExpectedOutput(type_error) 8 | assert s == m 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-type-simple2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type Point struct { 7 | x int 8 | y int 9 | } 10 | 11 | func foo() { 12 | // sequences of custom defined types are supported 13 | ghost var xs mset[Point] 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-union-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost m1 mset[int], ghost m2 mset[bool]) { 7 | //:: ExpectedOutput(type_error) 8 | ghost m := m1 union m2 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-union-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | assert mset[int] { } union mset[bool] { } == mset[int] { } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-union-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | requires m != mset[int] { } 7 | func foo(ghost m mset[int]) { 8 | //:: ExpectedOutput(assert_error:assertion_error) 9 | assert m union m == m 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/multisets/multiset-union-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert mset[int] { 1, 2 } union mset[int] { 2, 3 } == mset[int] { 1, 2, 3 } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/no_semicolons/multi-assign.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | x, y, z := 1, 2, 3 8 | y, z, x = z, x, y 9 | assert x == 2 && y == 3 && z == 1 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/no_semicolons/ternary_operator/ternary-operator1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func test() { 7 | assert 1 == 1 ? true : false 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/no_semicolons/ternary_operator/ternary-operator2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func test() { 7 | //:: ExpectedOutput(type_error) 8 | v := 1 == 1 ? 5 : true 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/opaque/opaque-function-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | // Cannot make non-pure function opaque 7 | //:: ExpectedOutput(type_error) 8 | opaque 9 | func A() int { 10 | return 42 11 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/features/opaque/opaque-method-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | type IntType int 7 | 8 | // Cannot make non-pure method opaque 9 | //:: ExpectedOutput(type_error) 10 | opaque 11 | func (x IntType) negateCorrectSpec() (ret IntType) { 12 | return -x 13 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/features/opaque/opaque-outline-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func test1() { 7 | // Cannot make outline opaque 8 | //:: ExpectedOutput(type_error) 9 | opaque 10 | outline ( 11 | x := 10 12 | ) 13 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/features/opaque/opaque-spec-simple1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | ensures res == (x > 0) 7 | decreases 8 | opaque 9 | pure func foo(x int) (res bool) 10 | 11 | func bar() { 12 | t := reveal foo(3) 13 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/features/opaque/reveal-conversion-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(i int) { 7 | // Cannot reveal conversions 8 | //:: ExpectedOutput(type_error) 9 | f := reveal float64(i) 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/opaque/reveal-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | decreases 7 | pure func A() int { 8 | return 42 9 | } 10 | 11 | func B() { 12 | // Cannot reveal non-opaque function 13 | //:: ExpectedOutput(type_error) 14 | a := reveal A() 15 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/features/options/options-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func test1() { 7 | // fails: `opt` isn't a ghost var 8 | //:: ExpectedOutput(type_error) 9 | var opt option[int] 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/options/options-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | ghost var opt option[int] 8 | 9 | //:: ExpectedOutput(type_error) 10 | opt = none[bool] 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/options/options-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | ghost var opt option[int] 8 | 9 | //:: ExpectedOutput(type_error) 10 | opt = some(false) 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/options/options-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(b bool) { 7 | ghost var opt option[bool] 8 | opt = some(false || b) 9 | 10 | //:: ExpectedOutput(assert_error:assertion_error) 11 | assert get(opt) == !b 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/options/options-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(b bool) { 7 | assert seq(none[int]) == seq[int] { } 8 | //:: ExpectedOutput(assert_error:assertion_error) 9 | assert seq(some(23)) == seq[int] { 32 } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/options/options-fail6.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert none[int] == some(get(none[int])) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/predicates/predicates_ill_formed1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | //:: ExpectedOutput(predicate_not_well_defined) 7 | pred p(x *int) { *x == 5 } -------------------------------------------------------------------------------- /src/test/resources/regressions/features/purefuncs/add_trivial.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | ensures res == a + b 7 | pure func test(a, b int) (res int) { 8 | return a + b 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/purefuncs/quantifier1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | pure func test()(res int){ 7 | return 3 8 | } 9 | 10 | ensures forall i int :: i==3 ==> (i == test()) 11 | func client(){} 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/purefuncs/quantifier2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | pure func test(a int)(res int){ 7 | return a+1 8 | } 9 | 10 | ensures forall i int :: i == test(i)-1 11 | func client(){} 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/quantifiers/exists-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | //:: ExpectedOutput(parser_error) 7 | requires exists n n int :: true 8 | func test () { } 9 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/quantifiers/exists-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | type Point struct { 7 | x int 8 | y int 9 | } 10 | 11 | //:: ExpectedOutput(type_error) 12 | requires exists p *Point :: acc(&p.x) 13 | func test () { } 14 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/quantifiers/exists-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | //:: ExpectedOutput(parser_error) 7 | requires exists x int :: { x, } 0 < x 8 | func test () { } 9 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/quantifiers/exists-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | func foo(ghost n int) bool 7 | 8 | // invalid: quantifier body isn't pure. 9 | //:: ExpectedOutput(type_error) 10 | requires exists k int :: foo(k) 11 | func bar() { } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/quantifiers/exists-simple3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | pure func foo(ghost n int) bool 7 | 8 | requires exists k int :: foo(k) 9 | func bar() { } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/quantifiers/exists-simple4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | pure func foo (n int) bool 7 | 8 | requires exists i int :: { foo(i) } 0 < i 9 | func bar () { } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/quantifiers/forall-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | //:: ExpectedOutput(parser_error) 7 | requires forall n n int :: true 8 | func test () { } 9 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/quantifiers/forall-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | //:: ExpectedOutput(parser_error) 7 | requires forall n int int :: true 8 | func test () { } 9 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/quantifiers/forall-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | //:: ExpectedOutput(type_error) 7 | requires forall x int, x int :: 0 < x 8 | func test () { } 9 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/quantifiers/forall-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | //:: ExpectedOutput(parser_error) 7 | requires forall x int :: { } 0 < x 8 | func test () { } 9 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/quantifiers/forall-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | //:: ExpectedOutput(parser_error) 7 | requires forall x int :: { x, } 0 < x 8 | func test () { } 9 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/quantifiers/forall-fail6.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | func foo(ghost n int) bool 7 | 8 | // invalid: quantifier body isn't pure. 9 | //:: ExpectedOutput(type_error) 10 | requires forall k int :: foo(k) 11 | func bar() { } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/quantifiers/forall-simple3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | pure func foo(ghost n int) bool 7 | 8 | requires forall k int :: foo(k) 9 | func bar() { } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/quantifiers/forall-simple4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | pure func foo (n int) bool 7 | 8 | requires forall i int :: { foo(i) } 0 < i 9 | func bar () { } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/quantifiers/quantperms-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type Point struct { 7 | x int 8 | y int 9 | } 10 | 11 | func test() { 12 | //:: ExpectedOutput(type_error) 13 | assert forall p *Point :: acc(&p.z) 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/quantifiers/quantperms-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type Point struct { 7 | x int 8 | y int 9 | } 10 | 11 | //:: ExpectedOutput(parser_error) 12 | ensures forall p *Point :: { } acc(&p.x) 13 | func test() { } 14 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/quantifiers/quantperms-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type Point struct { 7 | x int 8 | y int 9 | } 10 | 11 | func test() { 12 | //:: ExpectedOutput(parser_error) 13 | assert forall p *Point :: { p.x , } acc(&p.x) 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/quantifiers/trigger-simple4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | pred p(x int) 7 | 8 | // predicate instance is supported as trigger: 9 | requires forall x int :: { p(x) } (0 <= x ==> p(x)) 10 | func client() 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/runes/type-equality.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | func typeSynonymsAreEqual() { 7 | assert type[int32] == type[rune] 8 | assert type[uint8] == type[byte] 9 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-append-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | ghost func example1(xs seq[int]) { 7 | // fails since it tries to append two sequences of unidentical types 8 | //:: ExpectedOutput(type_error) 9 | zs := xs ++ seq[bool] { } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-contains-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost xs seq[int]) { 7 | // fails: left-hand side has a type that doesn't match the right-hand side 8 | //:: ExpectedOutput(type_error) 9 | assert true in xs 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-contains-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost xs int) { 7 | // fails: right-hand side isn't a sequence or (multi)set 8 | //:: ExpectedOutput(type_error) 9 | assert 2 in xs 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-contains-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | // fails since the membership test might fail 7 | func foo(ghost xs seq[int]) { 8 | //:: ExpectedOutput(assert_error:assertion_error) 9 | assert 42 in xs 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-contains-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | // obvious type error 7 | func foo(x int, ghost xs seq[int], ghost ys seq[bool]) { 8 | //:: ExpectedOutput(type_error) 9 | ghost b := x in (xs in ys) 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-convert-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | ghost xs := seq(seq[int] { true }) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-convert-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert seq[bool] { true, false } == seq(seq[bool] { false, true }) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-index-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost xs seq[int]) { 7 | //:: ExpectedOutput(type_error) 8 | ghost n := xs[true] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-index-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost xs int) { 7 | // fails: cannot use an indexed operation on something that isn't indexable 8 | //:: ExpectedOutput(type_error) 9 | ghost n := xs[2] 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-index-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost xs seq[bool]) { 7 | // fails: cannot mix up ghost expressions and actual program constructs 8 | //:: ExpectedOutput(type_error) 9 | if (xs[0]) { } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-index-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | requires 0 < len(xs) 7 | func foo(ghost xs seq[bool]) { 8 | //:: ExpectedOutput(assignment_error:seq_index_negative_error) 9 | ghost n := xs[-1] 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-index-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | requires len(xs) == 2 7 | func foo(ghost xs seq[bool]) { 8 | //:: ExpectedOutput(assignment_error:seq_index_exceeds_length_error) 9 | ghost n := xs[42] 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-index-fail6.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | requires len(xs) == 2 7 | func foo(ghost xs seq[int]) { 8 | var b bool 9 | //:: ExpectedOutput(type_error) 10 | b = xs[1] 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-index-fail7.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | requires 0 < len(xs) 7 | func foo(ghost xs seq[bool]) { 8 | //:: ExpectedOutput(conditional_error:seq_index_negative_error) 9 | ghost if (xs[-1]) { } else { } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-index-fail8.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | requires 0 < len(xs) 7 | func foo(ghost xs seq[bool]) { 8 | //:: ExpectedOutput(conditional_error:seq_index_exceeds_length_error) 9 | ghost if (xs[15]) { } else { } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-index-simple2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | requires 0 < len(xs) 7 | func foo(ghost xs seq[int]) { 8 | ghost xs[0] = 12 9 | assert xs[0] == 12 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-length-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | // fails: cannot take the length of an integer 7 | //:: ExpectedOutput(type_error) 8 | requires 0 < len(n) 9 | func foo(n int) { 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-length-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost xs seq[int]) { 7 | // fails: sequences do not have capacities 8 | //:: ExpectedOutput(type_error) 9 | ghost n := cap(xs) 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-literal-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | xs := seq[int] { } 8 | // ghost error 9 | //:: ExpectedOutput(type_error) 10 | test(0 in xs) 11 | } 12 | 13 | func test(b bool) { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-literal-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | // incorrectly typed sequence literal 8 | //:: ExpectedOutput(type_error) 9 | xs := seq[int] { false } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-literal-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | // incorrectly typed sequence literal (bool not assignable to int) 8 | //:: ExpectedOutput(type_error) 9 | xs := seq[int] { 1, 17, 32, false, 100 } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-literal-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | // error: negative keys 8 | //:: ExpectedOutput(type_error) 9 | ghost s := seq[int] { -10:42 } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-literal-fail6.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | // error: overlapping keys 8 | //:: ExpectedOutput(type_error) 9 | ghost s := seq[int] { 1:42, 12 } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-literal-fail7.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | ghost s := seq[int] { 1:12, 0:24 } 8 | //:: ExpectedOutput(assert_error:assertion_error) 9 | assert s == seq[int] { 12, 24 } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-literal-fail8.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | requires 0 == n 7 | func foo(ghost n int) { 8 | // error: keys must be constant 9 | //:: ExpectedOutput(type_error) 10 | ghost xs := seq[int] { n : 10 } 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-multiplicity-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost b bool, ghost xs seq[int]) { 7 | //:: ExpectedOutput(type_error) 8 | ghost n := b # xs 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-multiplicity-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost b int, ghost xs int) { 7 | //:: ExpectedOutput(type_error) 8 | ghost n := b # xs 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-multiplicity-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost x int, ghost xs seq[int]) { 7 | ghost n := x # xs 8 | //:: ExpectedOutput(assert_error:assertion_error) 9 | assert false 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-multiplicity-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert 42 # seq[int] { 1, 2, 3 } != 0 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-multiplicity-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost x int) { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert 0 < x # seq[int] { } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-multiplicity-fail6.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | requires x in xs 7 | func foo(ghost x int, ghost xs seq[int]) { 8 | //:: ExpectedOutput(assert_error:assertion_error) 9 | assert x # xs == 0 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-range-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | // fails: incorrectly typed left operand 8 | //:: ExpectedOutput(type_error) 9 | ghost xs := seq[true.. 5] 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-range-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(b bool) { 7 | // fails: incorrectly typed right operand 8 | //:: ExpectedOutput(type_error) 9 | ghost xs := seq[1 .. b] 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-slice-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost xs seq[int]) { 7 | // fails: 'low' index is not an integer 8 | //:: ExpectedOutput(type_error) 9 | ghost ys := xs[false:1] 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-slice-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost xs seq[int]) { 7 | // fails: 'high' index is not an integer 8 | //:: ExpectedOutput(type_error) 9 | ghost ys := xs[1:xs] 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-slice-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost xs seq[int]) { 7 | // fails: cannot specify a capacity in a sequence slice expression 8 | //:: ExpectedOutput(type_error) 9 | ghost ys := xs[1:2:3] 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-type-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | // this fails since a "ghost" annotation is missing for `xs` 7 | //:: ExpectedOutput(type_error) 8 | func foo(xs seq[int]) { 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-type-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | // this fails since the variable declaration is missing a "ghost" annotation 8 | //:: ExpectedOutput(type_error) 9 | var xs seq[int] 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-type-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | // fails since the output parameter `xs` is missing a "ghost" annotation 7 | //:: ExpectedOutput(type_error) 8 | func foo(n int) (xs seq[int]) { 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-type-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | // type error: the contract compares to incomparable sequences 7 | //:: ExpectedOutput(type_error) 8 | requires xs == ys 9 | func foo(ghost xs seq[int], ghost ys seq[bool]) { 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-type-simple2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type Point struct { 7 | x int 8 | y int 9 | } 10 | 11 | func foo() { 12 | // sequences of custom defined types are supported 13 | ghost var xs seq[Point] 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-update-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost xs int) { 7 | // fails since `xs` is not a sequence 8 | //:: ExpectedOutput(type_error) 9 | ghost ys := xs[0 = 42] 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-update-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost xs seq[int]) { 7 | // fails since `true` is not of an integer type 8 | //:: ExpectedOutput(type_error) 9 | ghost ys := xs[true = 42] 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-update-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost xs seq[int]) { 7 | // fails since `false` is not of an integer type 8 | //:: ExpectedOutput(type_error) 9 | ghost ys := xs[0 = false] 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-update-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost xs seq[int]) (ghost ys seq[bool]) { 7 | // fails: integer sequence not assignable to Boolean sequence 8 | //:: ExpectedOutput(type_error) 9 | ys = xs[0 = 42] 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sequences/seq-update-fail7.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost xs int) { 7 | // fails: should not parse a sequence update with no update clauses 8 | //:: ExpectedOutput(parser_error) 9 | ghost ys := xs[] 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-cardinality-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost s int) { 7 | // fails: operand of size operator is not a sequence or (multi)set 8 | //:: ExpectedOutput(type_error) 9 | ghost n := len(s) 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-cardinality-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost s set[int], ghost t set[int]) { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert len(s) <= len(s intersection t) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-cardinality-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost s set[int], ghost t set[int]) { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert len(s) <= len(t) ==> s subset t 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-contains-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost b bool, ghost s set[int]) { 7 | // fails: types don't match 8 | //:: ExpectedOutput(type_error) 9 | ghost u := b in s 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-contains-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(v int, ghost s seq[int]) { 7 | // fails: mixing ghost and non-ghost code 8 | //:: ExpectedOutput(type_error) 9 | u := s in t 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-contains-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert 2 in set[int] { 1, 3 } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-convert-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | ghost t := set(42) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-convert-fail10.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost xs seq[int], ghost ys seq[int]) { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert set(xs ++ ys) setminus set(ys) == set(xs) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-convert-fail11.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost xs seq[int]) { 7 | ghost s := set(xs) 8 | //:: ExpectedOutput(assert_error:assertion_error) 9 | assert false 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-convert-fail12.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost xs seq[int]) { 7 | //:: ExpectedOutput(type_error) 8 | ghost m := set(mset(xs)) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-convert-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | ghost t := set(set(false)) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-convert-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert true in set(set[bool] { false }) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-convert-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | ghost t := set(set[int] { false }) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-convert-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost xs seq[int]) { 7 | //:: ExpectedOutput(type_error) 8 | assert xs == set(xs) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-convert-fail6.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost xs seq[int], ghost s set[bool]) { 7 | //:: ExpectedOutput(type_error) 8 | assert set(xs) == s 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-convert-fail7.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost xs seq[int], n int, i int) { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert n in xs[i:] ==> n in set(xs[:i]) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-convert-fail8.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert 42 in set(seq[1..10]) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-convert-fail9.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost xs seq[int], ghost ys seq[bool]) { 7 | //:: ExpectedOutput(type_error) 8 | assert set(xs) == set(ys) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-intersection-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost s seq[int], ghost t set[int]) { 7 | // fails: `s` is a sequence rather than a set 8 | //:: ExpectedOutput(type_error) 9 | ghost u := s intersection t 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-intersection-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost s set[int], ghost t seq[int]) { 7 | // fails: `t` is a sequence rather than a set 8 | //:: ExpectedOutput(type_error) 9 | ghost u := s intersection t 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-intersection-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost s set[int]) { 7 | // fails: identical set type expected 8 | //:: ExpectedOutput(type_error) 9 | ghost t := s intersection set[bool] { } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-intersection-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() (b bool) { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert set[bool] { true, false } == set[bool] { false } intersection set[bool] { b } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-intersection-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost s set[int]) { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert s == s intersection set[int] { 42 } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-literal-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | // fails: integer is not assignable to a Boolean 8 | //:: ExpectedOutput(type_error) 9 | s := set[bool] { 42 } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-literal-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | // fails: Boolean not assignable to integer 8 | //:: ExpectedOutput(type_error) 9 | s := set[int] { 1, 2, 3, 4, false, 5 } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-literal-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() (ghost s seq[int]) { 7 | // fails: sets and sequences are incompatible 8 | //:: ExpectedOutput(type_error) 9 | s = set[int] { 42 } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-literal-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | // trivial, but should fail of course 8 | //:: ExpectedOutput(assert_error:assertion_error) 9 | assert set[int] { 1, 2 } == set[int] { 2, 3 } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-literal-fail6.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | assert set[int] { 42 } == seq[int] { 42 } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-literal-fail7.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | // error: set literals cannot have keys 8 | //:: ExpectedOutput(type_error) 9 | ghost s := set[bool] { 0 : false } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-literal-fail8.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | ghost s := set[seq[int]] { { 1 : 10, 0 : 20 } } 8 | //:: ExpectedOutput(assert_error:assertion_error) 9 | assert s == set[seq[int]] { { 10, 20 } } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-multiplicity-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost x int, ghost s set[int]) { 7 | ghost var b bool 8 | //:: ExpectedOutput(type_error) 9 | b = x # s 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-multiplicity-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost x int, ghost s set[bool]) { 7 | ghost var n int 8 | //:: ExpectedOutput(type_error) 9 | n = x # s 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-multiplicity-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost x int, ghost s set[int]) { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert (x # s < 0) || (x # s > 1) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-multiplicity-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost x int, ghost s set[int]) { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert (x in s && x # s == 0) || (!(x in s) && x # s == 1) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-multiplicity-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert 0 < 42 # set[int] { 1, 2, 3, 4 } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-range-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | assert seq[1..10] == set[1..10] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-range-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | assert set[true .. 10] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-range-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert 42 in set[1..10] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-range-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | assert set[1..10] ++ set[10..20] == set[1..20] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-range-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | assert set[0..10][0] == 0 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-range-fail6.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | assert set[0..10][:5] == set[0..5] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-setminus-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost s seq[int], ghost t set[int]) { 7 | // fails: `s` is a sequence rather than a set 8 | //:: ExpectedOutput(type_error) 9 | ghost u := s setminus t 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-setminus-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost s set[int], ghost t seq[int]) { 7 | // fails: `t` is a sequence rather than a set 8 | //:: ExpectedOutput(type_error) 9 | ghost u := s setminus t 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-setminus-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost s set[int]) { 7 | // fails: identical set type expected 8 | //:: ExpectedOutput(type_error) 9 | ghost t := s setminus set[bool] { } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-setminus-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() (b bool) { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert set[bool] { true, false } == set[bool] { true } setminus set[bool] { b } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-setminus-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost s set[int]) { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert s == s setminus set[int] { 42 } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-subset-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost s seq[int], ghost t set[int]) { 7 | // fails: `s` is a sequence rather than a set 8 | //:: ExpectedOutput(type_error) 9 | ghost u := s subset t 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-subset-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost s set[int], ghost t seq[int]) { 7 | // fails: `t` is a sequence rather than a set 8 | //:: ExpectedOutput(type_error) 9 | ghost u := s subset t 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-subset-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost s set[int]) { 7 | // fails: identical set type expected 8 | //:: ExpectedOutput(type_error) 9 | ghost t := s subset set[bool] { } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-subset-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost s set[int], ghost t set[int]) { 7 | // fails: mixing ghost with non-ghost code 8 | //:: ExpectedOutput(type_error) 9 | if (s subset t) { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-subset-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost s set[int], ghost t set[int]) { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert set[int] { 1, 2, 3 } subset set[int] { 1, 3, 4 } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-type-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | // fails: `s` should've been marked ghost 7 | //:: ExpectedOutput(type_error) 8 | func foo(s set[int]) { 9 | } 10 | 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-type-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | // fails: `s` should've been marked as ghost 8 | //:: ExpectedOutput(type_error) 9 | var s set[int] 10 | } 11 | 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-type-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | // fails: `s` should've been marked as ghost 7 | //:: ExpectedOutput(type_error) 8 | func foo(n int) (s set[int]) { 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-type-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type Cell struct { 7 | // fails since the field declaration `xs` is of a ghost type while the field is not marked as being ghost. 8 | //:: ExpectedOutput(type_error) 9 | xs set[int] 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-type-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | // fails: sets `s1` and `s2` are of inidentical types 7 | //:: ExpectedOutput(type_error) 8 | ensures s1 == s2 9 | func foo(ghost s1 set[int]) (ghost s2 set[bool]) { 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-type-simple2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type Point struct { 7 | x int 8 | y int 9 | } 10 | 11 | func foo() { 12 | // sequences of custom defined types are supported 13 | ghost var xs set[Point] 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-union-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost s seq[int], ghost t set[int]) { 7 | // fails: `s` is a sequence rather than a set 8 | //:: ExpectedOutput(type_error) 9 | ghost u := s union t 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-union-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost s set[int], ghost t seq[int]) { 7 | // fails: `t` is a sequence rather than a set 8 | //:: ExpectedOutput(type_error) 9 | ghost u := s union t 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-union-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(ghost s set[int]) { 7 | // fails: identical set type expected 8 | //:: ExpectedOutput(type_error) 9 | ghost t := s union set[bool] { } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-union-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() (b bool) { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert set[bool] { true, false } == set[bool] { false } union set[bool] { b } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/sets/set-union-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() (ghost s set[int]) { 7 | //:: ExpectedOutput(assert_error:assertion_error) 8 | assert s == s union set[int] { 42 } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/slices/slice-cap-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | n := cap(nil) // error: untyped nil 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/slices/slice-cap-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | var s []int 8 | //:: ExpectedOutput(assert_error:assertion_error) 9 | assert cap(s) > 0 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/slices/slice-cap-simple2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type IP []byte 7 | 8 | requires len(x) <= cap(x) 9 | decreases _ 10 | pure func foo(x IP) bool 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/slices/slice-index-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo(s []int) { 7 | //:: ExpectedOutput(assignment_error:permission_error) 8 | n := s[0] 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/slices/slice-index-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | requires s == nil 7 | requires forall i int :: 0 <= i && i < len(s) ==> acc(&s[i]) 8 | func foo(s []int) { 9 | //:: ExpectedOutput(assert_error:assertion_error) 10 | assert false 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/slices/slice-init-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | var a [4]int 8 | // fails: cannot create a slice out of an exclusive array 9 | //:: ExpectedOutput(type_error) 10 | s := a[:] 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/slices/slice-length-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | n := len(nil) // error: untyped nil 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/slices/slice-length-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | var s []int 8 | //:: ExpectedOutput(assert_error:assertion_error) 9 | assert len(s) > 0 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/slices/slice-literal-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | s@ := []int { 1, 2, 3, 4, 5 }[1:3:4] 8 | //:: ExpectedOutput(assert_error:assertion_error) 9 | assert len(s) == 3 // just a sanity check; this should be 2 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/slices/slice-nil-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | var a []int 8 | //:: ExpectedOutput(assert_error:assertion_error) 9 | assert a != nil 10 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/features/slices/slice-type-fail2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | // ghost error 8 | //:: ExpectedOutput(type_error) 9 | var s []seq[bool] 10 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/features/slices/slice-type-fail3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(parser_error) 8 | var s []]int 9 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/features/slices/slice-type-fail4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | //:: ExpectedOutput(type_error) 8 | ghost var s []set[[-12]int] 9 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/features/slices/slice-type-fail5.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | requires s == nil 7 | func foo(s []int) { 8 | var a@ [0]int 9 | //:: ExpectedOutput(type_error) 10 | assert s[:] == a[:] // slices can only be compared when using ghost equality (===) 11 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/features/strings/string-conv-fail1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package strings 5 | 6 | // effectful conversions cannot be used in function specification 7 | //:: ExpectedOutput(type_error) 8 | requires len([]byte(s)) > 5 9 | func TestEffectulSpec(s string) -------------------------------------------------------------------------------- /src/test/resources/regressions/features/structs/cyclic-struct-def-check/pkg.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type SomeStruct struct { 7 | nested NestedStruct 8 | } 9 | 10 | type NestedStruct struct {} 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/structs/structs-simple4.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | requires 0 < s.val 7 | func foo(s struct { val int; }) { 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/stubs/stubs-fail0.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | import "net" 7 | 8 | // Should fail, package net does not contain member DoesNotExist 9 | //:: ExpectedOutput(type_error) 10 | func closePacketConn(conn net.DoesNotExist) error -------------------------------------------------------------------------------- /src/test/resources/regressions/features/stubs/stubs2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | import "encoding/binary" 7 | 8 | func main() { 9 | m := make([]byte, 2) 10 | x := binary.LittleEndian.Uint16(m) 11 | y := binary.BigEndian.Uint16(m) 12 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/features/stubs/stubs3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | // ##(--noassumeInjectivityOnInhale) 5 | 6 | package main 7 | 8 | // tests that the contracts provided in sync are valid when the flag 9 | // --noassumeInjectivityOnInhale is passed. 10 | 11 | import "sync" 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/ternary_operator/ternary-operator1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | func test() { 7 | assert 1 == 1 ? true : false; 8 | }; 9 | -------------------------------------------------------------------------------- /src/test/resources/regressions/features/ternary_operator/ternary-operator2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | func test() { 7 | // int and bool are not mergeable: 8 | //:: ExpectedOutput(type_error) 9 | v := 1 == 1 ? 5 : true; 10 | }; 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000002.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | func crash() { 7 | var x int; 8 | assert x == 0; 9 | }; 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000003.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | func recursive() { 7 | recursive(); 8 | }; 9 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000004.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | func f(t int) { 7 | t := 4; 8 | }; 9 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000005.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | func recursive(x int) { 7 | recursive(x); 8 | }; 9 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000008.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main; 5 | 6 | requires acc(p); 7 | func test (p *int) { }; 8 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000009.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main; 5 | 6 | requires n == 0; 7 | func test (n int) { 8 | share n 9 | var p *int = &n; 10 | }; 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000015.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | type Cell struct { 7 | val int 8 | } 9 | 10 | //:: ExpectedOutput(type_error) 11 | requires acc(&c.val) 12 | func test (c Cell) { } -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000016.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main; 5 | 6 | type cell struct { 7 | val int; 8 | }; 9 | 10 | func test () { 11 | c := &cell{42}; 12 | var v int = (*c).val; // problem was here 13 | assert v == 42; 14 | }; 15 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000025.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main; 5 | 6 | // func test () {}; 7 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000026-2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | type List struct { 7 | val int 8 | next *List 9 | } 10 | 11 | requires acc(&l.val) && acc(&l.next) && acc(&l.next.val) 12 | func test(l *List) { 13 | x := l.next.val 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000027-2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | type List struct { 7 | val int 8 | next *List 9 | } 10 | 11 | requires acc(&l.val) 12 | ensures acc(&l.val) && l.val == old(l).val 13 | func test(l *List) { 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000028.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | type Point struct { 7 | x int 8 | y int 9 | } 10 | 11 | requires 0 < p.x // problem was here 12 | func test(p Point) { 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000030.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type Cell struct { 7 | val int 8 | } 9 | 10 | func f(c Cell) Cell { 11 | return c 12 | } 13 | 14 | func g(c Cell) { 15 | d := f(c) 16 | } 17 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000031.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | //requires true 7 | //func f () { } 8 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000034-2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | // Pointers to pointers are not acceptable receiver types, according to the go spec 7 | //:: ExpectedOutput(parser_error) 8 | func (i **DeclaredStruct) Increment() **DeclaredStruct { 9 | return i 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000044.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | //:: ExpectedOutput(type_error) 7 | const CYCLE = CYCLE // this is a cyclic constant declaration 8 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000097-1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | type intPair struct { 7 | a int; 8 | b int; 9 | }; 10 | 11 | func test(t intPair) (res int) { 12 | return t.a + t.b 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000124-1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | // ##(-I ./000124/) 7 | import gobra "github.com/gobra" 8 | 9 | func main() { 10 | x := gobra.F() 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000124-2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | // ##(-I ./000124/) 7 | import "github.com/gobra" 8 | 9 | func main() { 10 | x := gobra.F() 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000124/github.com/gobra/main.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package gobra 5 | 6 | func F() int { 7 | return 0 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000126.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | //:: ExpectedOutput(type_error) 7 | func client1() { 8 | assert 1+1==2 9 | } 10 | 11 | //:: ExpectedOutput(type_error) 12 | func client1() { 13 | assert 4+4==8 14 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000129-3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func issue () { 7 | assert seq[int]{4: 20, 1: 10}[2] == 0 8 | } 9 | 10 | func extra1() { 11 | ghost xs := seq[int]{4: 20, 1: 10} 12 | assert xs[0] == 0 && xs[1] == 10 && xs[4] == 20 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000129.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func main() { 7 | assert [4]int{3: 2, 1: 5}[2] == 0; 8 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000133-1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func m() { 7 | var w T1 = T1 {x: 1, y: 2} 8 | var z T1 = struct { 9 | x int 10 | y uint32 11 | }(w) 12 | } 13 | 14 | type T1 struct { 15 | x int 16 | y uint32 17 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000133-2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type IntType int 7 | 8 | func main() { 9 | var x int = 1 10 | //:: ExpectedOutput(type_error) 11 | var y IntType = x 12 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000151.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | type G *struct { 7 | i int 8 | } 9 | 10 | requires acc(&g.i) 11 | func changeI(g G, i int) { 12 | g.i = i 13 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000155.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg; 5 | 6 | func ex1() { 7 | i@ := 5 8 | x, _ := 1, i 9 | } 10 | 11 | func ex2() { 12 | i@ := 5 13 | var x int 14 | x, _ = 1, i 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000157-1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | type T interface{} 7 | 8 | func main() { 9 | // In a previous version, the following assign would fail 10 | var x T = nil 11 | if x != nil { 12 | assert false 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000157-2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | func main() { 7 | var x interface{} = 42 8 | // In a previous version, the following comparison would fail 9 | if x == nil { 10 | assert false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000166.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | // ##(-I ./000166/) 7 | 8 | import "bug" 9 | 10 | func main() { 11 | //:: ExpectedOutput(precondition_error) 12 | bug.F1() 13 | bug.F2() 14 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000169.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | // ##(-I ./000169/) 7 | 8 | import "pkg2" 9 | 10 | requires t.mpred(y) 11 | pure func f(t* pkg2.T, y int) int -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000169/pkg2/imported.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg2 5 | 6 | type T struct {} 7 | 8 | pred (t *T) mpred(x int) -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000190.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package issue190 5 | 6 | // ##(-I ./000190/) 7 | import B "pkg" 8 | 9 | requires acc(t) 10 | requires *t == B.T{} 11 | func nonInitialized(t *B.T) -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000190/pkg/pkg.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type T struct { 7 | t1 int 8 | t2 int32 9 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000229.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type S []int 7 | 8 | type SInt interface { 9 | S() S 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000232.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | // ##(-I ./000232/) 7 | 8 | import "bug" 9 | 10 | requires x != nil 11 | ensures y >= 0 12 | func bar(x bug.I) (y int) { 13 | return x.foo() 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000232/bug/imported.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package bug 5 | 6 | type I interface { 7 | ensures y > 0 8 | foo() (y int) 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000235-1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type Location struct { 7 | name string 8 | zone []zone 9 | 10 | } 11 | 12 | type zone struct { 13 | name string 14 | offset int 15 | isDST bool 16 | } 17 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000235-2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type test struct { 7 | Path Path 8 | } 9 | 10 | type Path struct {} 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000272.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package issue272 5 | 6 | // ##(-I ./000272/) 7 | import b "pkg" 8 | 9 | func foo2() { 10 | r := &b.Rectangle{Width: 2, Height: 5} 11 | go r.Area() 12 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000272/pkg/pkg.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type Rectangle struct { 7 | Width, Height int 8 | } 9 | 10 | requires acc(self) 11 | ensures acc(self) 12 | func (self *Rectangle) Area() -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000282.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package issue282 5 | 6 | func variadic_function(params ...int) { 7 | var slice []int 8 | slice = params 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000308.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | type T int 7 | 8 | pred (t T)n() -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000316.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package test 5 | 6 | import "time" 7 | 8 | func test() time.Duration { 9 | return 1 + time.Second 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000318.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package issues 5 | 6 | type T interface { 7 | pred Mem() 8 | 9 | requires Mem() 10 | requires t.Mem() 11 | cmp(t T) bool 12 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000339.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package test 5 | 6 | type A uint64 7 | 8 | func f(a A) { 9 | a <<= 2 10 | } 11 | 12 | type Name string 13 | 14 | func g(s Name) Name { 15 | var greeting Name = Name("Hello, ") 16 | greeting += s 17 | return greeting 18 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000341/pkg2/f2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg2 5 | 6 | // ##(-I ../) 7 | 8 | import ( 9 | "pkg1" 10 | ) 11 | 12 | type SCION struct { 13 | SrcIA pkg1.HostSVC 14 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000344.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package test 5 | 6 | // ##(-I ./000344/) 7 | 8 | import "pkg" 9 | 10 | pred P(t *pkg.TE) { 11 | acc(&t.T) 12 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000344/pkg/bug.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type T struct { 7 | x int 8 | } 9 | 10 | type TE struct { 11 | T 12 | y int 13 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000351.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package test 5 | 6 | // ##(-I ./000351/) 7 | import "pkg2" 8 | 9 | type T []pkg2.M2 10 | 11 | pred (t T) Mem() { 12 | (&t[0]).Mem() 13 | } 14 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000351/pkg/f.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type M struct{} 7 | 8 | pred (m* M) Mem() 9 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000351/pkg2/f.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg2 5 | 6 | // ##(-I ../) 7 | import "pkg" 8 | 9 | type M2 = pkg.M 10 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000361.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package test 5 | 6 | pred P(x *int) { 7 | acc(x) 8 | } 9 | 10 | requires P(x) 11 | func f(x *int) int { 12 | invariant P(x) 13 | for unfolding P(x) in *x == 0 { 14 | return 0 15 | } 16 | return 1 17 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000401.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type S struct { 7 | m map[int]int 8 | } 9 | 10 | requires acc(s.m) 11 | decreases 12 | pure func f(s S) int { 13 | return (s.m)[0] 14 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000402.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type S struct { 7 | b []int 8 | } 9 | 10 | decreases 11 | pure func check(s S) bool { 12 | return s.b == nil 13 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000475-2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | func main() { 7 | t := T(1) 8 | //:: ExpectedOutput(type_error) 9 | t.inc() 10 | } 11 | 12 | type T int 13 | 14 | func (t *T) inc() { 15 | *t += 1 16 | } 17 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000486.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package issue486 5 | 6 | requires false 7 | func foo() 8 | 9 | func main() { 10 | outline ( 11 | assume false 12 | foo() 13 | ) 14 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000494.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | type B struct { 7 | f int 8 | } 9 | 10 | decreases 11 | pure func (b *B) isNil() bool { 12 | return b == nil 13 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000573.go: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | type X int 7 | 8 | func (s X) f() { 9 | x := func /*@ g @*/ () { 10 | return 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000576.go: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | var x /*@@@*/ int = 1 7 | 8 | func test() { 9 | f := 10 | // @ requires acc(&x, _) 11 | func /*@ g @*/ () int { 12 | return x 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000620-1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | type MyType struct { 7 | x int 8 | } 9 | 10 | func main() { 11 | mySlice := make([]MyType, 0) 12 | snd := []MyType{MyType{1}} 13 | mySlice = append(perm(1/2), mySlice, snd...) 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000620-2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | type MyStruct struct { 7 | x int 8 | } 9 | 10 | func test() { 11 | myStruct @ := MyStruct{42} 12 | l: 13 | assert myStruct == old[l](myStruct) 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000620-3.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | func test() { 7 | myInt @ := 42 8 | l: 9 | assert myInt == old[l](myInt) 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000621.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | type A struct { 7 | x [3]int 8 | } 9 | 10 | ghost 11 | requires acc(&a.x) 12 | decreases 13 | pure func f(a *A) int { 14 | return let x := a.x in x[0] 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000686-2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | ghost type X adt { 7 | A { a int } 8 | B { b bool } 9 | } 10 | 11 | type A int 12 | 13 | func client1() { 14 | x := X.A{} 15 | y := B{} 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000686-6.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | //:: ExpectedOutput(type_error) 7 | type X adt { 8 | A { x int } 9 | B { x int } 10 | } 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000713.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package issue000713 5 | 6 | func foo() { 7 | f := func g() {} 8 | assert f != nil 9 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000777-1.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package issue000777 5 | 6 | ghost 7 | requires i >= 0 8 | decreases i 9 | func h(i int) (res int) { 10 | //:: ExpectedOutput(type_error) 11 | return i == 0 ? 0 : h(i - 1) 12 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000777-2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package issue000777 5 | 6 | ghost 7 | requires i > 0 8 | decreases i 9 | pure func h(i int) (res int) 10 | 11 | ghost 12 | requires 0 <= i 13 | decreases 14 | func test(i int) { 15 | x := i == 0 ? 0 : h(i) 16 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000836.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package issue836 5 | 6 | func test1() { 7 | var x int 8 | //:: ExpectedOutput(type_error) 9 | assert typeOf(x) == type[int] 10 | } 11 | 12 | func test2() { 13 | var x interface{} = int(1) 14 | assert typeOf(x) == type[int] 15 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/000866.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package issue000866 5 | 6 | type I interface { 7 | //:: ExpectedOutput(type_error) 8 | decreases _ 9 | m() 10 | } -------------------------------------------------------------------------------- /src/test/resources/regressions/issues/windows-line-ending/000225.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | // This file uses the windows line endings (`\r\n`) 5 | package main 6 | 7 | ghost 8 | func f() -------------------------------------------------------------------------------- /src/test/resources/same_package/basic/same-package1a.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | func foo() { 7 | var x int 8 | x = bar() 9 | assert x == 1 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/same_package/basic/same-package1b.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package pkg 5 | 6 | ensures res == 1 7 | func bar() (res int) { 8 | res = 1 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/same_package/file_local_imports/import_not_avail/bar/bar.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package bar 5 | 6 | const Answer = 42 7 | -------------------------------------------------------------------------------- /src/test/resources/same_package/file_local_imports/import_not_avail/main2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | // no import of package bar 7 | 8 | func test2() { 9 | //:: ExpectedOutput(type_error) 10 | assert bar.Answer == 42 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/same_package/file_local_imports/import_not_avail_unqualified/bar/bar.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package bar 5 | 6 | const Answer = 42 7 | -------------------------------------------------------------------------------- /src/test/resources/same_package/file_local_imports/import_not_avail_unqualified/main2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | // no import of package bar 7 | 8 | func test2() { 9 | //:: ExpectedOutput(type_error) 10 | assert Answer == 42 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/same_package/file_local_imports/no_uniqueness_interference/bar/bar.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package bar 5 | 6 | const Answer = 42 7 | -------------------------------------------------------------------------------- /src/test/resources/same_package/file_local_imports/no_uniqueness_interference/main2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | // this import should work as it shouldn't interfere with the import in main1.gobra 7 | import "bar" 8 | 9 | func test2() { 10 | assert bar.Answer == 42 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/same_package/file_local_imports/no_uniqueness_interference_unqualified/bar/bar.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package bar 5 | 6 | const Answer = 42 7 | -------------------------------------------------------------------------------- /src/test/resources/same_package/pkg_init/import1/bar/bar.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package bar 5 | 6 | // ##(-I ../ --experimentalFriendClauses) 7 | 8 | friendPkg "../../pkg" acc(&A) && acc(&B) && acc(&C) 9 | 10 | var A@ int = 1 11 | var B@ int = 2 12 | var C@ int = 3 13 | -------------------------------------------------------------------------------- /src/test/resources/same_package/pkg_init/import1/pkg/importer.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | //:: IgnoreFile(/gobra/issue/830/) 5 | 6 | package pkg 7 | 8 | // ##(-I ../ --experimentalFriendClauses) 9 | 10 | importRequires acc(&bar.A) && acc(&bar.B) 11 | import "bar" 12 | -------------------------------------------------------------------------------- /src/test/resources/same_package/pkg_init/import2/bar/bar.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package bar 5 | 6 | // ##(-I ../ --experimentalFriendClauses) 7 | 8 | friendPkg "pkg" acc(&A) && acc(&B) && acc(&C) 9 | 10 | var A@ int = 1 11 | var B@ int = 2 12 | var C@ int = 3 13 | -------------------------------------------------------------------------------- /src/test/resources/same_package/pkg_init/import2/pkg/importer.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | //:: IgnoreFile(/gobra/issue/830/) 5 | 6 | package pkg 7 | 8 | // ##(-I ../) 9 | 10 | importRequires false 11 | import "bar" 12 | -------------------------------------------------------------------------------- /src/test/resources/same_package/shareProgramDecls/prog2.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package main 5 | 6 | var B@ = 2 -------------------------------------------------------------------------------- /src/test/resources/stats_collector/fail/fail.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package fail 5 | 6 | ensures ret != 0 7 | func fail() (ret int) { 8 | return 0 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/stats_collector/pkg1/subpackage/subpackage.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package subpackage 5 | 6 | ensures ret < 0 7 | func test(d int) (ret int) -------------------------------------------------------------------------------- /src/test/resources/stats_collector/pkg2/subpackage/subpackage.gobra: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package subpackage 5 | 6 | import s "pkg1/subpackage" 7 | 8 | ensures ret < 0 9 | func test(d int) (ret int) { 10 | return s.test(d) 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/unimplemented_go/controlflow/controlflow.go: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package controlflow 5 | 6 | func a() (res int) { 7 | for { 8 | continue 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/test/resources/unimplemented_go/function_literals/funclit.go: -------------------------------------------------------------------------------- 1 | // Any copyright is dedicated to the Public Domain. 2 | // http://creativecommons.org/publicdomain/zero/1.0/ 3 | 4 | package function_literals 5 | 6 | func bar() func() int { 7 | return func() int { 8 | return 2020 9 | } 10 | } 11 | --------------------------------------------------------------------------------