From 73c8cc9f113176078454b73b4b5804149f276d03 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 20 Mar 2026 12:15:29 +0100 Subject: [PATCH 01/79] Add a test for change https://github.com/strata-org/Strata/pull/609/changes#diff-0606e416379a3a38a1be1920d6d5721ab69bfbb1f0ba8316e444399f3d877cbfR277 --- .../Examples/Objects/T2_ModifiesClauses.lean | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/StrataTest/Languages/Laurel/Examples/Objects/T2_ModifiesClauses.lean b/StrataTest/Languages/Laurel/Examples/Objects/T2_ModifiesClauses.lean index 8479881f7..f7b718e57 100644 --- a/StrataTest/Languages/Laurel/Examples/Objects/T2_ModifiesClauses.lean +++ b/StrataTest/Languages/Laurel/Examples/Objects/T2_ModifiesClauses.lean @@ -27,23 +27,25 @@ composite Container { var value: int } -procedure modifyContainerOpaque(c: Container) +procedure modifyContainerOpaque(c: Container) returns (b: bool) ensures true // makes this procedure opaque. Maybe we should use explicit syntax modifies c { - c#value := c#value + 1 + c#value := c#value + 1; + true }; -procedure modifyContainerTransparant(c: Container) +procedure modifyContainerTransparant(c: Container) returns (i: int) { - c#value := c#value + 1 + c#value := c#value + 1; + 7 }; procedure caller() { var c: Container := new Container; var d: Container := new Container; var x: int := d#value; - modifyContainerOpaque(c); + var b: bool := modifyContainerOpaque(c); assert x == d#value // pass }; @@ -53,7 +55,7 @@ procedure caller() { // ensures true // modifies c //{ -// modifyContainerTransparant(c); +// var i: int := modifyContainerTransparant(c); //} procedure modifyContainerWithoutPermission1(c: Container, d: Container) @@ -61,7 +63,7 @@ procedure modifyContainerWithoutPermission1(c: Container, d: Container) // the above error is because the body does not satisfy the empty modifies clause. error needs to be improved ensures true { - modifyContainerTransparant(c) + var i: int := modifyContainerTransparant(c) }; procedure modifyContainerWithoutPermission2(c: Container, d: Container) @@ -79,7 +81,7 @@ procedure modifyContainerWithoutPermission3(c: Container, d: Container) ensures true modifies d { - modifyContainerTransparant(c) + var i: int := modifyContainerTransparant(c) }; procedure multipleModifiesClauses(c: Container, d: Container, e: Container) From a68381113aced5a8024b1cf2c5e1aad5cff1c7a4 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 20 Mar 2026 12:25:39 +0100 Subject: [PATCH 02/79] Fix soundness issue related to instance procedures not yet being implemented --- .../ConcreteToAbstractTreeTranslator.lean | 7 +++-- .../Laurel/Grammar/LaurelGrammar.lean | 2 +- .../Languages/Laurel/Grammar/LaurelGrammar.st | 3 +- .../Laurel/LaurelToCoreTranslator.lean | 30 ++++++++++++++----- 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/Strata/Languages/Laurel/Grammar/ConcreteToAbstractTreeTranslator.lean b/Strata/Languages/Laurel/Grammar/ConcreteToAbstractTreeTranslator.lean index 3b138729c..ac6f780d5 100644 --- a/Strata/Languages/Laurel/Grammar/ConcreteToAbstractTreeTranslator.lean +++ b/Strata/Languages/Laurel/Grammar/ConcreteToAbstractTreeTranslator.lean @@ -511,7 +511,7 @@ def parseComposite (arg : Arg) : TransM TypeDefinition := do let .op op := arg | TransM.error s!"parseComposite expects operation" match op.name, op.args with - | q`Laurel.composite, #[nameArg, extendsArg, fieldsArg] => + | q`Laurel.composite, #[nameArg, extendsArg, fieldsArg, procsArg] => let name ← translateIdent nameArg let extending ← match extendsArg with | .option _ (some (.op extendsOp)) => match extendsOp.name, extendsOp.args with @@ -525,7 +525,10 @@ def parseComposite (arg : Arg) : TransM TypeDefinition := do let fields ← match fieldsArg with | .seq _ _ args => args.toList.mapM parseField | _ => pure [] - return .Composite { name := name, extending := extending, fields := fields, instanceProcedures := [] } + let instanceProcedures ← match procsArg with + | .seq _ _ args => args.toList.mapM parseProcedure + | _ => pure [] + return .Composite { name := name, extending := extending, fields := fields, instanceProcedures := instanceProcedures } | _, _ => TransM.error s!"parseComposite expects composite, got {repr op.name}" diff --git a/Strata/Languages/Laurel/Grammar/LaurelGrammar.lean b/Strata/Languages/Laurel/Grammar/LaurelGrammar.lean index 5bb1669a1..4bbe62383 100644 --- a/Strata/Languages/Laurel/Grammar/LaurelGrammar.lean +++ b/Strata/Languages/Laurel/Grammar/LaurelGrammar.lean @@ -8,7 +8,7 @@ module -- Laurel dialect definition, loaded from LaurelGrammar.st -- NOTE: Changes to LaurelGrammar.st are not automatically tracked by the build system. -- Update this file (e.g. this comment) to trigger a recompile after modifying LaurelGrammar.st. --- Last grammar change: added exit and labelledBlock ops for break/continue support. +-- Last grammar change: composite op moved after Procedure category; accepts Seq Procedure for instance procedures. public import Strata.DDM.Integration.Lean public meta import Strata.DDM.Integration.Lean diff --git a/Strata/Languages/Laurel/Grammar/LaurelGrammar.st b/Strata/Languages/Laurel/Grammar/LaurelGrammar.st index 0e1b7ccf4..48f8e8124 100644 --- a/Strata/Languages/Laurel/Grammar/LaurelGrammar.st +++ b/Strata/Languages/Laurel/Grammar/LaurelGrammar.st @@ -124,7 +124,6 @@ category OptionalExtends; op optionalExtends(parents: CommaSepBy Ident): OptionalExtends => "extends " parents; category Composite; -op composite (name: Ident, extending: Option OptionalExtends, fields: Seq Field): Composite => "composite " name extending "{" fields "}"; // Datatype definitions category DatatypeConstructorArg; @@ -179,6 +178,8 @@ op function (name : Ident, parameters: CommaSepBy Parameter, body : Option OptionalBody) : Procedure => "function " name "(" parameters ")" returnType returnParameters requires ensures modifies body ";"; +op composite (name: Ident, extending: Option OptionalExtends, fields: Seq Field, procedures: Seq Procedure): Composite => "composite " name extending "{" fields procedures "}"; + category ConstrainedType; op constrainedType (name: Ident, valueName: Ident, base: LaurelType, constraint: StmtExpr, witness: StmtExpr): ConstrainedType diff --git a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean index 125fac35f..990a8a4c7 100644 --- a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean +++ b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean @@ -630,6 +630,27 @@ def translate (options: LaurelTranslateOptions) (program : Program): TranslateRe (coreProgramOption, allDiagnostics) where + /-- + Translate Laurel datatype definitions to Core declarations. + Datatypes are grouped by mutual references (SCC) so mutually recursive + datatypes share a single `.data` declaration. + -/ + translateTypes (program : Program) (model : SemanticModel) : TranslateM (List Core.Decl) := do + -- Emit diagnostics for composite types that have instance procedures. + for td in program.types do + if let .Composite ct := td then + for proc in ct.instanceProcedures do + emitDiagnostic $ proc.md.toDiagnostic + s!"Instance procedure '{proc.name.text}' on composite type '{ct.name.text}' is not yet supported" + DiagnosticType.NotYetImplemented + -- Translate datatype definitions to Core declarations. + let laurelDatatypes := program.types.filterMap fun td => match td with + | .Datatype dt => some dt + | _ => none + let ldatatypes := laurelDatatypes.map (translateDatatypeDefinition model) + let groups := groupDatatypes laurelDatatypes ldatatypes + return groups.map fun group => Core.Decl.type (.data group) + translateLaurelToCore (program : Program): TranslateM Core.Program := do let model := (← get).model @@ -661,14 +682,7 @@ def translate (options: LaurelTranslateOptions) (program : Program): TranslateRe let procDecls := procedures.map (fun p => Core.Decl.proc p .empty) -- Translate Laurel datatype definitions to Core declarations. - -- Datatypes are grouped by mutual references (SCC) so mutually recursive - -- datatypes share a single `.data` declaration. - let laurelDatatypes := program.types.filterMap fun td => match td with - | .Datatype dt => some dt - | _ => none - let ldatatypes := laurelDatatypes.map (translateDatatypeDefinition model) - let groups := groupDatatypes laurelDatatypes ldatatypes - let groupedDatatypeDecls := groups.map fun group => Core.Decl.type (.data group) + let groupedDatatypeDecls ← translateTypes program model let program := { decls := groupedDatatypeDecls ++ constantDecls ++ pureFuncDecls ++ procDecls } From 61f712ff37c22fa9dbdf24a5a432e48baca44bad Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 20 Mar 2026 12:28:13 +0100 Subject: [PATCH 03/79] Add new test file --- .../Objects/T7_InstanceProcedures.lean | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 StrataTest/Languages/Laurel/Examples/Objects/T7_InstanceProcedures.lean diff --git a/StrataTest/Languages/Laurel/Examples/Objects/T7_InstanceProcedures.lean b/StrataTest/Languages/Laurel/Examples/Objects/T7_InstanceProcedures.lean new file mode 100644 index 000000000..069c33cd4 --- /dev/null +++ b/StrataTest/Languages/Laurel/Examples/Objects/T7_InstanceProcedures.lean @@ -0,0 +1,32 @@ +/- + Copyright Strata Contributors + + SPDX-License-Identifier: Apache-2.0 OR MIT +-/ + +import StrataTest.Util.TestDiagnostics +import StrataTest.Languages.Laurel.TestExamples + +open StrataTest.Util +open Strata + +namespace Strata.Laurel + +def instanceProcedureProgram := r" +composite Counter { + var count: int + procedure increment(self: Counter) { +// ^^^^^^^^^ error: Instance procedure 'increment' on composite type 'Counter' is not yet supported + self#count := self#count + 1 + }; + procedure reset(self: Counter) { +// ^^^^^ error: Instance procedure 'reset' on composite type 'Counter' is not yet supported + self#count := 0 + }; +} +" + +#guard_msgs (error, drop all) in +#eval! testInputWithOffset "InstanceProcedures" instanceProcedureProgram 14 processLaurelFile + +end Laurel From f3f4d9ec96980c8aa35b6d931e1fba2a19fd1b61 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 20 Mar 2026 13:25:35 +0100 Subject: [PATCH 04/79] Add test for string fields --- .../Languages/Laurel/HeapParameterization.lean | 5 ++++- Strata/Languages/Python/PythonToLaurel.lean | 16 +++++++++------- .../Examples/Objects/T1_MutableFields.lean | 9 ++++++--- StrataTest/Languages/Python/run_py_analyze.sh | 17 +++++++++++++---- 4 files changed, 32 insertions(+), 15 deletions(-) diff --git a/Strata/Languages/Laurel/HeapParameterization.lean b/Strata/Languages/Laurel/HeapParameterization.lean index ec919b9a3..8bd85e9ed 100644 --- a/Strata/Languages/Laurel/HeapParameterization.lean +++ b/Strata/Languages/Laurel/HeapParameterization.lean @@ -175,6 +175,7 @@ def boxDestructorName (model : SemanticModel) (ty : HighType) : Identifier := | .TBool => "Box..boolVal!" | .TFloat64 => "Box..float64Val!" | .TReal => "Box..realVal!" + | .TString => "Box..stringVal" | .UserDefined name => if isDatatype model name then s!"Box..{name.text}Val!" else "Box..compositeVal!" @@ -190,11 +191,12 @@ def boxConstructorName (model : SemanticModel) (ty : HighType) : Identifier := | .TBool => "BoxBool" | .TFloat64 => "BoxFloat64" | .TReal => "BoxReal" + | .TString => "BoxString" | .UserDefined name => if isDatatype model name then s!"Box..{name.text}" else "BoxComposite" | .TCore name => s!"Box..{name}" - | ty => dbg_trace "BUG, boxConstructorName bad type: {repr ty}"; "boxConstructorNameError" + | ty => dbg_trace s!"BUG, boxConstructorName bad type: {repr ty}"; "boxConstructorNameError" /-- Build the DatatypeConstructor for a Box variant from a HighType, for datatype generation -/ private def boxConstructorDef (model : SemanticModel) (ty : HighType) : Option DatatypeConstructor := @@ -203,6 +205,7 @@ private def boxConstructorDef (model : SemanticModel) (ty : HighType) : Option D | .TBool => some { name := "BoxBool", args := [{ name := "boolVal", type := ⟨.TBool, #[]⟩ }] } | .TReal => some { name := "BoxReal", args := [{ name := "realVal", type := ⟨.TReal, #[]⟩ }] } | .TFloat64 => some { name := "BoxFloat64", args := [{ name := "float64Val", type := ⟨.TFloat64, #[]⟩ }] } + | .TString => some { name := "BoxString", args := [{ name := "stringVal", type := ⟨.TString, #[]⟩ }] } | .UserDefined name => if isDatatype model name then some { name := s!"Box..{name.text}", args := [{ name := s!"{name.text}Val", type := ⟨.UserDefined name, #[]⟩ }] } diff --git a/Strata/Languages/Python/PythonToLaurel.lean b/Strata/Languages/Python/PythonToLaurel.lean index bd8bba409..27c790c38 100644 --- a/Strata/Languages/Python/PythonToLaurel.lean +++ b/Strata/Languages/Python/PythonToLaurel.lean @@ -1356,7 +1356,7 @@ def translateMethod (ctx : TranslationContext) (className : String) let retType ← translateType ctx (pyExprToString retExpr) pure (match retType.val with | HighType.TVoid => [] - | _ => [{name := "result", type := retType}]) + | _ => [{name := "LaurelResult", type := AnyTy}]) | none => pure [] -- Translate method body with class context @@ -1398,7 +1398,7 @@ def extractFieldsFromInit (ctx : TranslationContext) (initBody : Array (Python.s /-- Translate a Python class to a Laurel CompositeType -/ def translateClass (ctx : TranslationContext) (classStmt : Python.stmt SourceRange) - : Except TranslationError CompositeType := do + : Except TranslationError (CompositeType × List Procedure) := do match classStmt with | .ClassDef _ className _bases _ body _ _ => let className := className.val @@ -1439,12 +1439,12 @@ def translateClass (ctx : TranslationContext) (classStmt : Python.stmt SourceRan let proc ← translateMethod ctx className methodStmt instanceProcedures := instanceProcedures ++ [proc] - return { + return ({ name := className extending := [] -- No inheritance support for now fields := fields - instanceProcedures := instanceProcedures - } + instanceProcedures := [] -- Laurel does not yet support instance procedures, so treat them as if they were static + }, instanceProcedures) | _ => throw (.internalError "Expected ClassDef") def getFunctions (decls: List Core.Decl) : List String := @@ -1601,6 +1601,8 @@ def pythonToLaurel' (info : PreludeInfo) instanceProcedures := [] } + let mut procedures : List Procedure := [] + -- FIRST PASS: Collect all class definitions and field type info let mut compositeTypes : List CompositeType := [pyErrorTy] let mut compositeTypeNames := info.compositeTypes.insert "PythonError" @@ -1615,7 +1617,8 @@ def pythonToLaurel' (info : PreludeInfo) classFieldHighType := classFieldHighType, filePath := filePath } - let composite ← translateClass initCtx stmt + let (composite, instanceProcedures) ← translateClass initCtx stmt + procedures := procedures ++ instanceProcedures compositeTypes := compositeTypes ++ [composite] compositeTypeNames := compositeTypeNames.insert composite.name.text -- Collect field types for Any coercions in field accesses @@ -1640,7 +1643,6 @@ def pythonToLaurel' (info : PreludeInfo) } -- Separate functions from other statements - let mut procedures : List Procedure := [] let mut otherStmts : List (Python.stmt SourceRange) := [] for stmt in body.val do diff --git a/StrataTest/Languages/Laurel/Examples/Objects/T1_MutableFields.lean b/StrataTest/Languages/Laurel/Examples/Objects/T1_MutableFields.lean index fd076e114..5c3c9caba 100644 --- a/StrataTest/Languages/Laurel/Examples/Objects/T1_MutableFields.lean +++ b/StrataTest/Languages/Laurel/Examples/Objects/T1_MutableFields.lean @@ -12,11 +12,12 @@ open StrataTest.Util namespace Strata namespace Laurel -def program := r" +def program := r#" composite Container { var intValue: int // var indicates mutable field var realValue: real var boolValue: bool + var stringValue: string } procedure newsAreNotEqual() { @@ -30,9 +31,11 @@ procedure simpleAssign() { c#intValue := 2; c#realValue := 3.0; c#boolValue := true; + c#stringValue := "hello"; assert c#intValue == 2; assert c#realValue == 3.0; - assert c#boolValue == true + assert c#boolValue == true; + assert c#stringValue == "hello" }; procedure updatesAndAliasing() @@ -128,7 +131,7 @@ procedure datatypeField() { // assert d#intValue == 1; // assert x == 4; // } -" +"# #guard_msgs(drop info, error) in #eval testInputWithOffset "MutableFields" program 14 processLaurelFile diff --git a/StrataTest/Languages/Python/run_py_analyze.sh b/StrataTest/Languages/Python/run_py_analyze.sh index 075e198c5..8fec84217 100755 --- a/StrataTest/Languages/Python/run_py_analyze.sh +++ b/StrataTest/Languages/Python/run_py_analyze.sh @@ -1,18 +1,22 @@ #!/bin/bash -# Usage: ./run_py_analyze.sh [laurel] [--update] +# Usage: ./run_py_analyze.sh [laurel] [--update] [--filter ] # Run without arguments for pyAnalyze, with "laurel" for pyAnalyzeLaurel # With --update, overwrite existing expected files with actual output +# With --filter , only run tests whose name contains failed=0 update=0 mode="core" +filter="" -for arg in "$@"; do - case "$arg" in +while [ $# -gt 0 ]; do + case "$1" in --update) update=1 ;; - *) mode="$arg" ;; + --filter) filter="$2"; shift ;; + *) mode="$1" ;; esac + shift done if [ "$mode" = "laurel" ]; then @@ -42,6 +46,11 @@ for test_file in tests/test_*.py; do done [ $skip -eq 1 ] && continue + # Apply name filter if specified + if [ -n "$filter" ] && [[ "$base_name" != *"$filter"* ]]; then + continue + fi + ion_file="tests/${base_name}.python.st.ion" expected_file="${expected_dir}/${base_name}.expected" From 0af755c1ef297acb98acd07870ebc6ad08b50344 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 20 Mar 2026 14:27:13 +0100 Subject: [PATCH 05/79] Add missing ! --- Strata/Languages/Laurel/HeapParameterization.lean | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Strata/Languages/Laurel/HeapParameterization.lean b/Strata/Languages/Laurel/HeapParameterization.lean index 8bd85e9ed..497935e04 100644 --- a/Strata/Languages/Laurel/HeapParameterization.lean +++ b/Strata/Languages/Laurel/HeapParameterization.lean @@ -175,7 +175,7 @@ def boxDestructorName (model : SemanticModel) (ty : HighType) : Identifier := | .TBool => "Box..boolVal!" | .TFloat64 => "Box..float64Val!" | .TReal => "Box..realVal!" - | .TString => "Box..stringVal" + | .TString => "Box..stringVal!" | .UserDefined name => if isDatatype model name then s!"Box..{name.text}Val!" else "Box..compositeVal!" From df0c7d829a893696e0834cf18ddaf265b3985ad9 Mon Sep 17 00:00:00 2001 From: KeyboardDrummer Date: Fri, 20 Mar 2026 13:37:35 +0000 Subject: [PATCH 06/79] Move some things from CorePart to LaurelPart, and let output use propertySummary --- .../Python/PythonLaurelCorePrelude.lean | 90 ------------------ .../Python/PythonRuntimeLaurelPart.lean | 93 ++++++++++++++++++- StrataMain.lean | 4 +- .../Python/tests/test_function_def_calls.py | 2 +- .../Python/tests/test_missing_models.py | 6 +- 5 files changed, 99 insertions(+), 96 deletions(-) diff --git a/Strata/Languages/Python/PythonLaurelCorePrelude.lean b/Strata/Languages/Python/PythonLaurelCorePrelude.lean index fb219cfa8..f8b072f48 100644 --- a/Strata/Languages/Python/PythonLaurelCorePrelude.lean +++ b/Strata/Languages/Python/PythonLaurelCorePrelude.lean @@ -99,78 +99,6 @@ type CoreOnlyDelimiter; // Core-only declarations (not expressed in Laurel) // ===================================================================== -// ///////////////////////////////////////////////////////////////////////////////////// -//Functions that we provide to Python user -//to write assertions/contracts about about types of variables - -inline function isBool (v: Any) : Any { - from_bool (Any..isfrom_bool(v)) -} - -inline function isInt (v: Any) : Any { - from_bool (Any..isfrom_int(v)) -} - -inline function isFloat (v: Any) : Any { - from_bool (Any..isfrom_float(v)) -} - -inline function isString (v: Any) : Any { - from_bool (Any..isfrom_string(v)) -} - -inline function isdatetime (v: Any) : Any { - from_bool (Any..isfrom_datetime(v)) -} - -inline function isDict (v: Any) : Any { - from_bool (Any..isfrom_Dict(v)) -} - -inline function isList (v: Any) : Any { - from_bool (Any..isfrom_ListAny(v)) -} - -inline function isClassInstance (v: Any) : Any { - from_bool (Any..isfrom_ClassInstance(v)) -} - -inline function isInstance_of_Int (v: Any) : Any { - from_bool (Any..isfrom_int(v) || Any..isfrom_bool(v)) -} - -inline function isInstance_of_Float (v: Any) : Any { - from_bool (Any..isfrom_float(v) || Any..isfrom_int(v) || Any..isfrom_bool(v)) -} - -// ///////////////////////////////////////////////////////////////////////////////////// -//Functions that we provide to Python user -//to write assertions/contracts about about types of errors -// ///////////////////////////////////////////////////////////////////////////////////// - -inline function isTypeError (e: Error) : Any { - from_bool (Error..isTypeError(e)) -} - -inline function isAttributeError (e: Error) : Any { - from_bool (Error..isAttributeError(e)) -} - -inline function isAssertionError (e: Error) : Any { - from_bool (Error..isAssertionError(e)) -} - -inline function isUnimplementedError (e: Error) : Any { - from_bool (Error..isUnimplementedError(e)) -} - -inline function isUndefinedError (e: Error) : Any { - from_bool (Error..isUndefinedError(e)) -} - -inline function isError (e: Error) : bool { - ! Error..isNoError(e) -} // ///////////////////////////////////////////////////////////////////////////////////// //The following function convert Any type to bool @@ -810,24 +738,6 @@ spec{ delta := from_int ((((days_i * 24) + hours_i) * 3600) * 1000000); }; -// ///////////////////////////////////////////////////////////////////////////////////// -// For testing purpose -// ///////////////////////////////////////////////////////////////////////////////////// - -procedure test_helper_procedure(req_name : Any, opt_name : Any) returns (ret: Any, maybe_except: Error) -spec { - requires [req_name_is_foo]: req_name == from_string("foo"); - requires [req_opt_name_none_or_str]: (Any..isfrom_none(opt_name)) || (Any..isfrom_string(opt_name)); - requires [req_opt_name_none_or_bar]: (opt_name == from_none()) || (opt_name == from_string("bar")); - ensures [ensures_maybe_except_none]: (Error..isNoError(maybe_except)); -} -{ - assert [assert_name_is_foo]: req_name == from_string("foo"); - assert [assert_opt_name_none_or_str]: (Any..isfrom_none(opt_name)) || (Any..isfrom_string(opt_name)); - assert [assert_opt_name_none_or_bar]: (opt_name == from_none()) || (opt_name == from_string("bar")); - assume [assume_maybe_except_none]: (Error..isNoError(maybe_except)); -}; - procedure print(msg : Any) returns (); #end diff --git a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean index 2f27284fa..1277621cf 100644 --- a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean +++ b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean @@ -89,6 +89,97 @@ datatype DictStrAny { DictStrAny_cons (key: string, val: Any, tail: DictStrAny) } +// ///////////////////////////////////////////////////////////////////////////////////// +//Functions that we provide to Python user +//to write assertions/contracts about about types of variables + +function isBool (v: Any) : Any { + from_bool (Any..isfrom_bool(v)) +}; + +function isInt (v: Any) : Any { + from_bool (Any..isfrom_int(v)) +}; + +function isFloat (v: Any) : Any { + from_bool (Any..isfrom_float(v)) +}; + +function isString (v: Any) : Any { + from_bool (Any..isfrom_string(v)) +}; + +function isdatetime (v: Any) : Any { + from_bool (Any..isfrom_datetime(v)) +}; + +function isDict (v: Any) : Any { + from_bool (Any..isfrom_Dict(v)) +}; + +function isList (v: Any) : Any { + from_bool (Any..isfrom_ListAny(v)) +}; + +function isClassInstance (v: Any) : Any { + from_bool (Any..isfrom_ClassInstance(v)) +}; + +function isInstance_of_Int (v: Any) : Any { + from_bool (Any..isfrom_int(v) || Any..isfrom_bool(v)) +}; + +function isInstance_of_Float (v: Any) : Any { + from_bool (Any..isfrom_float(v) || Any..isfrom_int(v) || Any..isfrom_bool(v)) +}; + + +// ///////////////////////////////////////////////////////////////////////////////////// +//Functions that we provide to Python user +//to write assertions/contracts about about types of errors +// ///////////////////////////////////////////////////////////////////////////////////// + +function isTypeError (e: Error) : Any { + from_bool (Error..isTypeError(e)) +}; + +function isAttributeError (e: Error) : Any { + from_bool (Error..isAttributeError(e)) +}; + +function isAssertionError (e: Error) : Any { + from_bool (Error..isAssertionError(e)) +}; + +function isUnimplementedError (e: Error) : Any { + from_bool (Error..isUnimplementedError(e)) +}; + +function isUndefinedError (e: Error) : Any { + from_bool (Error..isUndefinedError(e)) +}; + +function isError (e: Error) : bool { + ! Error..isNoError(e) +}; + + +// ///////////////////////////////////////////////////////////////////////////////////// +// For testing purpose +// ///////////////////////////////////////////////////////////////////////////////////// + +procedure test_helper_procedure(req_name : Any, opt_name : Any) returns (ret: Any, maybe_except: Error) + requires req_name == from_string("foo") summary "req_name_is_foo" + requires (Any..isfrom_none(opt_name)) || (Any..isfrom_string(opt_name)) summary "req_opt_name_none_or_str" + requires (opt_name == from_none()) || (opt_name == from_string("bar")) summary "req_opt_name_none_or_bar" + ensures (Error..isNoError(maybe_except)) summary "ensures_maybe_except_none" +{ + assert req_name == from_string("foo") summary "assert_name_is_foo"; + assert (Any..isfrom_none(opt_name)) || (Any..isfrom_string(opt_name)) summary "assert_opt_name_none_or_str"; + assert (opt_name == from_none()) || (opt_name == from_string("bar")) summary "assert_opt_name_none_or_bar"; + assume (Error..isNoError(maybe_except)) // summary "assume_maybe_except_none" +}; + datatype FIRST_END_MARKER { } #end @@ -97,7 +188,7 @@ datatype FIRST_END_MARKER { } Parse the Laurel DDM prelude into a Laurel Program. -/ public def pythonRuntimeLaurelPart : Laurel.Program := - match Laurel.TransM.run none (Laurel.parseProgram pythonRuntimeLaurelPartDDM) with + match Laurel.TransM.run (some $ .file "") (Laurel.parseProgram pythonRuntimeLaurelPartDDM) with | .ok p => p | .error e => dbg_trace s!"SOUND BUG: Failed to parse Python runtime Laurel part: {e}"; default diff --git a/StrataMain.lean b/StrataMain.lean index 977d9d5c8..abdfcdef4 100644 --- a/StrataMain.lean +++ b/StrataMain.lean @@ -460,6 +460,8 @@ def pyAnalyzeLaurelCommand : Command where IO.println "\n==== Verification Results ====" let mut s := "" for vcResult in vcResults do + let propertySummaryOption := vcResult.obligation.metadata.getPropertySummary + let propertyDescription := propertySummaryOption.getD vcResult.obligation.label let (locationPrefix, locationSuffix) := match Imperative.getFileRange vcResult.obligation.metadata with | some fr => if fr.range.isNone then ("", "") @@ -485,7 +487,7 @@ def pyAnalyzeLaurelCommand : Command where ("", "") | none => ("", "") let outcomeStr := vcResult.formatOutcome - s := s ++ s!"{locationPrefix}{vcResult.obligation.label}: \ + s := s ++ s!"{locationPrefix}{propertyDescription}: \ {outcomeStr}{locationSuffix}\n" IO.println s -- Output in SARIF format if requested diff --git a/StrataTest/Languages/Python/tests/test_function_def_calls.py b/StrataTest/Languages/Python/tests/test_function_def_calls.py index 31276d736..8e5063eb4 100644 --- a/StrataTest/Languages/Python/tests/test_function_def_calls.py +++ b/StrataTest/Languages/Python/tests/test_function_def_calls.py @@ -3,7 +3,7 @@ # Test function defs def my_f(s: str): - test_helper.procedure(s) + test_helper.procedure(s, none) def main(): my_f("foo") diff --git a/StrataTest/Languages/Python/tests/test_missing_models.py b/StrataTest/Languages/Python/tests/test_missing_models.py index 35ea71ff4..e97a5ef8d 100644 --- a/StrataTest/Languages/Python/tests/test_missing_models.py +++ b/StrataTest/Languages/Python/tests/test_missing_models.py @@ -6,10 +6,10 @@ try: response: Dict[str, Any] = foo.get_something(Keyword='bar') print(f"Response Bar Baz {response['Bar']['Baz']}") - test_helper.procedure("Foo") + test_helper.procedure("Foo", opt_name = None) except foo.exceptions.SomeException: print("Error: SomeException") - test_helper.procedure("Foo") + test_helper.procedure("Foo", opt_name = None) except Exception as e: print(f"Error: {e}") - test_helper.procedure("Foo") \ No newline at end of file + test_helper.procedure("Foo", opt_name = None) \ No newline at end of file From aecd814cef5263ba9372af2cfbae8ac9a2633d62 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 20 Mar 2026 14:43:39 +0100 Subject: [PATCH 07/79] Add missing tests for destructuring boxes before assigning them --- .../Languages/Laurel/Examples/Objects/T1_MutableFields.lean | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/StrataTest/Languages/Laurel/Examples/Objects/T1_MutableFields.lean b/StrataTest/Languages/Laurel/Examples/Objects/T1_MutableFields.lean index 5c3c9caba..5610675d1 100644 --- a/StrataTest/Languages/Laurel/Examples/Objects/T1_MutableFields.lean +++ b/StrataTest/Languages/Laurel/Examples/Objects/T1_MutableFields.lean @@ -28,10 +28,16 @@ procedure newsAreNotEqual() { procedure simpleAssign() { var c: Container := new Container; + var iv: int := c#intValue; + var rv: real := c#realValue; + var bv: bool := c#boolValue; + var sv: string := c#stringValue; + c#intValue := 2; c#realValue := 3.0; c#boolValue := true; c#stringValue := "hello"; + assert c#intValue == 2; assert c#realValue == 3.0; assert c#boolValue == true; From b55db9a6ce8c498235c774aa95e3a6a8002dbe73 Mon Sep 17 00:00:00 2001 From: KeyboardDrummer Date: Fri, 20 Mar 2026 14:22:42 +0000 Subject: [PATCH 08/79] Undo move off inline functions --- .../Python/PythonLaurelCorePrelude.lean | 72 ++++++++++++++++++ .../Python/PythonRuntimeLaurelPart.lean | 75 ------------------- 2 files changed, 72 insertions(+), 75 deletions(-) diff --git a/Strata/Languages/Python/PythonLaurelCorePrelude.lean b/Strata/Languages/Python/PythonLaurelCorePrelude.lean index f8b072f48..cc3a6ebc5 100644 --- a/Strata/Languages/Python/PythonLaurelCorePrelude.lean +++ b/Strata/Languages/Python/PythonLaurelCorePrelude.lean @@ -99,6 +99,78 @@ type CoreOnlyDelimiter; // Core-only declarations (not expressed in Laurel) // ===================================================================== +// ///////////////////////////////////////////////////////////////////////////////////// +//Functions that we provide to Python user +//to write assertions/contracts about about types of variables + +inline function isBool (v: Any) : Any { + from_bool (Any..isfrom_bool(v)) +} + +inline function isInt (v: Any) : Any { + from_bool (Any..isfrom_int(v)) +} + +inline function isFloat (v: Any) : Any { + from_bool (Any..isfrom_float(v)) +} + +inline function isString (v: Any) : Any { + from_bool (Any..isfrom_string(v)) +} + +inline function isdatetime (v: Any) : Any { + from_bool (Any..isfrom_datetime(v)) +} + +inline function isDict (v: Any) : Any { + from_bool (Any..isfrom_Dict(v)) +} + +inline function isList (v: Any) : Any { + from_bool (Any..isfrom_ListAny(v)) +} + +inline function isClassInstance (v: Any) : Any { + from_bool (Any..isfrom_ClassInstance(v)) +} + +inline function isInstance_of_Int (v: Any) : Any { + from_bool (Any..isfrom_int(v) || Any..isfrom_bool(v)) +} + +inline function isInstance_of_Float (v: Any) : Any { + from_bool (Any..isfrom_float(v) || Any..isfrom_int(v) || Any..isfrom_bool(v)) +} + +// ///////////////////////////////////////////////////////////////////////////////////// +//Functions that we provide to Python user +//to write assertions/contracts about about types of errors +// ///////////////////////////////////////////////////////////////////////////////////// + +inline function isTypeError (e: Error) : Any { + from_bool (Error..isTypeError(e)) +} + +inline function isAttributeError (e: Error) : Any { + from_bool (Error..isAttributeError(e)) +} + +inline function isAssertionError (e: Error) : Any { + from_bool (Error..isAssertionError(e)) +} + +inline function isUnimplementedError (e: Error) : Any { + from_bool (Error..isUnimplementedError(e)) +} + +inline function isUndefinedError (e: Error) : Any { + from_bool (Error..isUndefinedError(e)) +} + +inline function isError (e: Error) : bool { + ! Error..isNoError(e) +} // ///////////////////////////////////////////////////////////////////////////////////// //The following function convert Any type to bool diff --git a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean index 1277621cf..90b47a9f0 100644 --- a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean +++ b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean @@ -89,81 +89,6 @@ datatype DictStrAny { DictStrAny_cons (key: string, val: Any, tail: DictStrAny) } -// ///////////////////////////////////////////////////////////////////////////////////// -//Functions that we provide to Python user -//to write assertions/contracts about about types of variables - -function isBool (v: Any) : Any { - from_bool (Any..isfrom_bool(v)) -}; - -function isInt (v: Any) : Any { - from_bool (Any..isfrom_int(v)) -}; - -function isFloat (v: Any) : Any { - from_bool (Any..isfrom_float(v)) -}; - -function isString (v: Any) : Any { - from_bool (Any..isfrom_string(v)) -}; - -function isdatetime (v: Any) : Any { - from_bool (Any..isfrom_datetime(v)) -}; - -function isDict (v: Any) : Any { - from_bool (Any..isfrom_Dict(v)) -}; - -function isList (v: Any) : Any { - from_bool (Any..isfrom_ListAny(v)) -}; - -function isClassInstance (v: Any) : Any { - from_bool (Any..isfrom_ClassInstance(v)) -}; - -function isInstance_of_Int (v: Any) : Any { - from_bool (Any..isfrom_int(v) || Any..isfrom_bool(v)) -}; - -function isInstance_of_Float (v: Any) : Any { - from_bool (Any..isfrom_float(v) || Any..isfrom_int(v) || Any..isfrom_bool(v)) -}; - - -// ///////////////////////////////////////////////////////////////////////////////////// -//Functions that we provide to Python user -//to write assertions/contracts about about types of errors -// ///////////////////////////////////////////////////////////////////////////////////// - -function isTypeError (e: Error) : Any { - from_bool (Error..isTypeError(e)) -}; - -function isAttributeError (e: Error) : Any { - from_bool (Error..isAttributeError(e)) -}; - -function isAssertionError (e: Error) : Any { - from_bool (Error..isAssertionError(e)) -}; - -function isUnimplementedError (e: Error) : Any { - from_bool (Error..isUnimplementedError(e)) -}; - -function isUndefinedError (e: Error) : Any { - from_bool (Error..isUndefinedError(e)) -}; - -function isError (e: Error) : bool { - ! Error..isNoError(e) -}; - - // ///////////////////////////////////////////////////////////////////////////////////// // For testing purpose // ///////////////////////////////////////////////////////////////////////////////////// From 91083478cb6f70ca2423a1e3410d77fd6a22f156 Mon Sep 17 00:00:00 2001 From: KeyboardDrummer Date: Fri, 20 Mar 2026 14:23:54 +0000 Subject: [PATCH 09/79] Some logging changes --- Strata/Languages/Core/DDMTransform/ASTtoCST.lean | 2 +- Strata/Languages/Python/PySpecPipeline.lean | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Strata/Languages/Core/DDMTransform/ASTtoCST.lean b/Strata/Languages/Core/DDMTransform/ASTtoCST.lean index 08116cb1d..8259f65c3 100644 --- a/Strata/Languages/Core/DDMTransform/ASTtoCST.lean +++ b/Strata/Languages/Core/DDMTransform/ASTtoCST.lean @@ -57,7 +57,7 @@ namespace ASTToCSTError def toString {M} [ToString M] : ASTToCSTError M → String | unsupportedConstruct fn desc ctx _m => - s!"Unsupported construct in {fn}: {desc}\nContext: {ctx}" + s!"Unsupported construct in {fn}: {desc}\n" instance {M} [ToString M] : ToString (ASTToCSTError M) where toString := ASTToCSTError.toString diff --git a/Strata/Languages/Python/PySpecPipeline.lean b/Strata/Languages/Python/PySpecPipeline.lean index d1fbadf17..4044a8dba 100644 --- a/Strata/Languages/Python/PySpecPipeline.lean +++ b/Strata/Languages/Python/PySpecPipeline.lean @@ -268,7 +268,13 @@ private def prependPrelude (coreFromLaurel : Core.Program) : Core.Program := public def translateCombinedLaurel (combined : Laurel.Program) : (Option Core.Program × List DiagnosticModel) := let (coreOption, errors) := Laurel.translate { emitResolutionErrors := false } combined - (coreOption.map prependPrelude, errors) + (coreOption.map (fun core => + let prepended := prependPrelude core + -- dbg_trace "=== Final Core Program ===" + -- dbg_trace (toString (Std.Format.pretty (Strata.Core.formatProgram prepended) 100)) + -- dbg_trace "=================================" + prepended + ), errors) /-- Errors from the pyAnalyzeLaurel pipeline, distinguishing user code errors (detected bugs in Python source) from internal tool errors. -/ From fb639a2a6a7dc47a88bf7e49dc984f396c257fe6 Mon Sep 17 00:00:00 2001 From: KeyboardDrummer Date: Fri, 20 Mar 2026 14:24:51 +0000 Subject: [PATCH 10/79] Update summary messages --- Strata/Languages/Python/PythonRuntimeLaurelPart.lean | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean index 90b47a9f0..453833418 100644 --- a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean +++ b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean @@ -94,9 +94,9 @@ datatype DictStrAny { // ///////////////////////////////////////////////////////////////////////////////////// procedure test_helper_procedure(req_name : Any, opt_name : Any) returns (ret: Any, maybe_except: Error) - requires req_name == from_string("foo") summary "req_name_is_foo" - requires (Any..isfrom_none(opt_name)) || (Any..isfrom_string(opt_name)) summary "req_opt_name_none_or_str" - requires (opt_name == from_none()) || (opt_name == from_string("bar")) summary "req_opt_name_none_or_bar" + requires req_name == from_string("foo") summary "(Origin_test_helper_procedure_Requires)req_name_is_foo" + requires (Any..isfrom_none(opt_name)) || (Any..isfrom_string(opt_name)) summary "(Origin_test_helper_procedure_Requires)req_opt_name_none_or_str" + requires (opt_name == from_none()) || (opt_name == from_string("bar")) summary "(Origin_test_helper_procedure_Requires)req_opt_name_none_or_bar" ensures (Error..isNoError(maybe_except)) summary "ensures_maybe_except_none" { assert req_name == from_string("foo") summary "assert_name_is_foo"; From dbc1ee04f1189944ce985927472b76ea27455ece Mon Sep 17 00:00:00 2001 From: KeyboardDrummer Date: Fri, 20 Mar 2026 14:41:12 +0000 Subject: [PATCH 11/79] Update Laurel if grammar so match that of Core --- .../Languages/Laurel/Grammar/LaurelGrammar.st | 2 +- .../Python/PythonLaurelCorePrelude.lean | 202 +++++++++--------- .../Python/PythonRuntimeLaurelPart.lean | 12 ++ .../Laurel/ConstrainedTypeElimTest.lean | 2 +- .../Fundamentals/T2_ImpureExpressions.lean | 10 +- .../Examples/Fundamentals/T3_ControlFlow.lean | 20 +- .../Fundamentals/T3_ControlFlowError.lean | 2 +- .../Examples/Fundamentals/T4_LoopJumps.lean | 10 +- .../Examples/Fundamentals/T7_Decreases.lean | 2 +- .../Fundamentals/T8_Postconditions.lean | 2 +- .../T8b_EarlyReturnPostconditions.lean | 4 +- .../Examples/Objects/T1_MutableFields.lean | 2 +- .../Examples/Objects/WIP/6. TypeTests.lr.st | 2 +- .../Languages/Laurel/LiftHolesTest.lean | 6 +- .../Laurel/tests/test_control_flow.lr.st | 8 +- 15 files changed, 149 insertions(+), 137 deletions(-) diff --git a/Strata/Languages/Laurel/Grammar/LaurelGrammar.st b/Strata/Languages/Laurel/Grammar/LaurelGrammar.st index 48f8e8124..5bad8ffd7 100644 --- a/Strata/Languages/Laurel/Grammar/LaurelGrammar.st +++ b/Strata/Languages/Laurel/Grammar/LaurelGrammar.st @@ -88,7 +88,7 @@ category OptionalElse; op optionalElse(stmts : StmtExpr) : OptionalElse => @[prec(0)] "else" stmts; op ifThenElse (cond: StmtExpr, thenBranch: StmtExpr, elseBranch: Option OptionalElse): StmtExpr => - @[prec(20)] "if (" cond ") " thenBranch:0 elseBranch:0; + @[prec(20)] "if " cond " then " thenBranch:0 elseBranch:0; op assert (cond : StmtExpr, errorMessage: Option OptionalErrorMessage) : StmtExpr => @[prec(0)] "assert " cond:0 errorMessage:0; op assume (cond : StmtExpr) : StmtExpr => @[prec(0)] "assume " cond:0; diff --git a/Strata/Languages/Python/PythonLaurelCorePrelude.lean b/Strata/Languages/Python/PythonLaurelCorePrelude.lean index cc3a6ebc5..f6c9ac522 100644 --- a/Strata/Languages/Python/PythonLaurelCorePrelude.lean +++ b/Strata/Languages/Python/PythonLaurelCorePrelude.lean @@ -181,10 +181,10 @@ inline function isError (e: Error) : bool { inline function Any_to_bool (v: Any) : bool requires (Any..isfrom_bool(v) || Any..isfrom_none(v) || Any..isfrom_string(v) || Any..isfrom_int(v)); { - if (Any..isfrom_bool(v)) then Any..as_bool!(v) else - if (Any..isfrom_none(v)) then false else - if (Any..isfrom_string(v)) then !(Any..as_string!(v) == "") else - if (Any..isfrom_int(v)) then !(Any..as_int!(v) == 0) else + if Any..isfrom_bool(v) then Any..as_bool!(v) else + if Any..isfrom_none(v) then false else + if Any..isfrom_string(v) then !(Any..as_string!(v) == "") else + if Any..isfrom_int(v) then !(Any..as_int!(v) == 0) else false //WILL BE ADDED } @@ -421,11 +421,11 @@ inline function bool_to_real (b: bool) : real {if b then 1.0 else 0.0} inline function PNeg (v: Any) : Any { if Any..isexception(v) then v - else if (Any..isfrom_bool(v)) then + else if Any..isfrom_bool(v) then from_int(- bool_to_int(Any..as_bool!(v))) - else if (Any..isfrom_int(v)) then + else if Any..isfrom_int(v) then from_int(- Any..as_int!(v)) - else if (Any..isfrom_float(v)) then + else if Any..isfrom_float(v) then from_float(- Any..as_float!(v)) else exception(UndefinedError ("Operand Type is not defined")) @@ -434,15 +434,15 @@ inline function PNeg (v: Any) : Any inline function PNot (v: Any) : Any { if Any..isexception(v) then v - else if (Any..isfrom_bool(v)) then + else if Any..isfrom_bool(v) then from_bool(!(Any..as_bool!(v))) - else if (Any..isfrom_int(v)) then + else if Any..isfrom_int(v) then from_bool(!(Any..as_int!(v) == 0)) - else if (Any..isfrom_float(v)) then + else if Any..isfrom_float(v) then from_bool(!(Any..as_float!(v) == 0.0)) - else if (Any..isfrom_string(v)) then + else if Any..isfrom_string(v) then from_bool(!(Any..as_string!(v) == "")) - else if (Any..isfrom_ListAny(v)) then + else if Any..isfrom_ListAny(v) then from_bool(!(List_len(Any..as_ListAny!(v)) == 0)) else exception(UndefinedError ("Operand Type is not defined")) @@ -456,27 +456,27 @@ inline function PNot (v: Any) : Any inline function PAdd (v1: Any, v2: Any) : Any { if Any..isexception(v1) then v1 else if Any..isexception(v2) then v2 - else if (Any..isfrom_bool(v1) && Any..isfrom_bool(v2)) then + else if Any..isfrom_bool(v1) && Any..isfrom_bool(v2) then from_int(bool_to_int(Any..as_bool!(v1)) + bool_to_int(Any..as_bool!(v2))) - else if (Any..isfrom_bool(v1) && Any..isfrom_int(v2)) then + else if Any..isfrom_bool(v1) && Any..isfrom_int(v2) then from_int(bool_to_int(Any..as_bool!(v1)) + Any..as_int!(v2)) - else if (Any..isfrom_int(v1) && Any..isfrom_bool(v2)) then + else if Any..isfrom_int(v1) && Any..isfrom_bool(v2) then from_int(Any..as_int!(v1) + bool_to_int(Any..as_bool!(v2))) - else if (Any..isfrom_int(v1) && Any..isfrom_float(v2)) then + else if Any..isfrom_int(v1) && Any..isfrom_float(v2) then from_float(int_to_real(Any..as_int!(v1)) + Any..as_float!(v2)) - else if (Any..isfrom_float(v1) && Any..isfrom_bool(v2)) then + else if Any..isfrom_float(v1) && Any..isfrom_bool(v2) then from_float(Any..as_float!(v1) + bool_to_real(Any..as_bool!(v2))) - else if (Any..isfrom_int(v1) && Any..isfrom_int(v2)) then + else if Any..isfrom_int(v1) && Any..isfrom_int(v2) then from_int(Any..as_int!(v1) + Any..as_int!(v2)) - else if (Any..isfrom_float(v1) && Any..isfrom_int(v2)) then + else if Any..isfrom_float(v1) && Any..isfrom_int(v2) then from_float(Any..as_float!(v1) + int_to_real(Any..as_int!(v2)) ) - else if (Any..isfrom_float(v1) && Any..isfrom_float(v2)) then + else if Any..isfrom_float(v1) && Any..isfrom_float(v2) then from_float(Any..as_float!(v1) + Any..as_float!(v2)) - else if (Any..isfrom_string(v1) && Any..isfrom_string(v2)) then + else if Any..isfrom_string(v1) && Any..isfrom_string(v2) then from_string(str.concat(Any..as_string!(v1),Any..as_string!(v2))) - else if (Any..isfrom_ListAny(v1) && Any..isfrom_ListAny(v2)) then + else if Any..isfrom_ListAny(v1) && Any..isfrom_ListAny(v2) then from_ListAny(List_extend(Any..as_ListAny!(v1),Any..as_ListAny!(v2))) - else if (Any..isfrom_datetime(v1) && Any..isfrom_int(v2)) then + else if Any..isfrom_datetime(v1) && Any..isfrom_int(v2) then from_datetime((Any..as_datetime!(v1) + Any..as_int!(v2))) else exception(UndefinedError ("Operand Type is not defined")) @@ -486,27 +486,27 @@ inline function PAdd (v1: Any, v2: Any) : Any inline function PSub (v1: Any, v2: Any) : Any { if Any..isexception(v1) then v1 else if Any..isexception(v2) then v2 - else if (Any..isfrom_bool(v1) && Any..isfrom_bool(v2)) then + else if Any..isfrom_bool(v1) && Any..isfrom_bool(v2) then from_int(bool_to_int(Any..as_bool!(v1)) - bool_to_int(Any..as_bool!(v2))) - else if (Any..isfrom_bool(v1) && Any..isfrom_int(v2)) then + else if Any..isfrom_bool(v1) && Any..isfrom_int(v2) then from_int(bool_to_int(Any..as_bool!(v1)) - Any..as_int!(v2)) - else if (Any..isfrom_int(v1) && Any..isfrom_bool(v2)) then + else if Any..isfrom_int(v1) && Any..isfrom_bool(v2) then from_int(Any..as_int!(v1) - bool_to_int(Any..as_bool!(v2))) - else if (Any..isfrom_bool(v1) && Any..isfrom_float(v2)) then + else if Any..isfrom_bool(v1) && Any..isfrom_float(v2) then from_float(bool_to_real(Any..as_bool!(v1)) - Any..as_float!(v2)) - else if (Any..isfrom_float(v1) && Any..isfrom_bool(v2)) then + else if Any..isfrom_float(v1) && Any..isfrom_bool(v2) then from_float(Any..as_float!(v1) - bool_to_real(Any..as_bool!(v2))) - else if (Any..isfrom_int(v1) && Any..isfrom_int(v2)) then + else if Any..isfrom_int(v1) && Any..isfrom_int(v2) then from_int(Any..as_int!(v1) - Any..as_int!(v2)) - else if (Any..isfrom_int(v1) && Any..isfrom_float(v2)) then + else if Any..isfrom_int(v1) && Any..isfrom_float(v2) then from_float(int_to_real(Any..as_int!(v1)) - Any..as_float!(v2)) - else if (Any..isfrom_float(v1) && Any..isfrom_int(v2)) then + else if Any..isfrom_float(v1) && Any..isfrom_int(v2) then from_float(Any..as_float!(v1) - int_to_real(Any..as_int!(v2)) ) - else if (Any..isfrom_float(v1) && Any..isfrom_float(v2)) then + else if Any..isfrom_float(v1) && Any..isfrom_float(v2) then from_float(Any..as_float!(v1) - Any..as_float!(v2)) - else if (Any..isfrom_datetime(v1) && Any..isfrom_int(v2)) then + else if Any..isfrom_datetime(v1) && Any..isfrom_int(v2) then from_datetime(Any..as_datetime!(v1) - Any..as_int!(v2)) - else if (Any..isfrom_datetime(v1) && Any..isfrom_datetime(v2)) then + else if Any..isfrom_datetime(v1) && Any..isfrom_datetime(v2) then from_int(Any..as_datetime!(v1) - Any..as_datetime!(v2)) else exception(UndefinedError ("Operand Type is not defined")) @@ -518,35 +518,35 @@ function string_repeat (s: string, i: int) : string; inline function PMul (v1: Any, v2: Any) : Any { if Any..isexception(v1) then v1 else if Any..isexception(v2) then v2 - else if (Any..isfrom_bool(v1) && Any..isfrom_bool(v2)) then + else if Any..isfrom_bool(v1) && Any..isfrom_bool(v2) then from_int(bool_to_int(Any..as_bool!(v1)) * bool_to_int(Any..as_bool!(v2))) - else if (Any..isfrom_bool(v1) && Any..isfrom_int(v2)) then + else if Any..isfrom_bool(v1) && Any..isfrom_int(v2) then from_int(bool_to_int(Any..as_bool!(v1)) * Any..as_int!(v2)) - else if (Any..isfrom_int(v1) && Any..isfrom_bool(v2)) then + else if Any..isfrom_int(v1) && Any..isfrom_bool(v2) then from_int(Any..as_int!(v1) * bool_to_int(Any..as_bool!(v2))) - else if (Any..isfrom_bool(v1) && Any..isfrom_float(v2)) then + else if Any..isfrom_bool(v1) && Any..isfrom_float(v2) then from_float(bool_to_real(Any..as_bool!(v1)) * Any..as_float!(v2)) - else if (Any..isfrom_float(v1) && Any..isfrom_bool(v2)) then + else if Any..isfrom_float(v1) && Any..isfrom_bool(v2) then from_float(Any..as_float!(v1) * bool_to_real(Any..as_bool!(v2))) - else if (Any..isfrom_bool(v1) && Any..isfrom_string(v2)) then + else if Any..isfrom_bool(v1) && Any..isfrom_string(v2) then if Any..as_bool!(v1) then v2 else from_string("") - else if (Any..isfrom_string(v1) && Any..isfrom_bool(v2)) then + else if Any..isfrom_string(v1) && Any..isfrom_bool(v2) then if Any..as_bool!(v2) then v1 else from_string("") - else if (Any..isfrom_int(v1) && Any..isfrom_int(v2)) then + else if Any..isfrom_int(v1) && Any..isfrom_int(v2) then from_int(Any..as_int!(v1) * Any..as_int!(v2)) - else if (Any..isfrom_int(v1) && Any..isfrom_float(v2)) then + else if Any..isfrom_int(v1) && Any..isfrom_float(v2) then from_float(int_to_real(Any..as_int!(v1)) * Any..as_float!(v2)) - else if (Any..isfrom_float(v1) && Any..isfrom_int(v2)) then + else if Any..isfrom_float(v1) && Any..isfrom_int(v2) then from_float(Any..as_float!(v1) * int_to_real(Any..as_int!(v2)) ) - else if (Any..isfrom_int(v1) && Any..isfrom_string(v2)) then + else if Any..isfrom_int(v1) && Any..isfrom_string(v2) then from_string(string_repeat(Any..as_string!(v2), Any..as_int!(v1))) - else if (Any..isfrom_string(v1) && Any..isfrom_int(v2)) then + else if Any..isfrom_string(v1) && Any..isfrom_int(v2) then from_string(string_repeat(Any..as_string!(v1), Any..as_int!(v2))) - else if (Any..isfrom_int(v1) && Any..isfrom_ListAny(v2)) then + else if Any..isfrom_int(v1) && Any..isfrom_ListAny(v2) then from_ListAny(List_repeat(Any..as_ListAny!(v2), Any..as_int!(v1))) - else if (Any..isfrom_ListAny(v1) && Any..isfrom_int(v2)) then + else if Any..isfrom_ListAny(v1) && Any..isfrom_int(v2) then from_ListAny(List_repeat(Any..as_ListAny!(v1), Any..as_int!(v2))) - else if (Any..isfrom_float(v1) && Any..isfrom_float(v2)) then + else if Any..isfrom_float(v1) && Any..isfrom_float(v2) then from_float(Any..as_float!(v1) * Any..as_float!(v2)) else exception(UndefinedError ("Operand Type is not defined")) @@ -556,13 +556,13 @@ inline function PFloorDiv (v1: Any, v2: Any) : Any requires (Any..isfrom_bool(v2)==>Any..as_bool!(v2)) && (Any..isfrom_int(v2)==>Any..as_int!(v2)!=0); { if Any..isexception(v1) then v1 else if Any..isexception(v2) then v2 - else if (Any..isfrom_bool(v1) && Any..isfrom_bool(v2)) then + else if Any..isfrom_bool(v1) && Any..isfrom_bool(v2) then from_int( bool_to_int(Any..as_bool!(v1)) / bool_to_int(Any..as_bool!(v2))) - else if (Any..isfrom_bool(v1) && Any..isfrom_int(v2)) then + else if Any..isfrom_bool(v1) && Any..isfrom_int(v2) then from_int(bool_to_int(Any..as_bool!(v1)) / Any..as_int!(v2)) - else if (Any..isfrom_int(v1) && Any..isfrom_bool(v2)) then + else if Any..isfrom_int(v1) && Any..isfrom_bool(v2) then from_int(Any..as_int!(v1) / bool_to_int(Any..as_bool!(v2))) - else if (Any..isfrom_int(v1) && Any..isfrom_int(v2)) then + else if Any..isfrom_int(v1) && Any..isfrom_int(v2) then from_int(Any..as_int!(v1) / Any..as_int!(v2)) else exception(UndefinedError ("Operand Type is not defined")) @@ -584,29 +584,29 @@ function List_ge (l1: ListAny, l2: ListAny): bool; inline function PLt (v1: Any, v2: Any) : Any { if Any..isexception(v1) then v1 else if Any..isexception(v2) then v2 - else if (Any..isfrom_bool(v1) && Any..isfrom_bool(v2)) then + else if Any..isfrom_bool(v1) && Any..isfrom_bool(v2) then from_bool(bool_to_int(Any..as_bool!(v1)) < bool_to_int(Any..as_bool!(v2))) - else if (Any..isfrom_bool(v1) && Any..isfrom_int(v2)) then + else if Any..isfrom_bool(v1) && Any..isfrom_int(v2) then from_bool(bool_to_int(Any..as_bool!(v1)) < Any..as_int!(v2)) - else if (Any..isfrom_int(v1) && Any..isfrom_bool(v2)) then + else if Any..isfrom_int(v1) && Any..isfrom_bool(v2) then from_bool(Any..as_int!(v1) < bool_to_int(Any..as_bool!(v2))) - else if (Any..isfrom_bool(v1) && Any..isfrom_float(v2)) then + else if Any..isfrom_bool(v1) && Any..isfrom_float(v2) then from_bool(bool_to_real(Any..as_bool!(v1)) < Any..as_float!(v2)) - else if (Any..isfrom_float(v1) && Any..isfrom_bool(v2)) then + else if Any..isfrom_float(v1) && Any..isfrom_bool(v2) then from_bool(Any..as_float!(v1) < bool_to_real(Any..as_bool!(v2))) - else if (Any..isfrom_int(v1) && Any..isfrom_int(v2)) then + else if Any..isfrom_int(v1) && Any..isfrom_int(v2) then from_bool(Any..as_int!(v1) < Any..as_int!(v2)) - else if (Any..isfrom_int(v1) && Any..isfrom_float(v2)) then + else if Any..isfrom_int(v1) && Any..isfrom_float(v2) then from_bool(int_to_real(Any..as_int!(v1)) < Any..as_float!(v2)) - else if (Any..isfrom_float(v1) && Any..isfrom_int(v2)) then + else if Any..isfrom_float(v1) && Any..isfrom_int(v2) then from_bool(Any..as_float!(v1) < int_to_real(Any..as_int!(v2))) - else if (Any..isfrom_float(v1) && Any..isfrom_float(v2)) then + else if Any..isfrom_float(v1) && Any..isfrom_float(v2) then from_bool(Any..as_float!(v1) < Any..as_float!(v2)) - else if (Any..isfrom_string(v1) && Any..isfrom_string(v2)) then + else if Any..isfrom_string(v1) && Any..isfrom_string(v2) then from_bool(string_lt(Any..as_string!(v1), Any..as_string!(v2))) - else if (Any..isfrom_ListAny(v1) && Any..isfrom_ListAny(v2)) then + else if Any..isfrom_ListAny(v1) && Any..isfrom_ListAny(v2) then from_bool(List_lt(Any..as_ListAny!(v1),Any..as_ListAny!(v2))) - else if (Any..isfrom_datetime(v1) && Any..isfrom_datetime(v2)) then + else if Any..isfrom_datetime(v1) && Any..isfrom_datetime(v2) then from_bool(Any..as_datetime!(v1) bool_to_int(Any..as_bool!(v2))) - else if (Any..isfrom_bool(v1) && Any..isfrom_int(v2)) then + else if Any..isfrom_bool(v1) && Any..isfrom_int(v2) then from_bool(bool_to_int(Any..as_bool!(v1)) > Any..as_int!(v2)) - else if (Any..isfrom_int(v1) && Any..isfrom_bool(v2)) then + else if Any..isfrom_int(v1) && Any..isfrom_bool(v2) then from_bool(Any..as_int!(v1) > bool_to_int(Any..as_bool!(v2))) - else if (Any..isfrom_bool(v1) && Any..isfrom_float(v2)) then + else if Any..isfrom_bool(v1) && Any..isfrom_float(v2) then from_bool(bool_to_real(Any..as_bool!(v1)) > Any..as_float!(v2)) - else if (Any..isfrom_float(v1) && Any..isfrom_bool(v2)) then + else if Any..isfrom_float(v1) && Any..isfrom_bool(v2) then from_bool(Any..as_float!(v1) > bool_to_real(Any..as_bool!(v2))) - else if (Any..isfrom_int(v1) && Any..isfrom_int(v2)) then + else if Any..isfrom_int(v1) && Any..isfrom_int(v2) then from_bool(Any..as_int!(v1) > Any..as_int!(v2)) - else if (Any..isfrom_int(v1) && Any..isfrom_float(v2)) then + else if Any..isfrom_int(v1) && Any..isfrom_float(v2) then from_bool(int_to_real(Any..as_int!(v1)) > Any..as_float!(v2)) - else if (Any..isfrom_float(v1) && Any..isfrom_int(v2)) then + else if Any..isfrom_float(v1) && Any..isfrom_int(v2) then from_bool(Any..as_float!(v1) > int_to_real(Any..as_int!(v2))) - else if (Any..isfrom_float(v1) && Any..isfrom_float(v2)) then + else if Any..isfrom_float(v1) && Any..isfrom_float(v2) then from_bool(Any..as_float!(v1) > Any..as_float!(v2)) - else if (Any..isfrom_string(v1) && Any..isfrom_string(v2)) then + else if Any..isfrom_string(v1) && Any..isfrom_string(v2) then from_bool(string_gt(Any..as_string!(v1), Any..as_string!(v2))) - else if (Any..isfrom_ListAny(v1) && Any..isfrom_ListAny(v2)) then + else if Any..isfrom_ListAny(v1) && Any..isfrom_ListAny(v2) then from_bool(List_gt(Any..as_ListAny!(v1),Any..as_ListAny!(v2))) - else if (Any..isfrom_datetime(v1) && Any..isfrom_datetime(v2)) then + else if Any..isfrom_datetime(v1) && Any..isfrom_datetime(v2) then from_bool(Any..as_datetime!(v1) >Any..as_datetime!(v2)) else exception(UndefinedError ("Operand Type is not defined")) @@ -677,29 +677,29 @@ inline function PGt (v1: Any, v2: Any) : Any inline function PGe (v1: Any, v2: Any) : Any { if Any..isexception(v1) then v1 else if Any..isexception(v2) then v2 - else if (Any..isfrom_bool(v1) && Any..isfrom_bool(v2)) then + else if Any..isfrom_bool(v1) && Any..isfrom_bool(v2) then from_bool(bool_to_int(Any..as_bool!(v1)) >= bool_to_int(Any..as_bool!(v2))) - else if (Any..isfrom_bool(v1) && Any..isfrom_int(v2)) then + else if Any..isfrom_bool(v1) && Any..isfrom_int(v2) then from_bool(bool_to_int(Any..as_bool!(v1)) >= Any..as_int!(v2)) - else if (Any..isfrom_int(v1) && Any..isfrom_bool(v2)) then + else if Any..isfrom_int(v1) && Any..isfrom_bool(v2) then from_bool(Any..as_int!(v1) >= bool_to_int(Any..as_bool!(v2))) - else if (Any..isfrom_bool(v1) && Any..isfrom_float(v2)) then + else if Any..isfrom_bool(v1) && Any..isfrom_float(v2) then from_bool(bool_to_real(Any..as_bool!(v1)) >= Any..as_float!(v2)) - else if (Any..isfrom_float(v1) && Any..isfrom_bool(v2)) then + else if Any..isfrom_float(v1) && Any..isfrom_bool(v2) then from_bool(Any..as_float!(v1) >= bool_to_real(Any..as_bool!(v2))) - else if (Any..isfrom_int(v1) && Any..isfrom_int(v2)) then + else if Any..isfrom_int(v1) && Any..isfrom_int(v2) then from_bool(Any..as_int!(v1) >= Any..as_int!(v2)) - else if (Any..isfrom_int(v1) && Any..isfrom_float(v2)) then + else if Any..isfrom_int(v1) && Any..isfrom_float(v2) then from_bool(int_to_real(Any..as_int!(v1)) >= Any..as_float!(v2)) - else if (Any..isfrom_float(v1) && Any..isfrom_int(v2)) then + else if Any..isfrom_float(v1) && Any..isfrom_int(v2) then from_bool(Any..as_float!(v1) >= int_to_real(Any..as_int!(v2))) - else if (Any..isfrom_float(v1) && Any..isfrom_float(v2)) then + else if Any..isfrom_float(v1) && Any..isfrom_float(v2) then from_bool(Any..as_float!(v1) >= Any..as_float!(v2)) - else if (Any..isfrom_string(v1) && Any..isfrom_string(v2)) then + else if Any..isfrom_string(v1) && Any..isfrom_string(v2) then from_bool(string_ge(Any..as_string!(v1), Any..as_string!(v2))) - else if (Any..isfrom_ListAny(v1) && Any..isfrom_ListAny(v2)) then + else if Any..isfrom_ListAny(v1) && Any..isfrom_ListAny(v2) then from_bool(List_ge(Any..as_ListAny!(v1),Any..as_ListAny!(v2))) - else if (Any..isfrom_datetime(v1) && Any..isfrom_datetime(v2)) then + else if Any..isfrom_datetime(v1) && Any..isfrom_datetime(v2) then from_bool(Any..as_datetime!(v1) >=Any..as_datetime!(v2)) else exception(UndefinedError ("Operand Type is not defined")) diff --git a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean index 453833418..ac0fa6f68 100644 --- a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean +++ b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean @@ -105,6 +105,18 @@ procedure test_helper_procedure(req_name : Any, opt_name : Any) returns (ret: An assume (Error..isNoError(maybe_except)) // summary "assume_maybe_except_none" }; +// ///////////////////////////////////////////////////////////////////////////////////// +// DictStrAny functions +// ///////////////////////////////////////////////////////////////////////////////////// + +function Any_sets (dictOrList: Any, /* @[cases] */ indices: ListAny, val: Any): Any +{ + if ListAny..isListAny_nil(indices) then dictOrList + else if ListAny..isListAny_nil(ListAny..tail!(indices)) then Any_set!(dictOrList, ListAny..head!(indices), val) + else Any_set!(dictOrList, ListAny..head!(indices), + Any_sets(Any_get!(dictOrList, ListAny..head!(indices)), ListAny..tail!(indices), val)) +}; + datatype FIRST_END_MARKER { } #end diff --git a/StrataTest/Languages/Laurel/ConstrainedTypeElimTest.lean b/StrataTest/Languages/Laurel/ConstrainedTypeElimTest.lean index ab2b6ab56..7f4c1ac7a 100644 --- a/StrataTest/Languages/Laurel/ConstrainedTypeElimTest.lean +++ b/StrataTest/Languages/Laurel/ConstrainedTypeElimTest.lean @@ -67,7 +67,7 @@ deterministic def scopeProgram : String := r" constrained pos = v: int where v > 0 witness 1 procedure test(b: bool) { - if (b) { + if b then { var x: pos := 1 }; { diff --git a/StrataTest/Languages/Laurel/Examples/Fundamentals/T2_ImpureExpressions.lean b/StrataTest/Languages/Laurel/Examples/Fundamentals/T2_ImpureExpressions.lean index ce53e09f0..fec34e8c4 100644 --- a/StrataTest/Languages/Laurel/Examples/Fundamentals/T2_ImpureExpressions.lean +++ b/StrataTest/Languages/Laurel/Examples/Fundamentals/T2_ImpureExpressions.lean @@ -30,8 +30,8 @@ procedure multipleAssignments() { procedure conditionalAssignmentInExpression(x: int) { var y: int := 0; - var z: int := (if (x > 0) { y := y + 1 } else { 0 }) + y; - if (x > 0) { + var z: int := (if x > 0 then { y := y + 1 } else { 0 }) + y; + if x > 0 then { assert y == 1; assert z == 2 } else { @@ -42,7 +42,7 @@ procedure conditionalAssignmentInExpression(x: int) { procedure anotherConditionAssignmentInExpression(c: bool) { var b: bool := c; - var z: bool := (if (b) { b := false } else (b := true)) || b; + var z: bool := (if b then { b := false } else (b := true)) || b; assert z //^^^^^^^^ error: assertion does not hold }; @@ -90,8 +90,8 @@ procedure imperativeCallInExpressionPosition() { procedure imperativeCallInConditionalExpression(b: bool) { var counter: int := 0; // The imperative call in the then-branch is lifted out of the expression. - var result: int := (if (b) { imperativeProc(counter) } else { 0 }) + counter; - if (b) { + var result: int := (if b then { imperativeProc(counter) } else { 0 }) + counter; + if b then { assert result == 1 } else { assert result == 0 diff --git a/StrataTest/Languages/Laurel/Examples/Fundamentals/T3_ControlFlow.lean b/StrataTest/Languages/Laurel/Examples/Fundamentals/T3_ControlFlow.lean index c9c37b65b..e81c16afe 100644 --- a/StrataTest/Languages/Laurel/Examples/Fundamentals/T3_ControlFlow.lean +++ b/StrataTest/Languages/Laurel/Examples/Fundamentals/T3_ControlFlow.lean @@ -14,8 +14,8 @@ namespace Strata.Laurel def program := r" function returnAtEnd(x: int) returns (r: int) { - if (x > 0) { - if (x == 1) { + if x > 0 then { + if x == 1 then { return 1 } else { return 2 @@ -26,12 +26,12 @@ function returnAtEnd(x: int) returns (r: int) { }; function elseWithCall(): int { - if (true) 3 else returnAtEnd(3) + if true then 3 else returnAtEnd(3) }; function guardInFunction(x: int) returns (r: int) { - if (x > 0) { - if (x == 1) { + if x > 0 then { + if x == 1 then { return 1 } else { return 2 @@ -54,9 +54,9 @@ procedure testFunctions() { procedure guards(a: int) returns (r: int) { var b: int := a + 2; - if (b > 2) { + if b > 2 then { var c: int := b + 3; - if (c > 3) { + if c > 3 then { return c + 4 }; var d: int := c + 5; @@ -73,11 +73,11 @@ procedure dag(a: int) returns (r: int) { var b: int; - if (a > 0) { + if a > 0 then { b := 1 }; - assert if (a > 0) { b == 1 } else { true }; - assert if (a > 0) { b == 2 } else { true }; + assert if a > 0 then { b == 1 } else { true }; + assert if a > 0 then { b == 2 } else { true }; //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: assertion does not hold return b }; diff --git a/StrataTest/Languages/Laurel/Examples/Fundamentals/T3_ControlFlowError.lean b/StrataTest/Languages/Laurel/Examples/Fundamentals/T3_ControlFlowError.lean index ed4c4d55e..b2d5b5c9b 100644 --- a/StrataTest/Languages/Laurel/Examples/Fundamentals/T3_ControlFlowError.lean +++ b/StrataTest/Languages/Laurel/Examples/Fundamentals/T3_ControlFlowError.lean @@ -41,7 +41,7 @@ function localVariableWithoutInitializer(): int { }; function deadCodeAfterIfElse(x: int) returns (r: int) { - if (x > 0) { return 1 } else { return 2 }; + if x > 0 then { return 1 } else { return 2 }; //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: if-then-else only supported as the last statement in a block return 3 }; diff --git a/StrataTest/Languages/Laurel/Examples/Fundamentals/T4_LoopJumps.lean b/StrataTest/Languages/Laurel/Examples/Fundamentals/T4_LoopJumps.lean index bf54f0bbb..040bf3a18 100644 --- a/StrataTest/Languages/Laurel/Examples/Fundamentals/T4_LoopJumps.lean +++ b/StrataTest/Languages/Laurel/Examples/Fundamentals/T4_LoopJumps.lean @@ -20,11 +20,11 @@ procedure whileWithBreakAndContinue(steps: int, continueSteps: int, exitSteps: i invariant counter >= 0 { { - if (steps == exitSteps) { + if steps == exitSteps then { counter = -10; exit breakBlock; } - if (steps == continueSteps) { + if steps == continueSteps then { exit continueBlock; } counter = counter + 1; @@ -51,12 +51,12 @@ proof whileWithBreakAndContinue_body() { loopStart: { assert counter >= 0; - if (steps > 0) { - if (steps == exitSteps) { + if steps > 0 then { + if steps == exitSteps then { counter = -10; exit loopStart; } - if (steps == continueSteps) { + if steps == continueSteps then { exit loopStart; } counter = counter + 1; diff --git a/StrataTest/Languages/Laurel/Examples/Fundamentals/T7_Decreases.lean b/StrataTest/Languages/Laurel/Examples/Fundamentals/T7_Decreases.lean index dd13a46c5..ee5cfc149 100644 --- a/StrataTest/Languages/Laurel/Examples/Fundamentals/T7_Decreases.lean +++ b/StrataTest/Languages/Laurel/Examples/Fundamentals/T7_Decreases.lean @@ -58,7 +58,7 @@ proof foo_body { proof bar_body { var x: nat; - if (x != 0) { + if x != 0 then { assert decreases([x, 0], [x - 1, 1]); } } diff --git a/StrataTest/Languages/Laurel/Examples/Fundamentals/T8_Postconditions.lean b/StrataTest/Languages/Laurel/Examples/Fundamentals/T8_Postconditions.lean index 72ac115d2..b67e9c5f3 100644 --- a/StrataTest/Languages/Laurel/Examples/Fundamentals/T8_Postconditions.lean +++ b/StrataTest/Languages/Laurel/Examples/Fundamentals/T8_Postconditions.lean @@ -17,7 +17,7 @@ procedure opaqueBody(x: int) returns (r: int) // the presence of the ensures make the body opaque. we can consider more explicit syntax. ensures r > 0 { - if (x > 0) { r := x } + if x > 0 then { r := x } else { r := 1 } }; diff --git a/StrataTest/Languages/Laurel/Examples/Fundamentals/T8b_EarlyReturnPostconditions.lean b/StrataTest/Languages/Laurel/Examples/Fundamentals/T8b_EarlyReturnPostconditions.lean index b3d3e5069..2795f28a2 100644 --- a/StrataTest/Languages/Laurel/Examples/Fundamentals/T8b_EarlyReturnPostconditions.lean +++ b/StrataTest/Languages/Laurel/Examples/Fundamentals/T8b_EarlyReturnPostconditions.lean @@ -16,7 +16,7 @@ def program := r" procedure earlyReturnCorrect(x: int) returns (r: int) ensures r >= 0 { - if (x < 0) { + if x < 0 then { return -x }; return x @@ -26,7 +26,7 @@ procedure earlyReturnBuggy(x: int) returns (r: int) ensures r >= 0 // ^^^^^^ error: assertion does not hold { - if (x < 0) { + if x < 0 then { return x }; return x diff --git a/StrataTest/Languages/Laurel/Examples/Objects/T1_MutableFields.lean b/StrataTest/Languages/Laurel/Examples/Objects/T1_MutableFields.lean index 5c3c9caba..4b96057bf 100644 --- a/StrataTest/Languages/Laurel/Examples/Objects/T1_MutableFields.lean +++ b/StrataTest/Languages/Laurel/Examples/Objects/T1_MutableFields.lean @@ -65,7 +65,7 @@ procedure subsequentHeapMutations(c: Container) { procedure implicitEquality(c: Container, d: Container) { c#intValue := 1; d#intValue := 2; - if (c#intValue == d#intValue) { + if c#intValue == d#intValue then { assert c == d } else { // Somehow we can't prove this here diff --git a/StrataTest/Languages/Laurel/Examples/Objects/WIP/6. TypeTests.lr.st b/StrataTest/Languages/Laurel/Examples/Objects/WIP/6. TypeTests.lr.st index cb4e57afc..6d94f9a08 100644 --- a/StrataTest/Languages/Laurel/Examples/Objects/WIP/6. TypeTests.lr.st +++ b/StrataTest/Languages/Laurel/Examples/Objects/WIP/6. TypeTests.lr.st @@ -23,7 +23,7 @@ procedure typeTests(e: Extended1) { var b: Base = e as Base; // even upcasts are not implicit, but they pass statically var e2 = e as Extended2; // ^^ error: could not prove 'e' is of type 'Extended2' - if (e is Extended2) { + if e is Extended2 then { // unreachable, but that's OK var e2pass = e as Extended2; // no error } diff --git a/StrataTest/Languages/Laurel/LiftHolesTest.lean b/StrataTest/Languages/Laurel/LiftHolesTest.lean index 41c9e7ae7..21471f78f 100644 --- a/StrataTest/Languages/Laurel/LiftHolesTest.lean +++ b/StrataTest/Languages/Laurel/LiftHolesTest.lean @@ -133,7 +133,7 @@ deterministic -/ #guard_msgs in #eval! parseElimAndPrint r" -procedure test() { if () { assert true } }; +procedure test() { if then { assert true } }; " -- Hole in then-branch of if-then-else inside typed local variable → int. @@ -149,7 +149,7 @@ deterministic -/ #guard_msgs in #eval! parseElimAndPrint r" -procedure test() { var x: int := if (true) else 0 }; +procedure test() { var x: int := if true then else 0 }; " -- Hole as while-loop condition → bool. @@ -290,7 +290,7 @@ deterministic -/ #guard_msgs in #eval! parseElimAndPrint r" -procedure test() { if (1 + > 0) { assert true } }; +procedure test() { if 1 + > 0 then { assert true } }; " -- Hole in Implies inside while invariant → bool. diff --git a/StrataTest/Languages/Laurel/tests/test_control_flow.lr.st b/StrataTest/Languages/Laurel/tests/test_control_flow.lr.st index 22bc315c0..b255bd7b3 100644 --- a/StrataTest/Languages/Laurel/tests/test_control_flow.lr.st +++ b/StrataTest/Languages/Laurel/tests/test_control_flow.lr.st @@ -2,7 +2,7 @@ procedure main() { var x: int := 5; var result: int := 0; - if (x == 5) { + if x == 5 then { result := 10 } else { result := 20 @@ -12,8 +12,8 @@ procedure main() { var y: int := 7; var status: int := 0; - if (y == 7) { - if (y == 7) { + if y == 7 then { + if y == 7 then { status := 1 } else { status := 2 @@ -26,7 +26,7 @@ procedure main() { var a: int := 10; var b: int := 0; - if (a > 3) { + if a > 3 then { b := 1 } else { b := 2 From 2f8614e2b72088c39682da03333aa1d85a5bf6ef Mon Sep 17 00:00:00 2001 From: KeyboardDrummer Date: Fri, 20 Mar 2026 15:43:18 +0000 Subject: [PATCH 12/79] Draft recursive function support in Laurel --- .../Laurel/LaurelToCoreTranslator.lean | 66 ++++++++++++++++++- .../Fundamentals/T18_RecursiveFunction.lean | 39 +++++++++++ 2 files changed, 103 insertions(+), 2 deletions(-) create mode 100644 StrataTest/Languages/Laurel/Examples/Fundamentals/T18_RecursiveFunction.lean diff --git a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean index 990a8a4c7..092179ff2 100644 --- a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean +++ b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean @@ -529,6 +529,38 @@ def translateProcedure (proc : Procedure) : TranslateM Core.Procedure := do let spec : Core.Procedure.Spec := { modifies, preconditions, postconditions } return { header, spec, body } +partial def isRecursiveExpr (model: SemanticModel) (proc: Procedure) (expr : StmtExpr) : Bool := match expr with + | .StaticCall callee args => + -- Compare by text name: the callee's uniqueId in the body may differ from the + -- declaration's uniqueId (they are resolved separately), so text comparison is correct. + callee.text == proc.name.text || args.any (fun a => isRecursiveExpr model proc a.val) + | .IfThenElse cond thenBr elseBr => + isRecursiveExpr model proc cond.val || isRecursiveExpr model proc thenBr.val || (elseBr.any (fun e => isRecursiveExpr model proc e.val)) + | .Block stmts _ => stmts.any (fun s => isRecursiveExpr model proc s.val) + | .LocalVariable _ _ init => init.any (fun i => isRecursiveExpr model proc i.val) + | .While cond invs dec body => + isRecursiveExpr model proc cond.val || invs.any (fun i => isRecursiveExpr model proc i.val) || + dec.any (fun d => isRecursiveExpr model proc d.val) || isRecursiveExpr model proc body.val + | .Return val => val.any (fun v => isRecursiveExpr model proc v.val) + | .Assign targets value => targets.any (fun t => isRecursiveExpr model proc t.val) || isRecursiveExpr model proc value.val + | .FieldSelect target _ => isRecursiveExpr model proc target.val + | .PureFieldUpdate target _ newVal => isRecursiveExpr model proc target.val || isRecursiveExpr model proc newVal.val + | .PrimitiveOp _ args => args.any (fun a => isRecursiveExpr model proc a.val) + | .ReferenceEquals lhs rhs => isRecursiveExpr model proc lhs.val || isRecursiveExpr model proc rhs.val + | .AsType target _ => isRecursiveExpr model proc target.val + | .IsType target _ => isRecursiveExpr model proc target.val + | .InstanceCall target _ args => isRecursiveExpr model proc target.val || args.any (fun a => isRecursiveExpr model proc a.val) + | .Forall _ trigger body => trigger.any (fun t => isRecursiveExpr model proc t.val) || isRecursiveExpr model proc body.val + | .Exists _ trigger body => trigger.any (fun t => isRecursiveExpr model proc t.val) || isRecursiveExpr model proc body.val + | .Assigned name => isRecursiveExpr model proc name.val + | .Old val => isRecursiveExpr model proc val.val + | .Fresh val => isRecursiveExpr model proc val.val + | .Assert cond => isRecursiveExpr model proc cond.val + | .Assume cond => isRecursiveExpr model proc cond.val + | .ProveBy value proof => isRecursiveExpr model proc value.val || isRecursiveExpr model proc proof.val + | .ContractOf _ fn => isRecursiveExpr model proc fn.val + | _ => false + /-- Translate a Laurel Procedure to a Core Function (when applicable) using `TranslateM`. Diagnostics for disallowed constructs in the function body are emitted into the monad state. @@ -544,20 +576,50 @@ def translateProcedureToFunction (proc : Procedure) : TranslateM Core.Decl := do let checkExpr ← translateExpr precondition [] true return { expr := checkExpr, md := () }) + -- Check whether the body contains a self-referential StaticCall (i.e. the function is recursive). + let isRecursive := match proc.body with + | .Transparent bodyExpr => isRecursiveExpr model proc bodyExpr.val + | .Opaque _ (some bodyExpr) _ => isRecursiveExpr model proc bodyExpr.val + | _ => false + + -- For recursive functions, infer the @[cases] parameter index: the first input + -- whose type is a user-defined datatype (has constructors). This is the argument + -- the partial evaluator will case-split on to unfold the recursion. + let casesIdx : Option Nat := + if !isRecursive then none + else proc.inputs.findIdx? fun p => + match p.type.val with + | .UserDefined name => match model.get name with + | .datatypeDefinition _ => true + | _ => false + | _ => false + let attr : Array Strata.DL.Util.FuncAttr := + match casesIdx with + | some i => #[.inlineIfConstr i] + | none => #[] + let body ← match proc.body with | .Transparent bodyExpr => some <$> translateExpr bodyExpr [] (isPureContext := true) | .Opaque _ (some bodyExpr) _ => emitDiagnostic (proc.md.toDiagnostic "functions with postconditions are not yet supported") some <$> translateExpr bodyExpr [] (isPureContext := true) | _ => pure none - return .func { + let f : Core.Function := { name := ⟨proc.name.text, ()⟩ typeArgs := [] inputs := inputs output := outputTy body := body preconditions := preconditions + isRecursive := isRecursive + attr := attr } + -- Recursive functions must be wrapped in recFuncBlock so the type checker + -- pre-registers the signature before checking the body (enabling self-calls). + if isRecursive then + return .recFuncBlock [f] + else + return .func f /-- Translate a Laurel DatatypeDefinition to an `LDatatype Unit`. @@ -622,7 +684,7 @@ def translate (options: LaurelTranslateOptions) (program : Program): TranslateRe let result := resolve program (some model) let (program, model) := (result.program, result.model) - let initState : TranslateState := {model := model } + let initState : TranslateState := {model := model } let (coreProgramOption, translateState) := runTranslateM initState (translateLaurelToCore program) let resolutionErrors: List DiagnosticModel := if options.emitResolutionErrors then result.errors.toList else [] let allDiagnostics := resolutionErrors ++ diamondErrors ++ modifiesDiags ++ constrainedTypeDiags ++ translateState.diagnostics diff --git a/StrataTest/Languages/Laurel/Examples/Fundamentals/T18_RecursiveFunction.lean b/StrataTest/Languages/Laurel/Examples/Fundamentals/T18_RecursiveFunction.lean new file mode 100644 index 000000000..4a60bda44 --- /dev/null +++ b/StrataTest/Languages/Laurel/Examples/Fundamentals/T18_RecursiveFunction.lean @@ -0,0 +1,39 @@ +/- + Copyright Strata Contributors + + SPDX-License-Identifier: Apache-2.0 OR MIT +-/ + +import StrataTest.Util.TestDiagnostics +import StrataTest.Languages.Laurel.TestExamples + +open StrataTest.Util +open Strata + +namespace Strata.Laurel + +/- +A recursive function over a recursive datatype. +The `isRecursive` flag should be inferred automatically from the self-call. +-/ +def program := r" +datatype IntList { + Nil(), + Cons(head: int, tail: IntList) +} + +function listLen(xs: IntList): int { + if IntList..isNil(xs) then 0 + else 1 + listLen(IntList..tail!(xs)) +}; + +procedure testListLen() { + var xs: IntList := Cons(1, Cons(2, Nil())); + assert listLen(xs) == 2 +}; +" + +#guard_msgs (drop info, error) in +#eval testInputWithOffset "RecursiveFunction" program 14 processLaurelFile + +end Strata.Laurel From 41068c1b35418fe63463e2aba137c7ba6dfea9a6 Mon Sep 17 00:00:00 2001 From: KeyboardDrummer Date: Fri, 20 Mar 2026 15:43:46 +0000 Subject: [PATCH 13/79] Any sets change --- .../Python/PythonLaurelCorePrelude.lean | 8 ------- .../Python/PythonRuntimeLaurelPart.lean | 24 +++++++++---------- Strata/Languages/Python/PythonToLaurel.lean | 2 +- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/Strata/Languages/Python/PythonLaurelCorePrelude.lean b/Strata/Languages/Python/PythonLaurelCorePrelude.lean index f6c9ac522..a2730ccbb 100644 --- a/Strata/Languages/Python/PythonLaurelCorePrelude.lean +++ b/Strata/Languages/Python/PythonLaurelCorePrelude.lean @@ -351,14 +351,6 @@ inline function Any_set! (dictOrList: Any, index: Any, val: Any): Any exception (IndexError("Index out of bound")) } -rec function Any_sets (dictOrList: Any, @[cases] indices: ListAny, val: Any): Any -{ - if ListAny..isListAny_nil(indices) then dictOrList - else if ListAny..isListAny_nil(ListAny..tail!(indices)) then Any_set!(dictOrList, ListAny..head!(indices), val) - else Any_set!(dictOrList, ListAny..head!(indices), - Any_sets(Any_get!(dictOrList, ListAny..head!(indices)), ListAny..tail!(indices), val)) -}; - inline function PIn (v: Any, dictOrList: Any) : Any requires (Any..isfrom_Dict(dictOrList) && Any..isfrom_string(v)) || Any..isfrom_ListAny(dictOrList); { diff --git a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean index ac0fa6f68..9d3d09eb4 100644 --- a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean +++ b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean @@ -89,6 +89,18 @@ datatype DictStrAny { DictStrAny_cons (key: string, val: Any, tail: DictStrAny) } +// ///////////////////////////////////////////////////////////////////////////////////// +// DictStrAny functions +// ///////////////////////////////////////////////////////////////////////////////////// + +function Any_sets (/* @[cases] */ indices: ListAny, dictOrList: Any, val: Any): Any +{ + if ListAny..isListAny_nil(indices) then dictOrList + else if ListAny..isListAny_nil(ListAny..tail!(indices)) then Any_set!(dictOrList, ListAny..head!(indices), val) + else Any_set!(dictOrList, ListAny..head!(indices), + Any_sets(ListAny..tail!(indices), Any_get!(dictOrList, ListAny..head!(indices)), val)) +}; + // ///////////////////////////////////////////////////////////////////////////////////// // For testing purpose // ///////////////////////////////////////////////////////////////////////////////////// @@ -105,18 +117,6 @@ procedure test_helper_procedure(req_name : Any, opt_name : Any) returns (ret: An assume (Error..isNoError(maybe_except)) // summary "assume_maybe_except_none" }; -// ///////////////////////////////////////////////////////////////////////////////////// -// DictStrAny functions -// ///////////////////////////////////////////////////////////////////////////////////// - -function Any_sets (dictOrList: Any, /* @[cases] */ indices: ListAny, val: Any): Any -{ - if ListAny..isListAny_nil(indices) then dictOrList - else if ListAny..isListAny_nil(ListAny..tail!(indices)) then Any_set!(dictOrList, ListAny..head!(indices), val) - else Any_set!(dictOrList, ListAny..head!(indices), - Any_sets(Any_get!(dictOrList, ListAny..head!(indices)), ListAny..tail!(indices), val)) -}; - datatype FIRST_END_MARKER { } #end diff --git a/Strata/Languages/Python/PythonToLaurel.lean b/Strata/Languages/Python/PythonToLaurel.lean index 27c790c38..a3e07c524 100644 --- a/Strata/Languages/Python/PythonToLaurel.lean +++ b/Strata/Languages/Python/PythonToLaurel.lean @@ -863,7 +863,7 @@ partial def translateAssign (ctx : TranslationContext) | target :: slices => let target ← translateExpr ctx target let slices ← slices.mapM (translateExpr ctx) - let anySetsExpr := mkStmtExprMd (StmtExpr.StaticCall "Any_sets" [target, ListAny_mk slices, rhs_trans]) + let anySetsExpr := ⟨ StmtExpr.StaticCall "Any_sets" [ListAny_mk slices, target, rhs_trans] , md ⟩ let assignStmts := [mkStmtExprMd (StmtExpr.Assign [target] anySetsExpr)] return (ctx,assignStmts) | _ => throw (.internalError "Invalid Subscript Expr") From 827f7db55152c695f32751520a6eb264ba45306b Mon Sep 17 00:00:00 2001 From: KeyboardDrummer Date: Fri, 20 Mar 2026 15:53:08 +0000 Subject: [PATCH 14/79] Update tests --- .../Languages/Python/expected_laurel/test_arithmetic.expected | 4 ++-- .../Python/expected_laurel/test_augmented_assign.expected | 4 ++-- .../Python/expected_laurel/test_break_continue.expected | 4 ++-- .../Languages/Python/expected_laurel/test_class_decl.expected | 4 ++-- .../Python/expected_laurel/test_class_field_init.expected | 4 ++-- .../Python/expected_laurel/test_class_field_use.expected | 4 ++-- .../Python/expected_laurel/test_comparisons.expected | 4 ++-- .../Python/expected_laurel/test_control_flow.expected | 4 ++-- .../Languages/Python/expected_laurel/test_datetime.expected | 4 ++-- .../Python/expected_laurel/test_function_def_calls.expected | 4 ++-- .../Languages/Python/expected_laurel/test_list.expected | 4 ++-- .../Python/expected_laurel/test_missing_models.expected | 4 ++-- .../expected_laurel/test_precondition_verification.expected | 4 ++-- .../Languages/Python/expected_laurel/test_strings.expected | 4 ++-- .../Python/expected_laurel/test_subscription.expected | 4 ++-- .../Languages/Python/expected_laurel/test_try_except.expected | 4 ++-- .../Python/expected_laurel/test_try_except_scoping.expected | 4 ++-- .../Python/expected_laurel/test_with_statement.expected | 4 ++-- StrataTest/Languages/Python/tests/test_function_def_calls.py | 2 +- .../Languages/Python/tests/test_precondition_verification.py | 4 ++-- 20 files changed, 39 insertions(+), 39 deletions(-) diff --git a/StrataTest/Languages/Python/expected_laurel/test_arithmetic.expected b/StrataTest/Languages/Python/expected_laurel/test_arithmetic.expected index 87d118194..909766cb5 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_arithmetic.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_arithmetic.expected @@ -11,8 +11,6 @@ Any_get_body_calls_DictStrAny_get_0: ✅ pass Any_get_body_calls_List_get_1: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass @@ -22,6 +20,8 @@ POr_body_calls_Any_to_bool_0: ✅ pass ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_augmented_assign.expected b/StrataTest/Languages/Python/expected_laurel/test_augmented_assign.expected index 7f7d8d8e5..74a9e187a 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_augmented_assign.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_augmented_assign.expected @@ -11,8 +11,6 @@ Any_get_body_calls_DictStrAny_get_0: ✅ pass Any_get_body_calls_List_get_1: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass @@ -22,6 +20,8 @@ POr_body_calls_Any_to_bool_0: ✅ pass ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_break_continue.expected b/StrataTest/Languages/Python/expected_laurel/test_break_continue.expected index fe8d1b647..8961f8aac 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_break_continue.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_break_continue.expected @@ -11,8 +11,6 @@ Any_get_body_calls_DictStrAny_get_0: ✅ pass Any_get_body_calls_List_get_1: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass @@ -22,6 +20,8 @@ POr_body_calls_Any_to_bool_0: ✅ pass ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_decl.expected b/StrataTest/Languages/Python/expected_laurel/test_class_decl.expected index d6c0ba324..1e82b0d52 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_decl.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_decl.expected @@ -11,8 +11,6 @@ Any_get_body_calls_DictStrAny_get_0: ✅ pass Any_get_body_calls_List_get_1: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass @@ -22,6 +20,8 @@ POr_body_calls_Any_to_bool_0: ✅ pass ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_field_init.expected b/StrataTest/Languages/Python/expected_laurel/test_class_field_init.expected index d6c0ba324..1e82b0d52 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_field_init.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_field_init.expected @@ -11,8 +11,6 @@ Any_get_body_calls_DictStrAny_get_0: ✅ pass Any_get_body_calls_List_get_1: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass @@ -22,6 +20,8 @@ POr_body_calls_Any_to_bool_0: ✅ pass ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_field_use.expected b/StrataTest/Languages/Python/expected_laurel/test_class_field_use.expected index 1d3eac0d0..40e558aad 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_field_use.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_field_use.expected @@ -11,8 +11,6 @@ Any_get_body_calls_DictStrAny_get_0: ✅ pass Any_get_body_calls_List_get_1: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass @@ -22,6 +20,8 @@ POr_body_calls_Any_to_bool_0: ✅ pass ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_comparisons.expected b/StrataTest/Languages/Python/expected_laurel/test_comparisons.expected index cc06706e5..c83ccb36e 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_comparisons.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_comparisons.expected @@ -11,8 +11,6 @@ Any_get_body_calls_DictStrAny_get_0: ✅ pass Any_get_body_calls_List_get_1: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass @@ -22,6 +20,8 @@ POr_body_calls_Any_to_bool_0: ✅ pass ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_control_flow.expected b/StrataTest/Languages/Python/expected_laurel/test_control_flow.expected index 52d45de4d..e755613d3 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_control_flow.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_control_flow.expected @@ -11,8 +11,6 @@ Any_get_body_calls_DictStrAny_get_0: ✅ pass Any_get_body_calls_List_get_1: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass @@ -22,6 +20,8 @@ POr_body_calls_Any_to_bool_0: ✅ pass ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_datetime.expected b/StrataTest/Languages/Python/expected_laurel/test_datetime.expected index 373fe7fa9..4ae78f46e 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_datetime.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_datetime.expected @@ -11,8 +11,6 @@ Any_get_body_calls_DictStrAny_get_0: ✅ pass Any_get_body_calls_List_get_1: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass @@ -22,6 +20,8 @@ POr_body_calls_Any_to_bool_0: ✅ pass ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_function_def_calls.expected b/StrataTest/Languages/Python/expected_laurel/test_function_def_calls.expected index 13a7ae3da..f93bc5b31 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_function_def_calls.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_function_def_calls.expected @@ -11,8 +11,6 @@ Any_get_body_calls_DictStrAny_get_0: ✅ pass Any_get_body_calls_List_get_1: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass @@ -22,6 +20,8 @@ POr_body_calls_Any_to_bool_0: ✅ pass ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_list.expected b/StrataTest/Languages/Python/expected_laurel/test_list.expected index 19a508b80..b0df1a2d0 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_list.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_list.expected @@ -11,8 +11,6 @@ Any_get_body_calls_DictStrAny_get_0: ✅ pass Any_get_body_calls_List_get_1: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass @@ -22,6 +20,8 @@ POr_body_calls_Any_to_bool_0: ✅ pass ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected b/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected index 814950dd7..554b4fbd1 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected @@ -11,8 +11,6 @@ Any_get_body_calls_DictStrAny_get_0: ✅ pass Any_get_body_calls_List_get_1: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass @@ -22,6 +20,8 @@ POr_body_calls_Any_to_bool_0: ✅ pass ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected b/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected index 50557e4ca..e59f0f648 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected @@ -11,8 +11,6 @@ Any_get_body_calls_DictStrAny_get_0: ✅ pass Any_get_body_calls_List_get_1: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass @@ -22,6 +20,8 @@ POr_body_calls_Any_to_bool_0: ✅ pass ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_strings.expected b/StrataTest/Languages/Python/expected_laurel/test_strings.expected index 4543c0176..75f03bf44 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_strings.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_strings.expected @@ -11,8 +11,6 @@ Any_get_body_calls_DictStrAny_get_0: ✅ pass Any_get_body_calls_List_get_1: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass @@ -22,6 +20,8 @@ POr_body_calls_Any_to_bool_0: ✅ pass ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_subscription.expected b/StrataTest/Languages/Python/expected_laurel/test_subscription.expected index b09442262..2e28bc6fd 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_subscription.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_subscription.expected @@ -11,8 +11,6 @@ Any_get_body_calls_DictStrAny_get_0: ✅ pass Any_get_body_calls_List_get_1: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass @@ -22,6 +20,8 @@ POr_body_calls_Any_to_bool_0: ✅ pass ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_try_except.expected b/StrataTest/Languages/Python/expected_laurel/test_try_except.expected index d5833301d..851232b6f 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_try_except.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_try_except.expected @@ -11,8 +11,6 @@ Any_get_body_calls_DictStrAny_get_0: ✅ pass Any_get_body_calls_List_get_1: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass @@ -22,6 +20,8 @@ POr_body_calls_Any_to_bool_0: ✅ pass ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected b/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected index dcd97dfce..06b300388 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected @@ -11,8 +11,6 @@ Any_get_body_calls_DictStrAny_get_0: ✅ pass Any_get_body_calls_List_get_1: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass @@ -22,6 +20,8 @@ POr_body_calls_Any_to_bool_0: ✅ pass ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_with_statement.expected b/StrataTest/Languages/Python/expected_laurel/test_with_statement.expected index 3fcd620ec..1d8668ff5 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_with_statement.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_with_statement.expected @@ -11,8 +11,6 @@ Any_get_body_calls_DictStrAny_get_0: ✅ pass Any_get_body_calls_List_get_1: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass @@ -22,6 +20,8 @@ POr_body_calls_Any_to_bool_0: ✅ pass ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/tests/test_function_def_calls.py b/StrataTest/Languages/Python/tests/test_function_def_calls.py index 8e5063eb4..f03a67fef 100644 --- a/StrataTest/Languages/Python/tests/test_function_def_calls.py +++ b/StrataTest/Languages/Python/tests/test_function_def_calls.py @@ -3,7 +3,7 @@ # Test function defs def my_f(s: str): - test_helper.procedure(s, none) + test_helper.procedure(s, opt_name = None) def main(): my_f("foo") diff --git a/StrataTest/Languages/Python/tests/test_precondition_verification.py b/StrataTest/Languages/Python/tests/test_precondition_verification.py index f6c4df14b..6be6b9aa9 100644 --- a/StrataTest/Languages/Python/tests/test_precondition_verification.py +++ b/StrataTest/Languages/Python/tests/test_precondition_verification.py @@ -5,13 +5,13 @@ def main(): # Test minimal precondition verification # Should succeed - test_helper.procedure("foo") + test_helper.procedure("foo", opt_name = None) # Should succeed test_helper.procedure("foo", opt_name = "bar") # Should error - test_helper.procedure("Foo") + test_helper.procedure("Foo", opt_name = None) # Should error test_helper.procedure("foo", opt_name = "Bar") From 6b6123044e1b7c7edf4d3a8392a97c49278cc90c Mon Sep 17 00:00:00 2001 From: KeyboardDrummer Date: Fri, 20 Mar 2026 15:54:08 +0000 Subject: [PATCH 15/79] Turn on resolution errors for Python pipeline --- Strata/Languages/Python/PySpecPipeline.lean | 2 +- .../Python/PythonLaurelCorePrelude.lean | 31 -------------- .../Python/PythonRuntimeLaurelPart.lean | 42 +++++++++++++++++++ 3 files changed, 43 insertions(+), 32 deletions(-) diff --git a/Strata/Languages/Python/PySpecPipeline.lean b/Strata/Languages/Python/PySpecPipeline.lean index 4044a8dba..a08c35cc6 100644 --- a/Strata/Languages/Python/PySpecPipeline.lean +++ b/Strata/Languages/Python/PySpecPipeline.lean @@ -267,7 +267,7 @@ private def prependPrelude (coreFromLaurel : Core.Program) : Core.Program := removed. -/ public def translateCombinedLaurel (combined : Laurel.Program) : (Option Core.Program × List DiagnosticModel) := - let (coreOption, errors) := Laurel.translate { emitResolutionErrors := false } combined + let (coreOption, errors) := Laurel.translate {} combined (coreOption.map (fun core => let prepended := prependPrelude core -- dbg_trace "=== Final Core Program ===" diff --git a/Strata/Languages/Python/PythonLaurelCorePrelude.lean b/Strata/Languages/Python/PythonLaurelCorePrelude.lean index a2730ccbb..17c766e6c 100644 --- a/Strata/Languages/Python/PythonLaurelCorePrelude.lean +++ b/Strata/Languages/Python/PythonLaurelCorePrelude.lean @@ -295,13 +295,6 @@ rec function DictStrAny_get (@[cases] d : DictStrAny, key: string) : Any else DictStrAny_get(DictStrAny..tail!(d), key) }; -rec function DictStrAny_insert (@[cases] d : DictStrAny, key: string, val: Any) : DictStrAny -{ - if DictStrAny..isDictStrAny_empty(d) then DictStrAny_cons(key, val, DictStrAny_empty()) - else if DictStrAny..key!(d) == key then DictStrAny_cons(key, val, DictStrAny..tail!(d)) - else DictStrAny_cons(DictStrAny..key!(d), DictStrAny..val!(d), DictStrAny_insert(DictStrAny..tail!(d), key, val)) -}; - inline function Any_get (dictOrList: Any, index: Any): Any requires (Any..isfrom_Dict(dictOrList) && Any..isfrom_string(index) && DictStrAny_contains(Any..as_Dict!(dictOrList), Any..as_string!(index))) || (Any..isfrom_ListAny(dictOrList) && Any..isfrom_int(index) && Any..as_int!(index) >= 0 && Any..as_int!(index) < List_len(Any..as_ListAny!(dictOrList))); @@ -326,30 +319,6 @@ inline function Any_get! (dictOrList: Any, index: Any): Any exception (IndexError("Invalid subscription")) } -inline function Any_set (dictOrList: Any, index: Any, val: Any): Any - requires (Any..isfrom_Dict(dictOrList) && Any..isfrom_string(index)) || - (Any..isfrom_ListAny(dictOrList) && Any..isfrom_int(index) && Any..as_int!(index) >= 0 && Any..as_int!(index) < List_len(Any..as_ListAny!(dictOrList))); -{ - if Any..isfrom_Dict(dictOrList) then - from_Dict(DictStrAny_insert(Any..as_Dict!(dictOrList), Any..as_string!(index), val)) - else - from_ListAny(List_set(Any..as_ListAny!(dictOrList), Any..as_int!(index), val)) -} - -inline function Any_set! (dictOrList: Any, index: Any, val: Any): Any -{ - if Any..isexception(dictOrList) then dictOrList - else if Any..isexception(index) then index - else if Any..isexception(val) then val - else if !(Any..isfrom_Dict(dictOrList) && Any..isfrom_string(index)) && !(Any..isfrom_ListAny(dictOrList) && Any..isfrom_int(index)) then - exception (TypeError("Invalid subscription type")) - else if Any..isfrom_Dict(dictOrList) && Any..isfrom_string(index) then - from_Dict(DictStrAny_insert(Any..as_Dict!(dictOrList), Any..as_string!(index), val)) - else if Any..isfrom_ListAny(dictOrList) && Any..isfrom_int(index) && Any..as_int!(index) >= 0 && Any..as_int!(index) < List_len(Any..as_ListAny!(dictOrList)) then - from_ListAny(List_set(Any..as_ListAny!(dictOrList), Any..as_int!(index), val)) - else - exception (IndexError("Index out of bound")) -} inline function PIn (v: Any, dictOrList: Any) : Any requires (Any..isfrom_Dict(dictOrList) && Any..isfrom_string(v)) || Any..isfrom_ListAny(dictOrList); diff --git a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean index 9d3d09eb4..f7260b55d 100644 --- a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean +++ b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean @@ -89,10 +89,52 @@ datatype DictStrAny { DictStrAny_cons (key: string, val: Any, tail: DictStrAny) } +// ///////////////////////////////////////////////////////////////////////////////////// +// ListAny functions +// ///////////////////////////////////////////////////////////////////////////////////// + +function List_len (l : ListAny) : int + external; + +function List_set (l : ListAny, i : int, v: Any) : ListAny + external; + // ///////////////////////////////////////////////////////////////////////////////////// // DictStrAny functions // ///////////////////////////////////////////////////////////////////////////////////// +function DictStrAny_insert (/* @[cases] */ d : DictStrAny, key: string, val: Any) : DictStrAny +{ + if DictStrAny..isDictStrAny_empty(d) then DictStrAny_cons(key, val, DictStrAny_empty()) + else if DictStrAny..key!(d) == key then DictStrAny_cons(key, val, DictStrAny..tail!(d)) + else DictStrAny_cons(DictStrAny..key!(d), DictStrAny..val!(d), DictStrAny_insert(DictStrAny..tail!(d), key, val)) +}; + +/*inline*/ function Any_set (dictOrList: Any, index: Any, val: Any): Any + requires (Any..isfrom_Dict(dictOrList) && Any..isfrom_string(index)) || + (Any..isfrom_ListAny(dictOrList) && Any..isfrom_int(index) && Any..as_int!(index) >= 0 && Any..as_int!(index) < List_len(Any..as_ListAny!(dictOrList))) +{ + if Any..isfrom_Dict(dictOrList) then + from_Dict(DictStrAny_insert(Any..as_Dict!(dictOrList), Any..as_string!(index), val)) + else + from_ListAny(List_set(Any..as_ListAny!(dictOrList), Any..as_int!(index), val)) +}; + +/*inline*/ function Any_set! (dictOrList: Any, index: Any, val: Any): Any +{ + if Any..isexception(dictOrList) then dictOrList + else if Any..isexception(index) then index + else if Any..isexception(val) then val + else if !(Any..isfrom_Dict(dictOrList) && Any..isfrom_string(index)) && !(Any..isfrom_ListAny(dictOrList) && Any..isfrom_int(index)) then + exception (TypeError("Invalid subscription type")) + else if Any..isfrom_Dict(dictOrList) && Any..isfrom_string(index) then + from_Dict(DictStrAny_insert(Any..as_Dict!(dictOrList), Any..as_string!(index), val)) + else if Any..isfrom_ListAny(dictOrList) && Any..isfrom_int(index) && Any..as_int!(index) >= 0 && Any..as_int!(index) < List_len(Any..as_ListAny!(dictOrList)) then + from_ListAny(List_set(Any..as_ListAny!(dictOrList), Any..as_int!(index), val)) + else + exception (IndexError("Index out of bound")) +}; + function Any_sets (/* @[cases] */ indices: ListAny, dictOrList: Any, val: Any): Any { if ListAny..isListAny_nil(indices) then dictOrList From 80b146144b2533a8bdd72d1fee02113bd02f6433 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Mon, 23 Mar 2026 10:21:47 +0100 Subject: [PATCH 16/79] Inline functions when possible for Python --- .../Laurel/LaurelToCoreTranslator.lean | 20 +++++++++---------- Strata/Languages/Python/PySpecPipeline.lean | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean index 092179ff2..886d8d6c6 100644 --- a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean +++ b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean @@ -561,11 +561,15 @@ partial def isRecursiveExpr (model: SemanticModel) (proc: Procedure) (expr : Stm | .ContractOf _ fn => isRecursiveExpr model proc fn.val | _ => false +structure LaurelTranslateOptions where + emitResolutionErrors : Bool := true + inlineFunctionsWhenPossible : Bool := false + /-- Translate a Laurel Procedure to a Core Function (when applicable) using `TranslateM`. Diagnostics for disallowed constructs in the function body are emitted into the monad state. -/ -def translateProcedureToFunction (proc : Procedure) : TranslateM Core.Decl := do +def translateProcedureToFunction (options: LaurelTranslateOptions) (proc : Procedure) : TranslateM Core.Decl := do let model := (← get).model let inputs := proc.inputs.map (translateParameterToCore model) let outputTy := match proc.outputs.head? with @@ -596,7 +600,7 @@ def translateProcedureToFunction (proc : Procedure) : TranslateM Core.Decl := do let attr : Array Strata.DL.Util.FuncAttr := match casesIdx with | some i => #[.inlineIfConstr i] - | none => #[] + | none => if options.inlineFunctionsWhenPossible then #[.inline] else #[] let body ← match proc.body with | .Transparent bodyExpr => some <$> translateExpr bodyExpr [] (isPureContext := true) @@ -641,9 +645,6 @@ def translateDatatypeDefinition (model : SemanticModel) (dt : DatatypeDefinition constrs_ne := by simp [constrs]; grind } -structure LaurelTranslateOptions where - emitResolutionErrors : Bool := true - abbrev TranslateResult := (Option Core.Program) × (List DiagnosticModel) /-- Translate Laurel Program to Core Program @@ -685,7 +686,7 @@ def translate (options: LaurelTranslateOptions) (program : Program): TranslateRe let (program, model) := (result.program, result.model) let initState : TranslateState := {model := model } - let (coreProgramOption, translateState) := runTranslateM initState (translateLaurelToCore program) + let (coreProgramOption, translateState) := runTranslateM initState (translateLaurelToCore options program) let resolutionErrors: List DiagnosticModel := if options.emitResolutionErrors then result.errors.toList else [] let allDiagnostics := resolutionErrors ++ diamondErrors ++ modifiesDiags ++ constrainedTypeDiags ++ translateState.diagnostics let coreProgramOption := if translateState.coreProgramHasSuperfluousErrors then none else coreProgramOption @@ -713,7 +714,7 @@ def translate (options: LaurelTranslateOptions) (program : Program): TranslateRe let groups := groupDatatypes laurelDatatypes ldatatypes return groups.map fun group => Core.Decl.type (.data group) - translateLaurelToCore (program : Program): TranslateM Core.Program := do + translateLaurelToCore (options: LaurelTranslateOptions) (program : Program): TranslateM Core.Program := do let model := (← get).model -- Procedures marked isFunctional are translated to Core functions; all others become Core procedures. @@ -721,7 +722,7 @@ def translate (options: LaurelTranslateOptions) (program : Program): TranslateRe let nonExternal := program.staticProcedures.filter (fun p => !p.body.isExternal) let (markedPure, procProcs) := nonExternal.partition (·.isFunctional) -- Try to translate each isFunctional procedure to a Core function, collecting errors for failures - let pureFuncDecls ← markedPure.mapM translateProcedureToFunction + let pureFuncDecls ← markedPure.mapM (translateProcedureToFunction options) -- Translate procedures using the monad, collecting diagnostics from the final state let procedures ← procProcs.mapM translateProcedure @@ -761,7 +762,7 @@ Verify a Laurel program using an SMT solver def verifyToVcResults (program : Program) (options : VerifyOptions := .default) : IO (Option VCResults × List DiagnosticModel) := do - let (coreProgramOption, translateDiags) := translate { emitResolutionErrors := true } program + let (coreProgramOption, translateDiags) := translate {} program match coreProgramOption with | some coreProgram => @@ -776,7 +777,6 @@ def verifyToVcResults (program : Program) return (some ioResult, translateDiags) | none => return (none, translateDiags) - def verifyToDiagnostics (files: Map Strata.Uri Lean.FileMap) (program : Program) (options : VerifyOptions := .default): IO (Array Diagnostic) := do let results <- verifyToVcResults program options diff --git a/Strata/Languages/Python/PySpecPipeline.lean b/Strata/Languages/Python/PySpecPipeline.lean index a08c35cc6..1e2e4a7be 100644 --- a/Strata/Languages/Python/PySpecPipeline.lean +++ b/Strata/Languages/Python/PySpecPipeline.lean @@ -267,7 +267,7 @@ private def prependPrelude (coreFromLaurel : Core.Program) : Core.Program := removed. -/ public def translateCombinedLaurel (combined : Laurel.Program) : (Option Core.Program × List DiagnosticModel) := - let (coreOption, errors) := Laurel.translate {} combined + let (coreOption, errors) := Laurel.translate { inlineFunctionsWhenPossible := true } combined (coreOption.map (fun core => let prepended := prependPrelude core -- dbg_trace "=== Final Core Program ===" From 785a498e8f689777ee631d90acae07821c22c0f3 Mon Sep 17 00:00:00 2001 From: KeyboardDrummer Date: Mon, 23 Mar 2026 12:44:18 +0000 Subject: [PATCH 17/79] Fixes --- Strata/Languages/Laurel/LaurelToCoreTranslator.lean | 2 +- Strata/Languages/Laurel/Resolution.lean | 11 ++++++++--- .../Laurel/Examples/Fundamentals/T3_ControlFlow.lean | 2 +- .../Examples/Fundamentals/T3_ControlFlowError.lean | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean index 886d8d6c6..ebf56e68a 100644 --- a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean +++ b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean @@ -655,6 +655,7 @@ def translate (options: LaurelTranslateOptions) (program : Program): TranslateRe } let result := resolve program + let resolutionErrors: List DiagnosticModel := if options.emitResolutionErrors then result.errors.toList else [] let (program, model) := (result.program, result.model) let diamondErrors := validateDiamondFieldAccesses model program @@ -687,7 +688,6 @@ def translate (options: LaurelTranslateOptions) (program : Program): TranslateRe let initState : TranslateState := {model := model } let (coreProgramOption, translateState) := runTranslateM initState (translateLaurelToCore options program) - let resolutionErrors: List DiagnosticModel := if options.emitResolutionErrors then result.errors.toList else [] let allDiagnostics := resolutionErrors ++ diamondErrors ++ modifiesDiags ++ constrainedTypeDiags ++ translateState.diagnostics let coreProgramOption := if translateState.coreProgramHasSuperfluousErrors then none else coreProgramOption (coreProgramOption, allDiagnostics) diff --git a/Strata/Languages/Laurel/Resolution.lean b/Strata/Languages/Laurel/Resolution.lean index 790f650c0..2e5c1016b 100644 --- a/Strata/Languages/Laurel/Resolution.lean +++ b/Strata/Languages/Laurel/Resolution.lean @@ -499,9 +499,14 @@ def resolveTypeDefinition (td : TypeDefinition) : ResolveM TypeDefinition := do | .Constrained ct => let ctName' ← defineName ct.name (.constrainedType ct) let base' ← resolveHighType ct.base - let constraint' ← resolveStmtExpr ct.constraint - let witness' ← resolveStmtExpr ct.witness - return .Constrained { name := ctName', base := base', valueName := ct.valueName, + -- The valueName (e.g. `x` in `constrained nat = x: int where x >= 0`) must be + -- in scope when resolving the constraint and witness expressions. + let (valueName', constraint', witness') ← withScope do + let valueName' ← defineName ct.valueName (.quantifierVar ct.valueName base') + let constraint' ← resolveStmtExpr ct.constraint + let witness' ← resolveStmtExpr ct.witness + return (valueName', constraint', witness') + return .Constrained { name := ctName', base := base', valueName := valueName', constraint := constraint', witness := witness' } | .Datatype dt => let dtName' ← defineName dt.name (.datatypeDefinition dt) diff --git a/StrataTest/Languages/Laurel/Examples/Fundamentals/T3_ControlFlow.lean b/StrataTest/Languages/Laurel/Examples/Fundamentals/T3_ControlFlow.lean index e81c16afe..150ee55f5 100644 --- a/StrataTest/Languages/Laurel/Examples/Fundamentals/T3_ControlFlow.lean +++ b/StrataTest/Languages/Laurel/Examples/Fundamentals/T3_ControlFlow.lean @@ -78,7 +78,7 @@ procedure dag(a: int) returns (r: int) }; assert if a > 0 then { b == 1 } else { true }; assert if a > 0 then { b == 2 } else { true }; -//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: assertion does not hold +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: assertion does not hold return b }; " diff --git a/StrataTest/Languages/Laurel/Examples/Fundamentals/T3_ControlFlowError.lean b/StrataTest/Languages/Laurel/Examples/Fundamentals/T3_ControlFlowError.lean index b2d5b5c9b..b336119ea 100644 --- a/StrataTest/Languages/Laurel/Examples/Fundamentals/T3_ControlFlowError.lean +++ b/StrataTest/Languages/Laurel/Examples/Fundamentals/T3_ControlFlowError.lean @@ -42,7 +42,7 @@ function localVariableWithoutInitializer(): int { function deadCodeAfterIfElse(x: int) returns (r: int) { if x > 0 then { return 1 } else { return 2 }; -//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: if-then-else only supported as the last statement in a block +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: if-then-else only supported as the last statement in a block return 3 }; " From fb72f070a90d5e7f12f261eec77f59f047880ad4 Mon Sep 17 00:00:00 2001 From: KeyboardDrummer Date: Mon, 23 Mar 2026 13:22:26 +0000 Subject: [PATCH 18/79] Move dbg_trace comment --- Strata/Languages/Laurel/LaurelToCoreTranslator.lean | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean index ebf56e68a..756b1f228 100644 --- a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean +++ b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean @@ -654,6 +654,9 @@ def translate (options: LaurelTranslateOptions) (program : Program): TranslateRe staticProcedures := coreDefinitionsForLaurel.staticProcedures ++ program.staticProcedures } + -- dbg_trace "=== Initial Laurel program ===" + -- dbg_trace (toString (Std.Format.pretty (Std.ToFormat.format program))) + -- dbg_trace "=================================" let result := resolve program let resolutionErrors: List DiagnosticModel := if options.emitResolutionErrors then result.errors.toList else [] let (program, model) := (result.program, result.model) @@ -669,9 +672,6 @@ def translate (options: LaurelTranslateOptions) (program : Program): TranslateRe let (program, modifiesDiags) := modifiesClausesTransform model program let result := resolve program (some model) let (program, model) := (result.program, result.model) - -- dbg_trace "=== Program after heapParameterization + modifiesClausesTransform ===" - -- dbg_trace (toString (Std.Format.pretty (Std.ToFormat.format program))) - -- dbg_trace "=================================" let result := resolve program (some model) let (program, model) := (result.program, result.model) let program := inferHoleTypes model program From 9934b6b1ace4325fd75af7007b07ebcb07ec12a2 Mon Sep 17 00:00:00 2001 From: KeyboardDrummer Date: Mon, 23 Mar 2026 13:25:04 +0000 Subject: [PATCH 19/79] Move more from Core to Laurel prelude --- .../Python/PythonLaurelCorePrelude.lean | 72 ------------------ .../Python/PythonRuntimeLaurelPart.lean | 73 +++++++++++++++++++ 2 files changed, 73 insertions(+), 72 deletions(-) diff --git a/Strata/Languages/Python/PythonLaurelCorePrelude.lean b/Strata/Languages/Python/PythonLaurelCorePrelude.lean index 17c766e6c..c98a9ec61 100644 --- a/Strata/Languages/Python/PythonLaurelCorePrelude.lean +++ b/Strata/Languages/Python/PythonLaurelCorePrelude.lean @@ -99,78 +99,6 @@ type CoreOnlyDelimiter; // Core-only declarations (not expressed in Laurel) // ===================================================================== -// ///////////////////////////////////////////////////////////////////////////////////// -//Functions that we provide to Python user -//to write assertions/contracts about about types of variables - -inline function isBool (v: Any) : Any { - from_bool (Any..isfrom_bool(v)) -} - -inline function isInt (v: Any) : Any { - from_bool (Any..isfrom_int(v)) -} - -inline function isFloat (v: Any) : Any { - from_bool (Any..isfrom_float(v)) -} - -inline function isString (v: Any) : Any { - from_bool (Any..isfrom_string(v)) -} - -inline function isdatetime (v: Any) : Any { - from_bool (Any..isfrom_datetime(v)) -} - -inline function isDict (v: Any) : Any { - from_bool (Any..isfrom_Dict(v)) -} - -inline function isList (v: Any) : Any { - from_bool (Any..isfrom_ListAny(v)) -} - -inline function isClassInstance (v: Any) : Any { - from_bool (Any..isfrom_ClassInstance(v)) -} - -inline function isInstance_of_Int (v: Any) : Any { - from_bool (Any..isfrom_int(v) || Any..isfrom_bool(v)) -} - -inline function isInstance_of_Float (v: Any) : Any { - from_bool (Any..isfrom_float(v) || Any..isfrom_int(v) || Any..isfrom_bool(v)) -} - -// ///////////////////////////////////////////////////////////////////////////////////// -//Functions that we provide to Python user -//to write assertions/contracts about about types of errors -// ///////////////////////////////////////////////////////////////////////////////////// - -inline function isTypeError (e: Error) : Any { - from_bool (Error..isTypeError(e)) -} - -inline function isAttributeError (e: Error) : Any { - from_bool (Error..isAttributeError(e)) -} - -inline function isAssertionError (e: Error) : Any { - from_bool (Error..isAssertionError(e)) -} - -inline function isUnimplementedError (e: Error) : Any { - from_bool (Error..isUnimplementedError(e)) -} - -inline function isUndefinedError (e: Error) : Any { - from_bool (Error..isUndefinedError(e)) -} - -inline function isError (e: Error) : bool { - ! Error..isNoError(e) -} // ///////////////////////////////////////////////////////////////////////////////////// //The following function convert Any type to bool diff --git a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean index f7260b55d..4cf9fb823 100644 --- a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean +++ b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean @@ -89,6 +89,79 @@ datatype DictStrAny { DictStrAny_cons (key: string, val: Any, tail: DictStrAny) } +// ///////////////////////////////////////////////////////////////////////////////////// +//Functions that we provide to Python user +//to write assertions/contracts about about types of variables + +function isBool (v: Any) : Any { + from_bool (Any..isfrom_bool(v)) +}; + +function isInt (v: Any) : Any { + from_bool (Any..isfrom_int(v)) +}; + +function isFloat (v: Any) : Any { + from_bool (Any..isfrom_float(v)) +}; + +function isString (v: Any) : Any { + from_bool (Any..isfrom_string(v)) +}; + +function isdatetime (v: Any) : Any { + from_bool (Any..isfrom_datetime(v)) +}; + +function isDict (v: Any) : Any { + from_bool (Any..isfrom_Dict(v)) +}; + +function isList (v: Any) : Any { + from_bool (Any..isfrom_ListAny(v)) +}; + +function isClassInstance (v: Any) : Any { + from_bool (Any..isfrom_ClassInstance(v)) +}; + +function isInstance_of_Int (v: Any) : Any { + from_bool (Any..isfrom_int(v) || Any..isfrom_bool(v)) +}; + +function isInstance_of_Float (v: Any) : Any { + from_bool (Any..isfrom_float(v) || Any..isfrom_int(v) || Any..isfrom_bool(v)) +}; + +// ///////////////////////////////////////////////////////////////////////////////////// +//Functions that we provide to Python user +//to write assertions/contracts about about types of errors +// ///////////////////////////////////////////////////////////////////////////////////// + +function isTypeError (e: Error) : Any { + from_bool (Error..isTypeError(e)) +}; + +function isAttributeError (e: Error) : Any { + from_bool (Error..isAttributeError(e)) +}; + +function isAssertionError (e: Error) : Any { + from_bool (Error..isAssertionError(e)) +}; + +function isUnimplementedError (e: Error) : Any { + from_bool (Error..isUnimplementedError(e)) +}; + +function isUndefinedError (e: Error) : Any { + from_bool (Error..isUndefinedError(e)) +}; + +function isError (e: Error) : bool { + ! Error..isNoError(e) +}; + // ///////////////////////////////////////////////////////////////////////////////////// // ListAny functions // ///////////////////////////////////////////////////////////////////////////////////// From aae162d2720a75322ad3fee2f2616e1bcd736d2c Mon Sep 17 00:00:00 2001 From: KeyboardDrummer Date: Mon, 23 Mar 2026 13:28:57 +0000 Subject: [PATCH 20/79] undo bad change --- Strata/Languages/Core/DDMTransform/ASTtoCST.lean | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Strata/Languages/Core/DDMTransform/ASTtoCST.lean b/Strata/Languages/Core/DDMTransform/ASTtoCST.lean index 8259f65c3..08116cb1d 100644 --- a/Strata/Languages/Core/DDMTransform/ASTtoCST.lean +++ b/Strata/Languages/Core/DDMTransform/ASTtoCST.lean @@ -57,7 +57,7 @@ namespace ASTToCSTError def toString {M} [ToString M] : ASTToCSTError M → String | unsupportedConstruct fn desc ctx _m => - s!"Unsupported construct in {fn}: {desc}\n" + s!"Unsupported construct in {fn}: {desc}\nContext: {ctx}" instance {M} [ToString M] : ToString (ASTToCSTError M) where toString := ASTToCSTError.toString From e246bac96d7e1e2a4c6e0272a4b2ff0b2fd0edff Mon Sep 17 00:00:00 2001 From: KeyboardDrummer Date: Mon, 23 Mar 2026 13:57:12 +0000 Subject: [PATCH 21/79] Remove stub generating code --- Strata/Languages/Python/PySpecPipeline.lean | 7 +++---- Strata/Languages/Python/PythonToLaurel.lean | 20 +------------------- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/Strata/Languages/Python/PySpecPipeline.lean b/Strata/Languages/Python/PySpecPipeline.lean index 1e2e4a7be..3f5571929 100644 --- a/Strata/Languages/Python/PySpecPipeline.lean +++ b/Strata/Languages/Python/PySpecPipeline.lean @@ -242,10 +242,9 @@ public def buildPreludeInfo (result : PySpecLaurelResult) : Python.PreludeInfo : /-- Combine PySpec and user Laurel programs into a single program, prepending External stubs so the Laurel `resolve` pass can see prelude names (e.g. `print`, `from_string`). -/ -public def combinePySpecLaurel (info : Python.PreludeInfo) +public def combinePySpecLaurel (pySpec user : Laurel.Program) : Laurel.Program := - let stubs := Python.preludeStubs info - { staticProcedures := stubs ++ pySpec.staticProcedures ++ user.staticProcedures + { staticProcedures := pySpec.staticProcedures ++ user.staticProcedures staticFields := pySpec.staticFields ++ user.staticFields types := pySpec.types ++ user.types constants := pySpec.constants ++ user.constants @@ -321,6 +320,6 @@ public def pyAnalyzeLaurel | .error e => throw (.internal s!"Python to Laurel translation failed: {e}") | .ok result => pure result - return combinePySpecLaurel preludeInfo result.laurelProgram laurelProgram + return combinePySpecLaurel result.laurelProgram laurelProgram end Strata diff --git a/Strata/Languages/Python/PythonToLaurel.lean b/Strata/Languages/Python/PythonToLaurel.lean index a3e07c524..18d6b39e4 100644 --- a/Strata/Languages/Python/PythonToLaurel.lean +++ b/Strata/Languages/Python/PythonToLaurel.lean @@ -1688,21 +1688,6 @@ def pythonToLaurel' (info : PreludeInfo) | _ => throw (.internalError "Expected Module") -/-- Generate External procedure stubs for prelude names so the Laurel - `resolve` pass can see them. -/ -def preludeStubs (info : PreludeInfo) : List Laurel.Procedure := - let functionStubs := info.functions.map fun funcname => - { name := { text := funcname }, inputs := [], outputs := [], - preconditions := [], determinism := .deterministic none, - decreases := none, body := .External, md := default, - isFunctional := true } - let procedureStubs := info.procedureNames.map fun funcname => - { name := { text := funcname }, inputs := [], outputs := [], - preconditions := [], determinism := .deterministic none, - decreases := none, body := .External, md := default, - isFunctional := false } - functionStubs ++ procedureStubs - /-- Translate Python module to Laurel Program. Delegates to `pythonToLaurel'` after extracting prelude info, then prepends External stubs so the Laurel resolve pass can @@ -1714,10 +1699,7 @@ def pythonToLaurel (prelude: Core.Program) (overloadTable : Specs.ToLaurel.OverloadTable := {}) : Except TranslationError (Laurel.Program × TranslationContext) := do let info := PreludeInfo.ofCoreProgram prelude - let (program, ctx) ← pythonToLaurel' info pyModule prev_ctx filePath overloadTable - let stubs := preludeStubs info - return ({ program with - staticProcedures := stubs ++ program.staticProcedures }, ctx) + pythonToLaurel' info pyModule prev_ctx filePath overloadTable end -- public section From 894dbbcc2ffd6a440fbdbc1a0741cde8eb6aa076 Mon Sep 17 00:00:00 2001 From: KeyboardDrummer Date: Mon, 23 Mar 2026 14:32:37 +0000 Subject: [PATCH 22/79] Move almost all functinos from Core part of Python prelude to Laurel part --- .../Python/PythonLaurelCorePrelude.lean | 552 +----------------- .../Python/PythonRuntimeLaurelPart.lean | 545 ++++++++++++++++- 2 files changed, 546 insertions(+), 551 deletions(-) diff --git a/Strata/Languages/Python/PythonLaurelCorePrelude.lean b/Strata/Languages/Python/PythonLaurelCorePrelude.lean index c98a9ec61..4ce0903fd 100644 --- a/Strata/Languages/Python/PythonLaurelCorePrelude.lean +++ b/Strata/Languages/Python/PythonLaurelCorePrelude.lean @@ -93,6 +93,12 @@ datatype DictStrAny () { DictStrAny_cons (key: string, val: Any, tail: DictStrAny) }; +function List_len (l : ListAny) : int; +function List_take (l : ListAny, i: int) : ListAny; +function List_drop (l : ListAny, i: int) : ListAny; +function datetime_strptime(dtstring: Any, format: Any) : Any; +function to_string_any(a: Any) : Any; + type CoreOnlyDelimiter; // ===================================================================== @@ -121,68 +127,16 @@ inline function Any_to_bool (v: Any) : bool // ListAny functions // ///////////////////////////////////////////////////////////////////////////////////// -rec function List_len (@[cases] l : ListAny) : int -{ - if ListAny..isListAny_nil(l) then 0 else 1 + List_len(ListAny..tail!(l)) -}; - axiom [List_len_pos]: forall l : ListAny :: List_len(l) >= 0; -rec function List_contains (@[cases] l : ListAny, x: Any) : bool -{ - if ListAny..isListAny_nil(l) then false else (ListAny..head!(l) == x) || List_contains(ListAny..tail!(l), x) -}; - -rec function List_extend (@[cases] l1 : ListAny, l2: ListAny) : ListAny -{ - if ListAny..isListAny_nil(l1) then l2 - else ListAny_cons(ListAny..head!(l1), List_extend(ListAny..tail!(l1), l2)) -}; - -rec function List_get (@[cases] l : ListAny, i : int) : Any - requires i >= 0 && i < List_len(l); -{ - if ListAny..isListAny_nil(l) then from_none() - else if i == 0 then ListAny..head!(l) - else List_get(ListAny..tail!(l), i - 1) -}; - -rec function List_take (@[cases] l : ListAny, i: int) : ListAny - requires i >= 0 && i <= List_len(l); -{ - if ListAny..isListAny_nil(l) then ListAny_nil() - else if i == 0 then ListAny_nil() - else ListAny_cons(ListAny..head!(l), List_take(ListAny..tail!(l), i - 1)) -}; - axiom [List_take_len]: forall l : ListAny, i: int :: {List_len(List_take(l,i))} (i >= 0 && i <= List_len(l)) ==> List_len(List_take(l,i)) == i; -rec function List_drop (@[cases] l : ListAny, i: int) : ListAny - requires i >= 0 && i <= List_len(l); -{ - if ListAny..isListAny_nil(l) then ListAny_nil() - else if i == 0 then l - else List_drop(ListAny..tail!(l), i - 1) -}; axiom [List_drop_len]: forall l : ListAny, i: int :: {List_len(List_drop(l,i))} (i >= 0 && i <= List_len(l)) ==> List_len(List_drop(l,i)) == List_len(l) - i; -inline function List_slice (l : ListAny, start : int, stop: int) : ListAny - requires start >= 0 && start < List_len(l) && stop >= 0 && stop <= List_len(l) && start <= stop; -{ - List_take (List_drop (l, start), stop - start) -} - -rec function List_set (@[cases] l : ListAny, i : int, v: Any) : ListAny - requires i >= 0 && i < List_len(l); -{ - if ListAny..isListAny_nil(l) then ListAny_nil() - else if i == 0 then ListAny_cons(v, ListAny..tail!(l)) - else ListAny_cons(ListAny..head!(l), List_set(ListAny..tail!(l), i - 1, v)) -}; - +// TODO introduce procedure types in Laurel so we can move this to the Laurel part rec function List_map (@[cases] l : ListAny, f: Any -> Any) : ListAny { if ListAny..isListAny_nil(l) then @@ -201,506 +155,14 @@ rec function List_filter (@[cases] l : ListAny, f: Any -> bool) : ListAny List_filter(ListAny..tail!(l), f) }; -//Require recursive function on int -function List_repeat (l: ListAny, n: int): ListAny; - - -// ///////////////////////////////////////////////////////////////////////////////////// -// DictStrAny functions -// ///////////////////////////////////////////////////////////////////////////////////// - -rec function DictStrAny_contains (@[cases] d : DictStrAny, key: string) : bool -{ - if DictStrAny..isDictStrAny_empty(d) then false - else (DictStrAny..key!(d) == key) || DictStrAny_contains(DictStrAny..tail!(d), key) -}; - -rec function DictStrAny_get (@[cases] d : DictStrAny, key: string) : Any - requires DictStrAny_contains(d, key); -{ - if DictStrAny..isDictStrAny_empty(d) then from_none() - else if DictStrAny..key!(d) == key then DictStrAny..val!(d) - else DictStrAny_get(DictStrAny..tail!(d), key) -}; - -inline function Any_get (dictOrList: Any, index: Any): Any - requires (Any..isfrom_Dict(dictOrList) && Any..isfrom_string(index) && DictStrAny_contains(Any..as_Dict!(dictOrList), Any..as_string!(index))) || - (Any..isfrom_ListAny(dictOrList) && Any..isfrom_int(index) && Any..as_int!(index) >= 0 && Any..as_int!(index) < List_len(Any..as_ListAny!(dictOrList))); -{ - if Any..isfrom_Dict(dictOrList) then - DictStrAny_get(Any..as_Dict!(dictOrList), Any..as_string!(index)) - else - List_get(Any..as_ListAny!(dictOrList), Any..as_int!(index)) -} - -inline function Any_get! (dictOrList: Any, index: Any): Any -{ - if Any..isexception(dictOrList) then dictOrList - else if Any..isexception(index) then index - else if !(Any..isfrom_Dict(dictOrList) && Any..isfrom_string(index)) && !(Any..isfrom_ListAny(dictOrList) && Any..isfrom_int(index)) then - exception (TypeError("Invalid subscription type")) - else if Any..isfrom_Dict(dictOrList) && Any..isfrom_string(index) && DictStrAny_contains(Any..as_Dict!(dictOrList), Any..as_string!(index)) then - DictStrAny_get(Any..as_Dict!(dictOrList), Any..as_string!(index)) - else if Any..isfrom_ListAny(dictOrList) && Any..isfrom_int(index) && Any..as_int!(index) >= 0 && Any..as_int!(index) < List_len(Any..as_ListAny!(dictOrList)) then - List_get(Any..as_ListAny!(dictOrList), Any..as_int!(index)) - else - exception (IndexError("Invalid subscription")) -} - - -inline function PIn (v: Any, dictOrList: Any) : Any - requires (Any..isfrom_Dict(dictOrList) && Any..isfrom_string(v)) || Any..isfrom_ListAny(dictOrList); -{ - from_bool( - if Any..isfrom_Dict(dictOrList) then - DictStrAny_contains(Any..as_Dict!(dictOrList), Any..as_string!(v)) - else - List_contains(Any..as_ListAny!(dictOrList), v) - ) -} - -inline function PNotIn ( v: Any, dictOrList: Any) : Any - requires (Any..isfrom_Dict(dictOrList) && Any..isfrom_string(v)) || Any..isfrom_ListAny(dictOrList); -{ - from_bool( - if Any..isfrom_Dict(dictOrList) then - !DictStrAny_contains(Any..as_Dict!(dictOrList), Any..as_string!(v)) - else - !List_contains(Any..as_ListAny!(dictOrList), v) - ) -} - -// ///////////////////////////////////////////////////////////////////////////////////// -// Python treats some values of different types to be equivalent -// This function models that behavior -// ///////////////////////////////////////////////////////////////////////////////////// - -function is_IntReal (v: Any) : bool; -function Any_real_to_int (v: Any) : int; - -inline function normalize_any (v : Any) : Any { - if v == from_bool(true) then from_int(1) - else (if v == from_bool(false) then from_int(0) else - if Any..isfrom_float(v) && is_IntReal(v) then from_int(Any_real_to_int(v)) else - v) -} - -// ///////////////////////////////////////////////////////////////////////////////////// -// MODELLING PYTHON OPERATIONS -// Note that there is no official document that define the semantic of Python operations -// The model of them in this prelude is based on experiments of basic types -// ///////////////////////////////////////////////////////////////////////////////////// - - -// ///////////////////////////////////////////////////////////////////////////////////// -// This function convert an int to a real -// Need to connect to an SMT function -function int_to_real (i: int) : real; - -// ///////////////////////////////////////////////////////////////////////////////////// -// Converting bool to int or real -// Used to in Python binary operators' modelling -inline function bool_to_int (bval: bool) : int {if bval then 1 else 0} -inline function bool_to_real (b: bool) : real {if b then 1.0 else 0.0} - -// ///////////////////////////////////////////////////////////////////////////////////// -// Modelling of Python unary operations -// ///////////////////////////////////////////////////////////////////////////////////// - -inline function PNeg (v: Any) : Any -{ - if Any..isexception(v) then v - else if Any..isfrom_bool(v) then - from_int(- bool_to_int(Any..as_bool!(v))) - else if Any..isfrom_int(v) then - from_int(- Any..as_int!(v)) - else if Any..isfrom_float(v) then - from_float(- Any..as_float!(v)) - else - exception(UndefinedError ("Operand Type is not defined")) -} - -inline function PNot (v: Any) : Any -{ - if Any..isexception(v) then v - else if Any..isfrom_bool(v) then - from_bool(!(Any..as_bool!(v))) - else if Any..isfrom_int(v) then - from_bool(!(Any..as_int!(v) == 0)) - else if Any..isfrom_float(v) then - from_bool(!(Any..as_float!(v) == 0.0)) - else if Any..isfrom_string(v) then - from_bool(!(Any..as_string!(v) == "")) - else if Any..isfrom_ListAny(v) then - from_bool(!(List_len(Any..as_ListAny!(v)) == 0)) - else - exception(UndefinedError ("Operand Type is not defined")) -} - - -// ///////////////////////////////////////////////////////////////////////////////////// -// Modelling of Python binary operations -// ///////////////////////////////////////////////////////////////////////////////////// - -inline function PAdd (v1: Any, v2: Any) : Any -{ - if Any..isexception(v1) then v1 else if Any..isexception(v2) then v2 - else if Any..isfrom_bool(v1) && Any..isfrom_bool(v2) then - from_int(bool_to_int(Any..as_bool!(v1)) + bool_to_int(Any..as_bool!(v2))) - else if Any..isfrom_bool(v1) && Any..isfrom_int(v2) then - from_int(bool_to_int(Any..as_bool!(v1)) + Any..as_int!(v2)) - else if Any..isfrom_int(v1) && Any..isfrom_bool(v2) then - from_int(Any..as_int!(v1) + bool_to_int(Any..as_bool!(v2))) - else if Any..isfrom_int(v1) && Any..isfrom_float(v2) then - from_float(int_to_real(Any..as_int!(v1)) + Any..as_float!(v2)) - else if Any..isfrom_float(v1) && Any..isfrom_bool(v2) then - from_float(Any..as_float!(v1) + bool_to_real(Any..as_bool!(v2))) - else if Any..isfrom_int(v1) && Any..isfrom_int(v2) then - from_int(Any..as_int!(v1) + Any..as_int!(v2)) - else if Any..isfrom_float(v1) && Any..isfrom_int(v2) then - from_float(Any..as_float!(v1) + int_to_real(Any..as_int!(v2)) ) - else if Any..isfrom_float(v1) && Any..isfrom_float(v2) then - from_float(Any..as_float!(v1) + Any..as_float!(v2)) - else if Any..isfrom_string(v1) && Any..isfrom_string(v2) then - from_string(str.concat(Any..as_string!(v1),Any..as_string!(v2))) - else if Any..isfrom_ListAny(v1) && Any..isfrom_ListAny(v2) then - from_ListAny(List_extend(Any..as_ListAny!(v1),Any..as_ListAny!(v2))) - else if Any..isfrom_datetime(v1) && Any..isfrom_int(v2) then - from_datetime((Any..as_datetime!(v1) + Any..as_int!(v2))) - else - exception(UndefinedError ("Operand Type is not defined")) -} - - -inline function PSub (v1: Any, v2: Any) : Any -{ - if Any..isexception(v1) then v1 else if Any..isexception(v2) then v2 - else if Any..isfrom_bool(v1) && Any..isfrom_bool(v2) then - from_int(bool_to_int(Any..as_bool!(v1)) - bool_to_int(Any..as_bool!(v2))) - else if Any..isfrom_bool(v1) && Any..isfrom_int(v2) then - from_int(bool_to_int(Any..as_bool!(v1)) - Any..as_int!(v2)) - else if Any..isfrom_int(v1) && Any..isfrom_bool(v2) then - from_int(Any..as_int!(v1) - bool_to_int(Any..as_bool!(v2))) - else if Any..isfrom_bool(v1) && Any..isfrom_float(v2) then - from_float(bool_to_real(Any..as_bool!(v1)) - Any..as_float!(v2)) - else if Any..isfrom_float(v1) && Any..isfrom_bool(v2) then - from_float(Any..as_float!(v1) - bool_to_real(Any..as_bool!(v2))) - else if Any..isfrom_int(v1) && Any..isfrom_int(v2) then - from_int(Any..as_int!(v1) - Any..as_int!(v2)) - else if Any..isfrom_int(v1) && Any..isfrom_float(v2) then - from_float(int_to_real(Any..as_int!(v1)) - Any..as_float!(v2)) - else if Any..isfrom_float(v1) && Any..isfrom_int(v2) then - from_float(Any..as_float!(v1) - int_to_real(Any..as_int!(v2)) ) - else if Any..isfrom_float(v1) && Any..isfrom_float(v2) then - from_float(Any..as_float!(v1) - Any..as_float!(v2)) - else if Any..isfrom_datetime(v1) && Any..isfrom_int(v2) then - from_datetime(Any..as_datetime!(v1) - Any..as_int!(v2)) - else if Any..isfrom_datetime(v1) && Any..isfrom_datetime(v2) then - from_int(Any..as_datetime!(v1) - Any..as_datetime!(v2)) - else - exception(UndefinedError ("Operand Type is not defined")) -} - - -function string_repeat (s: string, i: int) : string; - -inline function PMul (v1: Any, v2: Any) : Any -{ - if Any..isexception(v1) then v1 else if Any..isexception(v2) then v2 - else if Any..isfrom_bool(v1) && Any..isfrom_bool(v2) then - from_int(bool_to_int(Any..as_bool!(v1)) * bool_to_int(Any..as_bool!(v2))) - else if Any..isfrom_bool(v1) && Any..isfrom_int(v2) then - from_int(bool_to_int(Any..as_bool!(v1)) * Any..as_int!(v2)) - else if Any..isfrom_int(v1) && Any..isfrom_bool(v2) then - from_int(Any..as_int!(v1) * bool_to_int(Any..as_bool!(v2))) - else if Any..isfrom_bool(v1) && Any..isfrom_float(v2) then - from_float(bool_to_real(Any..as_bool!(v1)) * Any..as_float!(v2)) - else if Any..isfrom_float(v1) && Any..isfrom_bool(v2) then - from_float(Any..as_float!(v1) * bool_to_real(Any..as_bool!(v2))) - else if Any..isfrom_bool(v1) && Any..isfrom_string(v2) then - if Any..as_bool!(v1) then v2 else from_string("") - else if Any..isfrom_string(v1) && Any..isfrom_bool(v2) then - if Any..as_bool!(v2) then v1 else from_string("") - else if Any..isfrom_int(v1) && Any..isfrom_int(v2) then - from_int(Any..as_int!(v1) * Any..as_int!(v2)) - else if Any..isfrom_int(v1) && Any..isfrom_float(v2) then - from_float(int_to_real(Any..as_int!(v1)) * Any..as_float!(v2)) - else if Any..isfrom_float(v1) && Any..isfrom_int(v2) then - from_float(Any..as_float!(v1) * int_to_real(Any..as_int!(v2)) ) - else if Any..isfrom_int(v1) && Any..isfrom_string(v2) then - from_string(string_repeat(Any..as_string!(v2), Any..as_int!(v1))) - else if Any..isfrom_string(v1) && Any..isfrom_int(v2) then - from_string(string_repeat(Any..as_string!(v1), Any..as_int!(v2))) - else if Any..isfrom_int(v1) && Any..isfrom_ListAny(v2) then - from_ListAny(List_repeat(Any..as_ListAny!(v2), Any..as_int!(v1))) - else if Any..isfrom_ListAny(v1) && Any..isfrom_int(v2) then - from_ListAny(List_repeat(Any..as_ListAny!(v1), Any..as_int!(v2))) - else if Any..isfrom_float(v1) && Any..isfrom_float(v2) then - from_float(Any..as_float!(v1) * Any..as_float!(v2)) - else - exception(UndefinedError ("Operand Type is not defined")) -} - -inline function PFloorDiv (v1: Any, v2: Any) : Any - requires (Any..isfrom_bool(v2)==>Any..as_bool!(v2)) && (Any..isfrom_int(v2)==>Any..as_int!(v2)!=0); -{ - if Any..isexception(v1) then v1 else if Any..isexception(v2) then v2 - else if Any..isfrom_bool(v1) && Any..isfrom_bool(v2) then - from_int( bool_to_int(Any..as_bool!(v1)) / bool_to_int(Any..as_bool!(v2))) - else if Any..isfrom_bool(v1) && Any..isfrom_int(v2) then - from_int(bool_to_int(Any..as_bool!(v1)) / Any..as_int!(v2)) - else if Any..isfrom_int(v1) && Any..isfrom_bool(v2) then - from_int(Any..as_int!(v1) / bool_to_int(Any..as_bool!(v2))) - else if Any..isfrom_int(v1) && Any..isfrom_int(v2) then - from_int(Any..as_int!(v1) / Any..as_int!(v2)) - else - exception(UndefinedError ("Operand Type is not defined")) -} - -// ///////////////////////////////////////////////////////////////////////////////////// -// Modelling of Python comparision operations -// ///////////////////////////////////////////////////////////////////////////////////// - -function string_lt (s1: string, s2: string) : bool; -function string_le (s1: string, s2: string) : bool; -function string_gt (s1: string, s2: string) : bool; -function string_ge (s1: string, s2: string) : bool; -function List_lt (l1: ListAny, l2: ListAny): bool; -function List_le (l1: ListAny, l2: ListAny): bool; -function List_gt (l1: ListAny, l2: ListAny): bool; -function List_ge (l1: ListAny, l2: ListAny): bool; - -inline function PLt (v1: Any, v2: Any) : Any -{ - if Any..isexception(v1) then v1 else if Any..isexception(v2) then v2 - else if Any..isfrom_bool(v1) && Any..isfrom_bool(v2) then - from_bool(bool_to_int(Any..as_bool!(v1)) < bool_to_int(Any..as_bool!(v2))) - else if Any..isfrom_bool(v1) && Any..isfrom_int(v2) then - from_bool(bool_to_int(Any..as_bool!(v1)) < Any..as_int!(v2)) - else if Any..isfrom_int(v1) && Any..isfrom_bool(v2) then - from_bool(Any..as_int!(v1) < bool_to_int(Any..as_bool!(v2))) - else if Any..isfrom_bool(v1) && Any..isfrom_float(v2) then - from_bool(bool_to_real(Any..as_bool!(v1)) < Any..as_float!(v2)) - else if Any..isfrom_float(v1) && Any..isfrom_bool(v2) then - from_bool(Any..as_float!(v1) < bool_to_real(Any..as_bool!(v2))) - else if Any..isfrom_int(v1) && Any..isfrom_int(v2) then - from_bool(Any..as_int!(v1) < Any..as_int!(v2)) - else if Any..isfrom_int(v1) && Any..isfrom_float(v2) then - from_bool(int_to_real(Any..as_int!(v1)) < Any..as_float!(v2)) - else if Any..isfrom_float(v1) && Any..isfrom_int(v2) then - from_bool(Any..as_float!(v1) < int_to_real(Any..as_int!(v2))) - else if Any..isfrom_float(v1) && Any..isfrom_float(v2) then - from_bool(Any..as_float!(v1) < Any..as_float!(v2)) - else if Any..isfrom_string(v1) && Any..isfrom_string(v2) then - from_bool(string_lt(Any..as_string!(v1), Any..as_string!(v2))) - else if Any..isfrom_ListAny(v1) && Any..isfrom_ListAny(v2) then - from_bool(List_lt(Any..as_ListAny!(v1),Any..as_ListAny!(v2))) - else if Any..isfrom_datetime(v1) && Any..isfrom_datetime(v2) then - from_bool(Any..as_datetime!(v1) bool_to_int(Any..as_bool!(v2))) - else if Any..isfrom_bool(v1) && Any..isfrom_int(v2) then - from_bool(bool_to_int(Any..as_bool!(v1)) > Any..as_int!(v2)) - else if Any..isfrom_int(v1) && Any..isfrom_bool(v2) then - from_bool(Any..as_int!(v1) > bool_to_int(Any..as_bool!(v2))) - else if Any..isfrom_bool(v1) && Any..isfrom_float(v2) then - from_bool(bool_to_real(Any..as_bool!(v1)) > Any..as_float!(v2)) - else if Any..isfrom_float(v1) && Any..isfrom_bool(v2) then - from_bool(Any..as_float!(v1) > bool_to_real(Any..as_bool!(v2))) - else if Any..isfrom_int(v1) && Any..isfrom_int(v2) then - from_bool(Any..as_int!(v1) > Any..as_int!(v2)) - else if Any..isfrom_int(v1) && Any..isfrom_float(v2) then - from_bool(int_to_real(Any..as_int!(v1)) > Any..as_float!(v2)) - else if Any..isfrom_float(v1) && Any..isfrom_int(v2) then - from_bool(Any..as_float!(v1) > int_to_real(Any..as_int!(v2))) - else if Any..isfrom_float(v1) && Any..isfrom_float(v2) then - from_bool(Any..as_float!(v1) > Any..as_float!(v2)) - else if Any..isfrom_string(v1) && Any..isfrom_string(v2) then - from_bool(string_gt(Any..as_string!(v1), Any..as_string!(v2))) - else if Any..isfrom_ListAny(v1) && Any..isfrom_ListAny(v2) then - from_bool(List_gt(Any..as_ListAny!(v1),Any..as_ListAny!(v2))) - else if Any..isfrom_datetime(v1) && Any..isfrom_datetime(v2) then - from_bool(Any..as_datetime!(v1) >Any..as_datetime!(v2)) - else - exception(UndefinedError ("Operand Type is not defined")) -} - -inline function PGe (v1: Any, v2: Any) : Any -{ - if Any..isexception(v1) then v1 else if Any..isexception(v2) then v2 - else if Any..isfrom_bool(v1) && Any..isfrom_bool(v2) then - from_bool(bool_to_int(Any..as_bool!(v1)) >= bool_to_int(Any..as_bool!(v2))) - else if Any..isfrom_bool(v1) && Any..isfrom_int(v2) then - from_bool(bool_to_int(Any..as_bool!(v1)) >= Any..as_int!(v2)) - else if Any..isfrom_int(v1) && Any..isfrom_bool(v2) then - from_bool(Any..as_int!(v1) >= bool_to_int(Any..as_bool!(v2))) - else if Any..isfrom_bool(v1) && Any..isfrom_float(v2) then - from_bool(bool_to_real(Any..as_bool!(v1)) >= Any..as_float!(v2)) - else if Any..isfrom_float(v1) && Any..isfrom_bool(v2) then - from_bool(Any..as_float!(v1) >= bool_to_real(Any..as_bool!(v2))) - else if Any..isfrom_int(v1) && Any..isfrom_int(v2) then - from_bool(Any..as_int!(v1) >= Any..as_int!(v2)) - else if Any..isfrom_int(v1) && Any..isfrom_float(v2) then - from_bool(int_to_real(Any..as_int!(v1)) >= Any..as_float!(v2)) - else if Any..isfrom_float(v1) && Any..isfrom_int(v2) then - from_bool(Any..as_float!(v1) >= int_to_real(Any..as_int!(v2))) - else if Any..isfrom_float(v1) && Any..isfrom_float(v2) then - from_bool(Any..as_float!(v1) >= Any..as_float!(v2)) - else if Any..isfrom_string(v1) && Any..isfrom_string(v2) then - from_bool(string_ge(Any..as_string!(v1), Any..as_string!(v2))) - else if Any..isfrom_ListAny(v1) && Any..isfrom_ListAny(v2) then - from_bool(List_ge(Any..as_ListAny!(v1),Any..as_ListAny!(v2))) - else if Any..isfrom_datetime(v1) && Any..isfrom_datetime(v2) then - from_bool(Any..as_datetime!(v1) >=Any..as_datetime!(v2)) - else - exception(UndefinedError ("Operand Type is not defined")) -} - -inline function PEq (v: Any, v': Any) : Any { - from_bool(normalize_any(v) == normalize_any (v')) -} - -inline function PNEq (v: Any, v': Any) : Any { - from_bool(normalize_any(v) != normalize_any (v')) -} - -// ///////////////////////////////////////////////////////////////////////////////////// -// Modelling of Python Boolean operations And and Or -// ///////////////////////////////////////////////////////////////////////////////////// - -inline function PAnd (v1: Any, v2: Any) : Any - requires (Any..isfrom_bool(v1) || Any..isfrom_none(v1) || Any..isfrom_string(v1) || Any..isfrom_int(v1)); -{ - if ! Any_to_bool (v1) then v1 else v2 -} - -inline function POr (v1: Any, v2: Any) : Any - requires (Any..isfrom_bool(v1) || Any..isfrom_none(v1) || Any..isfrom_string(v1) || Any..isfrom_int(v1)); -{ - if Any_to_bool (v1) then v1 else v2 -} - - -// ///////////////////////////////////////////////////////////////////////////////////// -// Modelling of other Python operations, currrently unsupported -// ///////////////////////////////////////////////////////////////////////////////////// -inline function PPow (v1: Any, v2: Any) : Any -{ - exception(UnimplementedError ("Pow operator is not supported")) -} - -inline function PMod (v1: Any, v2: Any) : Any -{ - exception(UnimplementedError ("Mod operator is not supported")) -} - -// ///////////////////////////////////////////////////////////////////////////////////// -// Modelling of Python Boolean operations And and Or -// ///////////////////////////////////////////////////////////////////////////////////// - // ///////////////////////////////////////////////////////////////////////////////////// // Modelling some datetime-related Python operations, for testing purpose // ///////////////////////////////////////////////////////////////////////////////////// -function to_string(a: Any) : string; - -function to_string_any(a: Any) : Any { - from_string(to_string(a)) -} - -function datetime_strptime(dtstring: Any, format: Any) : Any; - axiom [datetime_tostring_cancel]: forall dt: Any :: datetime_strptime(to_string_any(dt), from_string ("%Y-%m-%d")) == dt; -procedure datetime_date(d: Any) returns (ret: Any, error: Error) -spec { - requires [d_type]: Any..isfrom_datetime(d); - ensures [ret_type]: Any..isfrom_datetime(ret) && Any..as_datetime!(ret) <= Any..as_datetime!(d); -} -{ - var timedt: int; - if (Any..isfrom_datetime(d)) { - assume [timedt_le]: timedt <= Any..as_datetime!(d); - ret := from_datetime(timedt); - error := NoError(); - } - else { - ret := from_none(); - error := TypeError("Input must be datetime"); - } -}; - -procedure datetime_now() returns (ret: Any) -spec { - ensures [ret_type]: Any..isfrom_datetime(ret); -} -{ - var d: int; - ret := from_datetime(d); -}; - -procedure timedelta(days: Any, hours: Any) returns (delta : Any, maybe_except: Error) -spec{ - requires [days_type]: Any..isfrom_none(days) || Any..isfrom_int(days); - requires [hours_type]: Any..isfrom_none(hours) || Any..isfrom_int(hours); - requires [days_pos]: Any..isfrom_int(days) ==> Any..as_int!(days)>=0; - requires [hours_pos]: Any..isfrom_int(hours) ==> Any..as_int!(hours)>=0; - ensures [ret_pos]: Any..isfrom_int(delta) && Any..as_int!(delta)>=0; -} -{ - var days_i : int := 0; - if (Any..isfrom_int(days)) { - days_i := Any..as_int!(days); - } - var hours_i : int := 0; - if (Any..isfrom_int(hours)) { - hours_i := Any..as_int!(hours); - } - delta := from_int ((((days_i * 24) + hours_i) * 3600) * 1000000); -}; - -procedure print(msg : Any) returns (); - #end public section diff --git a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean index 4cf9fb823..49d77a505 100644 --- a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean +++ b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean @@ -162,28 +162,118 @@ function isError (e: Error) : bool { ! Error..isNoError(e) }; + // ///////////////////////////////////////////////////////////////////////////////////// // ListAny functions // ///////////////////////////////////////////////////////////////////////////////////// function List_len (l : ListAny) : int - external; +{ + if ListAny..isListAny_nil(l) then 0 else 1 + List_len(ListAny..tail!(l)) +}; + +function List_contains (l : ListAny, x: Any) : bool +{ + if ListAny..isListAny_nil(l) then false else (ListAny..head!(l) == x) || List_contains(ListAny..tail!(l), x) +}; + +function List_extend (l1 : ListAny, l2: ListAny) : ListAny +{ + if ListAny..isListAny_nil(l1) then l2 + else ListAny_cons(ListAny..head!(l1), List_extend(ListAny..tail!(l1), l2)) +}; + +function List_get (l : ListAny, i : int) : Any + requires i >= 0 && i < List_len(l) +{ + if ListAny..isListAny_nil(l) then from_none() + else if i == 0 then ListAny..head!(l) + else List_get(ListAny..tail!(l), i - 1) +}; + +function List_take (l : ListAny, i: int) : ListAny + requires i >= 0 && i <= List_len(l) +{ + if ListAny..isListAny_nil(l) then ListAny_nil() + else if i == 0 then ListAny_nil() + else ListAny_cons(ListAny..head!(l), List_take(ListAny..tail!(l), i - 1)) +}; + +function List_drop (l : ListAny, i: int) : ListAny + requires i >= 0 && i <= List_len(l) +{ + if ListAny..isListAny_nil(l) then ListAny_nil() + else if i == 0 then l + else List_drop(ListAny..tail!(l), i - 1) +}; + +function List_slice (l : ListAny, start : int, stop: int) : ListAny + requires start >= 0 && start < List_len(l) && stop >= 0 && stop <= List_len(l) && start <= stop +{ + List_take (List_drop (l, start), stop - start) +}; function List_set (l : ListAny, i : int, v: Any) : ListAny - external; + requires i >= 0 && i < List_len(l) +{ + if ListAny..isListAny_nil(l) then ListAny_nil() + else if i == 0 then ListAny_cons(v, ListAny..tail!(l)) + else ListAny_cons(ListAny..head!(l), List_set(ListAny..tail!(l), i - 1, v)) +}; + +//Require recursive function on int +function List_repeat (l: ListAny, n: int): ListAny; // ///////////////////////////////////////////////////////////////////////////////////// // DictStrAny functions // ///////////////////////////////////////////////////////////////////////////////////// -function DictStrAny_insert (/* @[cases] */ d : DictStrAny, key: string, val: Any) : DictStrAny +function DictStrAny_contains (d : DictStrAny, key: string) : bool +{ + if DictStrAny..isDictStrAny_empty(d) then false + else (DictStrAny..key!(d) == key) || DictStrAny_contains(DictStrAny..tail!(d), key) +}; + +function DictStrAny_get (d : DictStrAny, key: string) : Any + requires DictStrAny_contains(d, key) +{ + if DictStrAny..isDictStrAny_empty(d) then from_none() + else if DictStrAny..key!(d) == key then DictStrAny..val!(d) + else DictStrAny_get(DictStrAny..tail!(d), key) +}; + +function DictStrAny_insert (/* */ d : DictStrAny, key: string, val: Any) : DictStrAny { if DictStrAny..isDictStrAny_empty(d) then DictStrAny_cons(key, val, DictStrAny_empty()) else if DictStrAny..key!(d) == key then DictStrAny_cons(key, val, DictStrAny..tail!(d)) else DictStrAny_cons(DictStrAny..key!(d), DictStrAny..val!(d), DictStrAny_insert(DictStrAny..tail!(d), key, val)) }; -/*inline*/ function Any_set (dictOrList: Any, index: Any, val: Any): Any +function Any_get (dictOrList: Any, index: Any): Any + requires (Any..isfrom_Dict(dictOrList) && Any..isfrom_string(index) && DictStrAny_contains(Any..as_Dict!(dictOrList), Any..as_string!(index))) || + (Any..isfrom_ListAny(dictOrList) && Any..isfrom_int(index) && Any..as_int!(index) >= 0 && Any..as_int!(index) < List_len(Any..as_ListAny!(dictOrList))) +{ + if Any..isfrom_Dict(dictOrList) then + DictStrAny_get(Any..as_Dict!(dictOrList), Any..as_string!(index)) + else + List_get(Any..as_ListAny!(dictOrList), Any..as_int!(index)) +}; + +function Any_get! (dictOrList: Any, index: Any): Any +{ + if Any..isexception(dictOrList) then dictOrList + else if Any..isexception(index) then index + else if !(Any..isfrom_Dict(dictOrList) && Any..isfrom_string(index)) && !(Any..isfrom_ListAny(dictOrList) && Any..isfrom_int(index)) then + exception (TypeError("Invalid subscription type")) + else if Any..isfrom_Dict(dictOrList) && Any..isfrom_string(index) && DictStrAny_contains(Any..as_Dict!(dictOrList), Any..as_string!(index)) then + DictStrAny_get(Any..as_Dict!(dictOrList), Any..as_string!(index)) + else if Any..isfrom_ListAny(dictOrList) && Any..isfrom_int(index) && Any..as_int!(index) >= 0 && Any..as_int!(index) < List_len(Any..as_ListAny!(dictOrList)) then + List_get(Any..as_ListAny!(dictOrList), Any..as_int!(index)) + else + exception (IndexError("Invalid subscription")) +}; + +function Any_set (dictOrList: Any, index: Any, val: Any): Any requires (Any..isfrom_Dict(dictOrList) && Any..isfrom_string(index)) || (Any..isfrom_ListAny(dictOrList) && Any..isfrom_int(index) && Any..as_int!(index) >= 0 && Any..as_int!(index) < List_len(Any..as_ListAny!(dictOrList))) { @@ -193,7 +283,7 @@ function DictStrAny_insert (/* @[cases] */ d : DictStrAny, key: string, val: Any from_ListAny(List_set(Any..as_ListAny!(dictOrList), Any..as_int!(index), val)) }; -/*inline*/ function Any_set! (dictOrList: Any, index: Any, val: Any): Any +function Any_set! (dictOrList: Any, index: Any, val: Any): Any { if Any..isexception(dictOrList) then dictOrList else if Any..isexception(index) then index @@ -208,7 +298,7 @@ function DictStrAny_insert (/* @[cases] */ d : DictStrAny, key: string, val: Any exception (IndexError("Index out of bound")) }; -function Any_sets (/* @[cases] */ indices: ListAny, dictOrList: Any, val: Any): Any +function Any_sets (indices: ListAny, dictOrList: Any, val: Any): Any { if ListAny..isListAny_nil(indices) then dictOrList else if ListAny..isListAny_nil(ListAny..tail!(indices)) then Any_set!(dictOrList, ListAny..head!(indices), val) @@ -216,6 +306,447 @@ function Any_sets (/* @[cases] */ indices: ListAny, dictOrList: Any, val: Any): Any_sets(ListAny..tail!(indices), Any_get!(dictOrList, ListAny..head!(indices)), val)) }; +function PIn (v: Any, dictOrList: Any) : Any + requires (Any..isfrom_Dict(dictOrList) && Any..isfrom_string(v)) || Any..isfrom_ListAny(dictOrList) +{ + from_bool( + if Any..isfrom_Dict(dictOrList) then + DictStrAny_contains(Any..as_Dict!(dictOrList), Any..as_string!(v)) + else + List_contains(Any..as_ListAny!(dictOrList), v) + ) +}; + +function PNotIn ( v: Any, dictOrList: Any) : Any + requires (Any..isfrom_Dict(dictOrList) && Any..isfrom_string(v)) || Any..isfrom_ListAny(dictOrList) +{ + from_bool( + if Any..isfrom_Dict(dictOrList) then + !DictStrAny_contains(Any..as_Dict!(dictOrList), Any..as_string!(v)) + else + !List_contains(Any..as_ListAny!(dictOrList), v) + ) +}; + +// ///////////////////////////////////////////////////////////////////////////////////// +// Python treats some values of different types to be equivalent +// This function models that behavior +// ///////////////////////////////////////////////////////////////////////////////////// + +function is_IntReal (v: Any) : bool; +function Any_real_to_int (v: Any) : int; + +function normalize_any (v : Any) : Any { + if v == from_bool(true) then from_int(1) + else (if v == from_bool(false) then from_int(0) else + if Any..isfrom_float(v) && is_IntReal(v) then from_int(Any_real_to_int(v)) else + v) +}; + + +// ///////////////////////////////////////////////////////////////////////////////////// +// MODELLING PYTHON OPERATIONS +// Note that there is no official document that define the semantic of Python operations +// The model of them in this prelude is based on experiments of basic types +// ///////////////////////////////////////////////////////////////////////////////////// + + +// ///////////////////////////////////////////////////////////////////////////////////// +// This function convert an int to a real +// Need to connect to an SMT function +function int_to_real (i: int) : real; + +// ///////////////////////////////////////////////////////////////////////////////////// +// Converting bool to int or real +// Used to in Python binary operators' modelling +function bool_to_int (bval: bool) : int {if bval then 1 else 0}; +function bool_to_real (b: bool) : real {if b then 1.0 else 0.0}; + +// ///////////////////////////////////////////////////////////////////////////////////// +// Modelling of Python unary operations +// ///////////////////////////////////////////////////////////////////////////////////// + +function PNeg (v: Any) : Any +{ + if Any..isexception(v) then v + else if Any..isfrom_bool(v) then + from_int(- bool_to_int(Any..as_bool!(v))) + else if Any..isfrom_int(v) then + from_int(- Any..as_int!(v)) + else if Any..isfrom_float(v) then + from_float(- Any..as_float!(v)) + else + exception(UndefinedError ("Operand Type is not defined")) +}; + +function PNot (v: Any) : Any +{ + if Any..isexception(v) then v + else if Any..isfrom_bool(v) then + from_bool(!(Any..as_bool!(v))) + else if Any..isfrom_int(v) then + from_bool(!(Any..as_int!(v) == 0)) + else if Any..isfrom_float(v) then + from_bool(!(Any..as_float!(v) == 0.0)) + else if Any..isfrom_string(v) then + from_bool(!(Any..as_string!(v) == "")) + else if Any..isfrom_ListAny(v) then + from_bool(!(List_len(Any..as_ListAny!(v)) == 0)) + else + exception(UndefinedError ("Operand Type is not defined")) +}; + +// ///////////////////////////////////////////////////////////////////////////////////// +// Modelling of Python binary operations +// ///////////////////////////////////////////////////////////////////////////////////// + +function PAdd (v1: Any, v2: Any) : Any +{ + if Any..isexception(v1) then v1 else if Any..isexception(v2) then v2 + else if Any..isfrom_bool(v1) && Any..isfrom_bool(v2) then + from_int(bool_to_int(Any..as_bool!(v1)) + bool_to_int(Any..as_bool!(v2))) + else if Any..isfrom_bool(v1) && Any..isfrom_int(v2) then + from_int(bool_to_int(Any..as_bool!(v1)) + Any..as_int!(v2)) + else if Any..isfrom_int(v1) && Any..isfrom_bool(v2) then + from_int(Any..as_int!(v1) + bool_to_int(Any..as_bool!(v2))) + else if Any..isfrom_int(v1) && Any..isfrom_float(v2) then + from_float(int_to_real(Any..as_int!(v1)) + Any..as_float!(v2)) + else if Any..isfrom_float(v1) && Any..isfrom_bool(v2) then + from_float(Any..as_float!(v1) + bool_to_real(Any..as_bool!(v2))) + else if Any..isfrom_int(v1) && Any..isfrom_int(v2) then + from_int(Any..as_int!(v1) + Any..as_int!(v2)) + else if Any..isfrom_float(v1) && Any..isfrom_int(v2) then + from_float(Any..as_float!(v1) + int_to_real(Any..as_int!(v2)) ) + else if Any..isfrom_float(v1) && Any..isfrom_float(v2) then + from_float(Any..as_float!(v1) + Any..as_float!(v2)) + else if Any..isfrom_string(v1) && Any..isfrom_string(v2) then + from_string(str.concat(Any..as_string!(v1),Any..as_string!(v2))) + else if Any..isfrom_ListAny(v1) && Any..isfrom_ListAny(v2) then + from_ListAny(List_extend(Any..as_ListAny!(v1),Any..as_ListAny!(v2))) + else if Any..isfrom_datetime(v1) && Any..isfrom_int(v2) then + from_datetime((Any..as_datetime!(v1) + Any..as_int!(v2))) + else + exception(UndefinedError ("Operand Type is not defined")) +}; + +function PSub (v1: Any, v2: Any) : Any +{ + if Any..isexception(v1) then v1 else if Any..isexception(v2) then v2 + else if Any..isfrom_bool(v1) && Any..isfrom_bool(v2) then + from_int(bool_to_int(Any..as_bool!(v1)) - bool_to_int(Any..as_bool!(v2))) + else if Any..isfrom_bool(v1) && Any..isfrom_int(v2) then + from_int(bool_to_int(Any..as_bool!(v1)) - Any..as_int!(v2)) + else if Any..isfrom_int(v1) && Any..isfrom_bool(v2) then + from_int(Any..as_int!(v1) - bool_to_int(Any..as_bool!(v2))) + else if Any..isfrom_bool(v1) && Any..isfrom_float(v2) then + from_float(bool_to_real(Any..as_bool!(v1)) - Any..as_float!(v2)) + else if Any..isfrom_float(v1) && Any..isfrom_bool(v2) then + from_float(Any..as_float!(v1) - bool_to_real(Any..as_bool!(v2))) + else if Any..isfrom_int(v1) && Any..isfrom_int(v2) then + from_int(Any..as_int!(v1) - Any..as_int!(v2)) + else if Any..isfrom_int(v1) && Any..isfrom_float(v2) then + from_float(int_to_real(Any..as_int!(v1)) - Any..as_float!(v2)) + else if Any..isfrom_float(v1) && Any..isfrom_int(v2) then + from_float(Any..as_float!(v1) - int_to_real(Any..as_int!(v2)) ) + else if Any..isfrom_float(v1) && Any..isfrom_float(v2) then + from_float(Any..as_float!(v1) - Any..as_float!(v2)) + else if Any..isfrom_datetime(v1) && Any..isfrom_int(v2) then + from_datetime(Any..as_datetime!(v1) - Any..as_int!(v2)) + else if Any..isfrom_datetime(v1) && Any..isfrom_datetime(v2) then + from_int(Any..as_datetime!(v1) - Any..as_datetime!(v2)) + else + exception(UndefinedError ("Operand Type is not defined")) +}; + +function string_repeat (s: string, i: int) : string; + +function PMul (v1: Any, v2: Any) : Any +{ + if Any..isexception(v1) then v1 else if Any..isexception(v2) then v2 + else if Any..isfrom_bool(v1) && Any..isfrom_bool(v2) then + from_int(bool_to_int(Any..as_bool!(v1)) * bool_to_int(Any..as_bool!(v2))) + else if Any..isfrom_bool(v1) && Any..isfrom_int(v2) then + from_int(bool_to_int(Any..as_bool!(v1)) * Any..as_int!(v2)) + else if Any..isfrom_int(v1) && Any..isfrom_bool(v2) then + from_int(Any..as_int!(v1) * bool_to_int(Any..as_bool!(v2))) + else if Any..isfrom_bool(v1) && Any..isfrom_float(v2) then + from_float(bool_to_real(Any..as_bool!(v1)) * Any..as_float!(v2)) + else if Any..isfrom_float(v1) && Any..isfrom_bool(v2) then + from_float(Any..as_float!(v1) * bool_to_real(Any..as_bool!(v2))) + else if Any..isfrom_bool(v1) && Any..isfrom_string(v2) then + if Any..as_bool!(v1) then v2 else from_string("") + else if Any..isfrom_string(v1) && Any..isfrom_bool(v2) then + if Any..as_bool!(v2) then v1 else from_string("") + else if Any..isfrom_int(v1) && Any..isfrom_int(v2) then + from_int(Any..as_int!(v1) * Any..as_int!(v2)) + else if Any..isfrom_int(v1) && Any..isfrom_float(v2) then + from_float(int_to_real(Any..as_int!(v1)) * Any..as_float!(v2)) + else if Any..isfrom_float(v1) && Any..isfrom_int(v2) then + from_float(Any..as_float!(v1) * int_to_real(Any..as_int!(v2)) ) + else if Any..isfrom_int(v1) && Any..isfrom_string(v2) then + from_string(string_repeat(Any..as_string!(v2), Any..as_int!(v1))) + else if Any..isfrom_string(v1) && Any..isfrom_int(v2) then + from_string(string_repeat(Any..as_string!(v1), Any..as_int!(v2))) + else if Any..isfrom_int(v1) && Any..isfrom_ListAny(v2) then + from_ListAny(List_repeat(Any..as_ListAny!(v2), Any..as_int!(v1))) + else if Any..isfrom_ListAny(v1) && Any..isfrom_int(v2) then + from_ListAny(List_repeat(Any..as_ListAny!(v1), Any..as_int!(v2))) + else if Any..isfrom_float(v1) && Any..isfrom_float(v2) then + from_float(Any..as_float!(v1) * Any..as_float!(v2)) + else + exception(UndefinedError ("Operand Type is not defined")) +}; + +function PFloorDiv (v1: Any, v2: Any) : Any + requires (Any..isfrom_bool(v2)==>Any..as_bool!(v2)) && (Any..isfrom_int(v2)==>Any..as_int!(v2)!=0) +{ + if Any..isexception(v1) then v1 else if Any..isexception(v2) then v2 + else if Any..isfrom_bool(v1) && Any..isfrom_bool(v2) then + from_int( bool_to_int(Any..as_bool!(v1)) / bool_to_int(Any..as_bool!(v2))) + else if Any..isfrom_bool(v1) && Any..isfrom_int(v2) then + from_int(bool_to_int(Any..as_bool!(v1)) / Any..as_int!(v2)) + else if Any..isfrom_int(v1) && Any..isfrom_bool(v2) then + from_int(Any..as_int!(v1) / bool_to_int(Any..as_bool!(v2))) + else if Any..isfrom_int(v1) && Any..isfrom_int(v2) then + from_int(Any..as_int!(v1) / Any..as_int!(v2)) + else + exception(UndefinedError ("Operand Type is not defined")) +}; + +// ///////////////////////////////////////////////////////////////////////////////////// +// Modelling of Python comparision operations +// ///////////////////////////////////////////////////////////////////////////////////// + +function string_lt (s1: string, s2: string) : bool; +function string_le (s1: string, s2: string) : bool; +function string_gt (s1: string, s2: string) : bool; +function string_ge (s1: string, s2: string) : bool; +function List_lt (l1: ListAny, l2: ListAny): bool; +function List_le (l1: ListAny, l2: ListAny): bool; +function List_gt (l1: ListAny, l2: ListAny): bool; +function List_ge (l1: ListAny, l2: ListAny): bool; + +function PLt (v1: Any, v2: Any) : Any +{ + if Any..isexception(v1) then v1 else if Any..isexception(v2) then v2 + else if Any..isfrom_bool(v1) && Any..isfrom_bool(v2) then + from_bool(bool_to_int(Any..as_bool!(v1)) < bool_to_int(Any..as_bool!(v2))) + else if Any..isfrom_bool(v1) && Any..isfrom_int(v2) then + from_bool(bool_to_int(Any..as_bool!(v1)) < Any..as_int!(v2)) + else if Any..isfrom_int(v1) && Any..isfrom_bool(v2) then + from_bool(Any..as_int!(v1) < bool_to_int(Any..as_bool!(v2))) + else if Any..isfrom_bool(v1) && Any..isfrom_float(v2) then + from_bool(bool_to_real(Any..as_bool!(v1)) < Any..as_float!(v2)) + else if Any..isfrom_float(v1) && Any..isfrom_bool(v2) then + from_bool(Any..as_float!(v1) < bool_to_real(Any..as_bool!(v2))) + else if Any..isfrom_int(v1) && Any..isfrom_int(v2) then + from_bool(Any..as_int!(v1) < Any..as_int!(v2)) + else if Any..isfrom_int(v1) && Any..isfrom_float(v2) then + from_bool(int_to_real(Any..as_int!(v1)) < Any..as_float!(v2)) + else if Any..isfrom_float(v1) && Any..isfrom_int(v2) then + from_bool(Any..as_float!(v1) < int_to_real(Any..as_int!(v2))) + else if Any..isfrom_float(v1) && Any..isfrom_float(v2) then + from_bool(Any..as_float!(v1) < Any..as_float!(v2)) + else if Any..isfrom_string(v1) && Any..isfrom_string(v2) then + from_bool(string_lt(Any..as_string!(v1), Any..as_string!(v2))) + else if Any..isfrom_ListAny(v1) && Any..isfrom_ListAny(v2) then + from_bool(List_lt(Any..as_ListAny!(v1),Any..as_ListAny!(v2))) + else if Any..isfrom_datetime(v1) && Any..isfrom_datetime(v2) then + from_bool(Any..as_datetime!(v1) bool_to_int(Any..as_bool!(v2))) + else if Any..isfrom_bool(v1) && Any..isfrom_int(v2) then + from_bool(bool_to_int(Any..as_bool!(v1)) > Any..as_int!(v2)) + else if Any..isfrom_int(v1) && Any..isfrom_bool(v2) then + from_bool(Any..as_int!(v1) > bool_to_int(Any..as_bool!(v2))) + else if Any..isfrom_bool(v1) && Any..isfrom_float(v2) then + from_bool(bool_to_real(Any..as_bool!(v1)) > Any..as_float!(v2)) + else if Any..isfrom_float(v1) && Any..isfrom_bool(v2) then + from_bool(Any..as_float!(v1) > bool_to_real(Any..as_bool!(v2))) + else if Any..isfrom_int(v1) && Any..isfrom_int(v2) then + from_bool(Any..as_int!(v1) > Any..as_int!(v2)) + else if Any..isfrom_int(v1) && Any..isfrom_float(v2) then + from_bool(int_to_real(Any..as_int!(v1)) > Any..as_float!(v2)) + else if Any..isfrom_float(v1) && Any..isfrom_int(v2) then + from_bool(Any..as_float!(v1) > int_to_real(Any..as_int!(v2))) + else if Any..isfrom_float(v1) && Any..isfrom_float(v2) then + from_bool(Any..as_float!(v1) > Any..as_float!(v2)) + else if Any..isfrom_string(v1) && Any..isfrom_string(v2) then + from_bool(string_gt(Any..as_string!(v1), Any..as_string!(v2))) + else if Any..isfrom_ListAny(v1) && Any..isfrom_ListAny(v2) then + from_bool(List_gt(Any..as_ListAny!(v1),Any..as_ListAny!(v2))) + else if Any..isfrom_datetime(v1) && Any..isfrom_datetime(v2) then + from_bool(Any..as_datetime!(v1) >Any..as_datetime!(v2)) + else + exception(UndefinedError ("Operand Type is not defined")) +}; + +function PGe (v1: Any, v2: Any) : Any +{ + if Any..isexception(v1) then v1 else if Any..isexception(v2) then v2 + else if Any..isfrom_bool(v1) && Any..isfrom_bool(v2) then + from_bool(bool_to_int(Any..as_bool!(v1)) >= bool_to_int(Any..as_bool!(v2))) + else if Any..isfrom_bool(v1) && Any..isfrom_int(v2) then + from_bool(bool_to_int(Any..as_bool!(v1)) >= Any..as_int!(v2)) + else if Any..isfrom_int(v1) && Any..isfrom_bool(v2) then + from_bool(Any..as_int!(v1) >= bool_to_int(Any..as_bool!(v2))) + else if Any..isfrom_bool(v1) && Any..isfrom_float(v2) then + from_bool(bool_to_real(Any..as_bool!(v1)) >= Any..as_float!(v2)) + else if Any..isfrom_float(v1) && Any..isfrom_bool(v2) then + from_bool(Any..as_float!(v1) >= bool_to_real(Any..as_bool!(v2))) + else if Any..isfrom_int(v1) && Any..isfrom_int(v2) then + from_bool(Any..as_int!(v1) >= Any..as_int!(v2)) + else if Any..isfrom_int(v1) && Any..isfrom_float(v2) then + from_bool(int_to_real(Any..as_int!(v1)) >= Any..as_float!(v2)) + else if Any..isfrom_float(v1) && Any..isfrom_int(v2) then + from_bool(Any..as_float!(v1) >= int_to_real(Any..as_int!(v2))) + else if Any..isfrom_float(v1) && Any..isfrom_float(v2) then + from_bool(Any..as_float!(v1) >= Any..as_float!(v2)) + else if Any..isfrom_string(v1) && Any..isfrom_string(v2) then + from_bool(string_ge(Any..as_string!(v1), Any..as_string!(v2))) + else if Any..isfrom_ListAny(v1) && Any..isfrom_ListAny(v2) then + from_bool(List_ge(Any..as_ListAny!(v1),Any..as_ListAny!(v2))) + else if Any..isfrom_datetime(v1) && Any..isfrom_datetime(v2) then + from_bool(Any..as_datetime!(v1) >=Any..as_datetime!(v2)) + else + exception(UndefinedError ("Operand Type is not defined")) +}; + +function PEq (v: Any, v': Any) : Any { + from_bool(normalize_any(v) == normalize_any (v')) +}; + +function PNEq (v: Any, v': Any) : Any { + from_bool(normalize_any(v) != normalize_any (v')) +}; + +// ///////////////////////////////////////////////////////////////////////////////////// +// Modelling of Python Boolean operations And and Or +// ///////////////////////////////////////////////////////////////////////////////////// + +function PAnd (v1: Any, v2: Any) : Any + requires (Any..isfrom_bool(v1) || Any..isfrom_none(v1) || Any..isfrom_string(v1) || Any..isfrom_int(v1)) +{ + if ! Any_to_bool (v1) then v1 else v2 +}; + +function POr (v1: Any, v2: Any) : Any + requires (Any..isfrom_bool(v1) || Any..isfrom_none(v1) || Any..isfrom_string(v1) || Any..isfrom_int(v1)) +{ + if Any_to_bool (v1) then v1 else v2 +}; + + +// ///////////////////////////////////////////////////////////////////////////////////// +// Modelling of other Python operations, currrently unsupported +// ///////////////////////////////////////////////////////////////////////////////////// +function PPow (v1: Any, v2: Any) : Any +{ + exception(UnimplementedError ("Pow operator is not supported")) +}; + +function PMod (v1: Any, v2: Any) : Any +{ + exception(UnimplementedError ("Mod operator is not supported")) +}; + +// ///////////////////////////////////////////////////////////////////////////////////// +// Modelling of Python Boolean operations And and Or +// ///////////////////////////////////////////////////////////////////////////////////// + + +// ///////////////////////////////////////////////////////////////////////////////////// +// Modelling some datetime-related Python operations, for testing purpose +// ///////////////////////////////////////////////////////////////////////////////////// + +function to_string(a: Any) : string; + +function to_string_any(a: Any) : Any { + from_string(to_string(a)) +}; + +function datetime_strptime(dtstring: Any, format: Any) : Any; + +procedure datetime_date(d: Any) returns (ret: Any, error: Error) + requires Any..isfrom_datetime(d) summary "d_type" + ensures Any..isfrom_datetime(ret) && Any..as_datetime!(ret) <= Any..as_datetime!(d) summary "ret_type" +{ + var timedt: int; + if Any..isfrom_datetime(d) then { + // summary "timedt_le"; + assume timedt <= Any..as_datetime!(d); + ret := from_datetime(timedt); + error := NoError() + } + else { + ret := from_none(); + error := TypeError("Input must be datetime") + } +}; + +procedure datetime_now() returns (ret: Any) + ensures Any..isfrom_datetime(ret) summary "ret_type" +{ + var d: int; + ret := from_datetime(d) +}; + +procedure timedelta(days: Any, hours: Any) returns (delta : Any, maybe_except: Error) + requires Any..isfrom_none(days) || Any..isfrom_int(days) summary "days_type" + requires Any..isfrom_none(hours) || Any..isfrom_int(hours) summary "hours_type" + requires Any..isfrom_int(days) ==> Any..as_int!(days)>=0 summary "days_pos" + requires Any..isfrom_int(hours) ==> Any..as_int!(hours)>=0 summary "hours_pos" + ensures Any..isfrom_int(delta) && Any..as_int!(delta)>=0 summary "ret_pos" +{ + var days_i : int := 0; + if Any..isfrom_int(days) then { + days_i := Any..as_int!(days) + }; + var hours_i : int := 0; + if Any..isfrom_int(hours) then { + hours_i := Any..as_int!(hours) + }; + delta := from_int ((((days_i * 24) + hours_i) * 3600) * 1000000) +}; + // ///////////////////////////////////////////////////////////////////////////////////// // For testing purpose // ///////////////////////////////////////////////////////////////////////////////////// @@ -232,6 +763,8 @@ procedure test_helper_procedure(req_name : Any, opt_name : Any) returns (ret: An assume (Error..isNoError(maybe_except)) // summary "assume_maybe_except_none" }; +procedure print(msg : Any) returns (); + datatype FIRST_END_MARKER { } #end From 86a395cda4fa54e50f747b33a50f45b9d61723a2 Mon Sep 17 00:00:00 2001 From: KeyboardDrummer Date: Mon, 23 Mar 2026 14:33:47 +0000 Subject: [PATCH 23/79] Rename PythonLaurelCorePrelude to PythonRuntimeCorePart --- Strata/Languages/Laurel/Resolution.lean | 2 +- ...{PythonLaurelCorePrelude.lean => PythonRuntimeCorePart.lean} | 0 Strata/Languages/Python/PythonRuntimeLaurelPart.lean | 2 +- Strata/Languages/Python/PythonToLaurel.lean | 2 +- StrataMain.lean | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename Strata/Languages/Python/{PythonLaurelCorePrelude.lean => PythonRuntimeCorePart.lean} (100%) diff --git a/Strata/Languages/Laurel/Resolution.lean b/Strata/Languages/Laurel/Resolution.lean index 2e5c1016b..ae1bfba4e 100644 --- a/Strata/Languages/Laurel/Resolution.lean +++ b/Strata/Languages/Laurel/Resolution.lean @@ -8,7 +8,7 @@ module public import Strata.Languages.Laurel.Laurel public import Strata.Languages.Laurel.LaurelFormat import Strata.Util.Tactics -import Strata.Languages.Python.PythonLaurelCorePrelude +import Strata.Languages.Python.PythonRuntimeCorePart /-! # Name Resolution Pass diff --git a/Strata/Languages/Python/PythonLaurelCorePrelude.lean b/Strata/Languages/Python/PythonRuntimeCorePart.lean similarity index 100% rename from Strata/Languages/Python/PythonLaurelCorePrelude.lean rename to Strata/Languages/Python/PythonRuntimeCorePart.lean diff --git a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean index 49d77a505..88cf4c297 100644 --- a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean +++ b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean @@ -13,7 +13,7 @@ namespace Python /-- Python prelude declarations expressed in Laurel grammar. -Converted from PythonLaurelCorePrelude.lean (Core dialect) to Laurel dialect. +Converted from PythonRuntimeCorePart.lean (Core dialect) to Laurel dialect. Core-specific constructs that Laurel does not support: - `inline` keyword: noted in comments diff --git a/Strata/Languages/Python/PythonToLaurel.lean b/Strata/Languages/Python/PythonToLaurel.lean index 18d6b39e4..db72f4cfb 100644 --- a/Strata/Languages/Python/PythonToLaurel.lean +++ b/Strata/Languages/Python/PythonToLaurel.lean @@ -12,7 +12,7 @@ public import Strata.Languages.Laurel.LaurelTypes public import Strata.Languages.Laurel.LaurelToCoreTranslator public import Strata.Languages.Core.Verifier public import Strata.Languages.Python.PythonDialect -public import Strata.Languages.Python.PythonLaurelCorePrelude +public import Strata.Languages.Python.PythonRuntimeCorePart public import Strata.Languages.Python.Specs.ToLaurel public import Strata.Languages.Core.Program diff --git a/StrataMain.lean b/StrataMain.lean index abdfcdef4..294ffb0e2 100644 --- a/StrataMain.lean +++ b/StrataMain.lean @@ -21,7 +21,7 @@ import Strata.Languages.Laurel.Laurel import Strata.Transform.ProcedureInlining import Strata.Languages.Python.CorePrelude import Strata.Languages.Python.PythonRuntimeLaurelPart -import Strata.Languages.Python.PythonLaurelCorePrelude +import Strata.Languages.Python.PythonRuntimeCorePart import Strata.Backends.CBMC.CollectSymbols import Strata.Backends.CBMC.GOTO.CoreToGOTOPipeline From 1546296fbf262fbca327887a2542b0f0dd1f7e39 Mon Sep 17 00:00:00 2001 From: KeyboardDrummer Date: Mon, 23 Mar 2026 15:19:57 +0000 Subject: [PATCH 24/79] Fixes --- Strata/Languages/Python/PySpecPipeline.lean | 3 +-- .../Python/PythonRuntimeCorePart.lean | 19 ------------------ .../Python/PythonRuntimeLaurelPart.lean | 20 ++++++++++++++++--- 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/Strata/Languages/Python/PySpecPipeline.lean b/Strata/Languages/Python/PySpecPipeline.lean index 3f5571929..2461ed0ed 100644 --- a/Strata/Languages/Python/PySpecPipeline.lean +++ b/Strata/Languages/Python/PySpecPipeline.lean @@ -254,8 +254,7 @@ public def combinePySpecLaurel procedure bodies, etc.) to the Core program produced by Laurel translation. -/ private def prependPrelude (coreFromLaurel : Core.Program) : Core.Program := - let (preludeDecls, userDecls) := coreFromLaurel.decls.span (fun d => toString d.name != "FIRST_END_MARKER") - { decls := preludeDecls ++ Python.coreOnlyFromRuntimeCorePart ++ userDecls } + { decls := coreFromLaurel.decls ++ Python.coreOnlyFromRuntimeCorePart } /-- Translate a combined Laurel program to Core and prepend the full runtime prelude. Resolution errors are suppressed because PySpec diff --git a/Strata/Languages/Python/PythonRuntimeCorePart.lean b/Strata/Languages/Python/PythonRuntimeCorePart.lean index 4ce0903fd..de9a1e81b 100644 --- a/Strata/Languages/Python/PythonRuntimeCorePart.lean +++ b/Strata/Languages/Python/PythonRuntimeCorePart.lean @@ -105,24 +105,6 @@ type CoreOnlyDelimiter; // Core-only declarations (not expressed in Laurel) // ===================================================================== - -// ///////////////////////////////////////////////////////////////////////////////////// -//The following function convert Any type to bool -//based on the Python definition of truthiness for basic types -// https://docs.python.org/3/library/stdtypes.html -// ///////////////////////////////////////////////////////////////////////////////////// - -inline function Any_to_bool (v: Any) : bool - requires (Any..isfrom_bool(v) || Any..isfrom_none(v) || Any..isfrom_string(v) || Any..isfrom_int(v)); -{ - if Any..isfrom_bool(v) then Any..as_bool!(v) else - if Any..isfrom_none(v) then false else - if Any..isfrom_string(v) then !(Any..as_string!(v) == "") else - if Any..isfrom_int(v) then !(Any..as_int!(v) == 0) else - false - //WILL BE ADDED -} - // ///////////////////////////////////////////////////////////////////////////////////// // ListAny functions // ///////////////////////////////////////////////////////////////////////////////////// @@ -132,7 +114,6 @@ axiom [List_len_pos]: forall l : ListAny :: List_len(l) >= 0; axiom [List_take_len]: forall l : ListAny, i: int :: {List_len(List_take(l,i))} (i >= 0 && i <= List_len(l)) ==> List_len(List_take(l,i)) == i; - axiom [List_drop_len]: forall l : ListAny, i: int :: {List_len(List_drop(l,i))} (i >= 0 && i <= List_len(l)) ==> List_len(List_drop(l,i)) == List_len(l) - i; diff --git a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean index 88cf4c297..492c890f2 100644 --- a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean +++ b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean @@ -162,6 +162,22 @@ function isError (e: Error) : bool { ! Error..isNoError(e) }; +// ///////////////////////////////////////////////////////////////////////////////////// +//The following function convert Any type to bool +//based on the Python definition of truthiness for basic types +// https://docs.python.org/3/library/stdtypes.html +// ///////////////////////////////////////////////////////////////////////////////////// + +function Any_to_bool (v: Any) : bool + requires (Any..isfrom_bool(v) || Any..isfrom_none(v) || Any..isfrom_string(v) || Any..isfrom_int(v)) +{ + if (Any..isfrom_bool(v)) then Any..as_bool!(v) else + if (Any..isfrom_none(v)) then false else + if (Any..isfrom_string(v)) then !(Any..as_string!(v) == "") else + if (Any..isfrom_int(v)) then !(Any..as_int!(v) == 0) else + false + //WILL BE ADDED +}; // ///////////////////////////////////////////////////////////////////////////////////// // ListAny functions @@ -420,7 +436,7 @@ function PAdd (v1: Any, v2: Any) : Any else if Any..isfrom_float(v1) && Any..isfrom_float(v2) then from_float(Any..as_float!(v1) + Any..as_float!(v2)) else if Any..isfrom_string(v1) && Any..isfrom_string(v2) then - from_string(str.concat(Any..as_string!(v1),Any..as_string!(v2))) + from_string(Str.Concat(Any..as_string!(v1),Any..as_string!(v2))) else if Any..isfrom_ListAny(v1) && Any..isfrom_ListAny(v2) then from_ListAny(List_extend(Any..as_ListAny!(v1),Any..as_ListAny!(v2))) else if Any..isfrom_datetime(v1) && Any..isfrom_int(v2) then @@ -765,8 +781,6 @@ procedure test_helper_procedure(req_name : Any, opt_name : Any) returns (ret: An procedure print(msg : Any) returns (); -datatype FIRST_END_MARKER { } - #end /-- From b0033888b736563b1e5c582e15ef79b24357ba95 Mon Sep 17 00:00:00 2001 From: KeyboardDrummer Date: Mon, 23 Mar 2026 15:21:35 +0000 Subject: [PATCH 25/79] Undo rename of CorePart --- Strata/Languages/Laurel/Resolution.lean | 2 +- ...imeCorePart.lean => PythonLaurelCorePrelude.lean} | 12 ++++++------ Strata/Languages/Python/PythonToLaurel.lean | 2 +- StrataMain.lean | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) rename Strata/Languages/Python/{PythonRuntimeCorePart.lean => PythonLaurelCorePrelude.lean} (95%) diff --git a/Strata/Languages/Laurel/Resolution.lean b/Strata/Languages/Laurel/Resolution.lean index ae1bfba4e..2e5c1016b 100644 --- a/Strata/Languages/Laurel/Resolution.lean +++ b/Strata/Languages/Laurel/Resolution.lean @@ -8,7 +8,7 @@ module public import Strata.Languages.Laurel.Laurel public import Strata.Languages.Laurel.LaurelFormat import Strata.Util.Tactics -import Strata.Languages.Python.PythonRuntimeCorePart +import Strata.Languages.Python.PythonLaurelCorePrelude /-! # Name Resolution Pass diff --git a/Strata/Languages/Python/PythonRuntimeCorePart.lean b/Strata/Languages/Python/PythonLaurelCorePrelude.lean similarity index 95% rename from Strata/Languages/Python/PythonRuntimeCorePart.lean rename to Strata/Languages/Python/PythonLaurelCorePrelude.lean index de9a1e81b..fe7450408 100644 --- a/Strata/Languages/Python/PythonRuntimeCorePart.lean +++ b/Strata/Languages/Python/PythonLaurelCorePrelude.lean @@ -5,7 +5,7 @@ -/ module --- TODO: rename file to PythonRuntimeCorePart +-- TODO: rename file to PythonLaurelCorePrelude import Strata.DDM.Elab import Strata.DDM.AST import Strata.Languages.Core.DDMTransform.Grammar @@ -30,7 +30,7 @@ are filtered out. The original `CorePrelude.lean` remains unchanged for the Python-through-Core pipeline. -/ -private def pythonRuntimeCorePartDDM := +private def PythonLaurelCorePreludeDDM := #strata program Core; @@ -153,8 +153,8 @@ These are declarations that cannot be expressed in Laurel grammar. The returned program includes forward declarations of types from the Laurel prelude; callers should filter out duplicates when merging. -/ -def pythonRuntimeCorePart : Core.Program := - Core.getProgram pythonRuntimeCorePartDDM |>.fst +def PythonLaurelCorePrelude : Core.Program := + Core.getProgram PythonLaurelCorePreludeDDM |>.fst /-- Get only the Core-only declarations, dropping the forward declarations @@ -162,11 +162,11 @@ that precede the `type CoreOnlyDelimiter;` sentinel (and the sentinel itself). Everything after the delimiter is a genuine Core-only declaration. -/ def coreOnlyFromRuntimeCorePart : List Core.Decl := - let decls := pythonRuntimeCorePart.decls + let decls := PythonLaurelCorePrelude.decls -- Drop everything up to and including the CoreOnlyDelimiter sentinel match decls.dropWhile (fun d => d.name.name != "CoreOnlyDelimiter") with | _ :: rest => rest -- drop the delimiter itself - | [] => dbg_trace "SOUND BUG: CoreOnlyDelimiter sentinel not found in pythonRuntimeCorePart"; [] + | [] => dbg_trace "SOUND BUG: CoreOnlyDelimiter sentinel not found in PythonLaurelCorePrelude"; [] end -- public section diff --git a/Strata/Languages/Python/PythonToLaurel.lean b/Strata/Languages/Python/PythonToLaurel.lean index db72f4cfb..18d6b39e4 100644 --- a/Strata/Languages/Python/PythonToLaurel.lean +++ b/Strata/Languages/Python/PythonToLaurel.lean @@ -12,7 +12,7 @@ public import Strata.Languages.Laurel.LaurelTypes public import Strata.Languages.Laurel.LaurelToCoreTranslator public import Strata.Languages.Core.Verifier public import Strata.Languages.Python.PythonDialect -public import Strata.Languages.Python.PythonRuntimeCorePart +public import Strata.Languages.Python.PythonLaurelCorePrelude public import Strata.Languages.Python.Specs.ToLaurel public import Strata.Languages.Core.Program diff --git a/StrataMain.lean b/StrataMain.lean index 294ffb0e2..abdfcdef4 100644 --- a/StrataMain.lean +++ b/StrataMain.lean @@ -21,7 +21,7 @@ import Strata.Languages.Laurel.Laurel import Strata.Transform.ProcedureInlining import Strata.Languages.Python.CorePrelude import Strata.Languages.Python.PythonRuntimeLaurelPart -import Strata.Languages.Python.PythonRuntimeCorePart +import Strata.Languages.Python.PythonLaurelCorePrelude import Strata.Backends.CBMC.CollectSymbols import Strata.Backends.CBMC.GOTO.CoreToGOTOPipeline From 4e77197800145e13c0629cd2956459a011c28cd3 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Tue, 24 Mar 2026 10:47:11 +0100 Subject: [PATCH 26/79] Don't compile instance procedures --- Strata/Languages/Python/PythonToLaurel.lean | 4 ++-- StrataTest/Languages/Boole/FeatureRequests/binary_search.lean | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Strata/Languages/Python/PythonToLaurel.lean b/Strata/Languages/Python/PythonToLaurel.lean index 8b816ffea..b1e749df0 100644 --- a/Strata/Languages/Python/PythonToLaurel.lean +++ b/Strata/Languages/Python/PythonToLaurel.lean @@ -1672,8 +1672,8 @@ def pythonToLaurel' (info : PreludeInfo) classFieldHighType := classFieldHighType, filePath := filePath } - let (composite, instanceProcedures) ← translateClass initCtx stmt - procedures := procedures ++ instanceProcedures + let (composite, _instanceProcedures) ← translateClass initCtx stmt + procedures := procedures -- TODO, compile instanceProcedure ++ _instanceProcedures compositeTypes := compositeTypes ++ [composite] compositeTypeNames := compositeTypeNames.insert composite.name.text -- Collect field types for Any coercions in field accesses diff --git a/StrataTest/Languages/Boole/FeatureRequests/binary_search.lean b/StrataTest/Languages/Boole/FeatureRequests/binary_search.lean index da65ec3f4..ed9fb94e9 100644 --- a/StrataTest/Languages/Boole/FeatureRequests/binary_search.lean +++ b/StrataTest/Languages/Boole/FeatureRequests/binary_search.lean @@ -111,4 +111,5 @@ spec #end +#guard_msgs(drop info, error) in #eval Strata.Boole.verify "cvc5" binarySearchPgm From d63ac554832a6e62e287cac39386c328fff7c821 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Tue, 24 Mar 2026 13:34:33 +0100 Subject: [PATCH 27/79] Fix minor issues --- Strata/Languages/Python/PythonToLaurel.lean | 3 ++- StrataTest/Languages/Boole/FeatureRequests/binary_search.lean | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Strata/Languages/Python/PythonToLaurel.lean b/Strata/Languages/Python/PythonToLaurel.lean index b1e749df0..fc8cf81f9 100644 --- a/Strata/Languages/Python/PythonToLaurel.lean +++ b/Strata/Languages/Python/PythonToLaurel.lean @@ -1673,7 +1673,8 @@ def pythonToLaurel' (info : PreludeInfo) filePath := filePath } let (composite, _instanceProcedures) ← translateClass initCtx stmt - procedures := procedures -- TODO, compile instanceProcedure ++ _instanceProcedures + -- TODO uncomment this line and resolve compilation issues + -- procedures := procedures ++ _instanceProcedures compositeTypes := compositeTypes ++ [composite] compositeTypeNames := compositeTypeNames.insert composite.name.text -- Collect field types for Any coercions in field accesses diff --git a/StrataTest/Languages/Boole/FeatureRequests/binary_search.lean b/StrataTest/Languages/Boole/FeatureRequests/binary_search.lean index ed9fb94e9..f6a3f56d7 100644 --- a/StrataTest/Languages/Boole/FeatureRequests/binary_search.lean +++ b/StrataTest/Languages/Boole/FeatureRequests/binary_search.lean @@ -111,5 +111,5 @@ spec #end -#guard_msgs(drop info, error) in +#guard_msgs(drop info) in #eval Strata.Boole.verify "cvc5" binarySearchPgm From e4dd00d49887b65f14651a9519313c0a91f56d3e Mon Sep 17 00:00:00 2001 From: KeyboardDrummer Date: Tue, 24 Mar 2026 13:00:23 +0000 Subject: [PATCH 28/79] Move axioms to Laurel part --- Strata/Languages/Python/PySpecPipeline.lean | 6 +++--- .../Python/PythonLaurelCorePrelude.lean | 11 ----------- .../Python/PythonRuntimeLaurelPart.lean | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/Strata/Languages/Python/PySpecPipeline.lean b/Strata/Languages/Python/PySpecPipeline.lean index 2461ed0ed..6ff177af2 100644 --- a/Strata/Languages/Python/PySpecPipeline.lean +++ b/Strata/Languages/Python/PySpecPipeline.lean @@ -250,10 +250,10 @@ public def combinePySpecLaurel constants := pySpec.constants ++ user.constants } -/-- Prepend the full Python runtime Core prelude (datatype definitions, +/-- Prepend the Core part of the Python runtime (datatype definitions, procedure bodies, etc.) to the Core program produced by Laurel translation. -/ -private def prependPrelude (coreFromLaurel : Core.Program) : Core.Program := +private def prependCorePartOfRuntime (coreFromLaurel : Core.Program) : Core.Program := { decls := coreFromLaurel.decls ++ Python.coreOnlyFromRuntimeCorePart } /-- Translate a combined Laurel program to Core and prepend the full @@ -267,7 +267,7 @@ public def translateCombinedLaurel (combined : Laurel.Program) : (Option Core.Program × List DiagnosticModel) := let (coreOption, errors) := Laurel.translate { inlineFunctionsWhenPossible := true } combined (coreOption.map (fun core => - let prepended := prependPrelude core + let prepended := prependCorePartOfRuntime core -- dbg_trace "=== Final Core Program ===" -- dbg_trace (toString (Std.Format.pretty (Strata.Core.formatProgram prepended) 100)) -- dbg_trace "=================================" diff --git a/Strata/Languages/Python/PythonLaurelCorePrelude.lean b/Strata/Languages/Python/PythonLaurelCorePrelude.lean index 3ba5a5363..cc8fc53c2 100644 --- a/Strata/Languages/Python/PythonLaurelCorePrelude.lean +++ b/Strata/Languages/Python/PythonLaurelCorePrelude.lean @@ -116,14 +116,6 @@ type CoreOnlyDelimiter; // ListAny functions // ///////////////////////////////////////////////////////////////////////////////////// -axiom [List_len_pos]: forall l : ListAny :: List_len(l) >= 0; - -axiom [List_take_len]: forall l : ListAny, i: int :: {List_len(List_take(l,i))} - (i >= 0 && i <= List_len(l)) ==> List_len(List_take(l,i)) == i; - -axiom [List_drop_len]: forall l : ListAny, i: int :: {List_len(List_drop(l,i))} - (i >= 0 && i <= List_len(l)) ==> List_len(List_drop(l,i)) == List_len(l) - i; - // TODO introduce procedure types in Laurel so we can move this to the Laurel part rec function List_map (@[cases] l : ListAny, f: Any -> Any) : ListAny { @@ -147,9 +139,6 @@ rec function List_filter (@[cases] l : ListAny, f: Any -> bool) : ListAny // Modelling some datetime-related Python operations, for testing purpose // ///////////////////////////////////////////////////////////////////////////////////// -axiom [datetime_tostring_cancel]: forall dt: Any :: - datetime_strptime(to_string_any(dt), from_string ("%Y-%m-%d")) == dt; - #end public section diff --git a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean index 23cc70ab9..d4d8b2aaf 100644 --- a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean +++ b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean @@ -195,6 +195,10 @@ function List_len (l : ListAny) : int if ListAny..isListAny_nil(l) then 0 else 1 + List_len(ListAny..tail!(l)) }; +procedure List_len_pos(l : ListAny) + // autoinvoke + ensures List_len(l) >= 0; + function List_contains (l : ListAny, x: Any) : bool { if ListAny..isListAny_nil(l) then false else (ListAny..head!(l) == x) || List_contains(ListAny..tail!(l), x) @@ -222,6 +226,10 @@ function List_take (l : ListAny, i: int) : ListAny else ListAny_cons(ListAny..head!(l), List_take(ListAny..tail!(l), i - 1)) }; +procedure List_take_len(l : ListAny, i: int) + // autoinvoke {List_len(List_take(l,i))} + ensures i >= 0 && i <= List_len(l) ==> List_len(List_take(l,i)) == i; + function List_drop (l : ListAny, i: int) : ListAny requires i >= 0 && i <= List_len(l) { @@ -230,6 +238,10 @@ function List_drop (l : ListAny, i: int) : ListAny else List_drop(ListAny..tail!(l), i - 1) }; +procedure List_drop_len(l : ListAny, i: int) + // autoinvoke {List_len(List_drop(l,i))} + ensures i >= 0 && i <= List_len(l) ==> List_len(List_drop(l,i)) == List_len(l) - i; + function List_slice (l : ListAny, start : int, stop: int) : ListAny requires start >= 0 && start < List_len(l) && stop >= 0 && stop <= List_len(l) && start <= stop { @@ -430,6 +442,8 @@ function PNot (v: Any) : Any // Modelling of Python binary operations // ///////////////////////////////////////////////////////////////////////////////////// +function Str.Concat(s: string, s2: string): string external; + function PAdd (v1: Any, v2: Any) : Any { if Any..isexception(v1) then v1 else if Any..isexception(v2) then v2 @@ -735,6 +749,10 @@ function to_string_any(a: Any) : Any { function datetime_strptime(dtstring: Any, format: Any) : Any; +procedure datetime_tostring_cancel(dt: Any) + // autoinvoke + ensures datetime_strptime(to_string_any(dt), from_string ("%Y-%m-%d")) == dt; + procedure datetime_date(d: Any) returns (ret: Any, error: Error) requires Any..isfrom_datetime(d) summary "d_type" ensures Any..isfrom_datetime(ret) && Any..as_datetime!(ret) <= Any..as_datetime!(d) summary "ret_type" From f21b60080b3f411e495c340b5b6f87c3a679346e Mon Sep 17 00:00:00 2001 From: KeyboardDrummer Date: Tue, 24 Mar 2026 13:11:18 +0000 Subject: [PATCH 29/79] Add autoInvoke featuresToProcedures --- Strata/Languages/Laurel/Laurel.lean | 4 ++ .../Laurel/LaurelToCoreTranslator.lean | 51 ++++++++++++++++++- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/Strata/Languages/Laurel/Laurel.lean b/Strata/Languages/Laurel/Laurel.lean index 62b22179f..9de5d9a15 100644 --- a/Strata/Languages/Laurel/Laurel.lean +++ b/Strata/Languages/Laurel/Laurel.lean @@ -189,6 +189,10 @@ structure Procedure : Type where isFunctional : Bool /-- The procedure body: transparent, opaque, or abstract. -/ body : Body + /-- Optional trigger for auto-invocation. When present, the translator also emits an axiom + whose body is the ensures clause universally quantified over the procedure's inputs, + with this expression as the SMT trigger. -/ + autoInvoke : Option (WithMetadata StmtExpr) := none /-- Source-level metadata (locations, annotations). -/ md : MetaData diff --git a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean index 756b1f228..588f15599 100644 --- a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean +++ b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean @@ -529,6 +529,49 @@ def translateProcedure (proc : Procedure) : TranslateM Core.Procedure := do let spec : Core.Procedure.Spec := { modifies, preconditions, postconditions } return { header, spec, body } +/-- +Generate a Core axiom for a Laurel procedure that has an `autoInvoke` trigger. + +The axiom universally quantifies over the procedure's input parameters, uses the +`autoInvoke` expression as the SMT trigger, and asserts the conjunction of all +postconditions from an `Opaque` body. + +For a procedure `f(x: Int)` with `autoInvoke { f(x) }` and `ensures P(x)`, this emits: + `axiom autoInvoke_f: ∀ x: int :: { f(x) } P(x)` +-/ +def translateAutoInvokeAxiom (proc : Procedure) (trigger : StmtExprMd) + : TranslateM (Option Core.Decl) := do + let model := (← get).model + let postconds := match proc.body with + | .Opaque postconds _ _ => postconds + | _ => [] + if postconds.isEmpty then return none + -- All input param names become bound variables (outermost first = index 0 for first param) + let boundVars := proc.inputs.map (·.name) + -- Translate postconditions and trigger with the full bound-var context + let postcondExprs ← postconds.mapM (fun pc => translateExpr pc boundVars (isPureContext := true)) + let bodyExpr : Core.Expression.Expr := match postcondExprs with + | [] => .const () (.boolConst true) + | [e] => e + | e :: rest => rest.foldl (fun acc x => LExpr.mkApp () boolAndOp [acc, x]) e + let triggerExpr ← translateExpr trigger boundVars (isPureContext := true) + -- Wrap in ∀ from outermost (first param) to innermost (last param). + -- The trigger is placed on the innermost quantifier. + let quantified := buildQuants model proc.inputs bodyExpr triggerExpr + return some (.ax { name := s!"autoInvoke_{proc.name.text}", e := quantified }) +where + /-- Build `∀ p1 ... pn :: { trigger } body`. The trigger is on the innermost quantifier. -/ + buildQuants (model : SemanticModel) (params : List Parameter) + (body : Core.Expression.Expr) (trigger : Core.Expression.Expr) + : Core.Expression.Expr := + match params with + | [] => body + | [p] => + LExpr.allTr () p.name.text (some (translateType model p.type)) trigger body + | p :: rest => + LExpr.all () p.name.text (some (translateType model p.type)) + (buildQuants model rest body trigger) + partial def isRecursiveExpr (model: SemanticModel) (proc: Procedure) (expr : StmtExpr) : Bool := match expr with | .StaticCall callee args => -- Compare by text name: the callee's uniqueId in the body may differ from the @@ -726,6 +769,12 @@ def translate (options: LaurelTranslateOptions) (program : Program): TranslateRe -- Translate procedures using the monad, collecting diagnostics from the final state let procedures ← procProcs.mapM translateProcedure + -- Generate autoInvoke axioms for procedures that declare one + let autoInvokeAxioms ← procProcs.filterMapM (fun proc => + match proc.autoInvoke with + | some trigger => translateAutoInvokeAxiom proc trigger + | none => pure none) + -- Translate Laurel constants to Core function declarations (0-ary functions) let constantDecls ← program.constants.mapM fun c => do let coreTy := translateType model c.type @@ -747,7 +796,7 @@ def translate (options: LaurelTranslateOptions) (program : Program): TranslateRe -- Translate Laurel datatype definitions to Core declarations. let groupedDatatypeDecls ← translateTypes program model let program := { - decls := groupedDatatypeDecls ++ constantDecls ++ pureFuncDecls ++ procDecls + decls := groupedDatatypeDecls ++ constantDecls ++ pureFuncDecls ++ procDecls ++ autoInvokeAxioms } -- dbg_trace "=== Generated Strata Core Program ===" From 3c0c8900a193ff67fc7e3f296542d61d44500a6b Mon Sep 17 00:00:00 2001 From: KeyboardDrummer Date: Tue, 24 Mar 2026 13:12:59 +0000 Subject: [PATCH 30/79] Rename to invokeOn --- Strata/Languages/Laurel/Laurel.lean | 2 +- .../Laurel/LaurelToCoreTranslator.lean | 22 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Strata/Languages/Laurel/Laurel.lean b/Strata/Languages/Laurel/Laurel.lean index 9de5d9a15..c4e9974b2 100644 --- a/Strata/Languages/Laurel/Laurel.lean +++ b/Strata/Languages/Laurel/Laurel.lean @@ -192,7 +192,7 @@ structure Procedure : Type where /-- Optional trigger for auto-invocation. When present, the translator also emits an axiom whose body is the ensures clause universally quantified over the procedure's inputs, with this expression as the SMT trigger. -/ - autoInvoke : Option (WithMetadata StmtExpr) := none + invokeOn : Option (WithMetadata StmtExpr) := none /-- Source-level metadata (locations, annotations). -/ md : MetaData diff --git a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean index 588f15599..6c807c809 100644 --- a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean +++ b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean @@ -530,16 +530,16 @@ def translateProcedure (proc : Procedure) : TranslateM Core.Procedure := do return { header, spec, body } /-- -Generate a Core axiom for a Laurel procedure that has an `autoInvoke` trigger. +Generate a Core axiom for a Laurel procedure that has an `invokeOn` trigger. The axiom universally quantifies over the procedure's input parameters, uses the -`autoInvoke` expression as the SMT trigger, and asserts the conjunction of all +`invokeOn` expression as the SMT trigger, and asserts the conjunction of all postconditions from an `Opaque` body. -For a procedure `f(x: Int)` with `autoInvoke { f(x) }` and `ensures P(x)`, this emits: - `axiom autoInvoke_f: ∀ x: int :: { f(x) } P(x)` +For a procedure `f(x: Int)` with `invokeOn { f(x) }` and `ensures P(x)`, this emits: + `axiom invokeOn_f: ∀ x: int :: { f(x) } P(x)` -/ -def translateAutoInvokeAxiom (proc : Procedure) (trigger : StmtExprMd) +def translateInvokeOnAxiom (proc : Procedure) (trigger : StmtExprMd) : TranslateM (Option Core.Decl) := do let model := (← get).model let postconds := match proc.body with @@ -558,7 +558,7 @@ def translateAutoInvokeAxiom (proc : Procedure) (trigger : StmtExprMd) -- Wrap in ∀ from outermost (first param) to innermost (last param). -- The trigger is placed on the innermost quantifier. let quantified := buildQuants model proc.inputs bodyExpr triggerExpr - return some (.ax { name := s!"autoInvoke_{proc.name.text}", e := quantified }) + return some (.ax { name := s!"invokeOn_{proc.name.text}", e := quantified }) where /-- Build `∀ p1 ... pn :: { trigger } body`. The trigger is on the innermost quantifier. -/ buildQuants (model : SemanticModel) (params : List Parameter) @@ -769,10 +769,10 @@ def translate (options: LaurelTranslateOptions) (program : Program): TranslateRe -- Translate procedures using the monad, collecting diagnostics from the final state let procedures ← procProcs.mapM translateProcedure - -- Generate autoInvoke axioms for procedures that declare one - let autoInvokeAxioms ← procProcs.filterMapM (fun proc => - match proc.autoInvoke with - | some trigger => translateAutoInvokeAxiom proc trigger + -- Generate invokeOn axioms for procedures that declare one + let invokeOnAxioms ← procProcs.filterMapM (fun proc => + match proc.invokeOn with + | some trigger => translateInvokeOnAxiom proc trigger | none => pure none) -- Translate Laurel constants to Core function declarations (0-ary functions) @@ -796,7 +796,7 @@ def translate (options: LaurelTranslateOptions) (program : Program): TranslateRe -- Translate Laurel datatype definitions to Core declarations. let groupedDatatypeDecls ← translateTypes program model let program := { - decls := groupedDatatypeDecls ++ constantDecls ++ pureFuncDecls ++ procDecls ++ autoInvokeAxioms + decls := groupedDatatypeDecls ++ constantDecls ++ pureFuncDecls ++ procDecls ++ invokeOnAxioms } -- dbg_trace "=== Generated Strata Core Program ===" From 1f93c19c10632b922086a47819d16873ab419d92 Mon Sep 17 00:00:00 2001 From: KeyboardDrummer Date: Tue, 24 Mar 2026 14:01:19 +0000 Subject: [PATCH 31/79] Fixes for invokeOn --- .../ConcreteToAbstractTreeTranslator.lean | 16 ++- .../Laurel/Grammar/LaurelGrammar.lean | 2 +- .../Languages/Laurel/Grammar/LaurelGrammar.st | 9 +- .../Laurel/LaurelToCoreTranslator.lean | 103 +++++++++++++++--- Strata/Languages/Laurel/Resolution.lean | 4 + .../Python/PythonRuntimeLaurelPart.lean | 8 +- 6 files changed, 116 insertions(+), 26 deletions(-) diff --git a/Strata/Languages/Laurel/Grammar/ConcreteToAbstractTreeTranslator.lean b/Strata/Languages/Laurel/Grammar/ConcreteToAbstractTreeTranslator.lean index ac6f780d5..c5d0d2b77 100644 --- a/Strata/Languages/Laurel/Grammar/ConcreteToAbstractTreeTranslator.lean +++ b/Strata/Languages/Laurel/Grammar/ConcreteToAbstractTreeTranslator.lean @@ -146,6 +146,7 @@ instance : Inhabited Procedure where determinism := .deterministic none decreases := none isFunctional := false + invokeOn := none body := .Transparent ⟨.LiteralBool true, #[]⟩ md := .empty } @@ -426,9 +427,9 @@ def parseProcedure (arg : Arg) : TransM Procedure := do match op.name, op.args with | q`Laurel.procedure, #[nameArg, paramArg, returnTypeArg, returnParamsArg, - requiresArg, ensuresArg, modifiesArg, bodyArg] + requiresArg, invokeOnArg, ensuresArg, modifiesArg, bodyArg] | q`Laurel.function, #[nameArg, paramArg, returnTypeArg, returnParamsArg, - requiresArg, ensuresArg, modifiesArg, bodyArg] => + requiresArg, invokeOnArg, ensuresArg, modifiesArg, bodyArg] => let name ← translateIdent nameArg let nameMd ← getArgMetaData nameArg let parameters ← translateParameters paramArg @@ -451,6 +452,14 @@ def parseProcedure (arg : Arg) : TransM Procedure := do | _ => TransM.error s!"Expected optionalReturnType operation, got {repr returnTypeArg}" -- Parse preconditions (requires clauses - zero or more) let preconditions ← translateRequiresClauses requiresArg + -- Parse optional invokeOn clause + let invokeOn ← match invokeOnArg with + | .option _ (some (.op invokeOnOp)) => match invokeOnOp.name, invokeOnOp.args with + | q`Laurel.invokeOnClause, #[triggerExprArg] => + translateStmtExpr triggerExprArg >>= (pure ∘ some) + | _, _ => TransM.error s!"Expected invokeOnClause operation, got {repr invokeOnOp.name}" + | .option _ none => pure none + | _ => pure none -- Parse postconditions (ensures clauses - zero or more) let postconditions ← translateEnsuresClauses ensuresArg -- Parse modifies clauses (zero or more) @@ -483,12 +492,13 @@ def parseProcedure (arg : Arg) : TransM Procedure := do determinism := .deterministic none decreases := none isFunctional := op.name == q`Laurel.function + invokeOn := invokeOn body := procBody md := nameMd } | q`Laurel.procedure, args | q`Laurel.function, args => - TransM.error s!"parseProcedure expects 8 arguments, got {args.size}" + TransM.error s!"parseProcedure expects 9 arguments, got {args.size}" | _, _ => TransM.error s!"parseProcedure expects procedure or function, got {repr op.name}" diff --git a/Strata/Languages/Laurel/Grammar/LaurelGrammar.lean b/Strata/Languages/Laurel/Grammar/LaurelGrammar.lean index 4bbe62383..b72e2f8a9 100644 --- a/Strata/Languages/Laurel/Grammar/LaurelGrammar.lean +++ b/Strata/Languages/Laurel/Grammar/LaurelGrammar.lean @@ -8,7 +8,7 @@ module -- Laurel dialect definition, loaded from LaurelGrammar.st -- NOTE: Changes to LaurelGrammar.st are not automatically tracked by the build system. -- Update this file (e.g. this comment) to trigger a recompile after modifying LaurelGrammar.st. --- Last grammar change: composite op moved after Procedure category; accepts Seq Procedure for instance procedures. +-- Last grammar change: added invokeOn clause before ensures in procedure/function ops. public import Strata.DDM.Integration.Lean public meta import Strata.DDM.Integration.Lean diff --git a/Strata/Languages/Laurel/Grammar/LaurelGrammar.st b/Strata/Languages/Laurel/Grammar/LaurelGrammar.st index 5bad8ffd7..1729fce3b 100644 --- a/Strata/Languages/Laurel/Grammar/LaurelGrammar.st +++ b/Strata/Languages/Laurel/Grammar/LaurelGrammar.st @@ -143,6 +143,9 @@ op datatype (name: Ident, constructors: DatatypeConstructorList): Datatype => "d category OptionalReturnType; op optionalReturnType(returnType: LaurelType): OptionalReturnType => ":" returnType; +category InvokeOnClause; +op invokeOnClause(trigger: StmtExpr): InvokeOnClause => "invokeOn" trigger:0; + category RequiresClause; op requiresClause(cond: StmtExpr, errorMessage: Option OptionalErrorMessage): RequiresClause => "requires" cond:0 errorMessage; @@ -164,19 +167,21 @@ op procedure (name : Ident, parameters: CommaSepBy Parameter, returnType: Option OptionalReturnType, returnParameters: Option ReturnParameters, requires: Seq RequiresClause, + invokeOn: Option InvokeOnClause, ensures: Seq EnsuresClause, modifies: Seq ModifiesClause, body : Option OptionalBody) : Procedure => - "procedure " name "(" parameters ")" returnType returnParameters requires ensures modifies body ";"; + "procedure " name "(" parameters ")" returnType returnParameters requires invokeOn ensures modifies body ";"; op function (name : Ident, parameters: CommaSepBy Parameter, returnType: Option OptionalReturnType, returnParameters: Option ReturnParameters, requires: Seq RequiresClause, + invokeOn: Option InvokeOnClause, ensures: Seq EnsuresClause, modifies: Seq ModifiesClause, body : Option OptionalBody) : Procedure => - "function " name "(" parameters ")" returnType returnParameters requires ensures modifies body ";"; + "function " name "(" parameters ")" returnType returnParameters requires invokeOn ensures modifies body ";"; op composite (name: Ident, extending: Option OptionalExtends, fields: Seq Field, procedures: Seq Procedure): Composite => "composite " name extending "{" fields procedures "}"; diff --git a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean index 6c807c809..12fb48b51 100644 --- a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean +++ b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean @@ -530,15 +530,57 @@ def translateProcedure (proc : Procedure) : TranslateM Core.Procedure := do return { header, spec, body } /-- -Generate a Core axiom for a Laurel procedure that has an `invokeOn` trigger. - -The axiom universally quantifies over the procedure's input parameters, uses the -`invokeOn` expression as the SMT trigger, and asserts the conjunction of all -postconditions from an `Opaque` body. +Collect all `StaticCall` callee names referenced anywhere in a `StmtExpr`. +Used to determine which functions an invokeOn axiom depends on. +-/ +partial def collectStaticCallNames (expr : StmtExpr) : List String := + match expr with + | .StaticCall callee args => + callee.text :: args.flatMap (fun a => collectStaticCallNames a.val) + | .PrimitiveOp _ args => args.flatMap (fun a => collectStaticCallNames a.val) + | .IfThenElse cond t e => + collectStaticCallNames cond.val ++ + collectStaticCallNames t.val ++ + (e.toList.flatMap (fun x => collectStaticCallNames x.val)) + | .Block stmts _ => stmts.flatMap (fun s => collectStaticCallNames s.val) + | .Assign targets v => + targets.flatMap (fun t => collectStaticCallNames t.val) ++ + collectStaticCallNames v.val + | .LocalVariable _ _ init => init.toList.flatMap (fun i => collectStaticCallNames i.val) + | .Return v => v.toList.flatMap (fun x => collectStaticCallNames x.val) + | .While cond invs dec body => + collectStaticCallNames cond.val ++ + invs.flatMap (fun i => collectStaticCallNames i.val) ++ + dec.toList.flatMap (fun d => collectStaticCallNames d.val) ++ + collectStaticCallNames body.val + | .Forall _ trig body => + trig.toList.flatMap (fun t => collectStaticCallNames t.val) ++ + collectStaticCallNames body.val + | .Exists _ trig body => + trig.toList.flatMap (fun t => collectStaticCallNames t.val) ++ + collectStaticCallNames body.val + | .FieldSelect t _ => collectStaticCallNames t.val + | .PureFieldUpdate t _ v => collectStaticCallNames t.val ++ collectStaticCallNames v.val + | .InstanceCall t _ args => + collectStaticCallNames t.val ++ args.flatMap (fun a => collectStaticCallNames a.val) + | .Old v | .Fresh v | .Assert v | .Assume v => collectStaticCallNames v.val + | .ProveBy v p => collectStaticCallNames v.val ++ collectStaticCallNames p.val + | .ReferenceEquals l r => collectStaticCallNames l.val ++ collectStaticCallNames r.val + | .AsType t _ | .IsType t _ => collectStaticCallNames t.val + | .ContractOf _ f => collectStaticCallNames f.val + | .Assigned v => collectStaticCallNames v.val + | _ => [] -For a procedure `f(x: Int)` with `invokeOn { f(x) }` and `ensures P(x)`, this emits: - `axiom invokeOn_f: ∀ x: int :: { f(x) } P(x)` +/-- +Collect the function names that an invokeOn axiom (from `proc`) depends on. +These are the `StaticCall` names appearing in the procedure's postconditions. -/ +def invokeOnAxiomDeps (proc : Procedure) : List String := + match proc.body with + | .Opaque postconds _ _ => + (postconds.flatMap (fun pc => collectStaticCallNames pc.val)).eraseDups + | _ => [] + def translateInvokeOnAxiom (proc : Procedure) (trigger : StmtExprMd) : TranslateM (Option Core.Decl) := do let model := (← get).model @@ -766,14 +808,44 @@ def translate (options: LaurelTranslateOptions) (program : Program): TranslateRe let (markedPure, procProcs) := nonExternal.partition (·.isFunctional) -- Try to translate each isFunctional procedure to a Core function, collecting errors for failures let pureFuncDecls ← markedPure.mapM (translateProcedureToFunction options) - -- Translate procedures using the monad, collecting diagnostics from the final state - let procedures ← procProcs.mapM translateProcedure - -- Generate invokeOn axioms for procedures that declare one - let invokeOnAxioms ← procProcs.filterMapM (fun proc => - match proc.invokeOn with - | some trigger => translateInvokeOnAxiom proc trigger - | none => pure none) + -- Collect invokeOn axioms from non-functional procedures, paired with their + -- function dependencies (StaticCall names in postconditions). + let pendingAxioms : List (Core.Decl × List String) ← + program.staticProcedures.filterMapM (fun proc => do + match proc.invokeOn with + | none => pure none + | some trigger => do + let axDecl? ← translateInvokeOnAxiom proc trigger + return axDecl?.map (fun ax => (ax, invokeOnAxiomDeps proc))) + + -- Build the set of function names defined in pureFuncDecls (in order). + let funcNames : List String := markedPure.map (·.name.text) + + -- Interleave pureFuncDecls with axioms in topological order: + -- after emitting each function, immediately emit any pending axioms whose + -- every function dependency has now been emitted. + let (interleavedFuncAxioms, remainingAxioms) := + funcNames.foldl (fun (acc : List Core.Decl × List (Core.Decl × List String)) + (fname : String) => + let (emitted, pending) := acc + -- Find the function decl for this name + let funcDecl := pureFuncDecls.find? (fun d => d.name.name == fname) + let emitted' := emitted ++ funcDecl.toList + -- Track which names are now defined + let definedSoFar := (emitted'.filterMap (fun d => + match d with | .func f => some f.name.name | .recFuncBlock (f :: _) => some f.name.name | _ => none)) + -- Emit any pending axioms whose deps are all satisfied + let (ready, stillPending) := pending.partition (fun (_, deps) => + deps.all (fun dep => !funcNames.contains dep || definedSoFar.contains dep)) + (emitted' ++ ready.map (·.1), stillPending)) + ([], pendingAxioms) + -- Append any axioms that had no function deps (or deps outside pureFuncDecls) + let funcAndAxiomDecls := interleavedFuncAxioms ++ remainingAxioms.map (·.1) + -- Translate procedures using the monad, collecting diagnostics from the final state. + let procDecls ← procProcs.mapM (fun proc => do + let coreProc ← translateProcedure proc + return Core.Decl.proc coreProc .empty) -- Translate Laurel constants to Core function declarations (0-ary functions) let constantDecls ← program.constants.mapM fun c => do @@ -791,12 +863,11 @@ def translate (options: LaurelTranslateOptions) (program : Program): TranslateRe -- let allErrors :=pureErrors ++ procDiags ++ constantsState.diagnostics -- if !allErrors.isEmpty then -- .error allErrors.toArray - let procDecls := procedures.map (fun p => Core.Decl.proc p .empty) -- Translate Laurel datatype definitions to Core declarations. let groupedDatatypeDecls ← translateTypes program model let program := { - decls := groupedDatatypeDecls ++ constantDecls ++ pureFuncDecls ++ procDecls ++ invokeOnAxioms + decls := groupedDatatypeDecls ++ constantDecls ++ funcAndAxiomDecls ++ procDecls } -- dbg_trace "=== Generated Strata Core Program ===" diff --git a/Strata/Languages/Laurel/Resolution.lean b/Strata/Languages/Laurel/Resolution.lean index 2e5c1016b..0c2e8f931 100644 --- a/Strata/Languages/Laurel/Resolution.lean +++ b/Strata/Languages/Laurel/Resolution.lean @@ -439,9 +439,11 @@ def resolveProcedure (proc : Procedure) : ResolveM Procedure := do let det' ← resolveDeterminism proc.determinism let dec' ← proc.decreases.mapM resolveStmtExpr let body' ← resolveBody proc.body + let invokeOn' ← proc.invokeOn.mapM resolveStmtExpr return { name := procName', inputs := inputs', outputs := outputs', isFunctional := proc.isFunctional, preconditions := pres', determinism := det', decreases := dec', + invokeOn := invokeOn', body := body', md := proc.md } /-- Resolve a field: define its name under the qualified key (OwnerType.fieldName) and resolve its type. -/ @@ -463,10 +465,12 @@ def resolveInstanceProcedure (typeName : Identifier) (proc : Procedure) : Resolv let det' ← resolveDeterminism proc.determinism let dec' ← proc.decreases.mapM resolveStmtExpr let body' ← resolveBody proc.body + let invokeOn' ← proc.invokeOn.mapM resolveStmtExpr modify fun s => { s with instanceTypeName := savedInstType } return { name := procName', inputs := inputs', outputs := outputs', isFunctional := proc.isFunctional, preconditions := pres', determinism := det', decreases := dec', + invokeOn := invokeOn', body := body', md := proc.md } /-- Resolve a type definition. -/ diff --git a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean index d4d8b2aaf..77836b2c0 100644 --- a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean +++ b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean @@ -196,7 +196,7 @@ function List_len (l : ListAny) : int }; procedure List_len_pos(l : ListAny) - // autoinvoke + invokeOn List_len(l) ensures List_len(l) >= 0; function List_contains (l : ListAny, x: Any) : bool @@ -227,7 +227,7 @@ function List_take (l : ListAny, i: int) : ListAny }; procedure List_take_len(l : ListAny, i: int) - // autoinvoke {List_len(List_take(l,i))} + invokeOn List_len(List_take(l,i)) ensures i >= 0 && i <= List_len(l) ==> List_len(List_take(l,i)) == i; function List_drop (l : ListAny, i: int) : ListAny @@ -239,7 +239,7 @@ function List_drop (l : ListAny, i: int) : ListAny }; procedure List_drop_len(l : ListAny, i: int) - // autoinvoke {List_len(List_drop(l,i))} + invokeOn List_len(List_drop(l,i)) ensures i >= 0 && i <= List_len(l) ==> List_len(List_drop(l,i)) == List_len(l) - i; function List_slice (l : ListAny, start : int, stop: int) : ListAny @@ -750,7 +750,7 @@ function to_string_any(a: Any) : Any { function datetime_strptime(dtstring: Any, format: Any) : Any; procedure datetime_tostring_cancel(dt: Any) - // autoinvoke + invokeOn datetime_strptime(to_string_any(dt), from_string ("%Y-%m-%d")) ensures datetime_strptime(to_string_any(dt), from_string ("%Y-%m-%d")) == dt; procedure datetime_date(d: Any) returns (ret: Any, error: Error) From 983cf3e75cfdcb9d168f765987e6ab4cadc308e7 Mon Sep 17 00:00:00 2001 From: KeyboardDrummer Date: Tue, 24 Mar 2026 14:02:04 +0000 Subject: [PATCH 32/79] Add test for invokeOn --- .../Examples/Fundamentals/T19_InvokeOn.lean | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean diff --git a/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean b/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean new file mode 100644 index 000000000..72f9aa43d --- /dev/null +++ b/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean @@ -0,0 +1,83 @@ +/- + Copyright Strata Contributors + + SPDX-License-Identifier: Apache-2.0 OR MIT +-/ + +import StrataTest.Util.TestDiagnostics +import StrataTest.Languages.Laurel.TestExamples + +open StrataTest.Util +open Strata + +namespace Strata.Laurel + +def program := r#" +// abs returns the absolute value of x. +// The invokeOn trigger fires whenever abs(x) appears in the SMT context, +// automatically instantiating the axiom: abs(x) >= 0. +function abs(x: int): int { + if x >= 0 then x else -x +}; + +procedure abs_nonneg(x: int) + invokeOn abs(x) + ensures abs(x) >= 0; + +// The axiom fires because abs(n) appears in the goal. +procedure useAbsAxiom(n: int) { + assert abs(n) >= 0 +}; + +// The axiom fires for a concrete expression too. +procedure useAbsAxiomConcrete() { + assert abs(-5) >= 0 +}; + +// Without the axiom, a false claim about abs should fail. +procedure wrongAbsClaim(n: int) { + assert abs(n) < 0 +//^^^^^^^^^^^^^^^^^ error: assertion does not hold +}; + +// double_abs: abs(abs(x)) == abs(x). +// The invokeOn trigger is abs(abs(x)), so the axiom fires when that +// exact pattern appears, giving us abs(abs(x)) >= 0 for free. +procedure abs_abs_nonneg(x: int) + invokeOn abs(abs(x)) + ensures abs(abs(x)) >= 0; + +procedure useAbsAbsAxiom(n: int) { + assert abs(abs(n)) >= 0 +}; + +// A procedure with multiple parameters: invokeOn fires on max(a, b). +function max(a: int, b: int): int { + if a >= b then a else b +}; + +procedure max_ge_left(a: int, b: int) + invokeOn max(a, b) + ensures max(a, b) >= a; + +procedure max_ge_right(a: int, b: int) + invokeOn max(a, b) + ensures max(a, b) >= b; + +// Both axioms fire because max(x, y) appears in the goal. +procedure useMaxAxioms(x: int, y: int) { + assert max(x, y) >= x; + assert max(x, y) >= y +}; + +// A wrong claim about max should fail even with the axiom. +procedure wrongMaxClaim(x: int, y: int) { + assert max(x, y) == x +//^^^^^^^^^^^^^^^^^^^^^ error: assertion does not hold +}; +"# + +#guard_msgs (drop info, error) in +#eval testInputWithOffset "InvokeOn" program 14 processLaurelFile + +end Strata.Laurel From 24e6693433b57177374caed68216a312826c976c Mon Sep 17 00:00:00 2001 From: KeyboardDrummer Date: Tue, 24 Mar 2026 14:34:34 +0000 Subject: [PATCH 33/79] Update test --- .../Examples/Fundamentals/T19_InvokeOn.lean | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean b/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean index 72f9aa43d..8a6b89d2c 100644 --- a/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean +++ b/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean @@ -75,6 +75,33 @@ procedure wrongMaxClaim(x: int, y: int) { assert max(x, y) == x //^^^^^^^^^^^^^^^^^^^^^ error: assertion does not hold }; + +// A procedure with two parameters of different types (int and bool). +// scale(x, flag) returns x when flag is true, and 0 otherwise. +// The invokeOn trigger fires on scale(x, flag), giving us the ensures for free. +function scale(x: int, flag: bool): int { + if flag then x else 0 +}; + +procedure scale_nonneg_when_flag(x: int, flag: bool) + invokeOn scale(x, flag) + ensures flag ==> scale(x, flag) == x; + +procedure scale_zero_when_not_flag(x: int, flag: bool) + invokeOn scale(x, flag) + ensures !flag ==> scale(x, flag) == 0; + +// Both axioms fire because scale(n, b) appears in the goal. +procedure useScaleAxioms(n: int, b: bool) { + assert b ==> scale(n, b) == n; + assert !b ==> scale(n, b) == 0 +}; + +// A wrong claim about scale should fail. +procedure wrongScaleClaim(n: int, b: bool) { + assert scale(n, b) == n +//^^^^^^^^^^^^^^^^^^^^^^^ error: assertion does not hold +}; "# #guard_msgs (drop info, error) in From 37b300b9f8f33728b585257d52945cd6458cac99 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Tue, 24 Mar 2026 15:45:11 +0100 Subject: [PATCH 34/79] Fix test --- .../Laurel/LaurelToCoreTranslator.lean | 3 +- .../Examples/Fundamentals/T19_InvokeOn.lean | 97 ++++--------------- 2 files changed, 19 insertions(+), 81 deletions(-) diff --git a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean index 12fb48b51..167f6f641 100644 --- a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean +++ b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean @@ -817,7 +817,8 @@ def translate (options: LaurelTranslateOptions) (program : Program): TranslateRe | none => pure none | some trigger => do let axDecl? ← translateInvokeOnAxiom proc trigger - return axDecl?.map (fun ax => (ax, invokeOnAxiomDeps proc))) + return axDecl?.map (fun ax => (ax, invokeOnAxiomDeps proc)) + ) -- Build the set of function names defined in pureFuncDecls (in order). let funcNames : List String := markedPure.map (·.name.text) diff --git a/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean b/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean index 8a6b89d2c..b2e0c3307 100644 --- a/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean +++ b/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean @@ -13,95 +13,32 @@ open Strata namespace Strata.Laurel def program := r#" -// abs returns the absolute value of x. -// The invokeOn trigger fires whenever abs(x) appears in the SMT context, -// automatically instantiating the axiom: abs(x) >= 0. -function abs(x: int): int { - if x >= 0 then x else -x -}; - -procedure abs_nonneg(x: int) - invokeOn abs(x) - ensures abs(x) >= 0; - -// The axiom fires because abs(n) appears in the goal. -procedure useAbsAxiom(n: int) { - assert abs(n) >= 0 -}; - -// The axiom fires for a concrete expression too. -procedure useAbsAxiomConcrete() { - assert abs(-5) >= 0 -}; - -// Without the axiom, a false claim about abs should fail. -procedure wrongAbsClaim(n: int) { - assert abs(n) < 0 -//^^^^^^^^^^^^^^^^^ error: assertion does not hold -}; - -// double_abs: abs(abs(x)) == abs(x). -// The invokeOn trigger is abs(abs(x)), so the axiom fires when that -// exact pattern appears, giving us abs(abs(x)) >= 0 for free. -procedure abs_abs_nonneg(x: int) - invokeOn abs(abs(x)) - ensures abs(abs(x)) >= 0; +function P(x: int): bool; +function Q(x: int): bool; -procedure useAbsAbsAxiom(n: int) { - assert abs(abs(n)) >= 0 -}; +procedure PAndQ(x: int) + invokeOn P(x) + ensures P(x) && Q(x); -// A procedure with multiple parameters: invokeOn fires on max(a, b). -function max(a: int, b: int): int { - if a >= b then a else b +// The axiom fires because P(x) appears in the goal. +procedure fireAxiomUsingPattern(x: int) { + assert P(x) }; -procedure max_ge_left(a: int, b: int) - invokeOn max(a, b) - ensures max(a, b) >= a; - -procedure max_ge_right(a: int, b: int) - invokeOn max(a, b) - ensures max(a, b) >= b; - -// Both axioms fire because max(x, y) appears in the goal. -procedure useMaxAxioms(x: int, y: int) { - assert max(x, y) >= x; - assert max(x, y) >= y +procedure axiomDoesNotFireBecauseOfPattern(x: int) { + assert Q(x) +//^^^^^^^^^^^ error: assertion does not hold }; -// A wrong claim about max should fail even with the axiom. -procedure wrongMaxClaim(x: int, y: int) { - assert max(x, y) == x -//^^^^^^^^^^^^^^^^^^^^^ error: assertion does not hold -}; +function Z(x: real): bool; +procedure PAndZ(x: int, y: real) + invokeOn P(x) + ensures P(x) && Z(y); -// A procedure with two parameters of different types (int and bool). -// scale(x, flag) returns x when flag is true, and 0 otherwise. -// The invokeOn trigger fires on scale(x, flag), giving us the ensures for free. -function scale(x: int, flag: bool): int { - if flag then x else 0 +procedure invokePAndZ(x: int, y :real) { + assert P(x) && Z(y) }; -procedure scale_nonneg_when_flag(x: int, flag: bool) - invokeOn scale(x, flag) - ensures flag ==> scale(x, flag) == x; - -procedure scale_zero_when_not_flag(x: int, flag: bool) - invokeOn scale(x, flag) - ensures !flag ==> scale(x, flag) == 0; - -// Both axioms fire because scale(n, b) appears in the goal. -procedure useScaleAxioms(n: int, b: bool) { - assert b ==> scale(n, b) == n; - assert !b ==> scale(n, b) == 0 -}; - -// A wrong claim about scale should fail. -procedure wrongScaleClaim(n: int, b: bool) { - assert scale(n, b) == n -//^^^^^^^^^^^^^^^^^^^^^^^ error: assertion does not hold -}; "# #guard_msgs (drop info, error) in From 376d825b3097a7553586753623bee783f7500051 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Tue, 24 Mar 2026 15:47:55 +0100 Subject: [PATCH 35/79] bug fix --- Strata/Languages/Laurel/LaurelToCoreTranslator.lean | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean index 167f6f641..4faaad450 100644 --- a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean +++ b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean @@ -588,8 +588,12 @@ def translateInvokeOnAxiom (proc : Procedure) (trigger : StmtExprMd) | .Opaque postconds _ _ => postconds | _ => [] if postconds.isEmpty then return none - -- All input param names become bound variables (outermost first = index 0 for first param) - let boundVars := proc.inputs.map (·.name) + -- All input param names become bound variables. + -- buildQuants nests ∀ p1, ∀ p2, ..., ∀ pn :: body, so inside body the innermost + -- binder (pn) is de Bruijn index 0, and the outermost (p1) is index n-1. + -- translateExpr uses findIdx? on boundVars, so we must list params innermost-first + -- (i.e. reversed) so that pn → 0, ..., p1 → n-1. + let boundVars := proc.inputs.reverse.map (·.name) -- Translate postconditions and trigger with the full bound-var context let postcondExprs ← postconds.mapM (fun pc => translateExpr pc boundVars (isPureContext := true)) let bodyExpr : Core.Expression.Expr := match postcondExprs with From da5203ad0e605cab1bc2a4ef6b788612de4bf784 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Tue, 24 Mar 2026 18:46:16 +0100 Subject: [PATCH 36/79] Updates --- .../Laurel/Examples/Fundamentals/T19_InvokeOn.lean | 12 +++++++----- StrataTest/Languages/Laurel/TestExamples.lean | 7 +++++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean b/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean index b2e0c3307..4466111dc 100644 --- a/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean +++ b/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean @@ -27,21 +27,23 @@ procedure fireAxiomUsingPattern(x: int) { procedure axiomDoesNotFireBecauseOfPattern(x: int) { assert Q(x) -//^^^^^^^^^^^ error: assertion does not hold +//^^^^^^^^^^^ error: assertion could not be proved }; +function A(x: int, y: real); function Z(x: real): bool; procedure PAndZ(x: int, y: real) - invokeOn P(x) - ensures P(x) && Z(y); + invokeOn P(x, y) + ensures P(x, y) && Z(y); procedure invokePAndZ(x: int, y :real) { - assert P(x) && Z(y) + assert P(x, y) && Z(y) }; "# #guard_msgs (drop info, error) in -#eval testInputWithOffset "InvokeOn" program 14 processLaurelFile +#eval testInputWithOffset "InvokeOn" program 14 + (Strata.Laurel.processLaurelFileWithOptions { Core.VerifyOptions.default with solver := "z3" }) end Strata.Laurel diff --git a/StrataTest/Languages/Laurel/TestExamples.lean b/StrataTest/Languages/Laurel/TestExamples.lean index d5f18f16a..3f16e79f7 100644 --- a/StrataTest/Languages/Laurel/TestExamples.lean +++ b/StrataTest/Languages/Laurel/TestExamples.lean @@ -19,7 +19,7 @@ open Lean.Parser (InputContext) namespace Strata.Laurel -def processLaurelFile (input : InputContext) : IO (Array Diagnostic) := do +def processLaurelFileWithOptions (options : Core.VerifyOptions) (input : InputContext) : IO (Array Diagnostic) := do let dialects := Strata.Elab.LoadedDialects.ofDialects! #[initDialect, Laurel] let strataProgram ← parseStrataProgramFromDialect dialects Laurel.name input @@ -29,8 +29,11 @@ def processLaurelFile (input : InputContext) : IO (Array Diagnostic) := do | .error transErrors => throw (IO.userError s!"Translation errors: {transErrors}") | .ok laurelProgram => let files := Map.insert Map.empty uri input.fileMap - let diagnostics ← Laurel.verifyToDiagnostics files laurelProgram + let diagnostics ← Laurel.verifyToDiagnostics files laurelProgram options pure diagnostics +def processLaurelFile (input : InputContext) : IO (Array Diagnostic) := + processLaurelFileWithOptions Core.VerifyOptions.default input + end Laurel From 173a4abe7bc77cd2d7bc390ccea3eb2b658fd7c9 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Tue, 24 Mar 2026 18:50:55 +0100 Subject: [PATCH 37/79] update test --- .../Examples/Fundamentals/T19_InvokeOn.lean | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean b/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean index 4466111dc..f325067b1 100644 --- a/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean +++ b/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean @@ -30,14 +30,19 @@ procedure axiomDoesNotFireBecauseOfPattern(x: int) { //^^^^^^^^^^^ error: assertion could not be proved }; -function A(x: int, y: real); -function Z(x: real): bool; -procedure PAndZ(x: int, y: real) - invokeOn P(x, y) - ensures P(x, y) && Z(y); - -procedure invokePAndZ(x: int, y :real) { - assert P(x, y) && Z(y) +function A(x: int, y: real): bool; +function B(x: real): bool; +procedure AAndB(x: int, y: real) + invokeOn A(x, y) + ensures A(x, y) && B(y); + +procedure invokeA(x: int, y :real) { + assert A(x, y) +}; + +procedure invokeB(x: int, y :real) { + assert B(y) +//^^^^^^^^^^^ error: assertion could not be proved }; "# From 804281838a84fe7031f01487199b0a2bdf0f72c1 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Tue, 24 Mar 2026 18:58:39 +0100 Subject: [PATCH 38/79] More fixes --- Strata/Languages/Python/PythonToLaurel.lean | 8 ++++---- .../Languages/Python/tests/test_class_with_methods.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Strata/Languages/Python/PythonToLaurel.lean b/Strata/Languages/Python/PythonToLaurel.lean index d37cc2509..592d6ee8e 100644 --- a/Strata/Languages/Python/PythonToLaurel.lean +++ b/Strata/Languages/Python/PythonToLaurel.lean @@ -1487,7 +1487,8 @@ def translateClass (ctx : TranslationContext) (classStmt : Python.stmt SourceRan let mut instanceProcedures : List Procedure := [] for methodStmt in methodStmts do let proc ← translateMethod ctx className methodStmt - instanceProcedures := instanceProcedures ++ [proc] + -- TODO don't replace the body with an empty one + instanceProcedures := instanceProcedures ++ [{ proc with body := .Opaque [] .none [] }] return ({ name := className @@ -1667,9 +1668,8 @@ def pythonToLaurel' (info : PreludeInfo) classFieldHighType := classFieldHighType, filePath := filePath } - let (composite, _instanceProcedures) ← translateClass initCtx stmt - -- TODO uncomment this line and resolve compilation issues - -- procedures := procedures ++ _instanceProcedures + let (composite, instanceProcedures) ← translateClass initCtx stmt + procedures := procedures ++ instanceProcedures compositeTypes := compositeTypes ++ [composite] compositeTypeNames := compositeTypeNames.insert composite.name.text -- Collect field types for Any coercions in field accesses diff --git a/StrataTest/Languages/Python/tests/test_class_with_methods.py b/StrataTest/Languages/Python/tests/test_class_with_methods.py index 65d6cdfe7..9f85e52b2 100644 --- a/StrataTest/Languages/Python/tests/test_class_with_methods.py +++ b/StrataTest/Languages/Python/tests/test_class_with_methods.py @@ -25,7 +25,7 @@ def main(): name: str = store.get_name() assert name == "mystore", "get_name should return mystore" - test_helper.procedure("foo") + test_helper.procedure("foo", opt_name = None) if __name__ == "__main__": main() From 386319519d120a95096f15e1d579641cb0babc11 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Tue, 24 Mar 2026 21:39:01 +0100 Subject: [PATCH 39/79] Enable default values for functions defined in Laurel part of Python prelude --- Strata/Languages/Python/PythonToLaurel.lean | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Strata/Languages/Python/PythonToLaurel.lean b/Strata/Languages/Python/PythonToLaurel.lean index 592d6ee8e..1e9738281 100644 --- a/Strata/Languages/Python/PythonToLaurel.lean +++ b/Strata/Languages/Python/PythonToLaurel.lean @@ -1591,9 +1591,9 @@ def PreludeInfo.ofLaurelProgram (prog : Laurel.Program) : PreludeInfo where prog.staticProcedures.filterMap fun p => if p.body.isExternal then none else - let noDefault : Option (Python.expr SourceRange) := none + let noneexpr : Python.expr SourceRange := .Constant default (.ConNone default) default let args := p.inputs.map fun param => - (param.name.text, getHighTypeName param.type.val, noDefault) + (param.name.text, getHighTypeName param.type.val, some noneexpr) let ret := p.outputs.head?.map fun param => getHighTypeName param.type.val some { name := p.name.text, args := args, hasKwargs := false, ret := ret } functions := From e2f61b4b7a05d3adb5edddcbe73f3849fedcc1da Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Tue, 24 Mar 2026 21:39:11 +0100 Subject: [PATCH 40/79] update expect files --- .../expected_laurel/test_arithmetic.expected | 10 ++++++++-- .../test_augmented_assign.expected | 10 ++++++++-- .../test_boolean_logic.expected | 6 ++++++ .../test_break_continue.expected | 10 ++++++++-- .../expected_laurel/test_class_decl.expected | 10 ++++++++-- .../test_class_field_any.expected | 6 ++++++ .../test_class_field_init.expected | 10 ++++++++-- .../test_class_field_use.expected | 10 ++++++++-- .../test_class_methods.expected | 6 ++++++ .../test_class_with_methods.expected | 6 ++++++ .../expected_laurel/test_comparisons.expected | 10 ++++++++-- .../test_control_flow.expected | 10 ++++++++-- .../expected_laurel/test_datetime.expected | 20 ++++++++++++------- .../test_default_params.expected | 6 ++++++ .../test_dict_operations.expected | 6 ++++++ .../expected_laurel/test_for_loop.expected | 6 ++++++ .../test_function_def_calls.expected | 10 ++++++++-- .../expected_laurel/test_if_elif.expected | 6 ++++++ .../Python/expected_laurel/test_list.expected | 10 ++++++++-- .../expected_laurel/test_list_slice.expected | 6 ++++++ .../expected_laurel/test_loops.expected | 6 ++++++ .../test_missing_models.expected | 12 ++++++++--- .../test_module_level.expected | 6 ++++++ .../test_multi_function.expected | 6 ++++++ .../test_multiple_except.expected | 6 ++++++ .../test_nested_calls.expected | 6 ++++++ .../test_precondition_verification.expected | 12 ++++++++--- .../test_return_types.expected | 6 ++++++ .../expected_laurel/test_strings.expected | 10 ++++++++-- .../test_subscription.expected | 10 ++++++++-- .../expected_laurel/test_try_except.expected | 10 ++++++++-- .../test_try_except_scoping.expected | 10 ++++++++-- .../test_variable_reassign.expected | 6 ++++++ .../expected_laurel/test_while_loop.expected | 6 ++++++ .../test_with_statement.expected | 10 ++++++++-- .../Python/tests/test_class_with_methods.py | 2 +- .../Python/tests/test_missing_models.py | 6 +++--- .../tests/test_precondition_verification.py | 4 ++-- 38 files changed, 259 insertions(+), 49 deletions(-) diff --git a/StrataTest/Languages/Python/expected_laurel/test_arithmetic.expected b/StrataTest/Languages/Python/expected_laurel/test_arithmetic.expected index edb786555..814ca3e8d 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_arithmetic.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_arithmetic.expected @@ -13,17 +13,23 @@ Any_get_body_calls_List_slice_2: ✅ pass Any_get_body_calls_List_drop_3: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_augmented_assign.expected b/StrataTest/Languages/Python/expected_laurel/test_augmented_assign.expected index 7a3d8cb42..3846591cf 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_augmented_assign.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_augmented_assign.expected @@ -13,17 +13,23 @@ Any_get_body_calls_List_slice_2: ✅ pass Any_get_body_calls_List_drop_3: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_boolean_logic.expected b/StrataTest/Languages/Python/expected_laurel/test_boolean_logic.expected index 165201662..9080dbb1f 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_boolean_logic.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_boolean_logic.expected @@ -21,6 +21,12 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_break_continue.expected b/StrataTest/Languages/Python/expected_laurel/test_break_continue.expected index 1b97b1cd3..aec754589 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_break_continue.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_break_continue.expected @@ -13,17 +13,23 @@ Any_get_body_calls_List_slice_2: ✅ pass Any_get_body_calls_List_drop_3: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_decl.expected b/StrataTest/Languages/Python/expected_laurel/test_class_decl.expected index 35e663092..357094777 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_decl.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_decl.expected @@ -13,17 +13,23 @@ Any_get_body_calls_List_slice_2: ✅ pass Any_get_body_calls_List_drop_3: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_field_any.expected b/StrataTest/Languages/Python/expected_laurel/test_class_field_any.expected index 64218f0a9..1401472b0 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_field_any.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_field_any.expected @@ -21,6 +21,12 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_field_init.expected b/StrataTest/Languages/Python/expected_laurel/test_class_field_init.expected index 35e663092..357094777 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_field_init.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_field_init.expected @@ -13,17 +13,23 @@ Any_get_body_calls_List_slice_2: ✅ pass Any_get_body_calls_List_drop_3: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_field_use.expected b/StrataTest/Languages/Python/expected_laurel/test_class_field_use.expected index 1bb4f0174..623d00799 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_field_use.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_field_use.expected @@ -13,17 +13,23 @@ Any_get_body_calls_List_slice_2: ✅ pass Any_get_body_calls_List_drop_3: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_methods.expected b/StrataTest/Languages/Python/expected_laurel/test_class_methods.expected index 2a839e167..0126495e8 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_methods.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_methods.expected @@ -21,6 +21,12 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_with_methods.expected b/StrataTest/Languages/Python/expected_laurel/test_class_with_methods.expected index a98a659e5..ac4c69fda 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_with_methods.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_with_methods.expected @@ -21,6 +21,12 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_comparisons.expected b/StrataTest/Languages/Python/expected_laurel/test_comparisons.expected index 9cccf0ccf..a3555b30e 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_comparisons.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_comparisons.expected @@ -13,17 +13,23 @@ Any_get_body_calls_List_slice_2: ✅ pass Any_get_body_calls_List_drop_3: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_control_flow.expected b/StrataTest/Languages/Python/expected_laurel/test_control_flow.expected index 29f659ec8..ef54efe5d 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_control_flow.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_control_flow.expected @@ -13,17 +13,23 @@ Any_get_body_calls_List_slice_2: ✅ pass Any_get_body_calls_List_drop_3: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_datetime.expected b/StrataTest/Languages/Python/expected_laurel/test_datetime.expected index 4718bf60a..4644f67f0 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_datetime.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_datetime.expected @@ -13,26 +13,32 @@ Any_get_body_calls_List_slice_2: ✅ pass Any_get_body_calls_List_drop_3: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -(Origin_datetime_date_Requires)d_type: ✅ pass (in prelude file) -(Origin_timedelta_Requires)days_type: ✅ pass (in prelude file) -(Origin_timedelta_Requires)hours_type: ✅ pass (in prelude file) -(Origin_timedelta_Requires)days_pos: ✅ pass (in prelude file) -(Origin_timedelta_Requires)hours_pos: ✅ pass (in prelude file) +d_type: ✅ pass (in prelude file) +days_type: ✅ pass (in prelude file) +hours_type: ✅ pass (in prelude file) +days_pos: ✅ pass (in prelude file) +hours_pos: ✅ pass (in prelude file) assert_assert(554)_calls_Any_to_bool_0: ✅ pass (at line 21, col 0) assert(554): ✅ pass (at line 21, col 0) assert_assert(673)_calls_Any_to_bool_0: ✅ pass (at line 25, col 0) diff --git a/StrataTest/Languages/Python/expected_laurel/test_default_params.expected b/StrataTest/Languages/Python/expected_laurel/test_default_params.expected index e494ea9d1..1c5ff5bd4 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_default_params.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_default_params.expected @@ -21,6 +21,12 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_dict_operations.expected b/StrataTest/Languages/Python/expected_laurel/test_dict_operations.expected index d302fbbc9..2397189d0 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_dict_operations.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_dict_operations.expected @@ -21,6 +21,12 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_for_loop.expected b/StrataTest/Languages/Python/expected_laurel/test_for_loop.expected index bbd3aa876..9f32cfeae 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_for_loop.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_for_loop.expected @@ -21,6 +21,12 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_function_def_calls.expected b/StrataTest/Languages/Python/expected_laurel/test_function_def_calls.expected index 99c219a0a..5c3430bd1 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_function_def_calls.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_function_def_calls.expected @@ -13,17 +13,23 @@ Any_get_body_calls_List_slice_2: ✅ pass Any_get_body_calls_List_drop_3: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_if_elif.expected b/StrataTest/Languages/Python/expected_laurel/test_if_elif.expected index 4f691bbed..162502fca 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_if_elif.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_if_elif.expected @@ -21,6 +21,12 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_list.expected b/StrataTest/Languages/Python/expected_laurel/test_list.expected index de4881e6b..1b8390c90 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_list.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_list.expected @@ -13,17 +13,23 @@ Any_get_body_calls_List_slice_2: ✅ pass Any_get_body_calls_List_drop_3: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_list_slice.expected b/StrataTest/Languages/Python/expected_laurel/test_list_slice.expected index 15648b8a2..50c8eb76b 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_list_slice.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_list_slice.expected @@ -21,6 +21,12 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_loops.expected b/StrataTest/Languages/Python/expected_laurel/test_loops.expected index 9b4b314b0..2381d8463 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_loops.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_loops.expected @@ -21,6 +21,12 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected b/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected index a46dbf291..7f1355755 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected @@ -13,22 +13,28 @@ Any_get_body_calls_List_slice_2: ✅ pass Any_get_body_calls_List_drop_3: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -(Origin_test_helper_procedure_Requires)req_name_is_foo: ❓ unknown (in prelude file) +(Origin_test_helper_procedure_Requires)req_name_is_foo: ✅ pass (in prelude file) (Origin_test_helper_procedure_Requires)req_opt_name_none_or_str: ✅ pass (in prelude file) (Origin_test_helper_procedure_Requires)req_opt_name_none_or_bar: ✅ pass (in prelude file) (Origin_test_helper_procedure_Requires)req_name_is_foo: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_module_level.expected b/StrataTest/Languages/Python/expected_laurel/test_module_level.expected index 5844b7397..9fc265da6 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_module_level.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_module_level.expected @@ -21,6 +21,12 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_multi_function.expected b/StrataTest/Languages/Python/expected_laurel/test_multi_function.expected index b371d0cea..5905a7e97 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_multi_function.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_multi_function.expected @@ -21,6 +21,12 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_multiple_except.expected b/StrataTest/Languages/Python/expected_laurel/test_multiple_except.expected index 68a02fcbf..ed14ca1b8 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_multiple_except.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_multiple_except.expected @@ -21,6 +21,12 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_nested_calls.expected b/StrataTest/Languages/Python/expected_laurel/test_nested_calls.expected index 26ab4368d..833ff99fb 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_nested_calls.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_nested_calls.expected @@ -21,6 +21,12 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected b/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected index 5a3d8a39d..c9fd72f5b 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected @@ -13,17 +13,23 @@ Any_get_body_calls_List_slice_2: ✅ pass Any_get_body_calls_List_drop_3: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) @@ -34,7 +40,7 @@ ensures_maybe_except_none: ✅ pass (in prelude file) (Origin_test_helper_procedure_Requires)req_name_is_foo: ✅ pass (in prelude file) (Origin_test_helper_procedure_Requires)req_opt_name_none_or_str: ✅ pass (in prelude file) (Origin_test_helper_procedure_Requires)req_opt_name_none_or_bar: ✅ pass (in prelude file) -(Origin_test_helper_procedure_Requires)req_name_is_foo: ❓ unknown (in prelude file) +(Origin_test_helper_procedure_Requires)req_name_is_foo: ✅ pass (in prelude file) (Origin_test_helper_procedure_Requires)req_opt_name_none_or_str: ✅ pass (in prelude file) (Origin_test_helper_procedure_Requires)req_opt_name_none_or_bar: ✅ pass (in prelude file) (Origin_test_helper_procedure_Requires)req_name_is_foo: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_return_types.expected b/StrataTest/Languages/Python/expected_laurel/test_return_types.expected index 644c5adc7..4813f1796 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_return_types.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_return_types.expected @@ -21,6 +21,12 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_strings.expected b/StrataTest/Languages/Python/expected_laurel/test_strings.expected index 096e58fdd..2c27bdc8d 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_strings.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_strings.expected @@ -13,17 +13,23 @@ Any_get_body_calls_List_slice_2: ✅ pass Any_get_body_calls_List_drop_3: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_subscription.expected b/StrataTest/Languages/Python/expected_laurel/test_subscription.expected index 929218c8d..d31af67b4 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_subscription.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_subscription.expected @@ -13,17 +13,23 @@ Any_get_body_calls_List_slice_2: ✅ pass Any_get_body_calls_List_drop_3: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_try_except.expected b/StrataTest/Languages/Python/expected_laurel/test_try_except.expected index 1f3e9cc8a..0e6698633 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_try_except.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_try_except.expected @@ -13,17 +13,23 @@ Any_get_body_calls_List_slice_2: ✅ pass Any_get_body_calls_List_drop_3: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected b/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected index 39a376bf5..b3f13df20 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected @@ -13,17 +13,23 @@ Any_get_body_calls_List_slice_2: ✅ pass Any_get_body_calls_List_drop_3: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_variable_reassign.expected b/StrataTest/Languages/Python/expected_laurel/test_variable_reassign.expected index aa7f45eb7..7297ac8aa 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_variable_reassign.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_variable_reassign.expected @@ -21,6 +21,12 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_while_loop.expected b/StrataTest/Languages/Python/expected_laurel/test_while_loop.expected index 14ce42f35..c0dd17757 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_while_loop.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_while_loop.expected @@ -21,6 +21,12 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_with_statement.expected b/StrataTest/Languages/Python/expected_laurel/test_with_statement.expected index c96ccc1bc..d64874c13 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_with_statement.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_with_statement.expected @@ -13,17 +13,23 @@ Any_get_body_calls_List_slice_2: ✅ pass Any_get_body_calls_List_drop_3: ✅ pass Any_get!_body_calls_DictStrAny_get_0: ✅ pass Any_get!_body_calls_List_get_1: ✅ pass +Any_set_body_calls_List_set_0: ✅ pass +Any_set!_body_calls_List_set_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) -Any_set_body_calls_List_set_0: ✅ pass -Any_set!_body_calls_List_set_0: ✅ pass assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/tests/test_class_with_methods.py b/StrataTest/Languages/Python/tests/test_class_with_methods.py index 9f85e52b2..65d6cdfe7 100644 --- a/StrataTest/Languages/Python/tests/test_class_with_methods.py +++ b/StrataTest/Languages/Python/tests/test_class_with_methods.py @@ -25,7 +25,7 @@ def main(): name: str = store.get_name() assert name == "mystore", "get_name should return mystore" - test_helper.procedure("foo", opt_name = None) + test_helper.procedure("foo") if __name__ == "__main__": main() diff --git a/StrataTest/Languages/Python/tests/test_missing_models.py b/StrataTest/Languages/Python/tests/test_missing_models.py index e97a5ef8d..4d46be7b5 100644 --- a/StrataTest/Languages/Python/tests/test_missing_models.py +++ b/StrataTest/Languages/Python/tests/test_missing_models.py @@ -6,10 +6,10 @@ try: response: Dict[str, Any] = foo.get_something(Keyword='bar') print(f"Response Bar Baz {response['Bar']['Baz']}") - test_helper.procedure("Foo", opt_name = None) + test_helper.procedure("foo") except foo.exceptions.SomeException: print("Error: SomeException") - test_helper.procedure("Foo", opt_name = None) + test_helper.procedure("foo") except Exception as e: print(f"Error: {e}") - test_helper.procedure("Foo", opt_name = None) \ No newline at end of file + test_helper.procedure("foo") \ No newline at end of file diff --git a/StrataTest/Languages/Python/tests/test_precondition_verification.py b/StrataTest/Languages/Python/tests/test_precondition_verification.py index 6be6b9aa9..d6a90e6f8 100644 --- a/StrataTest/Languages/Python/tests/test_precondition_verification.py +++ b/StrataTest/Languages/Python/tests/test_precondition_verification.py @@ -5,13 +5,13 @@ def main(): # Test minimal precondition verification # Should succeed - test_helper.procedure("foo", opt_name = None) + test_helper.procedure("foo") # Should succeed test_helper.procedure("foo", opt_name = "bar") # Should error - test_helper.procedure("Foo", opt_name = None) + test_helper.procedure("foo") # Should error test_helper.procedure("foo", opt_name = "Bar") From 6e65754d021be00ba8d7666260cd1bc03c5def5d Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Tue, 24 Mar 2026 21:51:53 +0100 Subject: [PATCH 41/79] Update test expectations --- Strata/Languages/Python/PySpecPipeline.lean | 8 +------- Strata/Languages/Python/PythonRuntimeLaurelPart.lean | 10 +++++----- .../Python/expected_laurel/test_datetime.expected | 10 +++++----- .../expected_laurel/test_missing_models.expected | 2 +- .../test_precondition_verification.expected | 2 +- .../Languages/Python/tests/test_function_def_calls.py | 2 +- .../Languages/Python/tests/test_missing_models.py | 6 +++--- .../Python/tests/test_precondition_verification.py | 2 +- 8 files changed, 18 insertions(+), 24 deletions(-) diff --git a/Strata/Languages/Python/PySpecPipeline.lean b/Strata/Languages/Python/PySpecPipeline.lean index a28054e22..798ad5a47 100644 --- a/Strata/Languages/Python/PySpecPipeline.lean +++ b/Strata/Languages/Python/PySpecPipeline.lean @@ -269,13 +269,7 @@ private def prependCorePartOfRuntime (coreFromLaurel : Core.Program) : Core.Prog public def translateCombinedLaurel (combined : Laurel.Program) : (Option Core.Program × List DiagnosticModel) := let (coreOption, errors) := Laurel.translate { inlineFunctionsWhenPossible := true } combined - (coreOption.map (fun core => - let prepended := prependCorePartOfRuntime core - -- dbg_trace "=== Final Core Program ===" - -- dbg_trace (toString (Std.Format.pretty (Strata.Core.formatProgram prepended) 100)) - -- dbg_trace "=================================" - prepended - ), errors) + (coreOption.map prependCorePartOfRuntime, errors) /-- Errors from the pyAnalyzeLaurel pipeline, distinguishing user code errors (detected bugs in Python source) from internal tool errors. -/ diff --git a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean index 77836b2c0..783f825d7 100644 --- a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean +++ b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean @@ -754,7 +754,7 @@ procedure datetime_tostring_cancel(dt: Any) ensures datetime_strptime(to_string_any(dt), from_string ("%Y-%m-%d")) == dt; procedure datetime_date(d: Any) returns (ret: Any, error: Error) - requires Any..isfrom_datetime(d) summary "d_type" + requires Any..isfrom_datetime(d) summary "(Origin_datetime_date_Requires)d_type" ensures Any..isfrom_datetime(ret) && Any..as_datetime!(ret) <= Any..as_datetime!(d) summary "ret_type" { var timedt: int; @@ -778,10 +778,10 @@ procedure datetime_now() returns (ret: Any) }; procedure timedelta(days: Any, hours: Any) returns (delta : Any, maybe_except: Error) - requires Any..isfrom_none(days) || Any..isfrom_int(days) summary "days_type" - requires Any..isfrom_none(hours) || Any..isfrom_int(hours) summary "hours_type" - requires Any..isfrom_int(days) ==> Any..as_int!(days)>=0 summary "days_pos" - requires Any..isfrom_int(hours) ==> Any..as_int!(hours)>=0 summary "hours_pos" + requires Any..isfrom_none(days) || Any..isfrom_int(days) summary "(Origin_timedelta_Requires)" + requires Any..isfrom_none(hours) || Any..isfrom_int(hours) summary "(Origin_timedelta_Requires)hours_type" + requires Any..isfrom_int(days) ==> Any..as_int!(days)>=0 summary "(Origin_timedelta_Requires)days_pos" + requires Any..isfrom_int(hours) ==> Any..as_int!(hours)>=0 summary "(Origin_timedelta_Requires)hours_pos" ensures Any..isfrom_int(delta) && Any..as_int!(delta)>=0 summary "ret_pos" { var days_i : int := 0; diff --git a/StrataTest/Languages/Python/expected_laurel/test_datetime.expected b/StrataTest/Languages/Python/expected_laurel/test_datetime.expected index 4644f67f0..64f56b7ad 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_datetime.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_datetime.expected @@ -34,11 +34,11 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -d_type: ✅ pass (in prelude file) -days_type: ✅ pass (in prelude file) -hours_type: ✅ pass (in prelude file) -days_pos: ✅ pass (in prelude file) -hours_pos: ✅ pass (in prelude file) +(Origin_datetime_date_Requires)d_type: ✅ pass (in prelude file) +(Origin_timedelta_Requires): ✅ pass (in prelude file) +(Origin_timedelta_Requires)hours_type: ✅ pass (in prelude file) +(Origin_timedelta_Requires)days_pos: ✅ pass (in prelude file) +(Origin_timedelta_Requires)hours_pos: ✅ pass (in prelude file) assert_assert(554)_calls_Any_to_bool_0: ✅ pass (at line 21, col 0) assert(554): ✅ pass (at line 21, col 0) assert_assert(673)_calls_Any_to_bool_0: ✅ pass (at line 25, col 0) diff --git a/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected b/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected index 7f1355755..527436d3a 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected @@ -34,7 +34,7 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -(Origin_test_helper_procedure_Requires)req_name_is_foo: ✅ pass (in prelude file) +(Origin_test_helper_procedure_Requires)req_name_is_foo: ❓ unknown (in prelude file) (Origin_test_helper_procedure_Requires)req_opt_name_none_or_str: ✅ pass (in prelude file) (Origin_test_helper_procedure_Requires)req_opt_name_none_or_bar: ✅ pass (in prelude file) (Origin_test_helper_procedure_Requires)req_name_is_foo: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected b/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected index c9fd72f5b..bc1969693 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected @@ -40,7 +40,7 @@ ensures_maybe_except_none: ✅ pass (in prelude file) (Origin_test_helper_procedure_Requires)req_name_is_foo: ✅ pass (in prelude file) (Origin_test_helper_procedure_Requires)req_opt_name_none_or_str: ✅ pass (in prelude file) (Origin_test_helper_procedure_Requires)req_opt_name_none_or_bar: ✅ pass (in prelude file) -(Origin_test_helper_procedure_Requires)req_name_is_foo: ✅ pass (in prelude file) +(Origin_test_helper_procedure_Requires)req_name_is_foo: ❓ unknown (in prelude file) (Origin_test_helper_procedure_Requires)req_opt_name_none_or_str: ✅ pass (in prelude file) (Origin_test_helper_procedure_Requires)req_opt_name_none_or_bar: ✅ pass (in prelude file) (Origin_test_helper_procedure_Requires)req_name_is_foo: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/tests/test_function_def_calls.py b/StrataTest/Languages/Python/tests/test_function_def_calls.py index f03a67fef..31276d736 100644 --- a/StrataTest/Languages/Python/tests/test_function_def_calls.py +++ b/StrataTest/Languages/Python/tests/test_function_def_calls.py @@ -3,7 +3,7 @@ # Test function defs def my_f(s: str): - test_helper.procedure(s, opt_name = None) + test_helper.procedure(s) def main(): my_f("foo") diff --git a/StrataTest/Languages/Python/tests/test_missing_models.py b/StrataTest/Languages/Python/tests/test_missing_models.py index 4d46be7b5..35ea71ff4 100644 --- a/StrataTest/Languages/Python/tests/test_missing_models.py +++ b/StrataTest/Languages/Python/tests/test_missing_models.py @@ -6,10 +6,10 @@ try: response: Dict[str, Any] = foo.get_something(Keyword='bar') print(f"Response Bar Baz {response['Bar']['Baz']}") - test_helper.procedure("foo") + test_helper.procedure("Foo") except foo.exceptions.SomeException: print("Error: SomeException") - test_helper.procedure("foo") + test_helper.procedure("Foo") except Exception as e: print(f"Error: {e}") - test_helper.procedure("foo") \ No newline at end of file + test_helper.procedure("Foo") \ No newline at end of file diff --git a/StrataTest/Languages/Python/tests/test_precondition_verification.py b/StrataTest/Languages/Python/tests/test_precondition_verification.py index d6a90e6f8..f6c4df14b 100644 --- a/StrataTest/Languages/Python/tests/test_precondition_verification.py +++ b/StrataTest/Languages/Python/tests/test_precondition_verification.py @@ -11,7 +11,7 @@ def main(): test_helper.procedure("foo", opt_name = "bar") # Should error - test_helper.procedure("foo") + test_helper.procedure("Foo") # Should error test_helper.procedure("foo", opt_name = "Bar") From 4c16a8794c090916bc5112bb3ff79d26f7fa8b79 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Tue, 24 Mar 2026 23:17:01 +0100 Subject: [PATCH 42/79] update expect files --- .../Python/PythonRuntimeLaurelPart.lean | 20 +++++++++++++++---- .../test_regex_negative.expected | 6 ++++++ .../test_regex_positive.expected | 6 ++++++ 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean index c5c93b92a..7cc4fb5c3 100644 --- a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean +++ b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean @@ -139,6 +139,18 @@ function re_Match_lastindex (self : re_Match) : int; function re_Match_lastgroup (self : re_Match) : string; function re_Match_groups (self : re_Match) : ListStr; +function re_fullmatch_str(s: string): Core regex + external; +function re_match_str(s: string): Core regex + external; +function re_search_str(s: string): Core regex + external; +function re_pattern_error(s: string): Error + external; + +function Str.InRegEx(s: string, r: Core regex): bool external; +function Str.Length(s: string): int external; + // Regex support // // Python signatures: @@ -168,20 +180,20 @@ function re_Match_groups (self : re_Match) : ListStr; // definitions. function re_fullmatch_bool(pattern : string, s : string) : bool { - str.in.re(s, re_fullmatch_str(pattern)) + Str.InRegEx(s, re_fullmatch_str(pattern)) }; function re_match_bool(pattern : string, s : string) : bool { - str.in.re(s, re_match_str(pattern)) + Str.InRegEx(s, re_match_str(pattern)) }; function re_search_bool(pattern : string, s : string) : bool { - str.in.re(s, re_search_str(pattern)) + Str.InRegEx(s, re_search_str(pattern)) }; function mk_re_Match(s : string) : Any { from_ClassInstance("re_Match", DictStrAny_cons("re_match_string", from_string(s), DictStrAny_cons("re_match_pos", from_int(0), - DictStrAny_cons("re_match_endpos", from_int(str.len(s)), + DictStrAny_cons("re_match_endpos", from_int(Str.Length(s)), DictStrAny_empty())))) }; diff --git a/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected b/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected index fd7882d62..dd07f5a30 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected @@ -21,6 +21,12 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected b/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected index 1ee32a6bb..30b58f0d6 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected @@ -21,6 +21,12 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) From 90c238f6a583ddede0b1ca69ecfc14d2c96146cf Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Tue, 24 Mar 2026 23:22:27 +0100 Subject: [PATCH 43/79] Update comment --- .../Python/PythonRuntimeLaurelPart.lean | 56 +++++++++---------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean index 7cc4fb5c3..f972aed86 100644 --- a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean +++ b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean @@ -98,7 +98,7 @@ datatype DictStrAny { } -// Regex support — re.Match +// Regex support — re.Match and re module functions // // Models Python's re.Match as a composite (reference) type following the // module_Class naming convention (re_Match). @@ -109,8 +109,7 @@ datatype DictStrAny { // or from_ClassInstance wrapping a re_Match). If the pipeline ever // moves to concrete types, these should return re_Match | None directly. // -// Fields that can be determined from the call site are set concretely -// in the Core-only prelude. pos and endpos are sound as 0 / str.len +// pos and endpos are sound as 0 / str.len // for the module-level re.match/re.search/re.fullmatch API which does // not accept pos/endpos arguments. If compiled-pattern method calls // with explicit pos/endpos are supported later, those values must be @@ -122,6 +121,31 @@ datatype DictStrAny { // over-approximation: the solver treats them as abstract, so // verification results involving these will be inconclusive rather // than unsound. +// +// Python signatures: +// re.compile(pattern: str) -> re.Pattern +// re.match(pattern: str | re.Pattern, string: str) -> re.Match | None +// re.search(pattern: str | re.Pattern, string: str) -> re.Match | None +// re.fullmatch(pattern: str | re.Pattern, string: str) -> re.Match | None +// +// Architecture: +// +// re.compile is a semantic no-op — it returns the pattern string unchanged. +// The mode-specific factory functions re_fullmatch_str, re_match_str, +// re_search_str each compile a pattern string to a regex with the correct +// MatchMode (via pythonRegexToCore), so anchors (^/$) are handled properly. +// Their concreteEval fires when the pattern is a string literal. +// +// The _bool helpers call the mode-specific factories, so there is a single +// source of truth for mode-specific compilation. +// +// On match, we return a from_ClassInstance wrapping a concrete re_Match +// with pos=0 and endpos=str.len(s), which is sound for the module-level +// API (no pos/endpos parameters). +// +// Mode-specific factory functions are declared via ReFactory (with concreteEval +// for literal pattern expansion), not in this prelude, to avoid duplicate +// definitions. composite re_Match { var re_match_string : string @@ -151,34 +175,8 @@ function re_pattern_error(s: string): Error function Str.InRegEx(s: string, r: Core regex): bool external; function Str.Length(s: string): int external; -// Regex support -// -// Python signatures: -// re.compile(pattern: str) -> re.Pattern -// re.match(pattern: str | re.Pattern, string: str) -> re.Match | None -// re.search(pattern: str | re.Pattern, string: str) -> re.Match | None -// re.fullmatch(pattern: str | re.Pattern, string: str) -> re.Match | None -// -// Architecture: -// -// re.compile is a semantic no-op — it returns the pattern string unchanged. -// The mode-specific factory functions re_fullmatch_str, re_match_str, -// re_search_str each compile a pattern string to a regex with the correct -// MatchMode (via pythonRegexToCore), so anchors (^/$) are handled properly. -// Their concreteEval fires when the pattern is a string literal. -// -// The _bool helpers call the mode-specific factories, so there is a single -// source of truth for mode-specific compilation. -// -// On match, we return a from_ClassInstance wrapping a concrete re_Match -// with pos=0 and endpos=str.len(s), which is sound for the module-level -// API (no pos/endpos parameters). // ///////////////////////////////////////////////////////////////////////////////////// -// Mode-specific factory functions are declared via ReFactory (with concreteEval -// for literal pattern expansion), not in this prelude, to avoid duplicate -// definitions. - function re_fullmatch_bool(pattern : string, s : string) : bool { Str.InRegEx(s, re_fullmatch_str(pattern)) }; From f66fe2b5f31b618e956cf2ef2dfbf6317f7e4c9e Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Wed, 25 Mar 2026 15:15:08 +0100 Subject: [PATCH 44/79] Attempt to support mutual recursion as well --- .../Laurel/LaurelToCoreTranslator.lean | 149 ++++++++++-------- 1 file changed, 87 insertions(+), 62 deletions(-) diff --git a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean index 954d82887..d61ca3194 100644 --- a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean +++ b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean @@ -29,6 +29,7 @@ import Strata.DL.Lambda.LExpr import Strata.Languages.Laurel.LaurelFormat import Strata.Languages.Laurel.ConstrainedTypeElim import Strata.Util.Tactics +import Strata.DDM.Util.Graph.Tarjan open Core (VCResult VCResults VerifyOptions) open Core (intAddOp intSubOp intMulOp intSafeDivOp intSafeModOp intSafeDivTOp intSafeModTOp intNegOp intLtOp intLeOp intGtOp intGeOp boolAndOp boolOrOp boolNotOp boolImpliesOp strConcatOp) @@ -657,7 +658,7 @@ structure LaurelTranslateOptions where Translate a Laurel Procedure to a Core Function (when applicable) using `TranslateM`. Diagnostics for disallowed constructs in the function body are emitted into the monad state. -/ -def translateProcedureToFunction (options: LaurelTranslateOptions) (proc : Procedure) : TranslateM Core.Decl := do +def translateProcedureToFunction (options: LaurelTranslateOptions) (isRecursive: Bool) (proc : Procedure) : TranslateM Core.Decl := do let model := (← get).model let inputs := proc.inputs.map (translateParameterToCore model) let outputTy := match proc.outputs.head? with @@ -668,12 +669,6 @@ def translateProcedureToFunction (options: LaurelTranslateOptions) (proc : Proce let checkExpr ← translateExpr precondition [] true return { expr := checkExpr, md := () }) - -- Check whether the body contains a self-referential StaticCall (i.e. the function is recursive). - let isRecursive := match proc.body with - | .Transparent bodyExpr => isRecursiveExpr model proc bodyExpr.val - | .Opaque _ (some bodyExpr) _ => isRecursiveExpr model proc bodyExpr.val - | _ => false - -- For recursive functions, infer the @[cases] parameter index: the first input -- whose type is a user-defined datatype (has constructors). This is the argument -- the partial evaluator will case-split on to unfold the recursion. @@ -706,12 +701,7 @@ def translateProcedureToFunction (options: LaurelTranslateOptions) (proc : Proce isRecursive := isRecursive attr := attr } - -- Recursive functions must be wrapped in recFuncBlock so the type checker - -- pre-registers the signature before checking the body (enabling self-calls). - if isRecursive then - return .recFuncBlock [f] - else - return .func f + return .func f /-- Translate a Laurel DatatypeDefinition to an `LDatatype Unit`. @@ -805,51 +795,91 @@ def translate (options: LaurelTranslateOptions) (program : Program): TranslateRe translateLaurelToCore (options: LaurelTranslateOptions) (program : Program): TranslateM Core.Program := do let model := (← get).model - -- Procedures marked isFunctional are translated to Core functions; all others become Core procedures. -- External procedures are completely ignored (not translated to Core). let nonExternal := program.staticProcedures.filter (fun p => !p.body.isExternal) - let (markedPure, procProcs) := nonExternal.partition (·.isFunctional) - -- Try to translate each isFunctional procedure to a Core function, collecting errors for failures - let pureFuncDecls ← markedPure.mapM (translateProcedureToFunction options) - - -- Collect invokeOn axioms from non-functional procedures, paired with their - -- function dependencies (StaticCall names in postconditions). - let pendingAxioms : List (Core.Decl × List String) ← - program.staticProcedures.filterMapM (fun proc => do - match proc.invokeOn with - | none => pure none - | some trigger => do - let axDecl? ← translateInvokeOnAxiom proc trigger - return axDecl?.map (fun ax => (ax, invokeOnAxiomDeps proc)) - ) - - -- Build the set of function names defined in pureFuncDecls (in order). - let funcNames : List String := markedPure.map (·.name.text) - - -- Interleave pureFuncDecls with axioms in topological order: - -- after emitting each function, immediately emit any pending axioms whose - -- every function dependency has now been emitted. - let (interleavedFuncAxioms, remainingAxioms) := - funcNames.foldl (fun (acc : List Core.Decl × List (Core.Decl × List String)) - (fname : String) => - let (emitted, pending) := acc - -- Find the function decl for this name - let funcDecl := pureFuncDecls.find? (fun d => d.name.name == fname) - let emitted' := emitted ++ funcDecl.toList - -- Track which names are now defined - let definedSoFar := (emitted'.filterMap (fun d => - match d with | .func f => some f.name.name | .recFuncBlock (f :: _) => some f.name.name | _ => none)) - -- Emit any pending axioms whose deps are all satisfied - let (ready, stillPending) := pending.partition (fun (_, deps) => - deps.all (fun dep => !funcNames.contains dep || definedSoFar.contains dep)) - (emitted' ++ ready.map (·.1), stillPending)) - ([], pendingAxioms) - -- Append any axioms that had no function deps (or deps outside pureFuncDecls) - let funcAndAxiomDecls := interleavedFuncAxioms ++ remainingAxioms.map (·.1) - -- Translate procedures using the monad, collecting diagnostics from the final state. - let procDecls ← procProcs.mapM (fun proc => do - let coreProc ← translateProcedure proc - return Core.Decl.proc coreProc .empty) + + -- Build a call-graph over all non-external procedures. + -- An edge proc → callee means proc's body/contracts contain a StaticCall to callee. + let nonExternalArr : Array Procedure := nonExternal.toArray + let nameToIdx : Std.HashMap String Nat := + nonExternalArr.foldl (fun (acc : Std.HashMap String Nat × Nat) proc => + (acc.1.insert proc.name.text acc.2, acc.2 + 1)) ({}, 0) |>.1 + + -- Collect all callee names from a procedure's body and contracts. + let procCallees (proc : Procedure) : List String := + let bodyExprs : List StmtExpr := match proc.body with + | .Transparent b => [b.val] + | .Opaque postconds (some impl) _ => postconds.map (·.val) ++ [impl.val] + | .Opaque postconds none _ => postconds.map (·.val) + | _ => [] + let contractExprs : List StmtExpr := + proc.preconditions.map (·.val) ++ + proc.invokeOn.toList.map (·.val) + (bodyExprs ++ contractExprs).flatMap collectStaticCallNames + + -- Build the OutGraph for Tarjan. + let n := nonExternalArr.size + let graph : Strata.OutGraph n := + nonExternalArr.foldl (fun (acc : Strata.OutGraph n × Nat) proc => + let callerIdx := acc.2 + let g := acc.1 + let callees := procCallees proc + let g' := callees.foldl (fun g callee => + match nameToIdx.get? callee with + | some calleeIdx => g.addEdge! callerIdx calleeIdx + | none => g) g + (g', callerIdx + 1)) (Strata.OutGraph.empty n, 0) |>.1 + + -- Run Tarjan's SCC algorithm. Results are in reverse topological order + -- (a node appears after all nodes that have paths to it). + let sccs := Strata.OutGraph.tarjan graph + + -- For each SCC, determine if it is purely functional or contains procedures. + -- Procedures can't call functions (only functions can call functions), so an SCC + -- either contains only functional procedures or only non-functional procedures. + let sccDecls ← sccs.toList.mapM fun scc => do + let procs := scc.toList.filterMap fun idx => + nonExternalArr[idx.val]? + let isFuncSCC := procs.all (·.isFunctional) + if isFuncSCC then + -- Translate all as Core functions. + -- An SCC is recursive if it has >1 member, or if the single node has a self-edge. + let isRecursive := procs.length > 1 || + (match scc.toList.head? with + | some node => (graph.nodesOut node).contains node + | none => false) + + -- A single-element SCC → .func; multi-element SCC → .recFuncBlock. + let funcs ← procs.mapM (translateProcedureToFunction options isRecursive ) + if procs.length > 1 then + -- Collect all Core.Function values from the translated decls. + let coreFuncs := funcs.filterMap (fun d => match d with + | .func f => some f + | _ => none) + return [Core.Decl.recFuncBlock coreFuncs] + else + return funcs + else + -- Non-functional SCC: emit invokeOn axiom (if any) after each procedure. + -- So it can not be used to prove the procedure + procs.flatMapM fun proc => do + let axiomDecls : List Core.Decl ← match proc.invokeOn with + | none => pure [] + | some trigger => do + let axDecl? ← translateInvokeOnAxiom proc trigger + return axDecl?.toList + let procDecl ← translateProcedure proc + return [Core.Decl.proc procDecl .empty] ++ axiomDecls + + -- Topological sort: tarjan already gives reverse-topological order (dependencies first). + -- We additionally want procedure SCCs to come before function SCCs at the same level, + -- so that invokeOn axioms (which reference functions) are placed after the functions + -- they depend on. Since tarjan output is already dependency-first, we just stable-sort + -- to move procedure-containing SCCs before function-only SCCs within the same position. + -- The tarjan output is already correct topological order; we emit it as-is since + -- procedure SCCs naturally depend on function SCCs (functions are called by procedures), + -- so functions will already appear before procedures in the tarjan output. + let orderedDecls := sccDecls.flatten -- Translate Laurel constants to Core function declarations (0-ary functions) let constantDecls ← program.constants.mapM fun c => do @@ -863,15 +893,10 @@ def translate (options: LaurelTranslateOptions) (program : Program): TranslateRe body := body } - -- Collect ALL errors from both functions, procedures, and resolution before deciding whether to fail - -- let allErrors :=pureErrors ++ procDiags ++ constantsState.diagnostics - -- if !allErrors.isEmpty then - -- .error allErrors.toArray - -- Translate Laurel datatype definitions to Core declarations. let groupedDatatypeDecls ← translateTypes program model let program := { - decls := groupedDatatypeDecls ++ constantDecls ++ funcAndAxiomDecls ++ procDecls + decls := groupedDatatypeDecls ++ constantDecls ++ orderedDecls } -- dbg_trace "=== Generated Strata Core Program ===" From 4d6f8ded7d2a1ea2b608a7d245d3979ba5189afb Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Wed, 25 Mar 2026 15:31:55 +0100 Subject: [PATCH 45/79] Fixes --- Strata/Languages/Laurel/LaurelToCoreTranslator.lean | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean index d61ca3194..65042b416 100644 --- a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean +++ b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean @@ -826,7 +826,7 @@ def translate (options: LaurelTranslateOptions) (program : Program): TranslateRe let callees := procCallees proc let g' := callees.foldl (fun g callee => match nameToIdx.get? callee with - | some calleeIdx => g.addEdge! callerIdx calleeIdx + | some calleeIdx => g.addEdge! calleeIdx callerIdx | none => g) g (g', callerIdx + 1)) (Strata.OutGraph.empty n, 0) |>.1 @@ -849,10 +849,10 @@ def translate (options: LaurelTranslateOptions) (program : Program): TranslateRe | some node => (graph.nodesOut node).contains node | none => false) - -- A single-element SCC → .func; multi-element SCC → .recFuncBlock. - let funcs ← procs.mapM (translateProcedureToFunction options isRecursive ) - if procs.length > 1 then - -- Collect all Core.Function values from the translated decls. + -- A single-element SCC → .func (or .recFuncBlock if recursive); multi-element SCC → .recFuncBlock. + let funcs ← procs.mapM (translateProcedureToFunction options isRecursive) + if isRecursive then + -- Wrap all recursive functions (single self-recursive or mutual) in recFuncBlock. let coreFuncs := funcs.filterMap (fun d => match d with | .func f => some f | _ => none) From 03c0748034fd325867c6b82cd33a36277ccfda61 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Wed, 25 Mar 2026 15:34:48 +0100 Subject: [PATCH 46/79] Add mutual recursion and badPostcondition test-cases --- .../Fundamentals/T18_RecursiveFunction.lean | 16 ++++++++++++++++ .../Examples/Fundamentals/T19_InvokeOn.lean | 8 ++++++++ 2 files changed, 24 insertions(+) diff --git a/StrataTest/Languages/Laurel/Examples/Fundamentals/T18_RecursiveFunction.lean b/StrataTest/Languages/Laurel/Examples/Fundamentals/T18_RecursiveFunction.lean index 4a60bda44..a0325e7c1 100644 --- a/StrataTest/Languages/Laurel/Examples/Fundamentals/T18_RecursiveFunction.lean +++ b/StrataTest/Languages/Laurel/Examples/Fundamentals/T18_RecursiveFunction.lean @@ -31,6 +31,22 @@ procedure testListLen() { var xs: IntList := Cons(1, Cons(2, Nil())); assert listLen(xs) == 2 }; + +// Mutual recursion +function listLenEven(xs: IntList): bool { + if IntList..isNil(xs) then true + else listLenOdd(IntList..tail!(xs)) +}; + +function listLenOdd(xs: IntList): bool { + if IntList..isNil(xs) then false + else listLenEven(IntList..tail!(xs)) +}; + +procedure testMutualRecursion() { + var xs: IntList := Cons(1, Cons(2, Nil())); + assert listLenEven(xs) == true +}; " #guard_msgs (drop info, error) in diff --git a/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean b/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean index f325067b1..038fbf3e7 100644 --- a/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean +++ b/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean @@ -45,6 +45,14 @@ procedure invokeB(x: int, y :real) { //^^^^^^^^^^^ error: assertion could not be proved }; + +procedure badPostcondition(x: int) + invokeOn P(x) + ensures P(x) +{ + assert false +}; + "# #guard_msgs (drop info, error) in From e44d3e1f62917ec58d1005d5822f3c3cfd7b1585 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Wed, 25 Mar 2026 16:04:44 +0100 Subject: [PATCH 47/79] Fix --- Strata/Languages/Laurel/LaurelToCoreTranslator.lean | 6 +++--- .../Laurel/Examples/Fundamentals/T19_InvokeOn.lean | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean index 65042b416..ab687c2e4 100644 --- a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean +++ b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean @@ -860,14 +860,14 @@ def translate (options: LaurelTranslateOptions) (program : Program): TranslateRe else return funcs else - -- Non-functional SCC: emit invokeOn axiom (if any) after each procedure. - -- So it can not be used to prove the procedure + -- Non-functional SCC: emit invokeOn axiom (if any) before each procedure, + -- so the axiom is in scope when the procedure's VCs are checked. procs.flatMapM fun proc => do let axiomDecls : List Core.Decl ← match proc.invokeOn with | none => pure [] | some trigger => do let axDecl? ← translateInvokeOnAxiom proc trigger - return axDecl?.toList + pure axDecl?.toList let procDecl ← translateProcedure proc return [Core.Decl.proc procDecl .empty] ++ axiomDecls diff --git a/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean b/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean index 038fbf3e7..d77493d6e 100644 --- a/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean +++ b/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean @@ -45,12 +45,12 @@ procedure invokeB(x: int, y :real) { //^^^^^^^^^^^ error: assertion could not be proved }; - +function R(x: int): bool; procedure badPostcondition(x: int) - invokeOn P(x) - ensures P(x) + invokeOn R(x) + ensures R(x) +// ^^^^ error: assertion does not hold { - assert false }; "# From 401bb37afe1676ff7a3e4f8406050e05dde7a002 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Wed, 25 Mar 2026 16:14:52 +0100 Subject: [PATCH 48/79] Update expect files --- .../Python/expected_laurel/test_arithmetic.expected | 10 +++++----- .../expected_laurel/test_augmented_assign.expected | 10 +++++----- .../Python/expected_laurel/test_boolean_logic.expected | 10 +++++----- .../expected_laurel/test_break_continue.expected | 10 +++++----- .../Python/expected_laurel/test_class_decl.expected | 10 +++++----- .../expected_laurel/test_class_field_any.expected | 10 +++++----- .../expected_laurel/test_class_field_init.expected | 10 +++++----- .../expected_laurel/test_class_field_use.expected | 10 +++++----- .../Python/expected_laurel/test_class_methods.expected | 10 +++++----- .../expected_laurel/test_class_with_methods.expected | 10 +++++----- .../Python/expected_laurel/test_comparisons.expected | 10 +++++----- .../Python/expected_laurel/test_control_flow.expected | 10 +++++----- .../Python/expected_laurel/test_datetime.expected | 10 +++++----- .../expected_laurel/test_default_params.expected | 10 +++++----- .../expected_laurel/test_dict_operations.expected | 10 +++++----- .../Python/expected_laurel/test_for_loop.expected | 10 +++++----- .../expected_laurel/test_function_def_calls.expected | 10 +++++----- .../Python/expected_laurel/test_if_elif.expected | 10 +++++----- .../Python/expected_laurel/test_list.expected | 10 +++++----- .../Python/expected_laurel/test_list_slice.expected | 10 +++++----- .../Python/expected_laurel/test_loops.expected | 10 +++++----- .../expected_laurel/test_missing_models.expected | 10 +++++----- .../Python/expected_laurel/test_module_level.expected | 10 +++++----- .../expected_laurel/test_multi_function.expected | 10 +++++----- .../expected_laurel/test_multiple_except.expected | 10 +++++----- .../Python/expected_laurel/test_nested_calls.expected | 10 +++++----- .../test_precondition_verification.expected | 10 +++++----- .../expected_laurel/test_regex_negative.expected | 10 +++++----- .../expected_laurel/test_regex_positive.expected | 10 +++++----- .../Python/expected_laurel/test_return_types.expected | 10 +++++----- .../Python/expected_laurel/test_strings.expected | 10 +++++----- .../Python/expected_laurel/test_subscription.expected | 10 +++++----- .../Python/expected_laurel/test_try_except.expected | 10 +++++----- .../expected_laurel/test_try_except_scoping.expected | 10 +++++----- .../expected_laurel/test_variable_reassign.expected | 10 +++++----- .../Python/expected_laurel/test_while_loop.expected | 10 +++++----- .../expected_laurel/test_with_statement.expected | 10 +++++----- 37 files changed, 185 insertions(+), 185 deletions(-) diff --git a/StrataTest/Languages/Python/expected_laurel/test_arithmetic.expected b/StrataTest/Languages/Python/expected_laurel/test_arithmetic.expected index 814ca3e8d..4b2cccb76 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_arithmetic.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_arithmetic.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_augmented_assign.expected b/StrataTest/Languages/Python/expected_laurel/test_augmented_assign.expected index 3846591cf..701b7816f 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_augmented_assign.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_augmented_assign.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_boolean_logic.expected b/StrataTest/Languages/Python/expected_laurel/test_boolean_logic.expected index 9080dbb1f..c8affd826 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_boolean_logic.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_boolean_logic.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_break_continue.expected b/StrataTest/Languages/Python/expected_laurel/test_break_continue.expected index aec754589..09748e1a8 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_break_continue.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_break_continue.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_decl.expected b/StrataTest/Languages/Python/expected_laurel/test_class_decl.expected index 357094777..19326455b 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_decl.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_decl.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_field_any.expected b/StrataTest/Languages/Python/expected_laurel/test_class_field_any.expected index 1401472b0..9982f30c9 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_field_any.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_field_any.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_field_init.expected b/StrataTest/Languages/Python/expected_laurel/test_class_field_init.expected index 357094777..19326455b 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_field_init.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_field_init.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_field_use.expected b/StrataTest/Languages/Python/expected_laurel/test_class_field_use.expected index 623d00799..a7dbc1dc7 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_field_use.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_field_use.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_methods.expected b/StrataTest/Languages/Python/expected_laurel/test_class_methods.expected index 0126495e8..d66815d25 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_methods.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_methods.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_with_methods.expected b/StrataTest/Languages/Python/expected_laurel/test_class_with_methods.expected index ac4c69fda..721b11de1 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_with_methods.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_with_methods.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_comparisons.expected b/StrataTest/Languages/Python/expected_laurel/test_comparisons.expected index a3555b30e..e3443a20d 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_comparisons.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_comparisons.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_control_flow.expected b/StrataTest/Languages/Python/expected_laurel/test_control_flow.expected index ef54efe5d..b1ad11a2a 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_control_flow.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_control_flow.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_datetime.expected b/StrataTest/Languages/Python/expected_laurel/test_datetime.expected index ae9b03eca..2f8037fb6 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_datetime.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_datetime.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_default_params.expected b/StrataTest/Languages/Python/expected_laurel/test_default_params.expected index 1c5ff5bd4..fbb9af0b1 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_default_params.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_default_params.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_dict_operations.expected b/StrataTest/Languages/Python/expected_laurel/test_dict_operations.expected index 2397189d0..e775104f7 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_dict_operations.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_dict_operations.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_for_loop.expected b/StrataTest/Languages/Python/expected_laurel/test_for_loop.expected index 9f32cfeae..005292c3c 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_for_loop.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_for_loop.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_function_def_calls.expected b/StrataTest/Languages/Python/expected_laurel/test_function_def_calls.expected index 5c3430bd1..092d073d4 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_function_def_calls.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_function_def_calls.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_if_elif.expected b/StrataTest/Languages/Python/expected_laurel/test_if_elif.expected index 162502fca..cb568ae65 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_if_elif.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_if_elif.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_list.expected b/StrataTest/Languages/Python/expected_laurel/test_list.expected index 1b8390c90..8268c2837 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_list.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_list.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_list_slice.expected b/StrataTest/Languages/Python/expected_laurel/test_list_slice.expected index 50c8eb76b..e71b463c1 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_list_slice.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_list_slice.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_loops.expected b/StrataTest/Languages/Python/expected_laurel/test_loops.expected index 2381d8463..df1f034ea 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_loops.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_loops.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected b/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected index 527436d3a..56ae4a944 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_module_level.expected b/StrataTest/Languages/Python/expected_laurel/test_module_level.expected index 9fc265da6..88cb84f0b 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_module_level.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_module_level.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_multi_function.expected b/StrataTest/Languages/Python/expected_laurel/test_multi_function.expected index 5905a7e97..314ac97b5 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_multi_function.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_multi_function.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_multiple_except.expected b/StrataTest/Languages/Python/expected_laurel/test_multiple_except.expected index ed14ca1b8..c77ee5add 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_multiple_except.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_multiple_except.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_nested_calls.expected b/StrataTest/Languages/Python/expected_laurel/test_nested_calls.expected index 833ff99fb..8d554d6a7 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_nested_calls.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_nested_calls.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected b/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected index bc1969693..8052e1251 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected b/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected index dd07f5a30..79c26a296 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected b/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected index 30b58f0d6..81fddbd25 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_return_types.expected b/StrataTest/Languages/Python/expected_laurel/test_return_types.expected index 4813f1796..8e81c4a48 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_return_types.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_return_types.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_strings.expected b/StrataTest/Languages/Python/expected_laurel/test_strings.expected index 2c27bdc8d..2869f060b 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_strings.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_strings.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_subscription.expected b/StrataTest/Languages/Python/expected_laurel/test_subscription.expected index d31af67b4..414e99e33 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_subscription.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_subscription.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_try_except.expected b/StrataTest/Languages/Python/expected_laurel/test_try_except.expected index 0e6698633..521b6ac37 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_try_except.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_try_except.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected b/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected index b3f13df20..0ad078cee 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_variable_reassign.expected b/StrataTest/Languages/Python/expected_laurel/test_variable_reassign.expected index 7297ac8aa..d8a29d2c6 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_variable_reassign.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_variable_reassign.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_while_loop.expected b/StrataTest/Languages/Python/expected_laurel/test_while_loop.expected index c0dd17757..fa717d10a 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_while_loop.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_while_loop.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_with_statement.expected b/StrataTest/Languages/Python/expected_laurel/test_with_statement.expected index d64874c13..e35c8bb7f 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_with_statement.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_with_statement.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -22,11 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) From 216ad13eb6a06395ad1d269f7390db90656a511a Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Wed, 25 Mar 2026 16:38:41 +0100 Subject: [PATCH 49/79] Update expect files --- .../Languages/Python/expected_laurel/test_ifexpr.expected | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/StrataTest/Languages/Python/expected_laurel/test_ifexpr.expected b/StrataTest/Languages/Python/expected_laurel/test_ifexpr.expected index b51d81161..e652428fe 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_ifexpr.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_ifexpr.expected @@ -1,8 +1,13 @@ ==== Verification Results ==== +postcondition: ✅ pass (in prelude file) List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass List_slice_body_calls_List_take_1: ✅ pass List_set_body_calls_List_set_0: ✅ pass @@ -21,6 +26,7 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass PAnd_body_calls_Any_to_bool_0: ✅ pass POr_body_calls_Any_to_bool_0: ✅ pass +postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) From 1821191b1c3e3a6b44e1cfe5d51fe0b77e91ef7f Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Wed, 25 Mar 2026 16:53:06 +0100 Subject: [PATCH 50/79] Cleanup --- .../Laurel/LaurelToCoreTranslator.lean | 46 +------------------ Strata/Languages/Python/PySpecPipeline.lean | 6 +-- .../Python/PythonLaurelCorePrelude.lean | 1 - 3 files changed, 5 insertions(+), 48 deletions(-) diff --git a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean index ab687c2e4..77896ab38 100644 --- a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean +++ b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean @@ -571,16 +571,6 @@ partial def collectStaticCallNames (expr : StmtExpr) : List String := | .Assigned v => collectStaticCallNames v.val | _ => [] -/-- -Collect the function names that an invokeOn axiom (from `proc`) depends on. -These are the `StaticCall` names appearing in the procedure's postconditions. --/ -def invokeOnAxiomDeps (proc : Procedure) : List String := - match proc.body with - | .Opaque postconds _ _ => - (postconds.flatMap (fun pc => collectStaticCallNames pc.val)).eraseDups - | _ => [] - def translateInvokeOnAxiom (proc : Procedure) (trigger : StmtExprMd) : TranslateM (Option Core.Decl) := do let model := (← get).model @@ -618,38 +608,6 @@ where LExpr.all () p.name.text (some (translateType model p.type)) (buildQuants model rest body trigger) -partial def isRecursiveExpr (model: SemanticModel) (proc: Procedure) (expr : StmtExpr) : Bool := match expr with - | .StaticCall callee args => - -- Compare by text name: the callee's uniqueId in the body may differ from the - -- declaration's uniqueId (they are resolved separately), so text comparison is correct. - callee.text == proc.name.text || args.any (fun a => isRecursiveExpr model proc a.val) - | .IfThenElse cond thenBr elseBr => - isRecursiveExpr model proc cond.val || isRecursiveExpr model proc thenBr.val || (elseBr.any (fun e => isRecursiveExpr model proc e.val)) - | .Block stmts _ => stmts.any (fun s => isRecursiveExpr model proc s.val) - | .LocalVariable _ _ init => init.any (fun i => isRecursiveExpr model proc i.val) - | .While cond invs dec body => - isRecursiveExpr model proc cond.val || invs.any (fun i => isRecursiveExpr model proc i.val) || - dec.any (fun d => isRecursiveExpr model proc d.val) || isRecursiveExpr model proc body.val - | .Return val => val.any (fun v => isRecursiveExpr model proc v.val) - | .Assign targets value => targets.any (fun t => isRecursiveExpr model proc t.val) || isRecursiveExpr model proc value.val - | .FieldSelect target _ => isRecursiveExpr model proc target.val - | .PureFieldUpdate target _ newVal => isRecursiveExpr model proc target.val || isRecursiveExpr model proc newVal.val - | .PrimitiveOp _ args => args.any (fun a => isRecursiveExpr model proc a.val) - | .ReferenceEquals lhs rhs => isRecursiveExpr model proc lhs.val || isRecursiveExpr model proc rhs.val - | .AsType target _ => isRecursiveExpr model proc target.val - | .IsType target _ => isRecursiveExpr model proc target.val - | .InstanceCall target _ args => isRecursiveExpr model proc target.val || args.any (fun a => isRecursiveExpr model proc a.val) - | .Forall _ trigger body => trigger.any (fun t => isRecursiveExpr model proc t.val) || isRecursiveExpr model proc body.val - | .Exists _ trigger body => trigger.any (fun t => isRecursiveExpr model proc t.val) || isRecursiveExpr model proc body.val - | .Assigned name => isRecursiveExpr model proc name.val - | .Old val => isRecursiveExpr model proc val.val - | .Fresh val => isRecursiveExpr model proc val.val - | .Assert cond => isRecursiveExpr model proc cond.val - | .Assume cond => isRecursiveExpr model proc cond.val - | .ProveBy value proof => isRecursiveExpr model proc value.val || isRecursiveExpr model proc proof.val - | .ContractOf _ fn => isRecursiveExpr model proc fn.val - | _ => false - structure LaurelTranslateOptions where emitResolutionErrors : Bool := true inlineFunctionsWhenPossible : Bool := false @@ -860,8 +818,8 @@ def translate (options: LaurelTranslateOptions) (program : Program): TranslateRe else return funcs else - -- Non-functional SCC: emit invokeOn axiom (if any) before each procedure, - -- so the axiom is in scope when the procedure's VCs are checked. + -- Non-functional SCC: emit invokeOn axiom (if any) after each procedure, + -- so the axiom is not in scope when the procedure's VCs are checked. procs.flatMapM fun proc => do let axiomDecls : List Core.Decl ← match proc.invokeOn with | none => pure [] diff --git a/Strata/Languages/Python/PySpecPipeline.lean b/Strata/Languages/Python/PySpecPipeline.lean index 3868dc255..ba9e50cd8 100644 --- a/Strata/Languages/Python/PySpecPipeline.lean +++ b/Strata/Languages/Python/PySpecPipeline.lean @@ -236,10 +236,10 @@ public def combinePySpecLaurel constants := pySpec.constants ++ user.constants } -/-- Prepend the Core part of the Python runtime (datatype definitions, +/-- Append the Core part of the Python runtime (datatype definitions, procedure bodies, etc.) to the Core program produced by Laurel translation. -/ -private def prependCorePartOfRuntime (coreFromLaurel : Core.Program) : Core.Program := +private def appendCorePartOfRuntime (coreFromLaurel : Core.Program) : Core.Program := { decls := coreFromLaurel.decls ++ Python.coreOnlyFromRuntimeCorePart } /-- Translate a combined Laurel program to Core and prepend the full @@ -252,7 +252,7 @@ private def prependCorePartOfRuntime (coreFromLaurel : Core.Program) : Core.Prog public def translateCombinedLaurel (combined : Laurel.Program) : (Option Core.Program × List DiagnosticModel) := let (coreOption, errors) := Laurel.translate { inlineFunctionsWhenPossible := true } combined - (coreOption.map prependCorePartOfRuntime, errors) + (coreOption.map appendCorePartOfRuntime, errors) /-- Errors from the pyAnalyzeLaurel pipeline, distinguishing user code errors (detected bugs in Python source) from internal tool errors. -/ diff --git a/Strata/Languages/Python/PythonLaurelCorePrelude.lean b/Strata/Languages/Python/PythonLaurelCorePrelude.lean index c33aab9f1..18f6fd5d7 100644 --- a/Strata/Languages/Python/PythonLaurelCorePrelude.lean +++ b/Strata/Languages/Python/PythonLaurelCorePrelude.lean @@ -5,7 +5,6 @@ -/ module --- TODO: rename file to PythonLaurelCorePrelude import Strata.DDM.Elab import Strata.DDM.AST import Strata.Languages.Core.DDMTransform.Grammar From 60fb71bf2806ecf97b22f55a10bc8cabee73efa9 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 27 Mar 2026 10:29:35 +0100 Subject: [PATCH 51/79] Small tweak --- .../Laurel/Grammar/ConcreteToAbstractTreeTranslator.lean | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Strata/Languages/Laurel/Grammar/ConcreteToAbstractTreeTranslator.lean b/Strata/Languages/Laurel/Grammar/ConcreteToAbstractTreeTranslator.lean index d915bfad5..fbd42e8b0 100644 --- a/Strata/Languages/Laurel/Grammar/ConcreteToAbstractTreeTranslator.lean +++ b/Strata/Languages/Laurel/Grammar/ConcreteToAbstractTreeTranslator.lean @@ -77,7 +77,7 @@ def translateBool (arg : Arg) : TransM Bool := do | x => TransM.error s!"translateBool expects expression or operation, got {repr x}" instance : Inhabited Parameter where - default := { name := "" , type := ⟨.TVoid, #[]⟩ } + default := { name := "" , type := ⟨.Unknown, #[]⟩ } def mkHighTypeMd (t : HighType) (md : MetaData) : HighTypeMd := ⟨t, md⟩ def mkStmtExprMd (e : StmtExpr) (md : MetaData) : StmtExprMd := ⟨e, md⟩ From a6db3f36bc6f607cf1714610cf09277d9b69552e Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 27 Mar 2026 11:07:49 +0100 Subject: [PATCH 52/79] Fix --- Strata/Languages/Python/PythonRuntimeLaurelPart.lean | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean index cf2ce8946..35fafbbee 100644 --- a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean +++ b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean @@ -316,8 +316,8 @@ function Any_to_bool (v: Any) : bool if (Any..isfrom_none(v)) then false else if (Any..isfrom_string(v)) then !(Any..as_string!(v) == "") else if (Any..isfrom_int(v)) then !(Any..as_int!(v) == 0) else - if (Any..isfrom_Dict(v)) then !(Any..as_Dict!(v) == DictStrAny_empty) else - if (Any..isfrom_ListAny(v)) then !(Any..as_ListAny!(v) == ListAny_nil) else + if (Any..isfrom_Dict(v)) then !(Any..as_Dict!(v) == DictStrAny_empty()) else + if (Any..isfrom_ListAny(v)) then !(Any..as_ListAny!(v) == ListAny_nil()) else false //WILL BE ADDED }; From 9a17a20268360896555c419ced44e1af3d6ff019 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 27 Mar 2026 11:39:13 +0100 Subject: [PATCH 53/79] Fix --- Strata/DDM/Format.lean | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Strata/DDM/Format.lean b/Strata/DDM/Format.lean index 26a58af21..b3e590d5a 100644 --- a/Strata/DDM/Format.lean +++ b/Strata/DDM/Format.lean @@ -30,9 +30,12 @@ Check if a character is valid for continuing a regular identifier. Includes @ and $ which are valid in SMT-LIB 2.6 simple symbols and used by the encoder for disambiguated names (e.g. x@1) and generated names (e.g. $__bv0). +Note: `'` (apostrophe) is intentionally excluded. Although SMT-LIB 2.6 allows +it in simple symbols, both cvc5 and Z3 reject it as an unquoted character. +Names containing `'` (e.g. Lean's `v'`) will be pipe-quoted instead. -/ private def isIdContinue (c : Char) : Bool := - c.isAlphanum || c == '_' || c == '\'' || c == '.' || c == '?' || c == '!' || c == '@' || c == '$' + c.isAlphanum || c == '_' || c == '.' || c == '?' || c == '!' || c == '@' || c == '$' /-- Check if a string needs pipe delimiters when formatted as an identifier. From 26fdd579ad127604ca63c0105b9713f74413fcb9 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 27 Mar 2026 11:41:15 +0100 Subject: [PATCH 54/79] Update expect files --- .../expected_laurel/test_arithmetic.expected | 14 +- .../test_augmented_assign.expected | 14 +- .../test_boolean_logic.expected | 14 +- .../test_break_continue.expected | 14 +- .../expected_laurel/test_class_decl.expected | 15 +- .../test_class_field_any.expected | 15 +- .../test_class_field_init.expected | 15 +- .../test_class_field_use.expected | 16 +- .../test_class_methods.expected | 40 +- .../test_class_with_methods.expected | 40 +- .../expected_laurel/test_comparisons.expected | 14 +- .../test_control_flow.expected | 14 +- .../expected_laurel/test_datetime.expected | 41 +- .../test_default_params.expected | 14 +- .../test_dict_operations.expected | 14 +- .../expected_laurel/test_for_loop.expected | 16 +- .../test_function_def_calls.expected | 38 +- .../expected_laurel/test_if_elif.expected | 16 +- .../expected_laurel/test_ifexpr.expected | 14 +- .../Python/expected_laurel/test_list.expected | 14 +- .../expected_laurel/test_list_slice.expected | 14 +- .../expected_laurel/test_loops.expected | 19 +- .../test_missing_models.expected | 62 ++- .../test_module_level.expected | 14 +- .../test_multi_function.expected | 38 +- .../test_multiple_except.expected | 26 +- .../test_nested_calls.expected | 14 +- .../expected_laurel/test_pin_any.expected | 27 +- .../test_precondition_verification.expected | 56 ++- .../test_regex_negative.expected | 97 +--- .../test_regex_positive.expected | 476 +----------------- .../test_return_types.expected | 14 +- .../expected_laurel/test_strings.expected | 14 +- .../test_subscription.expected | 14 +- .../expected_laurel/test_try_except.expected | 20 +- .../test_try_except_scoping.expected | 38 +- .../test_variable_reassign.expected | 17 +- .../expected_laurel/test_while_loop.expected | 21 +- .../test_with_statement.expected | 26 +- 39 files changed, 304 insertions(+), 1095 deletions(-) diff --git a/StrataTest/Languages/Python/expected_laurel/test_arithmetic.expected b/StrataTest/Languages/Python/expected_laurel/test_arithmetic.expected index cd6687793..7d4ed3d17 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_arithmetic.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_arithmetic.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,8 +35,6 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -======= ->>>>>>> origin/main assert_assert(102)_calls_Any_to_bool_0: ✅ pass (at line 7, col 4) assert(102): ✅ pass (at line 7, col 4) assert_assert(226)_calls_Any_to_bool_0: ✅ pass (at line 12, col 4) @@ -56,9 +48,5 @@ assert_assert(567)_calls_Any_to_bool_0: ✅ pass (at line 24, col 4) assert(567): ✅ pass (at line 24, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 26, col 0) -<<<<<<< HEAD -DETAIL: 46 passed, 0 failed, 0 inconclusive -======= -DETAIL: 34 passed, 0 failed, 0 inconclusive ->>>>>>> origin/main +DETAIL: 47 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_augmented_assign.expected b/StrataTest/Languages/Python/expected_laurel/test_augmented_assign.expected index 6db6a6509..20fe2bad6 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_augmented_assign.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_augmented_assign.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,8 +35,6 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -======= ->>>>>>> origin/main assert_assert(81)_calls_Any_to_bool_0: ✅ pass (at line 5, col 4) assert(81): ✅ pass (at line 5, col 4) assert_assert(124)_calls_Any_to_bool_0: ✅ pass (at line 7, col 4) @@ -50,9 +42,5 @@ assert(124): ✅ pass (at line 7, col 4) assert_assert(167)_calls_Any_to_bool_0: ✅ pass (at line 9, col 4) assert(167): ✅ pass (at line 9, col 4) -<<<<<<< HEAD -DETAIL: 40 passed, 0 failed, 0 inconclusive -======= -DETAIL: 28 passed, 0 failed, 0 inconclusive ->>>>>>> origin/main +DETAIL: 41 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_boolean_logic.expected b/StrataTest/Languages/Python/expected_laurel/test_boolean_logic.expected index 84bc957cb..4c9de0ead 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_boolean_logic.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_boolean_logic.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,8 +35,6 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -======= ->>>>>>> origin/main assert_assert(73)_calls_PAnd_0: ✅ pass (at line 5, col 4) assert_assert(73)_calls_Any_to_bool_1: ✅ pass (at line 5, col 4) assert(73): ✅ pass (at line 5, col 4) @@ -72,9 +64,5 @@ assert_assert(825)_calls_Any_to_bool_0: ✅ pass (at line 37, col 4) assert(825): ✅ pass (at line 37, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 39, col 0) -<<<<<<< HEAD -DETAIL: 62 passed, 0 failed, 0 inconclusive -======= -DETAIL: 50 passed, 0 failed, 0 inconclusive ->>>>>>> origin/main +DETAIL: 63 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_break_continue.expected b/StrataTest/Languages/Python/expected_laurel/test_break_continue.expected index 2d7e9ad4b..d2164967d 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_break_continue.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_break_continue.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,15 +35,9 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -======= ->>>>>>> origin/main loop_guard_calls_Any_to_bool_0: ✅ pass (at line 3, col 4) loop_guard_calls_Any_to_bool_0: ✅ pass (at line 8, col 4) loop_guard_end_calls_Any_to_bool_0: ✅ pass (at line 8, col 4) -<<<<<<< HEAD -DETAIL: 37 passed, 0 failed, 0 inconclusive -======= -DETAIL: 25 passed, 0 failed, 0 inconclusive ->>>>>>> origin/main +DETAIL: 38 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_decl.expected b/StrataTest/Languages/Python/expected_laurel/test_class_decl.expected index 7792562bf..e46180a97 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_decl.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_decl.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,13 +35,8 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) +callElimAssert_requires_4: ✅ pass ite_cond_calls_Any_to_bool_0: ✅ pass (at line 13, col 0) -DETAIL: 35 passed, 0 failed, 0 inconclusive -======= -callElimAssert_requires_5: ✅ pass -ite_cond_calls_Any_to_bool_0: ✅ pass (at line 13, col 0) - -DETAIL: 24 passed, 0 failed, 0 inconclusive ->>>>>>> origin/main +DETAIL: 37 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_field_any.expected b/StrataTest/Languages/Python/expected_laurel/test_class_field_any.expected index 114d37dc5..17ddd1d0b 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_field_any.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_field_any.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,14 +35,9 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) - -DETAIL: 34 passed, 0 failed, 0 inconclusive -RESULT: Analysis success -======= -callElimAssert_requires_5: ✅ pass +callElimAssert_requires_3: ✅ pass assert_assert(113)_calls_Any_to_bool_0: ✅ pass (at line 6, col 0) assert(113): ❓ unknown (at line 6, col 0) -DETAIL: 24 passed, 0 failed, 1 inconclusive +DETAIL: 37 passed, 0 failed, 1 inconclusive RESULT: Inconclusive ->>>>>>> origin/main diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_field_init.expected b/StrataTest/Languages/Python/expected_laurel/test_class_field_init.expected index 599528509..f7239371b 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_field_init.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_field_init.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,13 +35,8 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) +callElimAssert_requires_5: ✅ pass ite_cond_calls_Any_to_bool_0: ✅ pass (at line 13, col 0) -DETAIL: 35 passed, 0 failed, 0 inconclusive -======= -callElimAssert_requires_7: ✅ pass -ite_cond_calls_Any_to_bool_0: ✅ pass (at line 13, col 0) - -DETAIL: 24 passed, 0 failed, 0 inconclusive ->>>>>>> origin/main +DETAIL: 37 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_field_use.expected b/StrataTest/Languages/Python/expected_laurel/test_class_field_use.expected index bc5e0cb95..09301f4d1 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_field_use.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_field_use.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,15 +35,9 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) +callElimAssert_requires_7: ✅ pass assert_assert(285)_calls_Any_to_bool_0: ✅ pass (at line 14, col 4) Assertion failed at line 14, col 4: assert(285): ❌ fail -DETAIL: 35 passed, 1 failed, 0 inconclusive -======= -callElimAssert_requires_10: ✅ pass -assert_assert(285)_calls_Any_to_bool_0: ✅ pass (at line 14, col 4) -Assertion failed at line 14, col 4: assert(285): ❌ fail - -DETAIL: 24 passed, 1 failed, 0 inconclusive ->>>>>>> origin/main +DETAIL: 37 passed, 1 failed, 0 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_methods.expected b/StrataTest/Languages/Python/expected_laurel/test_class_methods.expected index 2a8e1f42a..4aa4907d4 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_methods.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_methods.expected @@ -1,18 +1,17 @@ -<<<<<<< HEAD -DETAIL: test_class_methods.py(715-743) ❌ Type checking error. -[call [nullcall_ret] := test_helper_procedure((~from_string #foo), - ~from_none)]: Arity mismatch in this call's return values!Here is the expected signature: (req_name, Any) (opt_name, Any) -RESULT: Internal error -======= ==== Verification Results ==== -List_get_body_calls_List_get_0: ✅ pass (in prelude file) -List_take_body_calls_List_take_0: ✅ pass (in prelude file) -List_drop_body_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass +List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) +List_set_body_calls_List_set_0: ✅ pass +DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) @@ -28,18 +27,25 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -callElimAssert_requires_14: ✅ pass +postcondition: ✅ pass (in prelude file) +ret_type: ✅ pass (in prelude file) +ret_type: ✅ pass (in prelude file) +ret_pos: ✅ pass (in prelude file) +assert_name_is_foo: ✅ pass (in prelude file) +assert_opt_name_none_or_str: ✅ pass (in prelude file) +assert_opt_name_none_or_bar: ✅ pass (in prelude file) +ensures_maybe_except_none: ✅ pass (in prelude file) +callElimAssert_requires_12: ✅ pass assert_assert(445)_calls_Any_to_bool_0: ✅ pass (at line 21, col 4) assert(445): ❓ unknown (at line 21, col 4) assert_assert(539)_calls_Any_to_bool_0: ✅ pass (at line 24, col 4) Assertion failed at line 24, col 4: assert(539): ❌ fail assert_assert(654)_calls_Any_to_bool_0: ✅ pass (at line 28, col 4) Assertion failed at line 28, col 4: assert(654): ❌ fail -callElimAssert_req_name_is_foo_4: ✅ pass (at line 30, col 4) -callElimAssert_req_opt_name_none_or_str_5: ✅ pass (at line 30, col 4) -callElimAssert_req_opt_name_none_or_bar_6: ✅ pass (at line 30, col 4) +callElimAssert_requires_0_4: ✅ pass (at line 30, col 4) +callElimAssert_requires_1_5: ✅ pass (at line 30, col 4) +callElimAssert_requires_2_6: ✅ pass (at line 30, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 32, col 0) -DETAIL: 30 passed, 2 failed, 1 inconclusive +DETAIL: 43 passed, 2 failed, 1 inconclusive RESULT: Failures found ->>>>>>> origin/main diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_with_methods.expected b/StrataTest/Languages/Python/expected_laurel/test_class_with_methods.expected index 1eb5aabae..6f7b119a4 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_with_methods.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_with_methods.expected @@ -1,18 +1,17 @@ -<<<<<<< HEAD -DETAIL: test_class_with_methods.py(608-636) ❌ Type checking error. -[call [nullcall_ret] := test_helper_procedure((~from_string #foo), - ~from_none)]: Arity mismatch in this call's return values!Here is the expected signature: (req_name, Any) (opt_name, Any) -RESULT: Internal error -======= ==== Verification Results ==== -List_get_body_calls_List_get_0: ✅ pass (in prelude file) -List_take_body_calls_List_take_0: ✅ pass (in prelude file) -List_drop_body_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass +List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) +List_set_body_calls_List_set_0: ✅ pass +DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) @@ -28,16 +27,23 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -callElimAssert_requires_13: ✅ pass +postcondition: ✅ pass (in prelude file) +ret_type: ✅ pass (in prelude file) +ret_type: ✅ pass (in prelude file) +ret_pos: ✅ pass (in prelude file) +assert_name_is_foo: ✅ pass (in prelude file) +assert_opt_name_none_or_str: ✅ pass (in prelude file) +assert_opt_name_none_or_bar: ✅ pass (in prelude file) +ensures_maybe_except_none: ✅ pass (in prelude file) +callElimAssert_requires_11: ✅ pass assert_assert(459)_calls_Any_to_bool_0: ✅ pass (at line 23, col 4) Assertion failed at line 23, col 4: assert(459): ❌ fail assert_assert(544)_calls_Any_to_bool_0: ✅ pass (at line 26, col 4) assert(544): ❓ unknown (at line 26, col 4) -callElimAssert_req_name_is_foo_4: ✅ pass (at line 28, col 4) -callElimAssert_req_opt_name_none_or_str_5: ✅ pass (at line 28, col 4) -callElimAssert_req_opt_name_none_or_bar_6: ✅ pass (at line 28, col 4) +callElimAssert_requires_0_4: ✅ pass (at line 28, col 4) +callElimAssert_requires_1_5: ✅ pass (at line 28, col 4) +callElimAssert_requires_2_6: ✅ pass (at line 28, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 30, col 0) -DETAIL: 29 passed, 1 failed, 1 inconclusive +DETAIL: 42 passed, 1 failed, 1 inconclusive RESULT: Failures found ->>>>>>> origin/main diff --git a/StrataTest/Languages/Python/expected_laurel/test_comparisons.expected b/StrataTest/Languages/Python/expected_laurel/test_comparisons.expected index 396f979a9..a0f88c08d 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_comparisons.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_comparisons.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,8 +35,6 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -======= ->>>>>>> origin/main assert_assert(89)_calls_Any_to_bool_0: ✅ pass (at line 5, col 4) assert(89): ✅ pass (at line 5, col 4) assert_assert(190)_calls_Any_to_bool_0: ✅ pass (at line 9, col 4) @@ -57,9 +49,5 @@ assert_assert(506)_calls_Any_to_bool_0: ✅ pass (at line 17, col 4) assert(506): ✅ pass (at line 17, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 19, col 0) -<<<<<<< HEAD -DETAIL: 47 passed, 0 failed, 0 inconclusive -======= -DETAIL: 35 passed, 0 failed, 0 inconclusive ->>>>>>> origin/main +DETAIL: 48 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_control_flow.expected b/StrataTest/Languages/Python/expected_laurel/test_control_flow.expected index f00858808..c25b96d93 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_control_flow.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_control_flow.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,8 +35,6 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -======= ->>>>>>> origin/main ite_cond_calls_Any_to_bool_0: ✅ pass (at line 6, col 4) assert_assert(154)_calls_Any_to_bool_0: ✅ pass (at line 11, col 4) assert(154): ✅ pass (at line 11, col 4) @@ -65,9 +57,5 @@ assert_assert(1224)_calls_Any_to_bool_0: ✅ pass (at line 72, col 4) assert(1224): ✅ pass (at line 72, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 74, col 0) -<<<<<<< HEAD -DETAIL: 55 passed, 0 failed, 0 inconclusive -======= -DETAIL: 43 passed, 0 failed, 0 inconclusive ->>>>>>> origin/main +DETAIL: 56 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_datetime.expected b/StrataTest/Languages/Python/expected_laurel/test_datetime.expected index b2e8264a6..81dbe702f 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_datetime.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_datetime.expected @@ -1,17 +1,17 @@ -<<<<<<< HEAD -DETAIL: ❌ Type checking error. -[call [end] := datetime_date((now : Any))]: Arity mismatch in this call's return values!Here is the expected signature: (d, Any) -RESULT: Internal error -======= ==== Verification Results ==== -List_get_body_calls_List_get_0: ✅ pass (in prelude file) -List_take_body_calls_List_take_0: ✅ pass (in prelude file) -List_drop_body_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass +List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) +List_set_body_calls_List_set_0: ✅ pass +DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) @@ -27,11 +27,19 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -callElimAssert_d_type_12: ✅ pass -callElimAssert_days_type_4: ✅ pass -callElimAssert_hours_type_5: ✅ pass -callElimAssert_days_pos_6: ✅ pass -callElimAssert_hours_pos_7: ✅ pass +postcondition: ✅ pass (in prelude file) +ret_type: ✅ pass (in prelude file) +ret_type: ✅ pass (in prelude file) +ret_pos: ✅ pass (in prelude file) +assert_name_is_foo: ✅ pass (in prelude file) +assert_opt_name_none_or_str: ✅ pass (in prelude file) +assert_opt_name_none_or_bar: ✅ pass (in prelude file) +ensures_maybe_except_none: ✅ pass (in prelude file) +callElimAssert_requires_12: ✅ pass +callElimAssert_requires_0_4: ✅ pass +callElimAssert_requires_1_5: ✅ pass +callElimAssert_requires_2_6: ✅ pass +callElimAssert_requires_3_7: ✅ pass assert_assert(554)_calls_Any_to_bool_0: ✅ pass (at line 21, col 0) assert(554): ✅ pass (at line 21, col 0) assert_assert(673)_calls_Any_to_bool_0: ✅ pass (at line 25, col 0) @@ -41,6 +49,5 @@ assert(758): ✅ pass (at line 27, col 0) assert_assert(859)_calls_Any_to_bool_0: ✅ pass (at line 30, col 0) assert(859): ✅ pass (at line 30, col 0) -DETAIL: 35 passed, 0 failed, 0 inconclusive +DETAIL: 48 passed, 0 failed, 0 inconclusive RESULT: Analysis success ->>>>>>> origin/main diff --git a/StrataTest/Languages/Python/expected_laurel/test_default_params.expected b/StrataTest/Languages/Python/expected_laurel/test_default_params.expected index f249e0de5..bbaf65100 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_default_params.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_default_params.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,8 +35,6 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -======= ->>>>>>> origin/main Assertion failed at line 8, col 4: loop_guard_calls_Any_to_bool_0: ❌ fail loop_guard_end_calls_Any_to_bool_0: ✅ pass (at line 8, col 4) assert_assert(325)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) @@ -55,9 +47,5 @@ assert_assert(571)_calls_Any_to_bool_0: ✅ pass (at line 24, col 4) Assertion failed at line 24, col 4: assert(571): ❌ fail ite_cond_calls_Any_to_bool_0: ✅ pass (at line 26, col 0) -<<<<<<< HEAD -DETAIL: 40 passed, 3 failed, 2 inconclusive -======= -DETAIL: 28 passed, 3 failed, 2 inconclusive ->>>>>>> origin/main +DETAIL: 41 passed, 3 failed, 2 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_dict_operations.expected b/StrataTest/Languages/Python/expected_laurel/test_dict_operations.expected index ae87ec047..fbc461f60 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_dict_operations.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_dict_operations.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,8 +35,6 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -======= ->>>>>>> origin/main assert_assert(81)_calls_Any_get_0: ✅ pass (at line 7, col 0) assert_assert(81)_calls_Any_to_bool_1: ✅ pass (at line 7, col 0) assert(81): ✅ pass (at line 7, col 0) @@ -74,9 +66,5 @@ assert_assert(557)_calls_Any_get_2: ✅ pass (at line 27, col 0) assert_assert(557)_calls_Any_to_bool_3: ✅ pass (at line 27, col 0) assert(557): ✅ pass (at line 27, col 0) -<<<<<<< HEAD -DETAIL: 64 passed, 0 failed, 0 inconclusive -======= -DETAIL: 52 passed, 0 failed, 0 inconclusive ->>>>>>> origin/main +DETAIL: 65 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_for_loop.expected b/StrataTest/Languages/Python/expected_laurel/test_for_loop.expected index 599877dda..aa24a4c24 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_for_loop.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_for_loop.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,10 +35,8 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -======= ->>>>>>> origin/main assert_assert(129)_calls_Any_to_bool_0: ✅ pass (at line 6, col 4) -Assertion failed at line 6, col 4: assert(129): ❌ fail +assert(129): ❓ unknown (at line 6, col 4) Assertion failed at line 13, col 8: ite_cond_calls_Any_to_bool_0: ❌ fail assert_assert(361)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) assert(361): ❓ unknown (at line 15, col 4) @@ -54,9 +46,5 @@ assert(611): ✅ pass (at line 25, col 4) assert_assert(611)_calls_Any_to_bool_0: ✅ pass (at line 25, col 4) Assertion failed at line 25, col 4: assert(611): ❌ fail -<<<<<<< HEAD -DETAIL: 40 passed, 4 failed, 0 inconclusive -======= -DETAIL: 28 passed, 2 failed, 2 inconclusive ->>>>>>> origin/main +DETAIL: 41 passed, 2 failed, 2 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_function_def_calls.expected b/StrataTest/Languages/Python/expected_laurel/test_function_def_calls.expected index fde4c60d2..33dce5fe9 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_function_def_calls.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_function_def_calls.expected @@ -1,18 +1,17 @@ -<<<<<<< HEAD -DETAIL: test_function_def_calls.py(64-88) ❌ Type checking error. -[call [nullcall_ret] := test_helper_procedure((s : Any), - ~from_none)]: Arity mismatch in this call's return values!Here is the expected signature: (req_name, Any) (opt_name, Any) -RESULT: Internal error -======= ==== Verification Results ==== -List_get_body_calls_List_get_0: ✅ pass (in prelude file) -List_take_body_calls_List_take_0: ✅ pass (in prelude file) -List_drop_body_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass +List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) +List_set_body_calls_List_set_0: ✅ pass +DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) @@ -28,11 +27,18 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -callElimAssert_req_name_is_foo_4: ❓ unknown (at line 6, col 4) -callElimAssert_req_opt_name_none_or_str_5: ✅ pass (at line 6, col 4) -callElimAssert_req_opt_name_none_or_bar_6: ✅ pass (at line 6, col 4) +postcondition: ✅ pass (in prelude file) +ret_type: ✅ pass (in prelude file) +ret_type: ✅ pass (in prelude file) +ret_pos: ✅ pass (in prelude file) +assert_name_is_foo: ✅ pass (in prelude file) +assert_opt_name_none_or_str: ✅ pass (in prelude file) +assert_opt_name_none_or_bar: ✅ pass (in prelude file) +ensures_maybe_except_none: ✅ pass (in prelude file) +callElimAssert_requires_0_4: ❓ unknown (at line 6, col 4) +callElimAssert_requires_1_5: ✅ pass (at line 6, col 4) +callElimAssert_requires_2_6: ✅ pass (at line 6, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 11, col 0) -DETAIL: 25 passed, 0 failed, 1 inconclusive +DETAIL: 38 passed, 0 failed, 1 inconclusive RESULT: Inconclusive ->>>>>>> origin/main diff --git a/StrataTest/Languages/Python/expected_laurel/test_if_elif.expected b/StrataTest/Languages/Python/expected_laurel/test_if_elif.expected index 10e6505d8..972ba03df 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_if_elif.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_if_elif.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,11 +35,9 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -======= ->>>>>>> origin/main Assertion failed at line 2, col 4: ite_cond_calls_Any_to_bool_0: ❌ fail ite_cond_calls_Any_to_bool_0: ✅ pass (at line 4, col 4) -ite_cond_calls_Any_to_bool_0: ❓ unknown (at line 6, col 4) +Assertion failed at line 6, col 4: ite_cond_calls_Any_to_bool_0: ❌ fail assert_assert(225)_calls_Any_to_bool_0: ✅ pass (at line 13, col 4) assert(225): ❓ unknown (at line 13, col 4) assert_assert(302)_calls_Any_to_bool_0: ✅ pass (at line 16, col 4) @@ -56,9 +48,5 @@ assert_assert(444)_calls_Any_to_bool_0: ✅ pass (at line 22, col 4) assert(444): ❓ unknown (at line 22, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 24, col 0) -<<<<<<< HEAD -DETAIL: 40 passed, 2 failed, 4 inconclusive -======= -DETAIL: 28 passed, 1 failed, 5 inconclusive ->>>>>>> origin/main +DETAIL: 41 passed, 2 failed, 4 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_ifexpr.expected b/StrataTest/Languages/Python/expected_laurel/test_ifexpr.expected index db94db4ac..09c5b9d27 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_ifexpr.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_ifexpr.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,15 +35,9 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -======= ->>>>>>> origin/main set_result_calls_Any_to_bool_0: ✅ pass assert_assert(56)_calls_Any_to_bool_0: ✅ pass (at line 3, col 0) assert(56): ✅ pass (at line 3, col 0) -<<<<<<< HEAD -DETAIL: 37 passed, 0 failed, 0 inconclusive -======= -DETAIL: 25 passed, 0 failed, 0 inconclusive ->>>>>>> origin/main +DETAIL: 38 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_list.expected b/StrataTest/Languages/Python/expected_laurel/test_list.expected index 2e9f41aa0..2c5d53180 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_list.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_list.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,8 +35,6 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -======= ->>>>>>> origin/main assert_assert(32)_calls_PIn_0: ✅ pass (at line 3, col 0) assert_assert(32)_calls_Any_to_bool_1: ✅ pass (at line 3, col 0) assert(32): ✅ pass (at line 3, col 0) @@ -57,9 +49,5 @@ assert_assert(200)_calls_Any_get_1: ✅ pass (at line 17, col 0) assert_assert(200)_calls_Any_to_bool_2: ✅ pass (at line 17, col 0) assert(200): ✅ pass (at line 17, col 0) -<<<<<<< HEAD -DETAIL: 47 passed, 0 failed, 0 inconclusive -======= -DETAIL: 35 passed, 0 failed, 0 inconclusive ->>>>>>> origin/main +DETAIL: 48 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_list_slice.expected b/StrataTest/Languages/Python/expected_laurel/test_list_slice.expected index 01026f59f..a68a2b2b6 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_list_slice.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_list_slice.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,8 +35,6 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -======= ->>>>>>> origin/main assert_assert(32)_calls_Any_get_0: ✅ pass (at line 3, col 0) assert_assert(32)_calls_Any_get_1: ✅ pass (at line 3, col 0) assert_assert(32)_calls_Any_to_bool_2: ✅ pass (at line 3, col 0) @@ -56,9 +48,5 @@ assert_assert(187)_calls_Any_get_0: ✅ pass (at line 9, col 0) assert_assert(187)_calls_Any_to_bool_1: ✅ pass (at line 9, col 0) assert(187): ✅ pass (at line 9, col 0) -<<<<<<< HEAD -DETAIL: 46 passed, 0 failed, 0 inconclusive -======= -DETAIL: 34 passed, 0 failed, 0 inconclusive ->>>>>>> origin/main +DETAIL: 47 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_loops.expected b/StrataTest/Languages/Python/expected_laurel/test_loops.expected index 5ac4cf09e..a7f9e123e 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_loops.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_loops.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,8 +35,6 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -======= ->>>>>>> origin/main assert_assert(95)_calls_Any_to_bool_0: ✅ pass (at line 6, col 4) assert(95): ✅ pass (at line 6, col 4) set_a_calls_Any_get_0: ❓ unknown @@ -57,13 +49,8 @@ assert_assert(409)_calls_Any_to_bool_0: ✅ pass (at line 18, col 4) assert(409): ✅ pass (at line 18, col 4) loop_guard_calls_Any_to_bool_0: ✅ pass (at line 22, col 4) loop_guard_end_calls_Any_to_bool_0: ✅ pass (at line 22, col 4) -assert_assert(531)_calls_Any_to_bool_0: ❓ unknown (at line 24, col 4) -assert(531): ❓ unknown (at line 24, col 4) +Assertion failed at line 24, col 4: assert_assert(531)_calls_Any_to_bool_0: ❌ fail +Assertion failed at line 24, col 4: assert(531): ❌ fail -<<<<<<< HEAD -DETAIL: 42 passed, 2 failed, 6 inconclusive +DETAIL: 43 passed, 2 failed, 6 inconclusive RESULT: Failures found -======= -DETAIL: 30 passed, 0 failed, 8 inconclusive -RESULT: Inconclusive ->>>>>>> origin/main diff --git a/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected b/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected index 3e30948b0..bbf59c8d4 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected @@ -1,18 +1,17 @@ -<<<<<<< HEAD -DETAIL: test_missing_models.py(226-254) ❌ Type checking error. -[call [nullcall_ret] := test_helper_procedure((~from_string #Foo), - ~from_none)]: Arity mismatch in this call's return values!Here is the expected signature: (req_name, Any) (opt_name, Any) -RESULT: Internal error -======= ==== Verification Results ==== -List_get_body_calls_List_get_0: ✅ pass (in prelude file) -List_take_body_calls_List_take_0: ✅ pass (in prelude file) -List_drop_body_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass +List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) +List_set_body_calls_List_set_0: ✅ pass +DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) @@ -28,16 +27,35 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -Assertion failed at line 9, col 4: callElimAssert_req_name_is_foo_22: ❌ fail -callElimAssert_req_opt_name_none_or_str_23: ✅ pass (at line 9, col 4) -callElimAssert_req_opt_name_none_or_bar_24: ✅ pass (at line 9, col 4) -callElimAssert_req_name_is_foo_13: ✅ pass (at line 12, col 4) -callElimAssert_req_opt_name_none_or_str_14: ✅ pass (at line 12, col 4) -callElimAssert_req_opt_name_none_or_bar_15: ✅ pass (at line 12, col 4) -callElimAssert_req_name_is_foo_4: ✅ pass (at line 15, col 4) -callElimAssert_req_opt_name_none_or_str_5: ✅ pass (at line 15, col 4) -callElimAssert_req_opt_name_none_or_bar_6: ✅ pass (at line 15, col 4) +postcondition: ✅ pass (in prelude file) +ret_type: ✅ pass (in prelude file) +ret_type: ✅ pass (in prelude file) +ret_pos: ✅ pass (in prelude file) +assert_name_is_foo: ✅ pass (in prelude file) +assert_opt_name_none_or_str: ✅ pass (in prelude file) +assert_opt_name_none_or_bar: ✅ pass (in prelude file) +ensures_maybe_except_none: ✅ pass (in prelude file) +callElimAssert_requires_0_13: ✅ pass (at line 12, col 4) +callElimAssert_requires_1_14: ✅ pass (at line 12, col 4) +callElimAssert_requires_2_15: ✅ pass (at line 12, col 4) +callElimAssert_requires_0_4: ✅ pass (at line 15, col 4) +callElimAssert_requires_1_5: ✅ pass (at line 15, col 4) +callElimAssert_requires_2_6: ✅ pass (at line 15, col 4) +callElimAssert_requires_0_13: ✅ pass (at line 12, col 4) +callElimAssert_requires_1_14: ✅ pass (at line 12, col 4) +callElimAssert_requires_2_15: ✅ pass (at line 12, col 4) +callElimAssert_requires_0_4: ✅ pass (at line 15, col 4) +callElimAssert_requires_1_5: ✅ pass (at line 15, col 4) +callElimAssert_requires_2_6: ✅ pass (at line 15, col 4) +Assertion failed at line 9, col 4: callElimAssert_requires_0_22: ❌ fail +callElimAssert_requires_1_23: ✅ pass (at line 9, col 4) +callElimAssert_requires_2_24: ✅ pass (at line 9, col 4) +callElimAssert_requires_0_13: ✅ pass (at line 12, col 4) +callElimAssert_requires_1_14: ✅ pass (at line 12, col 4) +callElimAssert_requires_2_15: ✅ pass (at line 12, col 4) +callElimAssert_requires_0_4: ✅ pass (at line 15, col 4) +callElimAssert_requires_1_5: ✅ pass (at line 15, col 4) +callElimAssert_requires_2_6: ✅ pass (at line 15, col 4) -DETAIL: 30 passed, 1 failed, 0 inconclusive +DETAIL: 55 passed, 1 failed, 0 inconclusive RESULT: Failures found ->>>>>>> origin/main diff --git a/StrataTest/Languages/Python/expected_laurel/test_module_level.expected b/StrataTest/Languages/Python/expected_laurel/test_module_level.expected index d387bea56..580bd2cf4 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_module_level.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_module_level.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,8 +35,6 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -======= ->>>>>>> origin/main assert_assert(115)_calls_Any_get_0: ✅ pass (at line 9, col 0) assert_assert(115)_calls_Any_to_bool_1: ✅ pass (at line 9, col 0) assert(115): ✅ pass (at line 9, col 0) @@ -59,9 +51,5 @@ assert_assert(258)_calls_PNotIn_0: ✅ pass (at line 15, col 0) assert_assert(258)_calls_Any_to_bool_1: ✅ pass (at line 15, col 0) assert(258): ✅ pass (at line 15, col 0) -<<<<<<< HEAD -DETAIL: 49 passed, 0 failed, 0 inconclusive -======= -DETAIL: 37 passed, 0 failed, 0 inconclusive ->>>>>>> origin/main +DETAIL: 50 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_multi_function.expected b/StrataTest/Languages/Python/expected_laurel/test_multi_function.expected index 173023c6e..fd4974637 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_multi_function.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_multi_function.expected @@ -1,18 +1,17 @@ -<<<<<<< HEAD -DETAIL: test_multi_function.py(715-743) ❌ Type checking error. -[call [nullcall_ret] := test_helper_procedure((~from_string #foo), - ~from_none)]: Arity mismatch in this call's return values!Here is the expected signature: (req_name, Any) (opt_name, Any) -RESULT: Internal error -======= ==== Verification Results ==== -List_get_body_calls_List_get_0: ✅ pass (in prelude file) -List_take_body_calls_List_take_0: ✅ pass (in prelude file) -List_drop_body_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass +List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) +List_set_body_calls_List_set_0: ✅ pass +DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) @@ -28,6 +27,14 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +ret_type: ✅ pass (in prelude file) +ret_type: ✅ pass (in prelude file) +ret_pos: ✅ pass (in prelude file) +assert_name_is_foo: ✅ pass (in prelude file) +assert_opt_name_none_or_str: ✅ pass (in prelude file) +assert_opt_name_none_or_bar: ✅ pass (in prelude file) +ensures_maybe_except_none: ✅ pass (in prelude file) Assertion failed at line 9, col 4: ite_cond_calls_PNotIn_0: ❌ fail ite_cond_calls_Any_to_bool_1: ✅ pass (at line 9, col 4) ite_cond_calls_PNotIn_0: ❓ unknown (at line 11, col 4) @@ -36,11 +43,10 @@ ite_cond_calls_Any_to_bool_0: ❓ unknown (at line 18, col 4) set_LaurelResult_calls_Any_get_0: ❓ unknown assert_assert(651)_calls_Any_to_bool_0: ✅ pass (at line 24, col 4) Assertion failed at line 24, col 4: assert(651): ❌ fail -callElimAssert_req_name_is_foo_9: ✅ pass (at line 26, col 4) -callElimAssert_req_opt_name_none_or_str_10: ✅ pass (at line 26, col 4) -callElimAssert_req_opt_name_none_or_bar_11: ✅ pass (at line 26, col 4) +callElimAssert_requires_0_9: ✅ pass (at line 26, col 4) +callElimAssert_requires_1_10: ✅ pass (at line 26, col 4) +callElimAssert_requires_2_11: ✅ pass (at line 26, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 28, col 0) -DETAIL: 29 passed, 2 failed, 3 inconclusive +DETAIL: 42 passed, 2 failed, 3 inconclusive RESULT: Failures found ->>>>>>> origin/main diff --git a/StrataTest/Languages/Python/expected_laurel/test_multiple_except.expected b/StrataTest/Languages/Python/expected_laurel/test_multiple_except.expected index 4636c4bbc..e6f2afc48 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_multiple_except.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_multiple_except.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,18 +35,24 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -======= ->>>>>>> origin/main +assert_assert(170)_calls_Any_to_bool_0: ✅ pass (at line 8, col 4) +assert(170): ✅ pass (at line 8, col 4) +assert_assert(170)_calls_Any_to_bool_0: ✅ pass (at line 8, col 4) +assert(170): ✅ pass (at line 8, col 4) assert_assert(170)_calls_Any_to_bool_0: ✅ pass (at line 8, col 4) Assertion failed at line 8, col 4: assert(170): ❌ fail assert_assert(471)_calls_Any_to_bool_0: ✅ pass (at line 21, col 4) +assert(471): ✅ pass (at line 21, col 4) +assert_assert(471)_calls_Any_to_bool_0: ✅ pass (at line 21, col 4) +assert(471): ✅ pass (at line 21, col 4) +assert_assert(471)_calls_Any_to_bool_0: ✅ pass (at line 21, col 4) +assert(471): ✅ pass (at line 21, col 4) +assert_assert(471)_calls_Any_to_bool_0: ✅ pass (at line 21, col 4) Assertion failed at line 21, col 4: assert(471): ❌ fail assert_assert(693)_calls_Any_to_bool_0: ✅ pass (at line 31, col 4) assert(693): ✅ pass (at line 31, col 4) +assert_assert(693)_calls_Any_to_bool_0: ✅ pass (at line 31, col 4) +assert(693): ✅ pass (at line 31, col 4) -<<<<<<< HEAD -DETAIL: 38 passed, 2 failed, 0 inconclusive -======= -DETAIL: 26 passed, 2 failed, 0 inconclusive ->>>>>>> origin/main +DETAIL: 51 passed, 2 failed, 0 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_nested_calls.expected b/StrataTest/Languages/Python/expected_laurel/test_nested_calls.expected index 0142f0f08..13b889375 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_nested_calls.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_nested_calls.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,8 +35,6 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -======= ->>>>>>> origin/main assert_assert(153)_calls_Any_to_bool_0: ✅ pass (at line 10, col 4) Assertion failed at line 10, col 4: assert(153): ❌ fail assert_assert(254)_calls_Any_to_bool_0: ✅ pass (at line 14, col 4) @@ -51,9 +43,5 @@ assert_assert(356)_calls_Any_to_bool_0: ✅ pass (at line 18, col 4) Assertion failed at line 18, col 4: assert(356): ❌ fail ite_cond_calls_Any_to_bool_0: ✅ pass (at line 20, col 0) -<<<<<<< HEAD -DETAIL: 38 passed, 3 failed, 0 inconclusive -======= -DETAIL: 26 passed, 3 failed, 0 inconclusive ->>>>>>> origin/main +DETAIL: 39 passed, 3 failed, 0 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_pin_any.expected b/StrataTest/Languages/Python/expected_laurel/test_pin_any.expected index 8a3a353e1..cce226d30 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_pin_any.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_pin_any.expected @@ -1,12 +1,17 @@ ==== Verification Results ==== -List_get_body_calls_List_get_0: ✔️ always true if reached (in prelude file) -List_take_body_calls_List_take_0: ✔️ always true if reached (in prelude file) -List_drop_body_calls_List_drop_0: ✔️ always true if reached (in prelude file) +postcondition: ✅ pass (❗path unreachable) (in prelude file) +List_get_body_calls_List_get_0: ✔️ always true if reached +List_take_body_calls_List_take_0: ✔️ always true if reached +List_take_len_post_postcondition_calls_List_take_0: ✔️ always true if reached (in prelude file) +postcondition: ✅ pass (❗path unreachable) (in prelude file) +List_drop_body_calls_List_drop_0: ✔️ always true if reached +List_drop_len_post_postcondition_calls_List_drop_0: ✔️ always true if reached (in prelude file) +postcondition: ✅ pass (❗path unreachable) (in prelude file) List_slice_body_calls_List_drop_0: ✔️ always true if reached (in prelude file) List_slice_body_calls_List_take_1: ✔️ always true if reached (in prelude file) -List_set_body_calls_List_set_0: ✔️ always true if reached (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✔️ always true if reached (in prelude file) +List_set_body_calls_List_set_0: ✔️ always true if reached +DictStrAny_get_body_calls_DictStrAny_get_0: ✔️ always true if reached DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✔️ always true if reached (in prelude file) Any_get_body_calls_DictStrAny_get_0: ✔️ always true if reached (in prelude file) Any_get_body_calls_List_get_1: ✔️ always true if reached (in prelude file) @@ -22,10 +27,18 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ always true and is reachable from declar PFloorDiv_body_calls_Int.SafeDiv_3: ✅ always true and is reachable from declaration entry (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ always true and is reachable from declaration entry (in prelude file) POr_body_calls_Any_to_bool_0: ✅ always true and is reachable from declaration entry (in prelude file) +postcondition: ✅ pass (❗path unreachable) (in prelude file) +ret_type: ✅ always true and is reachable from declaration entry (in prelude file) +ret_type: ✅ always true and is reachable from declaration entry (in prelude file) +ret_pos: ✅ always true and is reachable from declaration entry (in prelude file) +assert_name_is_foo: ✔️ always true if reached (in prelude file) +assert_opt_name_none_or_str: ✔️ always true if reached (in prelude file) +assert_opt_name_none_or_bar: ✔️ always true if reached (in prelude file) +ensures_maybe_except_none: ✔️ always true if reached (in prelude file) ite_cond_calls_Any_to_bool_0: 🔶 can be both true and false and is reachable from declaration entry (at line 3, col 4) -assert_assert(124)_calls_PIn_0: ❓ unknown (at line 4, col 8) +assert_assert(124)_calls_PIn_0: 🔶 can be both true and false and is reachable from declaration entry (at line 4, col 8) assert_assert(124)_calls_Any_to_bool_1: ✔️ always true if reached (at line 4, col 8) assert(124): ❓ unknown (at line 4, col 8) -DETAIL: 23 passed, 0 failed, 3 inconclusive +DETAIL: 36 passed, 0 failed, 3 inconclusive, 4 unreachable RESULT: Inconclusive diff --git a/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected b/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected index c1c606356..00a1b16d3 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected @@ -1,18 +1,17 @@ -<<<<<<< HEAD -DETAIL: test_precondition_verification.py(104-132) ❌ Type checking error. -[call [nullcall_ret] := test_helper_procedure((~from_string #foo), - ~from_none)]: Arity mismatch in this call's return values!Here is the expected signature: (req_name, Any) (opt_name, Any) -RESULT: Internal error -======= ==== Verification Results ==== -List_get_body_calls_List_get_0: ✅ pass (in prelude file) -List_take_body_calls_List_take_0: ✅ pass (in prelude file) -List_drop_body_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass +List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) +List_set_body_calls_List_set_0: ✅ pass +DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) @@ -28,20 +27,27 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -callElimAssert_req_name_is_foo_28: ✅ pass (at line 8, col 4) -callElimAssert_req_opt_name_none_or_str_29: ✅ pass (at line 8, col 4) -callElimAssert_req_opt_name_none_or_bar_30: ✅ pass (at line 8, col 4) -callElimAssert_req_name_is_foo_20: ✅ pass (at line 11, col 4) -callElimAssert_req_opt_name_none_or_str_21: ✅ pass (at line 11, col 4) -callElimAssert_req_opt_name_none_or_bar_22: ✅ pass (at line 11, col 4) -Assertion failed at line 14, col 4: callElimAssert_req_name_is_foo_12: ❌ fail -callElimAssert_req_opt_name_none_or_str_13: ✅ pass (at line 14, col 4) -callElimAssert_req_opt_name_none_or_bar_14: ✅ pass (at line 14, col 4) -callElimAssert_req_name_is_foo_4: ✅ pass (at line 17, col 4) -callElimAssert_req_opt_name_none_or_str_5: ✅ pass (at line 17, col 4) -Assertion failed at line 17, col 4: callElimAssert_req_opt_name_none_or_bar_6: ❌ fail +postcondition: ✅ pass (in prelude file) +ret_type: ✅ pass (in prelude file) +ret_type: ✅ pass (in prelude file) +ret_pos: ✅ pass (in prelude file) +assert_name_is_foo: ✅ pass (in prelude file) +assert_opt_name_none_or_str: ✅ pass (in prelude file) +assert_opt_name_none_or_bar: ✅ pass (in prelude file) +ensures_maybe_except_none: ✅ pass (in prelude file) +callElimAssert_requires_0_28: ✅ pass (at line 8, col 4) +callElimAssert_requires_1_29: ✅ pass (at line 8, col 4) +callElimAssert_requires_2_30: ✅ pass (at line 8, col 4) +callElimAssert_requires_0_20: ✅ pass (at line 11, col 4) +callElimAssert_requires_1_21: ✅ pass (at line 11, col 4) +callElimAssert_requires_2_22: ✅ pass (at line 11, col 4) +Assertion failed at line 14, col 4: callElimAssert_requires_0_12: ❌ fail +callElimAssert_requires_1_13: ✅ pass (at line 14, col 4) +callElimAssert_requires_2_14: ✅ pass (at line 14, col 4) +callElimAssert_requires_0_4: ✅ pass (at line 17, col 4) +callElimAssert_requires_1_5: ✅ pass (at line 17, col 4) +Assertion failed at line 17, col 4: callElimAssert_requires_2_6: ❌ fail ite_cond_calls_Any_to_bool_0: ✅ pass (at line 19, col 0) -DETAIL: 33 passed, 2 failed, 0 inconclusive +DETAIL: 46 passed, 2 failed, 0 inconclusive RESULT: Failures found ->>>>>>> origin/main diff --git a/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected b/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected index aad915386..0ba78f284 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected @@ -1,96 +1,5 @@ +DETAIL: stderr: +solver stdout: (error "Regular expression terms are not supported in theory combination") -==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass -List_take_body_calls_List_take_0: ✅ pass -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_body_calls_List_drop_0: ✅ pass -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) -List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD -List_set_body_calls_List_set_0: ✅ pass -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) -DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main -Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) -Any_get_body_calls_List_get_1: ✅ pass (in prelude file) -Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) -Any_get_body_calls_List_drop_3: ✅ pass (in prelude file) -Any_get!_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) -Any_get!_body_calls_List_get_1: ✅ pass (in prelude file) -Any_set_body_calls_List_set_0: ✅ pass (in prelude file) -Any_set!_body_calls_List_set_0: ✅ pass (in prelude file) -PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass (in prelude file) -PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass (in prelude file) -PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) -PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) -PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) -======= ->>>>>>> origin/main -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(272)_calls_Any_to_bool_0: ✅ pass (at line 10, col 4) -assert(272): ❓ unknown (at line 10, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(365)_calls_Any_to_bool_0: ✅ pass (at line 13, col 4) -assert(365): ❓ unknown (at line 13, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(465)_calls_Any_to_bool_0: ✅ pass (at line 16, col 4) -assert(465): ❓ unknown (at line 16, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(603)_calls_Any_to_bool_0: ✅ pass (at line 20, col 4) -assert(603): ❓ unknown (at line 20, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(702)_calls_Any_to_bool_0: ✅ pass (at line 23, col 4) -assert(702): ❓ unknown (at line 23, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(797)_calls_Any_to_bool_0: ✅ pass (at line 26, col 4) -assert(797): ❓ unknown (at line 26, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(888)_calls_Any_to_bool_0: ✅ pass (at line 29, col 4) -assert(888): ❓ unknown (at line 29, col 4) -set_p_calls_re_compile_0: ✅ pass -set_m_calls_re_search_0: ✅ pass -assert_assert(1038)_calls_Any_to_bool_0: ✅ pass (at line 34, col 4) -assert(1038): ❓ unknown (at line 34, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(1133)_calls_Any_to_bool_0: ✅ pass (at line 37, col 4) -assert(1133): ❓ unknown (at line 37, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(1495)_calls_Any_to_bool_0: ✅ pass (at line 47, col 4) -Assertion failed at line 47, col 4: assert(1495): ❌ fail -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(1667)_calls_Any_to_bool_0: ✅ pass (at line 54, col 4) -Assertion failed at line 54, col 4: assert(1667): ❌ fail -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(1846)_calls_Any_to_bool_0: ✅ pass (at line 61, col 4) -Assertion failed at line 61, col 4: assert(1846): ❌ fail -set_m_calls_re_search_0: ✅ pass -assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) -Assertion failed at line 68, col 4: assert(2015): ❌ fail -set_m_calls_re_match_0: ✅ pass -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -Assertion failed at line 75, col 4: assert(2193): ❌ fail -ite_cond_calls_Any_to_bool_0: ✅ pass (at line 77, col 0) -<<<<<<< HEAD -DETAIL: 64 passed, 5 failed, 9 inconclusive -======= -DETAIL: 52 passed, 5 failed, 9 inconclusive ->>>>>>> origin/main -RESULT: Failures found +RESULT: Internal error diff --git a/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected b/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected index 71d11a87f..0ba78f284 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected @@ -1,475 +1,5 @@ +DETAIL: stderr: +solver stdout: (error "Regular expression terms are not supported in theory combination") -==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass -List_take_body_calls_List_take_0: ✅ pass -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_body_calls_List_drop_0: ✅ pass -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) -List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD -List_set_body_calls_List_set_0: ✅ pass -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) -DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main -Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) -Any_get_body_calls_List_get_1: ✅ pass (in prelude file) -Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) -Any_get_body_calls_List_drop_3: ✅ pass (in prelude file) -Any_get!_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) -Any_get!_body_calls_List_get_1: ✅ pass (in prelude file) -Any_set_body_calls_List_set_0: ✅ pass (in prelude file) -Any_set!_body_calls_List_set_0: ✅ pass (in prelude file) -PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass (in prelude file) -PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass (in prelude file) -PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) -PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) -PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) -======= ->>>>>>> origin/main -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(215)_calls_Any_to_bool_0: ✅ pass (at line 8, col 4) -assert(215): ✅ pass (at line 8, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(308)_calls_Any_to_bool_0: ✅ pass (at line 11, col 4) -assert(308): ✅ pass (at line 11, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(440)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) -assert(440): ✅ pass (at line 15, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(540)_calls_Any_to_bool_0: ✅ pass (at line 18, col 4) -assert(540): ✅ pass (at line 18, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(672)_calls_Any_to_bool_0: ✅ pass (at line 22, col 4) -assert(672): ✅ pass (at line 22, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(790)_calls_Any_to_bool_0: ✅ pass (at line 25, col 4) -assert(790): ✅ pass (at line 25, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(921)_calls_Any_to_bool_0: ✅ pass (at line 29, col 4) -assert(921): ✅ pass (at line 29, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(1021)_calls_Any_to_bool_0: ✅ pass (at line 32, col 4) -assert(1021): ✅ pass (at line 32, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(1147)_calls_Any_to_bool_0: ✅ pass (at line 36, col 4) -assert(1147): ✅ pass (at line 36, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(1239)_calls_Any_to_bool_0: ✅ pass (at line 39, col 4) -assert(1239): ✅ pass (at line 39, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(1332)_calls_Any_to_bool_0: ✅ pass (at line 42, col 4) -assert(1332): ✅ pass (at line 42, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(1446)_calls_Any_to_bool_0: ✅ pass (at line 46, col 4) -assert(1446): ✅ pass (at line 46, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(1539)_calls_Any_to_bool_0: ✅ pass (at line 49, col 4) -assert(1539): ✅ pass (at line 49, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(1666)_calls_Any_to_bool_0: ✅ pass (at line 53, col 4) -assert(1666): ✅ pass (at line 53, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(1766)_calls_Any_to_bool_0: ✅ pass (at line 56, col 4) -assert(1766): ✅ pass (at line 56, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(1864)_calls_Any_to_bool_0: ✅ pass (at line 59, col 4) -assert(1864): ✅ pass (at line 59, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(1984)_calls_Any_to_bool_0: ✅ pass (at line 63, col 4) -assert(1984): ✅ pass (at line 63, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(2090)_calls_Any_to_bool_0: ✅ pass (at line 66, col 4) -assert(2090): ✅ pass (at line 66, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(2198)_calls_Any_to_bool_0: ✅ pass (at line 69, col 4) -assert(2198): ✅ pass (at line 69, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(2333)_calls_Any_to_bool_0: ✅ pass (at line 73, col 4) -assert(2333): ✅ pass (at line 73, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(2436)_calls_Any_to_bool_0: ✅ pass (at line 76, col 4) -assert(2436): ✅ pass (at line 76, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(2696)_calls_Any_to_bool_0: ✅ pass (at line 81, col 4) -assert(2696): ✅ pass (at line 81, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(2787)_calls_Any_to_bool_0: ✅ pass (at line 84, col 4) -assert(2787): ✅ pass (at line 84, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(2892)_calls_Any_to_bool_0: ✅ pass (at line 87, col 4) -assert(2892): ✅ pass (at line 87, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(2985)_calls_Any_to_bool_0: ✅ pass (at line 90, col 4) -assert(2985): ✅ pass (at line 90, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(3241)_calls_Any_to_bool_0: ✅ pass (at line 95, col 4) -assert(3241): ✅ pass (at line 95, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(3341)_calls_Any_to_bool_0: ✅ pass (at line 98, col 4) -assert(3341): ✅ pass (at line 98, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(3441)_calls_Any_to_bool_0: ✅ pass (at line 101, col 4) -assert(3441): ✅ pass (at line 101, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(3531)_calls_Any_to_bool_0: ✅ pass (at line 104, col 4) -assert(3531): ✅ pass (at line 104, col 4) -set_p_calls_re_compile_0: ✅ pass -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(3791)_calls_Any_to_bool_0: ✅ pass (at line 111, col 4) -assert(3791): ✅ pass (at line 111, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(3881)_calls_Any_to_bool_0: ✅ pass (at line 114, col 4) -assert(3881): ✅ pass (at line 114, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(3981)_calls_Any_to_bool_0: ✅ pass (at line 117, col 4) -assert(3981): ✅ pass (at line 117, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(4077)_calls_Any_to_bool_0: ✅ pass (at line 120, col 4) -assert(4077): ✅ pass (at line 120, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(4378)_calls_Any_to_bool_0: ✅ pass (at line 126, col 4) -assert(4378): ✅ pass (at line 126, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(4474)_calls_Any_to_bool_0: ✅ pass (at line 129, col 4) -assert(4474): ✅ pass (at line 129, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(4593)_calls_Any_to_bool_0: ✅ pass (at line 133, col 4) -assert(4593): ✅ pass (at line 133, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(4672)_calls_Any_to_bool_0: ✅ pass (at line 136, col 4) -assert(4672): ✅ pass (at line 136, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(4794)_calls_Any_to_bool_0: ✅ pass (at line 140, col 4) -assert(4794): ✅ pass (at line 140, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(4886)_calls_Any_to_bool_0: ✅ pass (at line 143, col 4) -assert(4886): ✅ pass (at line 143, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(5008)_calls_Any_to_bool_0: ✅ pass (at line 147, col 4) -assert(5008): ✅ pass (at line 147, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(5092)_calls_Any_to_bool_0: ✅ pass (at line 150, col 4) -assert(5092): ✅ pass (at line 150, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(5173)_calls_Any_to_bool_0: ✅ pass (at line 153, col 4) -assert(5173): ✅ pass (at line 153, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(5264)_calls_Any_to_bool_0: ✅ pass (at line 156, col 4) -assert(5264): ✅ pass (at line 156, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(5373)_calls_Any_to_bool_0: ✅ pass (at line 160, col 4) -assert(5373): ✅ pass (at line 160, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(5464)_calls_Any_to_bool_0: ✅ pass (at line 163, col 4) -assert(5464): ✅ pass (at line 163, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(5563)_calls_Any_to_bool_0: ✅ pass (at line 166, col 4) -assert(5563): ✅ pass (at line 166, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(5657)_calls_Any_to_bool_0: ✅ pass (at line 169, col 4) -assert(5657): ✅ pass (at line 169, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(5960)_calls_Any_to_bool_0: ✅ pass (at line 175, col 4) -assert(5960): ✅ pass (at line 175, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(6038)_calls_Any_to_bool_0: ✅ pass (at line 178, col 4) -assert(6038): ✅ pass (at line 178, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(6116)_calls_Any_to_bool_0: ✅ pass (at line 181, col 4) -assert(6116): ✅ pass (at line 181, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(6194)_calls_Any_to_bool_0: ✅ pass (at line 184, col 4) -assert(6194): ✅ pass (at line 184, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(6273)_calls_Any_to_bool_0: ✅ pass (at line 187, col 4) -assert(6273): ✅ pass (at line 187, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(6353)_calls_Any_to_bool_0: ✅ pass (at line 190, col 4) -assert(6353): ✅ pass (at line 190, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(6443)_calls_Any_to_bool_0: ✅ pass (at line 193, col 4) -assert(6443): ✅ pass (at line 193, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(6568)_calls_Any_to_bool_0: ✅ pass (at line 197, col 4) -assert(6568): ✅ pass (at line 197, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(6648)_calls_Any_to_bool_0: ✅ pass (at line 200, col 4) -assert(6648): ✅ pass (at line 200, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(6727)_calls_Any_to_bool_0: ✅ pass (at line 203, col 4) -assert(6727): ✅ pass (at line 203, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(6799)_calls_Any_to_bool_0: ✅ pass (at line 206, col 4) -assert(6799): ✅ pass (at line 206, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(6875)_calls_Any_to_bool_0: ✅ pass (at line 209, col 4) -assert(6875): ✅ pass (at line 209, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(6949)_calls_Any_to_bool_0: ✅ pass (at line 212, col 4) -assert(6949): ✅ pass (at line 212, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(7239)_calls_Any_to_bool_0: ✅ pass (at line 218, col 4) -assert(7239): ✅ pass (at line 218, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(7303)_calls_Any_to_bool_0: ✅ pass (at line 221, col 4) -assert(7303): ✅ pass (at line 221, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(7379)_calls_Any_to_bool_0: ✅ pass (at line 224, col 4) -assert(7379): ✅ pass (at line 224, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(7484)_calls_Any_to_bool_0: ✅ pass (at line 228, col 4) -assert(7484): ✅ pass (at line 228, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(7556)_calls_Any_to_bool_0: ✅ pass (at line 231, col 4) -assert(7556): ✅ pass (at line 231, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(7636)_calls_Any_to_bool_0: ✅ pass (at line 234, col 4) -assert(7636): ✅ pass (at line 234, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(7706)_calls_Any_to_bool_0: ✅ pass (at line 237, col 4) -assert(7706): ✅ pass (at line 237, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(7790)_calls_Any_to_bool_0: ✅ pass (at line 240, col 4) -assert(7790): ✅ pass (at line 240, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(7865)_calls_Any_to_bool_0: ✅ pass (at line 243, col 4) -assert(7865): ✅ pass (at line 243, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(8114)_calls_Any_to_bool_0: ✅ pass (at line 249, col 4) -assert(8114): ✅ pass (at line 249, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(8189)_calls_Any_to_bool_0: ✅ pass (at line 252, col 4) -assert(8189): ✅ pass (at line 252, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(8294)_calls_Any_to_bool_0: ✅ pass (at line 256, col 4) -assert(8294): ✅ pass (at line 256, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(8371)_calls_Any_to_bool_0: ✅ pass (at line 259, col 4) -assert(8371): ✅ pass (at line 259, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(8453)_calls_Any_to_bool_0: ✅ pass (at line 262, col 4) -assert(8453): ✅ pass (at line 262, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(8554)_calls_Any_to_bool_0: ✅ pass (at line 266, col 4) -assert(8554): ✅ pass (at line 266, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(8627)_calls_Any_to_bool_0: ✅ pass (at line 269, col 4) -assert(8627): ✅ pass (at line 269, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(8711)_calls_Any_to_bool_0: ✅ pass (at line 272, col 4) -assert(8711): ✅ pass (at line 272, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(8790)_calls_Any_to_bool_0: ✅ pass (at line 275, col 4) -assert(8790): ✅ pass (at line 275, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(8914)_calls_Any_to_bool_0: ✅ pass (at line 279, col 4) -assert(8914): ✅ pass (at line 279, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(8988)_calls_Any_to_bool_0: ✅ pass (at line 282, col 4) -assert(8988): ✅ pass (at line 282, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(9070)_calls_Any_to_bool_0: ✅ pass (at line 285, col 4) -assert(9070): ✅ pass (at line 285, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(9300)_calls_Any_to_bool_0: ✅ pass (at line 290, col 4) -assert(9300): ✅ pass (at line 290, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(9381)_calls_Any_to_bool_0: ✅ pass (at line 293, col 4) -assert(9381): ✅ pass (at line 293, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(9472)_calls_Any_to_bool_0: ✅ pass (at line 296, col 4) -assert(9472): ✅ pass (at line 296, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(9551)_calls_Any_to_bool_0: ✅ pass (at line 299, col 4) -assert(9551): ✅ pass (at line 299, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(9638)_calls_Any_to_bool_0: ✅ pass (at line 302, col 4) -assert(9638): ✅ pass (at line 302, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(9718)_calls_Any_to_bool_0: ✅ pass (at line 305, col 4) -assert(9718): ✅ pass (at line 305, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(9806)_calls_Any_to_bool_0: ✅ pass (at line 308, col 4) -assert(9806): ✅ pass (at line 308, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(10048)_calls_Any_to_bool_0: ✅ pass (at line 313, col 4) -assert(10048): ✅ pass (at line 313, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(10134)_calls_Any_to_bool_0: ✅ pass (at line 316, col 4) -assert(10134): ✅ pass (at line 316, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(10224)_calls_Any_to_bool_0: ✅ pass (at line 319, col 4) -assert(10224): ✅ pass (at line 319, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(10310)_calls_Any_to_bool_0: ✅ pass (at line 322, col 4) -assert(10310): ✅ pass (at line 322, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(10390)_calls_Any_to_bool_0: ✅ pass (at line 325, col 4) -assert(10390): ✅ pass (at line 325, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(10478)_calls_Any_to_bool_0: ✅ pass (at line 328, col 4) -assert(10478): ✅ pass (at line 328, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(10718)_calls_Any_to_bool_0: ✅ pass (at line 333, col 4) -assert(10718): ✅ pass (at line 333, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(10808)_calls_Any_to_bool_0: ✅ pass (at line 336, col 4) -assert(10808): ✅ pass (at line 336, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(10898)_calls_Any_to_bool_0: ✅ pass (at line 339, col 4) -assert(10898): ✅ pass (at line 339, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(10988)_calls_Any_to_bool_0: ✅ pass (at line 342, col 4) -assert(10988): ✅ pass (at line 342, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(11071)_calls_Any_to_bool_0: ✅ pass (at line 345, col 4) -assert(11071): ✅ pass (at line 345, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(11162)_calls_Any_to_bool_0: ✅ pass (at line 348, col 4) -assert(11162): ✅ pass (at line 348, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(11245)_calls_Any_to_bool_0: ✅ pass (at line 351, col 4) -assert(11245): ✅ pass (at line 351, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(11339)_calls_Any_to_bool_0: ✅ pass (at line 354, col 4) -assert(11339): ✅ pass (at line 354, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(11429)_calls_Any_to_bool_0: ✅ pass (at line 357, col 4) -assert(11429): ✅ pass (at line 357, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(11521)_calls_Any_to_bool_0: ✅ pass (at line 360, col 4) -assert(11521): ✅ pass (at line 360, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(11606)_calls_Any_to_bool_0: ✅ pass (at line 363, col 4) -assert(11606): ✅ pass (at line 363, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(11701)_calls_Any_to_bool_0: ✅ pass (at line 366, col 4) -assert(11701): ✅ pass (at line 366, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(11829)_calls_Any_to_bool_0: ✅ pass (at line 370, col 4) -assert(11829): ✅ pass (at line 370, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(11910)_calls_Any_to_bool_0: ✅ pass (at line 373, col 4) -assert(11910): ✅ pass (at line 373, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(11995)_calls_Any_to_bool_0: ✅ pass (at line 376, col 4) -assert(11995): ✅ pass (at line 376, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(12253)_calls_Any_to_bool_0: ✅ pass (at line 381, col 4) -assert(12253): ✅ pass (at line 381, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(12333)_calls_Any_to_bool_0: ✅ pass (at line 384, col 4) -assert(12333): ✅ pass (at line 384, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(12428)_calls_Any_to_bool_0: ✅ pass (at line 387, col 4) -assert(12428): ✅ pass (at line 387, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(12519)_calls_Any_to_bool_0: ✅ pass (at line 390, col 4) -assert(12519): ✅ pass (at line 390, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(12611)_calls_Any_to_bool_0: ✅ pass (at line 393, col 4) -assert(12611): ✅ pass (at line 393, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(12702)_calls_Any_to_bool_0: ✅ pass (at line 396, col 4) -assert(12702): ✅ pass (at line 396, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(12796)_calls_Any_to_bool_0: ✅ pass (at line 399, col 4) -assert(12796): ✅ pass (at line 399, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(13063)_calls_Any_to_bool_0: ✅ pass (at line 404, col 4) -assert(13063): ✅ pass (at line 404, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(13156)_calls_Any_to_bool_0: ✅ pass (at line 407, col 4) -assert(13156): ✅ pass (at line 407, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(13253)_calls_Any_to_bool_0: ✅ pass (at line 410, col 4) -assert(13253): ✅ pass (at line 410, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(13345)_calls_Any_to_bool_0: ✅ pass (at line 413, col 4) -assert(13345): ✅ pass (at line 413, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(13455)_calls_Any_to_bool_0: ✅ pass (at line 417, col 4) -assert(13455): ✅ pass (at line 417, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(13541)_calls_Any_to_bool_0: ✅ pass (at line 420, col 4) -assert(13541): ✅ pass (at line 420, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(13631)_calls_Any_to_bool_0: ✅ pass (at line 423, col 4) -assert(13631): ✅ pass (at line 423, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(13724)_calls_Any_to_bool_0: ✅ pass (at line 426, col 4) -assert(13724): ✅ pass (at line 426, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(13954)_calls_Any_to_bool_0: ✅ pass (at line 431, col 4) -assert(13954): ✅ pass (at line 431, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(14044)_calls_Any_to_bool_0: ✅ pass (at line 434, col 4) -assert(14044): ✅ pass (at line 434, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(14136)_calls_Any_to_bool_0: ✅ pass (at line 437, col 4) -assert(14136): ✅ pass (at line 437, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(14220)_calls_Any_to_bool_0: ✅ pass (at line 440, col 4) -assert(14220): ✅ pass (at line 440, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(14307)_calls_Any_to_bool_0: ✅ pass (at line 443, col 4) -assert(14307): ✅ pass (at line 443, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(14392)_calls_Any_to_bool_0: ✅ pass (at line 446, col 4) -assert(14392): ✅ pass (at line 446, col 4) -set_p_calls_re_compile_0: ✅ pass -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(14608)_calls_Any_to_bool_0: ✅ pass (at line 453, col 4) -assert(14608): ✅ pass (at line 453, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(14686)_calls_Any_to_bool_0: ✅ pass (at line 456, col 4) -assert(14686): ✅ pass (at line 456, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(14768)_calls_Any_to_bool_0: ✅ pass (at line 459, col 4) -assert(14768): ✅ pass (at line 459, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(14856)_calls_Any_to_bool_0: ✅ pass (at line 462, col 4) -assert(14856): ✅ pass (at line 462, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(14936)_calls_Any_to_bool_0: ✅ pass (at line 465, col 4) -assert(14936): ✅ pass (at line 465, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(15360)_calls_Any_to_bool_0: ✅ pass (at line 473, col 4) -assert(15360): ✅ pass (at line 473, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(15469)_calls_Any_to_bool_0: ✅ pass (at line 476, col 4) -assert(15469): ✅ pass (at line 476, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(15585)_calls_Any_to_bool_0: ✅ pass (at line 479, col 4) -assert(15585): ✅ pass (at line 479, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(15691)_calls_Any_to_bool_0: ✅ pass (at line 482, col 4) -assert(15691): ✅ pass (at line 482, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(15806)_calls_Any_to_bool_0: ✅ pass (at line 485, col 4) -assert(15806): ✅ pass (at line 485, col 4) -ite_cond_calls_Any_to_bool_0: ✅ pass (at line 487, col 0) -<<<<<<< HEAD -DETAIL: 457 passed, 0 failed, 0 inconclusive -======= -DETAIL: 445 passed, 0 failed, 0 inconclusive ->>>>>>> origin/main -RESULT: Analysis success +RESULT: Internal error diff --git a/StrataTest/Languages/Python/expected_laurel/test_return_types.expected b/StrataTest/Languages/Python/expected_laurel/test_return_types.expected index fef08b4ca..bb71e8622 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_return_types.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_return_types.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,8 +35,6 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -======= ->>>>>>> origin/main assert_assert(304)_calls_Any_to_bool_0: ✅ pass (at line 20, col 4) Assertion failed at line 20, col 4: assert(304): ❌ fail assert_assert(387)_calls_Any_to_bool_0: ✅ pass (at line 23, col 4) @@ -53,9 +45,5 @@ assert_assert(558)_calls_Any_to_bool_0: ✅ pass (at line 29, col 4) Assertion failed at line 29, col 4: assert(558): ❌ fail ite_cond_calls_Any_to_bool_0: ✅ pass (at line 31, col 0) -<<<<<<< HEAD -DETAIL: 39 passed, 3 failed, 1 inconclusive -======= -DETAIL: 27 passed, 3 failed, 1 inconclusive ->>>>>>> origin/main +DETAIL: 40 passed, 3 failed, 1 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_strings.expected b/StrataTest/Languages/Python/expected_laurel/test_strings.expected index 309d59e6e..6c7676010 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_strings.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_strings.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,17 +35,11 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -======= ->>>>>>> origin/main assert_assert(114)_calls_Any_to_bool_0: ✅ pass (at line 6, col 4) assert(114): ✅ pass (at line 6, col 4) assert_assert(264)_calls_Any_to_bool_0: ✅ pass (at line 11, col 4) assert(264): ✅ pass (at line 11, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 13, col 0) -<<<<<<< HEAD -DETAIL: 39 passed, 0 failed, 0 inconclusive -======= -DETAIL: 27 passed, 0 failed, 0 inconclusive ->>>>>>> origin/main +DETAIL: 40 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_subscription.expected b/StrataTest/Languages/Python/expected_laurel/test_subscription.expected index 625060c13..5eead29c1 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_subscription.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_subscription.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,8 +35,6 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -======= ->>>>>>> origin/main assert_assert(421)_calls_Any_get_0: ✅ pass (at line 16, col 0) assert_assert(421)_calls_Any_get_1: ✅ pass (at line 16, col 0) assert_assert(421)_calls_Any_get_2: ✅ pass (at line 16, col 0) @@ -59,9 +51,5 @@ assert_assert(554)_calls_PIn_0: ✅ pass (at line 20, col 0) assert_assert(554)_calls_Any_to_bool_1: ✅ pass (at line 20, col 0) assert(554): ✅ pass (at line 20, col 0) -<<<<<<< HEAD -DETAIL: 49 passed, 0 failed, 0 inconclusive -======= -DETAIL: 37 passed, 0 failed, 0 inconclusive ->>>>>>> origin/main +DETAIL: 50 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_try_except.expected b/StrataTest/Languages/Python/expected_laurel/test_try_except.expected index ba6e3eda5..575de8da9 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_try_except.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_try_except.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,16 +35,16 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -======= ->>>>>>> origin/main assert_assert(129)_calls_Any_to_bool_0: ✅ pass (at line 7, col 4) assert(129): ✅ pass (at line 7, col 4) +assert_assert(129)_calls_Any_to_bool_0: ✅ pass (at line 7, col 4) +assert(129): ✅ pass (at line 7, col 4) +assert_assert(358)_calls_Any_to_bool_0: ✅ pass (at line 17, col 4) +assert(358): ✅ pass (at line 17, col 4) +assert_assert(358)_calls_Any_to_bool_0: ✅ pass (at line 17, col 4) +assert(358): ✅ pass (at line 17, col 4) assert_assert(358)_calls_Any_to_bool_0: ✅ pass (at line 17, col 4) Assertion failed at line 17, col 4: assert(358): ❌ fail -<<<<<<< HEAD -DETAIL: 37 passed, 1 failed, 0 inconclusive -======= -DETAIL: 25 passed, 1 failed, 0 inconclusive ->>>>>>> origin/main +DETAIL: 44 passed, 1 failed, 0 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected b/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected index 8c6ccf323..2dcd726ba 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,18 +35,36 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -======= ->>>>>>> origin/main +assert_assert(355)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) +assert(355): ✅ pass (at line 15, col 4) +assert_assert(355)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) +assert(355): ✅ pass (at line 15, col 4) +assert_assert(355)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) +assert(355): ✅ pass (at line 15, col 4) +assert_assert(355)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) +assert(355): ✅ pass (at line 15, col 4) +assert_assert(355)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) +assert(355): ✅ pass (at line 15, col 4) +assert_assert(355)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) +assert(355): ✅ pass (at line 15, col 4) +assert_assert(355)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) +assert(355): ✅ pass (at line 15, col 4) +assert_assert(355)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) +assert(355): ✅ pass (at line 15, col 4) +assert_assert(355)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) +assert(355): ✅ pass (at line 15, col 4) assert_assert(355)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) assert(355): ✅ pass (at line 15, col 4) assert_assert(638)_calls_Any_to_bool_0: ✅ pass (at line 24, col 4) assert(638): ✅ pass (at line 24, col 4) +assert_assert(638)_calls_Any_to_bool_0: ✅ pass (at line 24, col 4) +assert(638): ✅ pass (at line 24, col 4) +assert_assert(952)_calls_Any_to_bool_0: ✅ pass (at line 35, col 4) +assert(952): ✅ pass (at line 35, col 4) +assert_assert(952)_calls_Any_to_bool_0: ✅ pass (at line 35, col 4) +assert(952): ✅ pass (at line 35, col 4) assert_assert(952)_calls_Any_to_bool_0: ✅ pass (at line 35, col 4) assert(952): ✅ pass (at line 35, col 4) -<<<<<<< HEAD -DETAIL: 40 passed, 0 failed, 0 inconclusive -======= -DETAIL: 28 passed, 0 failed, 0 inconclusive ->>>>>>> origin/main +DETAIL: 65 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_variable_reassign.expected b/StrataTest/Languages/Python/expected_laurel/test_variable_reassign.expected index f5b23656c..4c92863ec 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_variable_reassign.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_variable_reassign.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,8 +35,6 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -======= ->>>>>>> origin/main assert_assert(59)_calls_Any_to_bool_0: ✅ pass (at line 4, col 4) assert(59): ✅ pass (at line 4, col 4) assert_assert(104)_calls_Any_to_bool_0: ✅ pass (at line 6, col 4) @@ -52,7 +44,7 @@ assert(158): ✅ pass (at line 8, col 4) loop_guard_calls_Any_to_bool_0: ✅ pass (at line 13, col 4) loop_guard_end_calls_Any_to_bool_0: ✅ pass (at line 13, col 4) assert_assert(318)_calls_Any_to_bool_0: ✅ pass (at line 16, col 4) -assert(318): ❓ unknown (at line 16, col 4) +Assertion failed at line 16, col 4: assert(318): ❌ fail ite_cond_calls_Any_to_bool_0: ✅ pass (at line 21, col 4) assert_assert(496)_calls_Any_to_bool_0: ✅ pass (at line 25, col 4) assert(496): ✅ pass (at line 25, col 4) @@ -61,10 +53,5 @@ assert_assert(612)_calls_Any_to_bool_0: ✅ pass (at line 32, col 4) assert(612): ✅ pass (at line 32, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 34, col 0) -<<<<<<< HEAD -DETAIL: 50 passed, 1 failed, 0 inconclusive +DETAIL: 51 passed, 1 failed, 0 inconclusive RESULT: Failures found -======= -DETAIL: 38 passed, 0 failed, 1 inconclusive -RESULT: Inconclusive ->>>>>>> origin/main diff --git a/StrataTest/Languages/Python/expected_laurel/test_while_loop.expected b/StrataTest/Languages/Python/expected_laurel/test_while_loop.expected index 222c55858..6863e4d27 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_while_loop.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_while_loop.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,12 +35,10 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -======= ->>>>>>> origin/main loop_guard_calls_Any_to_bool_0: ✅ pass (at line 4, col 4) loop_guard_end_calls_Any_to_bool_0: ✅ pass (at line 4, col 4) assert_assert(134)_calls_Any_to_bool_0: ✅ pass (at line 7, col 4) -assert(134): ❓ unknown (at line 7, col 4) +Assertion failed at line 7, col 4: assert(134): ❌ fail loop_guard_calls_Any_to_bool_0: ✅ pass (at line 12, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 14, col 8) assert_assert(344)_calls_Any_to_bool_0: ✅ pass (at line 16, col 4) @@ -54,6 +46,8 @@ assert(344): ✅ pass (at line 16, col 4) loop_guard_end_calls_Any_to_bool_0: ✅ pass (at line 12, col 4) assert_assert(344)_calls_Any_to_bool_0: ✅ pass (at line 16, col 4) assert(344): ✅ pass (at line 16, col 4) +assert_assert(344)_calls_Any_to_bool_0: ✅ pass (at line 16, col 4) +assert(344): ✅ pass (at line 16, col 4) loop_guard_calls_Any_to_bool_0: ✅ pass (at line 22, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 24, col 8) loop_guard_end_calls_Any_to_bool_0: ✅ pass (at line 22, col 4) @@ -62,11 +56,8 @@ assert(589): ❓ unknown (at line 27, col 4) loop_guard_end_calls_Any_to_bool_0: ✅ pass (at line 22, col 4) assert_assert(589)_calls_Any_to_bool_0: ✅ pass (at line 27, col 4) assert(589): ❓ unknown (at line 27, col 4) +assert_assert(589)_calls_Any_to_bool_0: ✅ pass (at line 27, col 4) +assert(589): ✅ pass (at line 27, col 4) -<<<<<<< HEAD -DETAIL: 50 passed, 1 failed, 2 inconclusive +DETAIL: 55 passed, 1 failed, 2 inconclusive RESULT: Failures found -======= -DETAIL: 38 passed, 0 failed, 3 inconclusive -RESULT: Inconclusive ->>>>>>> origin/main diff --git a/StrataTest/Languages/Python/expected_laurel/test_with_statement.expected b/StrataTest/Languages/Python/expected_laurel/test_with_statement.expected index 9a166fa27..b3b2db8b1 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_with_statement.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_with_statement.expected @@ -10,14 +10,9 @@ List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -<<<<<<< HEAD List_set_body_calls_List_set_0: ✅ pass DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass -======= -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) ->>>>>>> origin/main Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) @@ -32,7 +27,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -<<<<<<< HEAD postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) @@ -41,26 +35,24 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -======= -callElimAssert_requires_12: ✅ pass -callElimAssert_requires_6: ✅ pass +callElimAssert_requires_9: ✅ pass +callElimAssert_requires_5: ✅ pass callElimAssert_requires_2: ✅ pass ->>>>>>> origin/main assert_assert(368)_calls_Any_to_bool_0: ✅ pass (at line 19, col 4) Assertion failed at line 19, col 4: assert(368): ❌ fail -callElimAssert_requires_25: ✅ pass callElimAssert_requires_19: ✅ pass +callElimAssert_requires_15: ✅ pass assert_assert(500)_calls_Any_to_bool_0: ✅ pass (at line 25, col 8) Assertion failed at line 25, col 8: assert(500): ❌ fail -callElimAssert_requires_15: ✅ pass -callElimAssert_requires_51: ✅ pass -callElimAssert_requires_45: ✅ pass +callElimAssert_requires_12: ✅ pass callElimAssert_requires_39: ✅ pass callElimAssert_requires_35: ✅ pass -assert_assert(666)_calls_Any_to_bool_0: ✅ pass (at line 32, col 8) -assert(666): ❓ unknown (at line 32, col 8) callElimAssert_requires_31: ✅ pass callElimAssert_requires_28: ✅ pass +assert_assert(666)_calls_Any_to_bool_0: ✅ pass (at line 32, col 8) +assert(666): ❓ unknown (at line 32, col 8) +callElimAssert_requires_25: ✅ pass +callElimAssert_requires_22: ✅ pass -DETAIL: 37 passed, 2 failed, 1 inconclusive +DETAIL: 50 passed, 2 failed, 1 inconclusive RESULT: Failures found From 2c1decc0d18f73e1f7fa2d087c7a9cc7efd9ddf7 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 27 Mar 2026 11:48:26 +0100 Subject: [PATCH 55/79] Update comments and test expectation --- .../Laurel/LaurelToCoreTranslator.lean | 11 ++---- .../Languages/Python/PreludeVerifyTest.lean | 38 +++++++++++++++---- 2 files changed, 34 insertions(+), 15 deletions(-) diff --git a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean index 4d11b18e3..f854560c0 100644 --- a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean +++ b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean @@ -661,6 +661,9 @@ def translateProcedureToFunction (options: LaurelTranslateOptions) (isRecursive: -- For recursive functions, infer the @[cases] parameter index: the first input -- whose type is a user-defined datatype (has constructors). This is the argument -- the partial evaluator will case-split on to unfold the recursion. + -- TODO: Use the decreases of the function to determine where to put @[cases] + -- First step should be to only support a decreases clause that is exactly one datatype parameter + -- Since that's what Core supports let casesIdx : Option Nat := if !isRecursive then none else proc.inputs.findIdx? fun p => @@ -865,14 +868,6 @@ def translateWithLaurel (options: LaurelTranslateOptions) (program : Program): T let procDecl ← translateProcedure proc return [Core.Decl.proc procDecl .empty] ++ axiomDecls - -- Topological sort: tarjan already gives reverse-topological order (dependencies first). - -- We additionally want procedure SCCs to come before function SCCs at the same level, - -- so that invokeOn axioms (which reference functions) are placed after the functions - -- they depend on. Since tarjan output is already dependency-first, we just stable-sort - -- to move procedure-containing SCCs before function-only SCCs within the same position. - -- The tarjan output is already correct topological order; we emit it as-is since - -- procedure SCCs naturally depend on function SCCs (functions are called by procedures), - -- so functions will already appear before procedures in the tarjan output. let orderedDecls := sccDecls.flatten -- Translate Laurel constants to Core function declarations (0-ary functions) diff --git a/StrataTest/Languages/Python/PreludeVerifyTest.lean b/StrataTest/Languages/Python/PreludeVerifyTest.lean index e33516a56..caf9c39bc 100644 --- a/StrataTest/Languages/Python/PreludeVerifyTest.lean +++ b/StrataTest/Languages/Python/PreludeVerifyTest.lean @@ -33,6 +33,10 @@ private def verifyPrelude : IO Core.VCResults := do /-- info: +Obligation: postcondition +Property: assert +Result: ✅ pass + Obligation: List_get_body_calls_List_get_0 Property: assert Result: ✅ pass @@ -41,10 +45,26 @@ Obligation: List_take_body_calls_List_take_0 Property: assert Result: ✅ pass +Obligation: List_take_len_post_postcondition_calls_List_take_0 +Property: assert +Result: ✅ pass + +Obligation: postcondition +Property: assert +Result: ✅ pass + Obligation: List_drop_body_calls_List_drop_0 Property: assert Result: ✅ pass +Obligation: List_drop_len_post_postcondition_calls_List_drop_0 +Property: assert +Result: ✅ pass + +Obligation: postcondition +Property: assert +Result: ✅ pass + Obligation: List_slice_body_calls_List_drop_0 Property: assert Result: ✅ pass @@ -121,31 +141,35 @@ Obligation: POr_body_calls_Any_to_bool_0 Property: assert Result: ✅ pass -Obligation: ret_type +Obligation: postcondition +Property: assert +Result: ✅ pass + +Obligation: postcondition Property: assert Result: ✅ pass -Obligation: ret_type +Obligation: postcondition Property: assert Result: ✅ pass -Obligation: ret_pos +Obligation: postcondition Property: assert Result: ✅ pass -Obligation: assert_name_is_foo +Obligation: assert(40598) Property: assert Result: ✅ pass -Obligation: assert_opt_name_none_or_str +Obligation: assert(40668) Property: assert Result: ✅ pass -Obligation: assert_opt_name_none_or_bar +Obligation: assert(40779) Property: assert Result: ✅ pass -Obligation: ensures_maybe_except_none +Obligation: postcondition Property: assert Result: ✅ pass -/ From 590b133ea049f6dbff800d744f556c9c91e124de Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 27 Mar 2026 12:21:39 +0100 Subject: [PATCH 56/79] Reverse failure expectation --- StrataTest/Languages/Python/AnalyzeLaurelTest.lean | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/StrataTest/Languages/Python/AnalyzeLaurelTest.lean b/StrataTest/Languages/Python/AnalyzeLaurelTest.lean index 40002ae58..3c62a7ba9 100644 --- a/StrataTest/Languages/Python/AnalyzeLaurelTest.lean +++ b/StrataTest/Languages/Python/AnalyzeLaurelTest.lean @@ -234,8 +234,8 @@ private meta def runTestCase (tmpDir : System.FilePath) match Strata.translateCombinedLaurel laurel with | (some core, []) => match Core.typeCheck Core.VerifyOptions.quiet core (moreFns := Strata.Python.ReFactory) with - | .error _ => return none -- Expected: Core type checking fails - | .ok _ => return some "test_class_any_as_composite.py: expected Core type checking to fail" + | .error errors => return some s!"test_class_any_as_composite.py: {errors}" + | .ok _ => return none | (_, errors) => return some s!"test_class_any_as_composite.py: Laurel to Core failed: {errors}" tasks := tasks.push ("test_class_any_as_composite.py", task) -- Collect results From b682e371d20bb308bba3505412c66a536aeae637 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 27 Mar 2026 12:54:09 +0100 Subject: [PATCH 57/79] update expect files --- .../test_regex_negative.expected | 225 ++++++++- .../test_regex_positive.expected | 464 +++++++++++++++++- 2 files changed, 683 insertions(+), 6 deletions(-) diff --git a/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected b/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected index 0ba78f284..f9b043bbc 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected @@ -1,5 +1,224 @@ -DETAIL: stderr: -solver stdout: (error "Regular expression terms are not supported in theory combination") +==== Verification Results ==== +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass +List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) +List_slice_body_calls_List_take_1: ✅ pass (in prelude file) +List_set_body_calls_List_set_0: ✅ pass +DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass +DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) +Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) +Any_get_body_calls_List_get_1: ✅ pass (in prelude file) +Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) +Any_get_body_calls_List_drop_3: ✅ pass (in prelude file) +Any_get!_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) +Any_get!_body_calls_List_get_1: ✅ pass (in prelude file) +Any_set_body_calls_List_set_0: ✅ pass (in prelude file) +Any_set!_body_calls_List_set_0: ✅ pass (in prelude file) +PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass (in prelude file) +PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass (in prelude file) +PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) +PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) +PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) +POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +ret_type: ✅ pass (in prelude file) +ret_type: ✅ pass (in prelude file) +ret_pos: ✅ pass (in prelude file) +assert_name_is_foo: ✅ pass (in prelude file) +assert_opt_name_none_or_str: ✅ pass (in prelude file) +assert_opt_name_none_or_bar: ✅ pass (in prelude file) +ensures_maybe_except_none: ✅ pass (in prelude file) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(272)_calls_Any_to_bool_0: ✅ pass (at line 10, col 4) +assert(272): ❓ unknown (at line 10, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(365)_calls_Any_to_bool_0: ✅ pass (at line 13, col 4) +assert(365): ❓ unknown (at line 13, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(465)_calls_Any_to_bool_0: ✅ pass (at line 16, col 4) +assert(465): ❓ unknown (at line 16, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(603)_calls_Any_to_bool_0: ✅ pass (at line 20, col 4) +assert(603): ❓ unknown (at line 20, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(702)_calls_Any_to_bool_0: ✅ pass (at line 23, col 4) +assert(702): ❓ unknown (at line 23, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(797)_calls_Any_to_bool_0: ✅ pass (at line 26, col 4) +assert(797): ❓ unknown (at line 26, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(888)_calls_Any_to_bool_0: ✅ pass (at line 29, col 4) +assert(888): ❓ unknown (at line 29, col 4) +set_p_calls_re_compile_0: ✅ pass +set_m_calls_re_search_0: ✅ pass +assert_assert(1038)_calls_Any_to_bool_0: ✅ pass (at line 34, col 4) +assert(1038): ❓ unknown (at line 34, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(1133)_calls_Any_to_bool_0: ✅ pass (at line 37, col 4) +assert(1133): ❓ unknown (at line 37, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(1495)_calls_Any_to_bool_0: ✅ pass (at line 47, col 4) +assert(1495): ✅ pass (at line 47, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(1667)_calls_Any_to_bool_0: ✅ pass (at line 54, col 4) +assert(1667): ✅ pass (at line 54, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(1846)_calls_Any_to_bool_0: ✅ pass (at line 61, col 4) +assert(1846): ✅ pass (at line 61, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) +assert(2015): ✅ pass (at line 68, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) +assert(2015): ✅ pass (at line 68, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(1846)_calls_Any_to_bool_0: ✅ pass (at line 61, col 4) +assert(1846): ✅ pass (at line 61, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) +assert(2015): ✅ pass (at line 68, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) +assert(2015): ✅ pass (at line 68, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(1667)_calls_Any_to_bool_0: ✅ pass (at line 54, col 4) +assert(1667): ✅ pass (at line 54, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(1846)_calls_Any_to_bool_0: ✅ pass (at line 61, col 4) +assert(1846): ✅ pass (at line 61, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) +assert(2015): ✅ pass (at line 68, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) +assert(2015): ✅ pass (at line 68, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(1846)_calls_Any_to_bool_0: ✅ pass (at line 61, col 4) +assert(1846): ✅ pass (at line 61, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) +assert(2015): ✅ pass (at line 68, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) +assert(2015): ✅ pass (at line 68, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(1495)_calls_Any_to_bool_0: ✅ pass (at line 47, col 4) +Assertion failed at line 47, col 4: assert(1495): ❌ fail +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(1667)_calls_Any_to_bool_0: ✅ pass (at line 54, col 4) +assert(1667): ✅ pass (at line 54, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(1846)_calls_Any_to_bool_0: ✅ pass (at line 61, col 4) +assert(1846): ✅ pass (at line 61, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) +assert(2015): ✅ pass (at line 68, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) +assert(2015): ✅ pass (at line 68, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(1846)_calls_Any_to_bool_0: ✅ pass (at line 61, col 4) +assert(1846): ✅ pass (at line 61, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) +assert(2015): ✅ pass (at line 68, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) +assert(2015): ✅ pass (at line 68, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(1667)_calls_Any_to_bool_0: ✅ pass (at line 54, col 4) +Assertion failed at line 54, col 4: assert(1667): ❌ fail +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(1846)_calls_Any_to_bool_0: ✅ pass (at line 61, col 4) +assert(1846): ✅ pass (at line 61, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) +assert(2015): ✅ pass (at line 68, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) +assert(2015): ✅ pass (at line 68, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(1846)_calls_Any_to_bool_0: ✅ pass (at line 61, col 4) +Assertion failed at line 61, col 4: assert(1846): ❌ fail +set_m_calls_re_search_0: ✅ pass +assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) +assert(2015): ✅ pass (at line 68, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) +Assertion failed at line 68, col 4: assert(2015): ❌ fail +set_m_calls_re_match_0: ✅ pass +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +assert(2193): ✅ pass (at line 75, col 4) +assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) +Assertion failed at line 75, col 4: assert(2193): ❌ fail +ite_cond_calls_Any_to_bool_0: ✅ pass (at line 77, col 0) -RESULT: Internal error +DETAIL: 205 passed, 5 failed, 9 inconclusive +RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected b/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected index 0ba78f284..58f03dd38 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected @@ -1,5 +1,463 @@ -DETAIL: stderr: -solver stdout: (error "Regular expression terms are not supported in theory combination") +==== Verification Results ==== +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass +List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) +List_slice_body_calls_List_take_1: ✅ pass (in prelude file) +List_set_body_calls_List_set_0: ✅ pass +DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass +DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) +Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) +Any_get_body_calls_List_get_1: ✅ pass (in prelude file) +Any_get_body_calls_List_slice_2: ✅ pass (in prelude file) +Any_get_body_calls_List_drop_3: ✅ pass (in prelude file) +Any_get!_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) +Any_get!_body_calls_List_get_1: ✅ pass (in prelude file) +Any_set_body_calls_List_set_0: ✅ pass (in prelude file) +Any_set!_body_calls_List_set_0: ✅ pass (in prelude file) +PFloorDiv_body_calls_Int.SafeDiv_0: ✅ pass (in prelude file) +PFloorDiv_body_calls_Int.SafeDiv_1: ✅ pass (in prelude file) +PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) +PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) +PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) +POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +ret_type: ✅ pass (in prelude file) +ret_type: ✅ pass (in prelude file) +ret_pos: ✅ pass (in prelude file) +assert_name_is_foo: ✅ pass (in prelude file) +assert_opt_name_none_or_str: ✅ pass (in prelude file) +assert_opt_name_none_or_bar: ✅ pass (in prelude file) +ensures_maybe_except_none: ✅ pass (in prelude file) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(215)_calls_Any_to_bool_0: ✅ pass (at line 8, col 4) +assert(215): ❓ unknown (at line 8, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(308)_calls_Any_to_bool_0: ✅ pass (at line 11, col 4) +assert(308): ❓ unknown (at line 11, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(440)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) +assert(440): ❓ unknown (at line 15, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(540)_calls_Any_to_bool_0: ✅ pass (at line 18, col 4) +assert(540): ❓ unknown (at line 18, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(672)_calls_Any_to_bool_0: ✅ pass (at line 22, col 4) +assert(672): ❓ unknown (at line 22, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(790)_calls_Any_to_bool_0: ✅ pass (at line 25, col 4) +assert(790): ❓ unknown (at line 25, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(921)_calls_Any_to_bool_0: ✅ pass (at line 29, col 4) +assert(921): ❓ unknown (at line 29, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(1021)_calls_Any_to_bool_0: ✅ pass (at line 32, col 4) +assert(1021): ❓ unknown (at line 32, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(1147)_calls_Any_to_bool_0: ✅ pass (at line 36, col 4) +assert(1147): ❓ unknown (at line 36, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(1239)_calls_Any_to_bool_0: ✅ pass (at line 39, col 4) +assert(1239): ❓ unknown (at line 39, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(1332)_calls_Any_to_bool_0: ✅ pass (at line 42, col 4) +assert(1332): ❓ unknown (at line 42, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(1446)_calls_Any_to_bool_0: ✅ pass (at line 46, col 4) +assert(1446): ❓ unknown (at line 46, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(1539)_calls_Any_to_bool_0: ✅ pass (at line 49, col 4) +assert(1539): ❓ unknown (at line 49, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(1666)_calls_Any_to_bool_0: ✅ pass (at line 53, col 4) +assert(1666): ❓ unknown (at line 53, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(1766)_calls_Any_to_bool_0: ✅ pass (at line 56, col 4) +assert(1766): ❓ unknown (at line 56, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(1864)_calls_Any_to_bool_0: ✅ pass (at line 59, col 4) +assert(1864): ❓ unknown (at line 59, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(1984)_calls_Any_to_bool_0: ✅ pass (at line 63, col 4) +assert(1984): ❓ unknown (at line 63, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(2090)_calls_Any_to_bool_0: ✅ pass (at line 66, col 4) +assert(2090): ❓ unknown (at line 66, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(2198)_calls_Any_to_bool_0: ✅ pass (at line 69, col 4) +assert(2198): ❓ unknown (at line 69, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(2333)_calls_Any_to_bool_0: ✅ pass (at line 73, col 4) +assert(2333): ❓ unknown (at line 73, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(2436)_calls_Any_to_bool_0: ✅ pass (at line 76, col 4) +assert(2436): ❓ unknown (at line 76, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(2696)_calls_Any_to_bool_0: ✅ pass (at line 81, col 4) +assert(2696): ❓ unknown (at line 81, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(2787)_calls_Any_to_bool_0: ✅ pass (at line 84, col 4) +assert(2787): ❓ unknown (at line 84, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(2892)_calls_Any_to_bool_0: ✅ pass (at line 87, col 4) +assert(2892): ❓ unknown (at line 87, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(2985)_calls_Any_to_bool_0: ✅ pass (at line 90, col 4) +assert(2985): ❓ unknown (at line 90, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(3241)_calls_Any_to_bool_0: ✅ pass (at line 95, col 4) +assert(3241): ❓ unknown (at line 95, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(3341)_calls_Any_to_bool_0: ✅ pass (at line 98, col 4) +assert(3341): ❓ unknown (at line 98, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(3441)_calls_Any_to_bool_0: ✅ pass (at line 101, col 4) +assert(3441): ❓ unknown (at line 101, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(3531)_calls_Any_to_bool_0: ✅ pass (at line 104, col 4) +assert(3531): ❓ unknown (at line 104, col 4) +set_p_calls_re_compile_0: ✅ pass +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(3791)_calls_Any_to_bool_0: ✅ pass (at line 111, col 4) +assert(3791): ❓ unknown (at line 111, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(3881)_calls_Any_to_bool_0: ✅ pass (at line 114, col 4) +assert(3881): ❓ unknown (at line 114, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(3981)_calls_Any_to_bool_0: ✅ pass (at line 117, col 4) +assert(3981): ❓ unknown (at line 117, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(4077)_calls_Any_to_bool_0: ✅ pass (at line 120, col 4) +assert(4077): ❓ unknown (at line 120, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(4378)_calls_Any_to_bool_0: ✅ pass (at line 126, col 4) +assert(4378): ❓ unknown (at line 126, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(4474)_calls_Any_to_bool_0: ✅ pass (at line 129, col 4) +assert(4474): ❓ unknown (at line 129, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(4593)_calls_Any_to_bool_0: ✅ pass (at line 133, col 4) +assert(4593): ❓ unknown (at line 133, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(4672)_calls_Any_to_bool_0: ✅ pass (at line 136, col 4) +assert(4672): ❓ unknown (at line 136, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(4794)_calls_Any_to_bool_0: ✅ pass (at line 140, col 4) +assert(4794): ❓ unknown (at line 140, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(4886)_calls_Any_to_bool_0: ✅ pass (at line 143, col 4) +assert(4886): ❓ unknown (at line 143, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(5008)_calls_Any_to_bool_0: ✅ pass (at line 147, col 4) +assert(5008): ❓ unknown (at line 147, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(5092)_calls_Any_to_bool_0: ✅ pass (at line 150, col 4) +assert(5092): ❓ unknown (at line 150, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(5173)_calls_Any_to_bool_0: ✅ pass (at line 153, col 4) +assert(5173): ❓ unknown (at line 153, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(5264)_calls_Any_to_bool_0: ✅ pass (at line 156, col 4) +assert(5264): ❓ unknown (at line 156, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(5373)_calls_Any_to_bool_0: ✅ pass (at line 160, col 4) +assert(5373): ❓ unknown (at line 160, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(5464)_calls_Any_to_bool_0: ✅ pass (at line 163, col 4) +assert(5464): ❓ unknown (at line 163, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(5563)_calls_Any_to_bool_0: ✅ pass (at line 166, col 4) +assert(5563): ❓ unknown (at line 166, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(5657)_calls_Any_to_bool_0: ✅ pass (at line 169, col 4) +assert(5657): ❓ unknown (at line 169, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(5960)_calls_Any_to_bool_0: ✅ pass (at line 175, col 4) +assert(5960): ❓ unknown (at line 175, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(6038)_calls_Any_to_bool_0: ✅ pass (at line 178, col 4) +assert(6038): ❓ unknown (at line 178, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(6116)_calls_Any_to_bool_0: ✅ pass (at line 181, col 4) +assert(6116): ❓ unknown (at line 181, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(6194)_calls_Any_to_bool_0: ✅ pass (at line 184, col 4) +assert(6194): ❓ unknown (at line 184, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(6273)_calls_Any_to_bool_0: ✅ pass (at line 187, col 4) +assert(6273): ❓ unknown (at line 187, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(6353)_calls_Any_to_bool_0: ✅ pass (at line 190, col 4) +assert(6353): ❓ unknown (at line 190, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(6443)_calls_Any_to_bool_0: ✅ pass (at line 193, col 4) +assert(6443): ❓ unknown (at line 193, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(6568)_calls_Any_to_bool_0: ✅ pass (at line 197, col 4) +assert(6568): ❓ unknown (at line 197, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(6648)_calls_Any_to_bool_0: ✅ pass (at line 200, col 4) +assert(6648): ❓ unknown (at line 200, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(6727)_calls_Any_to_bool_0: ✅ pass (at line 203, col 4) +assert(6727): ❓ unknown (at line 203, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(6799)_calls_Any_to_bool_0: ✅ pass (at line 206, col 4) +assert(6799): ❓ unknown (at line 206, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(6875)_calls_Any_to_bool_0: ✅ pass (at line 209, col 4) +assert(6875): ❓ unknown (at line 209, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(6949)_calls_Any_to_bool_0: ✅ pass (at line 212, col 4) +assert(6949): ❓ unknown (at line 212, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(7239)_calls_Any_to_bool_0: ✅ pass (at line 218, col 4) +assert(7239): ❓ unknown (at line 218, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(7303)_calls_Any_to_bool_0: ✅ pass (at line 221, col 4) +assert(7303): ❓ unknown (at line 221, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(7379)_calls_Any_to_bool_0: ✅ pass (at line 224, col 4) +assert(7379): ❓ unknown (at line 224, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(7484)_calls_Any_to_bool_0: ✅ pass (at line 228, col 4) +assert(7484): ❓ unknown (at line 228, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(7556)_calls_Any_to_bool_0: ✅ pass (at line 231, col 4) +assert(7556): ❓ unknown (at line 231, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(7636)_calls_Any_to_bool_0: ✅ pass (at line 234, col 4) +assert(7636): ❓ unknown (at line 234, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(7706)_calls_Any_to_bool_0: ✅ pass (at line 237, col 4) +assert(7706): ❓ unknown (at line 237, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(7790)_calls_Any_to_bool_0: ✅ pass (at line 240, col 4) +assert(7790): ❓ unknown (at line 240, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(7865)_calls_Any_to_bool_0: ✅ pass (at line 243, col 4) +assert(7865): ❓ unknown (at line 243, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(8114)_calls_Any_to_bool_0: ✅ pass (at line 249, col 4) +assert(8114): ❓ unknown (at line 249, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(8189)_calls_Any_to_bool_0: ✅ pass (at line 252, col 4) +assert(8189): ❓ unknown (at line 252, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(8294)_calls_Any_to_bool_0: ✅ pass (at line 256, col 4) +assert(8294): ❓ unknown (at line 256, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(8371)_calls_Any_to_bool_0: ✅ pass (at line 259, col 4) +assert(8371): ❓ unknown (at line 259, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(8453)_calls_Any_to_bool_0: ✅ pass (at line 262, col 4) +assert(8453): ❓ unknown (at line 262, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(8554)_calls_Any_to_bool_0: ✅ pass (at line 266, col 4) +assert(8554): ❓ unknown (at line 266, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(8627)_calls_Any_to_bool_0: ✅ pass (at line 269, col 4) +assert(8627): ❓ unknown (at line 269, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(8711)_calls_Any_to_bool_0: ✅ pass (at line 272, col 4) +assert(8711): ❓ unknown (at line 272, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(8790)_calls_Any_to_bool_0: ✅ pass (at line 275, col 4) +assert(8790): ❓ unknown (at line 275, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(8914)_calls_Any_to_bool_0: ✅ pass (at line 279, col 4) +assert(8914): ❓ unknown (at line 279, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(8988)_calls_Any_to_bool_0: ✅ pass (at line 282, col 4) +assert(8988): ❓ unknown (at line 282, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(9070)_calls_Any_to_bool_0: ✅ pass (at line 285, col 4) +assert(9070): ❓ unknown (at line 285, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(9300)_calls_Any_to_bool_0: ✅ pass (at line 290, col 4) +assert(9300): ❓ unknown (at line 290, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(9381)_calls_Any_to_bool_0: ✅ pass (at line 293, col 4) +assert(9381): ❓ unknown (at line 293, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(9472)_calls_Any_to_bool_0: ✅ pass (at line 296, col 4) +assert(9472): ❓ unknown (at line 296, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(9551)_calls_Any_to_bool_0: ✅ pass (at line 299, col 4) +assert(9551): ❓ unknown (at line 299, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(9638)_calls_Any_to_bool_0: ✅ pass (at line 302, col 4) +assert(9638): ❓ unknown (at line 302, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(9718)_calls_Any_to_bool_0: ✅ pass (at line 305, col 4) +assert(9718): ❓ unknown (at line 305, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(9806)_calls_Any_to_bool_0: ✅ pass (at line 308, col 4) +assert(9806): ❓ unknown (at line 308, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(10048)_calls_Any_to_bool_0: ✅ pass (at line 313, col 4) +assert(10048): ❓ unknown (at line 313, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(10134)_calls_Any_to_bool_0: ✅ pass (at line 316, col 4) +assert(10134): ❓ unknown (at line 316, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(10224)_calls_Any_to_bool_0: ✅ pass (at line 319, col 4) +assert(10224): ❓ unknown (at line 319, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(10310)_calls_Any_to_bool_0: ✅ pass (at line 322, col 4) +assert(10310): ❓ unknown (at line 322, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(10390)_calls_Any_to_bool_0: ✅ pass (at line 325, col 4) +assert(10390): ❓ unknown (at line 325, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(10478)_calls_Any_to_bool_0: ✅ pass (at line 328, col 4) +assert(10478): ❓ unknown (at line 328, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(10718)_calls_Any_to_bool_0: ✅ pass (at line 333, col 4) +assert(10718): ❓ unknown (at line 333, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(10808)_calls_Any_to_bool_0: ✅ pass (at line 336, col 4) +assert(10808): ❓ unknown (at line 336, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(10898)_calls_Any_to_bool_0: ✅ pass (at line 339, col 4) +assert(10898): ❓ unknown (at line 339, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(10988)_calls_Any_to_bool_0: ✅ pass (at line 342, col 4) +assert(10988): ❓ unknown (at line 342, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(11071)_calls_Any_to_bool_0: ✅ pass (at line 345, col 4) +assert(11071): ❓ unknown (at line 345, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(11162)_calls_Any_to_bool_0: ✅ pass (at line 348, col 4) +assert(11162): ❓ unknown (at line 348, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(11245)_calls_Any_to_bool_0: ✅ pass (at line 351, col 4) +assert(11245): ❓ unknown (at line 351, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(11339)_calls_Any_to_bool_0: ✅ pass (at line 354, col 4) +assert(11339): ❓ unknown (at line 354, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(11429)_calls_Any_to_bool_0: ✅ pass (at line 357, col 4) +assert(11429): ❓ unknown (at line 357, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(11521)_calls_Any_to_bool_0: ✅ pass (at line 360, col 4) +assert(11521): ❓ unknown (at line 360, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(11606)_calls_Any_to_bool_0: ✅ pass (at line 363, col 4) +assert(11606): ❓ unknown (at line 363, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(11701)_calls_Any_to_bool_0: ✅ pass (at line 366, col 4) +assert(11701): ❓ unknown (at line 366, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(11829)_calls_Any_to_bool_0: ✅ pass (at line 370, col 4) +assert(11829): ❓ unknown (at line 370, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(11910)_calls_Any_to_bool_0: ✅ pass (at line 373, col 4) +assert(11910): ❓ unknown (at line 373, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(11995)_calls_Any_to_bool_0: ✅ pass (at line 376, col 4) +assert(11995): ❓ unknown (at line 376, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(12253)_calls_Any_to_bool_0: ✅ pass (at line 381, col 4) +assert(12253): ❓ unknown (at line 381, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(12333)_calls_Any_to_bool_0: ✅ pass (at line 384, col 4) +assert(12333): ❓ unknown (at line 384, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(12428)_calls_Any_to_bool_0: ✅ pass (at line 387, col 4) +assert(12428): ❓ unknown (at line 387, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(12519)_calls_Any_to_bool_0: ✅ pass (at line 390, col 4) +assert(12519): ❓ unknown (at line 390, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(12611)_calls_Any_to_bool_0: ✅ pass (at line 393, col 4) +assert(12611): ❓ unknown (at line 393, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(12702)_calls_Any_to_bool_0: ✅ pass (at line 396, col 4) +assert(12702): ❓ unknown (at line 396, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(12796)_calls_Any_to_bool_0: ✅ pass (at line 399, col 4) +assert(12796): ❓ unknown (at line 399, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(13063)_calls_Any_to_bool_0: ✅ pass (at line 404, col 4) +assert(13063): ❓ unknown (at line 404, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(13156)_calls_Any_to_bool_0: ✅ pass (at line 407, col 4) +assert(13156): ❓ unknown (at line 407, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(13253)_calls_Any_to_bool_0: ✅ pass (at line 410, col 4) +assert(13253): ❓ unknown (at line 410, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(13345)_calls_Any_to_bool_0: ✅ pass (at line 413, col 4) +assert(13345): ❓ unknown (at line 413, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(13455)_calls_Any_to_bool_0: ✅ pass (at line 417, col 4) +assert(13455): ❓ unknown (at line 417, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(13541)_calls_Any_to_bool_0: ✅ pass (at line 420, col 4) +assert(13541): ❓ unknown (at line 420, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(13631)_calls_Any_to_bool_0: ✅ pass (at line 423, col 4) +assert(13631): ❓ unknown (at line 423, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(13724)_calls_Any_to_bool_0: ✅ pass (at line 426, col 4) +assert(13724): ❓ unknown (at line 426, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(13954)_calls_Any_to_bool_0: ✅ pass (at line 431, col 4) +assert(13954): ❓ unknown (at line 431, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(14044)_calls_Any_to_bool_0: ✅ pass (at line 434, col 4) +assert(14044): ❓ unknown (at line 434, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(14136)_calls_Any_to_bool_0: ✅ pass (at line 437, col 4) +assert(14136): ❓ unknown (at line 437, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(14220)_calls_Any_to_bool_0: ✅ pass (at line 440, col 4) +assert(14220): ❓ unknown (at line 440, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(14307)_calls_Any_to_bool_0: ✅ pass (at line 443, col 4) +assert(14307): ❓ unknown (at line 443, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(14392)_calls_Any_to_bool_0: ✅ pass (at line 446, col 4) +assert(14392): ❓ unknown (at line 446, col 4) +set_p_calls_re_compile_0: ✅ pass +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(14608)_calls_Any_to_bool_0: ✅ pass (at line 453, col 4) +assert(14608): ❓ unknown (at line 453, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(14686)_calls_Any_to_bool_0: ✅ pass (at line 456, col 4) +assert(14686): ❓ unknown (at line 456, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(14768)_calls_Any_to_bool_0: ✅ pass (at line 459, col 4) +assert(14768): ❓ unknown (at line 459, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(14856)_calls_Any_to_bool_0: ✅ pass (at line 462, col 4) +assert(14856): ❓ unknown (at line 462, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(14936)_calls_Any_to_bool_0: ✅ pass (at line 465, col 4) +assert(14936): ❓ unknown (at line 465, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(15360)_calls_Any_to_bool_0: ✅ pass (at line 473, col 4) +assert(15360): ❓ unknown (at line 473, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(15469)_calls_Any_to_bool_0: ✅ pass (at line 476, col 4) +assert(15469): ❓ unknown (at line 476, col 4) +set_m_calls_re_fullmatch_0: ✅ pass +assert_assert(15585)_calls_Any_to_bool_0: ✅ pass (at line 479, col 4) +assert(15585): ❓ unknown (at line 479, col 4) +set_m_calls_re_search_0: ✅ pass +assert_assert(15691)_calls_Any_to_bool_0: ✅ pass (at line 482, col 4) +assert(15691): ❓ unknown (at line 482, col 4) +set_m_calls_re_match_0: ✅ pass +assert_assert(15806)_calls_Any_to_bool_0: ✅ pass (at line 485, col 4) +assert(15806): ❓ unknown (at line 485, col 4) +ite_cond_calls_Any_to_bool_0: ✅ pass (at line 487, col 0) -RESULT: Internal error +DETAIL: 318 passed, 0 failed, 140 inconclusive +RESULT: Inconclusive From 449fa5b5ea15996019fe04ffd3cf19f0d89cd744 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 27 Mar 2026 13:27:11 +0100 Subject: [PATCH 58/79] Add test-case --- .../Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean b/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean index d77493d6e..5dd0b5cfe 100644 --- a/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean +++ b/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean @@ -20,6 +20,11 @@ procedure PAndQ(x: int) invokeOn P(x) ensures P(x) && Q(x); +function assertP(x: int): int requires P(x); +function needsPAndQsInvoke(): int { + assertP(3) +}; + // The axiom fires because P(x) appears in the goal. procedure fireAxiomUsingPattern(x: int) { assert P(x) From 629cfcab0aceefe3542a7a18aea8ddacc0eac679 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 27 Mar 2026 13:32:17 +0100 Subject: [PATCH 59/79] Refactoring --- .../Laurel/LaurelToCoreTranslator.lean | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean index f854560c0..48d544430 100644 --- a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean +++ b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean @@ -831,22 +831,22 @@ def translateWithLaurel (options: LaurelTranslateOptions) (program : Program): T -- (a node appears after all nodes that have paths to it). let sccs := Strata.OutGraph.tarjan graph - -- For each SCC, determine if it is purely functional or contains procedures. - -- Procedures can't call functions (only functions can call functions), so an SCC - -- either contains only functional procedures or only non-functional procedures. - let sccDecls ← sccs.toList.mapM fun scc => do + let sccDecls: List (List Procedure × Bool) ← sccs.toList.mapM fun scc => do let procs := scc.toList.filterMap fun idx => nonExternalArr[idx.val]? + + let isRecursive := procs.length > 1 || + (match scc.toList.head? with + | some node => (graph.nodesOut node).contains node + | none => false) + return (procs, isRecursive) + + let orderedDecls ← sccDecls.flatMapM (fun (procs, isRecursive) => do + -- For each SCC, determine if it is purely functional or contains procedures. + -- Procedures can't call functions (only functions can call functions), so an SCC + -- either contains only functional procedures or only non-functional procedures. let isFuncSCC := procs.all (·.isFunctional) if isFuncSCC then - -- Translate all as Core functions. - -- An SCC is recursive if it has >1 member, or if the single node has a self-edge. - let isRecursive := procs.length > 1 || - (match scc.toList.head? with - | some node => (graph.nodesOut node).contains node - | none => false) - - -- A single-element SCC → .func (or .recFuncBlock if recursive); multi-element SCC → .recFuncBlock. let funcs ← procs.mapM (translateProcedureToFunction options isRecursive) if isRecursive then -- Wrap all recursive functions (single self-recursive or mutual) in recFuncBlock. @@ -857,8 +857,6 @@ def translateWithLaurel (options: LaurelTranslateOptions) (program : Program): T else return funcs else - -- Non-functional SCC: emit invokeOn axiom (if any) after each procedure, - -- so the axiom is not in scope when the procedure's VCs are checked. procs.flatMapM fun proc => do let axiomDecls : List Core.Decl ← match proc.invokeOn with | none => pure [] @@ -867,8 +865,7 @@ def translateWithLaurel (options: LaurelTranslateOptions) (program : Program): T pure axDecl?.toList let procDecl ← translateProcedure proc return [Core.Decl.proc procDecl .empty] ++ axiomDecls - - let orderedDecls := sccDecls.flatten + ) -- Translate Laurel constants to Core function declarations (0-ary functions) let constantDecls ← program.constants.mapM fun c => do From 64ccccb6cdc92d5813b6d81fa7b239d2248921fe Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 27 Mar 2026 13:35:43 +0100 Subject: [PATCH 60/79] More refactoring --- .../Languages/Laurel/LaurelToCoreTranslator.lean | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean index 48d544430..48fa5f525 100644 --- a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean +++ b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean @@ -789,9 +789,9 @@ def translateWithLaurel (options: LaurelTranslateOptions) (program : Program): T let groups := groupDatatypes laurelDatatypes ldatatypes return groups.map fun group => Core.Decl.type (.data group) mdWithUnknownLoc - translateLaurelToCore (options: LaurelTranslateOptions) (program : Program): TranslateM Core.Program := do - let model := (← get).model - + -- Compute the SCCs of the call graph over non-external procedures, returning each SCC as a + -- list of procedures paired with a flag indicating whether the SCC is recursive. + computeSccDecls (program : Program) : TranslateM (List (List Procedure × Bool)) := do -- External procedures are completely ignored (not translated to Core). let nonExternal := program.staticProcedures.filter (fun p => !p.body.isExternal) @@ -831,16 +831,20 @@ def translateWithLaurel (options: LaurelTranslateOptions) (program : Program): T -- (a node appears after all nodes that have paths to it). let sccs := Strata.OutGraph.tarjan graph - let sccDecls: List (List Procedure × Bool) ← sccs.toList.mapM fun scc => do + sccs.toList.mapM fun scc => do let procs := scc.toList.filterMap fun idx => nonExternalArr[idx.val]? - let isRecursive := procs.length > 1 || (match scc.toList.head? with | some node => (graph.nodesOut node).contains node | none => false) return (procs, isRecursive) + translateLaurelToCore (options: LaurelTranslateOptions) (program : Program): TranslateM Core.Program := do + let model := (← get).model + + let sccDecls ← computeSccDecls program + let orderedDecls ← sccDecls.flatMapM (fun (procs, isRecursive) => do -- For each SCC, determine if it is purely functional or contains procedures. -- Procedures can't call functions (only functions can call functions), so an SCC From 7a57d717cbca2d983c9408f31b8b13580ffb5f86 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 27 Mar 2026 13:41:13 +0100 Subject: [PATCH 61/79] Refactoring --- Strata/Languages/Laurel/DatatypeGrouping.lean | 68 ------------- .../Laurel/LaurelToCoreTranslator.lean | 97 +------------------ 2 files changed, 2 insertions(+), 163 deletions(-) delete mode 100644 Strata/Languages/Laurel/DatatypeGrouping.lean diff --git a/Strata/Languages/Laurel/DatatypeGrouping.lean b/Strata/Languages/Laurel/DatatypeGrouping.lean deleted file mode 100644 index a3fab9d29..000000000 --- a/Strata/Languages/Laurel/DatatypeGrouping.lean +++ /dev/null @@ -1,68 +0,0 @@ -/- - Copyright Strata Contributors - - SPDX-License-Identifier: Apache-2.0 OR MIT --/ - -module -public import Strata.Languages.Laurel.Laurel -import Strata.DL.Lambda.LExpr -import Strata.DDM.Util.Graph.Tarjan - -/-! -## Datatype Grouping via Tarjan's SCC - -Groups `LDatatype Unit` values by strongly connected components of their direct type -references, so that mutually recursive datatypes share a single `.data` declaration. -SCCs are emitted in dependency order: dependencies (leaves) before dependents (roots). --/ - -namespace Strata.Laurel - -open Lambda (LMonoTy LExpr) - -/-- Collect all `UserDefined` type names referenced in a `HighType`, including nested ones. -/ -def collectTypeRefs : HighTypeMd → List String - | ⟨.UserDefined name, _⟩ => [name.text] - | ⟨.TSet elem, _⟩ => collectTypeRefs elem - | ⟨.TMap k v, _⟩ => collectTypeRefs k ++ collectTypeRefs v - | ⟨.TTypedField vt, _⟩ => collectTypeRefs vt - | ⟨.Applied base args, _⟩ => - collectTypeRefs base ++ args.flatMap collectTypeRefs - | ⟨.Pure base, _⟩ => collectTypeRefs base - | ⟨.Intersection ts, _⟩ => ts.flatMap collectTypeRefs - | ⟨.TCore name, _⟩ => [name] - | _ => [] - -/-- Get all datatype names that a `DatatypeDefinition` references in its constructor args. -/ -def datatypeRefs (dt : DatatypeDefinition) : List String := - dt.constructors.flatMap fun c => c.args.flatMap fun p => collectTypeRefs p.type - -/-- -Group `LDatatype Unit` values by strongly connected components of their direct type references. -Datatypes in the same SCC (mutually recursive) share a single `.data` declaration. -Non-recursive datatypes each get their own singleton `.data` declaration. -The returned groups are in topological order: leaves (no dependencies) first, roots last. --/ -public def groupDatatypes (dts : List DatatypeDefinition) - (ldts : List (Lambda.LDatatype Unit)) : List (List (Lambda.LDatatype Unit)) := - let n := dts.length - if n = 0 then [] else - let nameToIdx : Std.HashMap String Nat := - dts.foldlIdx (fun m i dt => m.insert dt.name.text i) {} - -- dt[i] references dt[j] means i depends on j (j must be declared first). - -- tarjan guarantees: if there's a path A→B, B appears after A in the output. - -- So we add edge j→i (j has a path to i), ensuring i (the dependent) appears after j (the dependency). - let edges : List (Nat × Nat) := - dts.foldlIdx (fun acc i dt => - (datatypeRefs dt).filterMap nameToIdx.get? |>.foldl (fun acc j => (j, i) :: acc) acc) [] - let g := OutGraph.ofEdges! n edges - let ldtMap : Std.HashMap String (Lambda.LDatatype Unit) := - ldts.foldl (fun m ldt => m.insert ldt.name ldt) {} - let dtsArr := dts.toArray - OutGraph.tarjan g |>.toList.filterMap fun comp => - let members := comp.toList.filterMap fun idx => - dtsArr[idx]? |>.bind fun dt => ldtMap.get? dt.name.text - if members.isEmpty then none else some members - -end Strata.Laurel diff --git a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean index 48fa5f525..bdc164990 100644 --- a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean +++ b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean @@ -21,7 +21,7 @@ public import Strata.Languages.Laurel.TypeHierarchy public import Strata.Languages.Laurel.LaurelTypes public import Strata.Languages.Laurel.ModifiesClauses public import Strata.Languages.Laurel.CoreDefinitionsForLaurel -import Strata.Languages.Laurel.DatatypeGrouping +import Strata.Languages.Laurel.CoreGroupingAndOrdering import Strata.DDM.Util.DecimalRat import Strata.DL.Imperative.Stmt import Strata.DL.Imperative.MetaData @@ -560,48 +560,6 @@ def translateProcedure (proc : Procedure) : TranslateM Core.Procedure := do let spec : Core.Procedure.Spec := { modifies, preconditions, postconditions } return { header, spec, body } -/-- -Collect all `StaticCall` callee names referenced anywhere in a `StmtExpr`. -Used to determine which functions an invokeOn axiom depends on. --/ -partial def collectStaticCallNames (expr : StmtExpr) : List String := - match expr with - | .StaticCall callee args => - callee.text :: args.flatMap (fun a => collectStaticCallNames a.val) - | .PrimitiveOp _ args => args.flatMap (fun a => collectStaticCallNames a.val) - | .IfThenElse cond t e => - collectStaticCallNames cond.val ++ - collectStaticCallNames t.val ++ - (e.toList.flatMap (fun x => collectStaticCallNames x.val)) - | .Block stmts _ => stmts.flatMap (fun s => collectStaticCallNames s.val) - | .Assign targets v => - targets.flatMap (fun t => collectStaticCallNames t.val) ++ - collectStaticCallNames v.val - | .LocalVariable _ _ init => init.toList.flatMap (fun i => collectStaticCallNames i.val) - | .Return v => v.toList.flatMap (fun x => collectStaticCallNames x.val) - | .While cond invs dec body => - collectStaticCallNames cond.val ++ - invs.flatMap (fun i => collectStaticCallNames i.val) ++ - dec.toList.flatMap (fun d => collectStaticCallNames d.val) ++ - collectStaticCallNames body.val - | .Forall _ trig body => - trig.toList.flatMap (fun t => collectStaticCallNames t.val) ++ - collectStaticCallNames body.val - | .Exists _ trig body => - trig.toList.flatMap (fun t => collectStaticCallNames t.val) ++ - collectStaticCallNames body.val - | .FieldSelect t _ => collectStaticCallNames t.val - | .PureFieldUpdate t _ v => collectStaticCallNames t.val ++ collectStaticCallNames v.val - | .InstanceCall t _ args => - collectStaticCallNames t.val ++ args.flatMap (fun a => collectStaticCallNames a.val) - | .Old v | .Fresh v | .Assert v | .Assume v => collectStaticCallNames v.val - | .ProveBy v p => collectStaticCallNames v.val ++ collectStaticCallNames p.val - | .ReferenceEquals l r => collectStaticCallNames l.val ++ collectStaticCallNames r.val - | .AsType t _ | .IsType t _ => collectStaticCallNames t.val - | .ContractOf _ f => collectStaticCallNames f.val - | .Assigned v => collectStaticCallNames v.val - | _ => [] - def translateInvokeOnAxiom (proc : Procedure) (trigger : StmtExprMd) : TranslateM (Option Core.Decl) := do let model := (← get).model @@ -789,61 +747,10 @@ def translateWithLaurel (options: LaurelTranslateOptions) (program : Program): T let groups := groupDatatypes laurelDatatypes ldatatypes return groups.map fun group => Core.Decl.type (.data group) mdWithUnknownLoc - -- Compute the SCCs of the call graph over non-external procedures, returning each SCC as a - -- list of procedures paired with a flag indicating whether the SCC is recursive. - computeSccDecls (program : Program) : TranslateM (List (List Procedure × Bool)) := do - -- External procedures are completely ignored (not translated to Core). - let nonExternal := program.staticProcedures.filter (fun p => !p.body.isExternal) - - -- Build a call-graph over all non-external procedures. - -- An edge proc → callee means proc's body/contracts contain a StaticCall to callee. - let nonExternalArr : Array Procedure := nonExternal.toArray - let nameToIdx : Std.HashMap String Nat := - nonExternalArr.foldl (fun (acc : Std.HashMap String Nat × Nat) proc => - (acc.1.insert proc.name.text acc.2, acc.2 + 1)) ({}, 0) |>.1 - - -- Collect all callee names from a procedure's body and contracts. - let procCallees (proc : Procedure) : List String := - let bodyExprs : List StmtExpr := match proc.body with - | .Transparent b => [b.val] - | .Opaque postconds (some impl) _ => postconds.map (·.val) ++ [impl.val] - | .Opaque postconds none _ => postconds.map (·.val) - | _ => [] - let contractExprs : List StmtExpr := - proc.preconditions.map (·.val) ++ - proc.invokeOn.toList.map (·.val) - (bodyExprs ++ contractExprs).flatMap collectStaticCallNames - - -- Build the OutGraph for Tarjan. - let n := nonExternalArr.size - let graph : Strata.OutGraph n := - nonExternalArr.foldl (fun (acc : Strata.OutGraph n × Nat) proc => - let callerIdx := acc.2 - let g := acc.1 - let callees := procCallees proc - let g' := callees.foldl (fun g callee => - match nameToIdx.get? callee with - | some calleeIdx => g.addEdge! calleeIdx callerIdx - | none => g) g - (g', callerIdx + 1)) (Strata.OutGraph.empty n, 0) |>.1 - - -- Run Tarjan's SCC algorithm. Results are in reverse topological order - -- (a node appears after all nodes that have paths to it). - let sccs := Strata.OutGraph.tarjan graph - - sccs.toList.mapM fun scc => do - let procs := scc.toList.filterMap fun idx => - nonExternalArr[idx.val]? - let isRecursive := procs.length > 1 || - (match scc.toList.head? with - | some node => (graph.nodesOut node).contains node - | none => false) - return (procs, isRecursive) - translateLaurelToCore (options: LaurelTranslateOptions) (program : Program): TranslateM Core.Program := do let model := (← get).model - let sccDecls ← computeSccDecls program + let sccDecls := computeSccDecls program let orderedDecls ← sccDecls.flatMapM (fun (procs, isRecursive) => do -- For each SCC, determine if it is purely functional or contains procedures. From 4fe114f8e5c00174cdc63b9de8695dfb20b1d353 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 27 Mar 2026 13:44:22 +0100 Subject: [PATCH 62/79] Add missing file --- .../Laurel/CoreGroupingAndOrdering.lean | 179 ++++++++++++++++++ .../Examples/Fundamentals/T19_InvokeOn.lean | 8 +- 2 files changed, 185 insertions(+), 2 deletions(-) create mode 100644 Strata/Languages/Laurel/CoreGroupingAndOrdering.lean diff --git a/Strata/Languages/Laurel/CoreGroupingAndOrdering.lean b/Strata/Languages/Laurel/CoreGroupingAndOrdering.lean new file mode 100644 index 000000000..48382850b --- /dev/null +++ b/Strata/Languages/Laurel/CoreGroupingAndOrdering.lean @@ -0,0 +1,179 @@ +/- + Copyright Strata Contributors + + SPDX-License-Identifier: Apache-2.0 OR MIT +-/ + +module +public import Strata.Languages.Laurel.Laurel +import Strata.DL.Lambda.LExpr +import Strata.DDM.Util.Graph.Tarjan + +/-! +## Grouping and Ordering for Core Translation + +Utilities for computing the grouping and topological ordering of Laurel +declarations before they are emitted as Strata Core declarations. + +- `groupDatatypes` — groups mutually recursive datatypes into a single `.data` + declaration using Tarjan's SCC algorithm. +- `computeSccDecls` — builds the procedure call graph, runs Tarjan's SCC + algorithm, and returns each SCC as a list of procedures paired with a flag + indicating whether the SCC is recursive. The result is in reverse topological + order (dependencies before dependents), which is the order required by Core. +-/ + +namespace Strata.Laurel + +open Lambda (LMonoTy LExpr) + +/-- Collect all `UserDefined` type names referenced in a `HighType`, including nested ones. -/ +def collectTypeRefs : HighTypeMd → List String + | ⟨.UserDefined name, _⟩ => [name.text] + | ⟨.TSet elem, _⟩ => collectTypeRefs elem + | ⟨.TMap k v, _⟩ => collectTypeRefs k ++ collectTypeRefs v + | ⟨.TTypedField vt, _⟩ => collectTypeRefs vt + | ⟨.Applied base args, _⟩ => + collectTypeRefs base ++ args.flatMap collectTypeRefs + | ⟨.Pure base, _⟩ => collectTypeRefs base + | ⟨.Intersection ts, _⟩ => ts.flatMap collectTypeRefs + | ⟨.TCore name, _⟩ => [name] + | _ => [] + +/-- Get all datatype names that a `DatatypeDefinition` references in its constructor args. -/ +def datatypeRefs (dt : DatatypeDefinition) : List String := + dt.constructors.flatMap fun c => c.args.flatMap fun p => collectTypeRefs p.type + +/-- +Group `LDatatype Unit` values by strongly connected components of their direct type references. +Datatypes in the same SCC (mutually recursive) share a single `.data` declaration. +Non-recursive datatypes each get their own singleton `.data` declaration. +The returned groups are in topological order: leaves (no dependencies) first, roots last. +-/ +public def groupDatatypes (dts : List DatatypeDefinition) + (ldts : List (Lambda.LDatatype Unit)) : List (List (Lambda.LDatatype Unit)) := + let n := dts.length + if n = 0 then [] else + let nameToIdx : Std.HashMap String Nat := + dts.foldlIdx (fun m i dt => m.insert dt.name.text i) {} + -- dt[i] references dt[j] means i depends on j (j must be declared first). + -- tarjan guarantees: if there's a path A→B, B appears after A in the output. + -- So we add edge j→i (j has a path to i), ensuring i (the dependent) appears after j (the dependency). + let edges : List (Nat × Nat) := + dts.foldlIdx (fun acc i dt => + (datatypeRefs dt).filterMap nameToIdx.get? |>.foldl (fun acc j => (j, i) :: acc) acc) [] + let g := OutGraph.ofEdges! n edges + let ldtMap : Std.HashMap String (Lambda.LDatatype Unit) := + ldts.foldl (fun m ldt => m.insert ldt.name ldt) {} + let dtsArr := dts.toArray + OutGraph.tarjan g |>.toList.filterMap fun comp => + let members := comp.toList.filterMap fun idx => + dtsArr[idx]? |>.bind fun dt => ldtMap.get? dt.name.text + if members.isEmpty then none else some members + +end Strata.Laurel + +namespace Strata.Laurel + +/-- +Collect all `StaticCall` callee names referenced anywhere in a `StmtExpr`. +Used to build the call graph for SCC-based procedure ordering. +-/ +partial def collectStaticCallNames (expr : StmtExpr) : List String := + match expr with + | .StaticCall callee args => + callee.text :: args.flatMap (fun a => collectStaticCallNames a.val) + | .PrimitiveOp _ args => args.flatMap (fun a => collectStaticCallNames a.val) + | .IfThenElse cond t e => + collectStaticCallNames cond.val ++ + collectStaticCallNames t.val ++ + (e.toList.flatMap (fun x => collectStaticCallNames x.val)) + | .Block stmts _ => stmts.flatMap (fun s => collectStaticCallNames s.val) + | .Assign targets v => + targets.flatMap (fun t => collectStaticCallNames t.val) ++ + collectStaticCallNames v.val + | .LocalVariable _ _ init => init.toList.flatMap (fun i => collectStaticCallNames i.val) + | .Return v => v.toList.flatMap (fun x => collectStaticCallNames x.val) + | .While cond invs dec body => + collectStaticCallNames cond.val ++ + invs.flatMap (fun i => collectStaticCallNames i.val) ++ + dec.toList.flatMap (fun d => collectStaticCallNames d.val) ++ + collectStaticCallNames body.val + | .Forall _ trig body => + trig.toList.flatMap (fun t => collectStaticCallNames t.val) ++ + collectStaticCallNames body.val + | .Exists _ trig body => + trig.toList.flatMap (fun t => collectStaticCallNames t.val) ++ + collectStaticCallNames body.val + | .FieldSelect t _ => collectStaticCallNames t.val + | .PureFieldUpdate t _ v => collectStaticCallNames t.val ++ collectStaticCallNames v.val + | .InstanceCall t _ args => + collectStaticCallNames t.val ++ args.flatMap (fun a => collectStaticCallNames a.val) + | .Old v | .Fresh v | .Assert v | .Assume v => collectStaticCallNames v.val + | .ProveBy v p => collectStaticCallNames v.val ++ collectStaticCallNames p.val + | .ReferenceEquals l r => collectStaticCallNames l.val ++ collectStaticCallNames r.val + | .AsType t _ | .IsType t _ => collectStaticCallNames t.val + | .ContractOf _ f => collectStaticCallNames f.val + | .Assigned v => collectStaticCallNames v.val + | _ => [] + +/-- +Build the procedure call graph, run Tarjan's SCC algorithm, and return each SCC +as a list of procedures paired with a flag indicating whether the SCC is recursive. + +Non-functional procedures should be placed as early as possible: +right after their dependencies, before any functional procedures they do not depend on. + +External procedures are excluded. +-/ +public def computeSccDecls (program : Program) : List (List Procedure × Bool) := + -- External procedures are completely ignored (not translated to Core). + let nonExternal := program.staticProcedures.filter (fun p => !p.body.isExternal) + + -- Build a call-graph over all non-external procedures. + -- An edge proc → callee means proc's body/contracts contain a StaticCall to callee. + let nonExternalArr : Array Procedure := nonExternal.toArray + let nameToIdx : Std.HashMap String Nat := + nonExternalArr.foldl (fun (acc : Std.HashMap String Nat × Nat) proc => + (acc.1.insert proc.name.text acc.2, acc.2 + 1)) ({}, 0) |>.1 + + -- Collect all callee names from a procedure's body and contracts. + let procCallees (proc : Procedure) : List String := + let bodyExprs : List StmtExpr := match proc.body with + | .Transparent b => [b.val] + | .Opaque postconds (some impl) _ => postconds.map (·.val) ++ [impl.val] + | .Opaque postconds none _ => postconds.map (·.val) + | _ => [] + let contractExprs : List StmtExpr := + proc.preconditions.map (·.val) ++ + proc.invokeOn.toList.map (·.val) + (bodyExprs ++ contractExprs).flatMap collectStaticCallNames + + -- Build the OutGraph for Tarjan. + let n := nonExternalArr.size + let graph : Strata.OutGraph n := + nonExternalArr.foldl (fun (acc : Strata.OutGraph n × Nat) proc => + let callerIdx := acc.2 + let g := acc.1 + let callees := procCallees proc + let g' := callees.foldl (fun g callee => + match nameToIdx.get? callee with + | some calleeIdx => g.addEdge! calleeIdx callerIdx + | none => g) g + (g', callerIdx + 1)) (Strata.OutGraph.empty n, 0) |>.1 + + -- Run Tarjan's SCC algorithm. Results are in reverse topological order + -- (a node appears after all nodes that have paths to it). + let sccs := Strata.OutGraph.tarjan graph + + sccs.toList.filterMap fun scc => + let procs := scc.toList.filterMap fun idx => + nonExternalArr[idx.val]? + if procs.isEmpty then none else + let isRecursive := procs.length > 1 || + (match scc.toList.head? with + | some node => (graph.nodesOut node).contains node + | none => false) + some (procs, isRecursive) + +end Strata.Laurel diff --git a/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean b/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean index 5dd0b5cfe..b1ade4f39 100644 --- a/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean +++ b/StrataTest/Languages/Laurel/Examples/Fundamentals/T19_InvokeOn.lean @@ -16,12 +16,16 @@ def program := r#" function P(x: int): bool; function Q(x: int): bool; +function assertP(x: int): int requires P(x); +function needsPAndQsInvoke1(): int { + assertP(3) +}; + procedure PAndQ(x: int) invokeOn P(x) ensures P(x) && Q(x); -function assertP(x: int): int requires P(x); -function needsPAndQsInvoke(): int { +function needsPAndQsInvoke2(): int { assertP(3) }; From 081c1735853dc2ca6812bb80aeaa4fd89e3b9cc9 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 27 Mar 2026 13:53:30 +0100 Subject: [PATCH 63/79] Fix bug --- .../Languages/Laurel/CoreGroupingAndOrdering.lean | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Strata/Languages/Laurel/CoreGroupingAndOrdering.lean b/Strata/Languages/Laurel/CoreGroupingAndOrdering.lean index 48382850b..3a8a5e55f 100644 --- a/Strata/Languages/Laurel/CoreGroupingAndOrdering.lean +++ b/Strata/Languages/Laurel/CoreGroupingAndOrdering.lean @@ -120,15 +120,22 @@ partial def collectStaticCallNames (expr : StmtExpr) : List String := /-- Build the procedure call graph, run Tarjan's SCC algorithm, and return each SCC as a list of procedures paired with a flag indicating whether the SCC is recursive. +Results are in reverse topological order: dependencies before dependents. -Non-functional procedures should be placed as early as possible: -right after their dependencies, before any functional procedures they do not depend on. +Procedures with an `invokeOn` trigger are placed as early as possible — before +unrelated procedures without one — by sorting them first before building the graph. +Tarjan then naturally assigns them lower indices, causing them to appear earlier in +the output. External procedures are excluded. -/ public def computeSccDecls (program : Program) : List (List Procedure × Bool) := -- External procedures are completely ignored (not translated to Core). - let nonExternal := program.staticProcedures.filter (fun p => !p.body.isExternal) + -- Sort so procedures with invokeOn come first; Tarjan will then place them + -- earlier in the topological order relative to unrelated procedures without invokeOn. + let nonExternal : List Procedure := + (program.staticProcedures.filter (fun p => !p.body.isExternal)) + |>.mergeSort (fun a b => a.invokeOn.isSome && b.invokeOn.isNone) -- Build a call-graph over all non-external procedures. -- An edge proc → callee means proc's body/contracts contain a StaticCall to callee. From d1fb01e63a54b360fe4330764de575478eb5e221 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 27 Mar 2026 14:05:38 +0100 Subject: [PATCH 64/79] Update expect files --- .../Laurel/CoreGroupingAndOrdering.lean | 15 ++++++++------- .../Languages/Laurel/LaurelToCoreTranslator.lean | 1 - .../Languages/Python/PreludeVerifyTest.lean | 16 ++++++++-------- .../expected_laurel/test_arithmetic.expected | 4 ++-- .../test_augmented_assign.expected | 4 ++-- .../expected_laurel/test_boolean_logic.expected | 4 ++-- .../expected_laurel/test_break_continue.expected | 4 ++-- .../expected_laurel/test_class_decl.expected | 4 ++-- .../test_class_field_any.expected | 4 ++-- .../test_class_field_init.expected | 4 ++-- .../test_class_field_use.expected | 4 ++-- .../expected_laurel/test_class_methods.expected | 4 ++-- .../test_class_with_methods.expected | 4 ++-- .../expected_laurel/test_comparisons.expected | 4 ++-- .../expected_laurel/test_control_flow.expected | 4 ++-- .../expected_laurel/test_datetime.expected | 4 ++-- .../expected_laurel/test_default_params.expected | 4 ++-- .../test_dict_operations.expected | 4 ++-- .../expected_laurel/test_for_loop.expected | 4 ++-- .../test_function_def_calls.expected | 4 ++-- .../Python/expected_laurel/test_if_elif.expected | 4 ++-- .../Python/expected_laurel/test_ifexpr.expected | 4 ++-- .../Python/expected_laurel/test_list.expected | 4 ++-- .../expected_laurel/test_list_slice.expected | 4 ++-- .../Python/expected_laurel/test_loops.expected | 4 ++-- .../expected_laurel/test_missing_models.expected | 4 ++-- .../expected_laurel/test_module_level.expected | 4 ++-- .../expected_laurel/test_multi_function.expected | 4 ++-- .../test_multiple_except.expected | 4 ++-- .../expected_laurel/test_nested_calls.expected | 4 ++-- .../Python/expected_laurel/test_pin_any.expected | 4 ++-- .../test_precondition_verification.expected | 4 ++-- .../expected_laurel/test_regex_negative.expected | 4 ++-- .../expected_laurel/test_regex_positive.expected | 4 ++-- .../expected_laurel/test_return_types.expected | 4 ++-- .../Python/expected_laurel/test_strings.expected | 4 ++-- .../expected_laurel/test_subscription.expected | 4 ++-- .../expected_laurel/test_try_except.expected | 4 ++-- .../test_try_except_scoping.expected | 4 ++-- .../test_variable_reassign.expected | 4 ++-- .../expected_laurel/test_while_loop.expected | 4 ++-- .../expected_laurel/test_with_statement.expected | 4 ++-- 42 files changed, 94 insertions(+), 94 deletions(-) diff --git a/Strata/Languages/Laurel/CoreGroupingAndOrdering.lean b/Strata/Languages/Laurel/CoreGroupingAndOrdering.lean index 3a8a5e55f..e659cc946 100644 --- a/Strata/Languages/Laurel/CoreGroupingAndOrdering.lean +++ b/Strata/Languages/Laurel/CoreGroupingAndOrdering.lean @@ -123,19 +123,20 @@ as a list of procedures paired with a flag indicating whether the SCC is recursi Results are in reverse topological order: dependencies before dependents. Procedures with an `invokeOn` trigger are placed as early as possible — before -unrelated procedures without one — by sorting them first before building the graph. -Tarjan then naturally assigns them lower indices, causing them to appear earlier in -the output. +unrelated procedures without one — by stably partitioning them first before building +the graph. Tarjan then naturally assigns them lower indices, causing them to appear +earlier in the output. External procedures are excluded. -/ public def computeSccDecls (program : Program) : List (List Procedure × Bool) := -- External procedures are completely ignored (not translated to Core). - -- Sort so procedures with invokeOn come first; Tarjan will then place them - -- earlier in the topological order relative to unrelated procedures without invokeOn. - let nonExternal : List Procedure := + -- Stable partition: procedures with invokeOn come first, preserving relative + -- order within each group. Tarjan then places them earlier in the topological output. + let (withInvokeOn, withoutInvokeOn) := (program.staticProcedures.filter (fun p => !p.body.isExternal)) - |>.mergeSort (fun a b => a.invokeOn.isSome && b.invokeOn.isNone) + |>.partition (fun p => p.invokeOn.isSome) + let nonExternal : List Procedure := withInvokeOn ++ withoutInvokeOn -- Build a call-graph over all non-external procedures. -- An edge proc → callee means proc's body/contracts contain a StaticCall to callee. diff --git a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean index bdc164990..6fea9ad2c 100644 --- a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean +++ b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean @@ -29,7 +29,6 @@ import Strata.DL.Lambda.LExpr import Strata.Languages.Laurel.LaurelFormat import Strata.Languages.Laurel.ConstrainedTypeElim import Strata.Util.Tactics -import Strata.DDM.Util.Graph.Tarjan open Core (VCResult VCResults VerifyOptions) open Core (intAddOp intSubOp intMulOp intSafeDivOp intSafeModOp intSafeDivTOp intSafeModTOp intNegOp intLtOp intLeOp intGtOp intGeOp boolAndOp boolOrOp boolNotOp boolImpliesOp strConcatOp) diff --git a/StrataTest/Languages/Python/PreludeVerifyTest.lean b/StrataTest/Languages/Python/PreludeVerifyTest.lean index caf9c39bc..d0599d9ff 100644 --- a/StrataTest/Languages/Python/PreludeVerifyTest.lean +++ b/StrataTest/Languages/Python/PreludeVerifyTest.lean @@ -37,10 +37,6 @@ Obligation: postcondition Property: assert Result: ✅ pass -Obligation: List_get_body_calls_List_get_0 -Property: assert -Result: ✅ pass - Obligation: List_take_body_calls_List_take_0 Property: assert Result: ✅ pass @@ -65,6 +61,14 @@ Obligation: postcondition Property: assert Result: ✅ pass +Obligation: postcondition +Property: assert +Result: ✅ pass + +Obligation: List_get_body_calls_List_get_0 +Property: assert +Result: ✅ pass + Obligation: List_slice_body_calls_List_drop_0 Property: assert Result: ✅ pass @@ -153,10 +157,6 @@ Obligation: postcondition Property: assert Result: ✅ pass -Obligation: postcondition -Property: assert -Result: ✅ pass - Obligation: assert(40598) Property: assert Result: ✅ pass diff --git a/StrataTest/Languages/Python/expected_laurel/test_arithmetic.expected b/StrataTest/Languages/Python/expected_laurel/test_arithmetic.expected index 7d4ed3d17..461555c19 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_arithmetic.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_arithmetic.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_augmented_assign.expected b/StrataTest/Languages/Python/expected_laurel/test_augmented_assign.expected index 20fe2bad6..964d96bc3 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_augmented_assign.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_augmented_assign.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_boolean_logic.expected b/StrataTest/Languages/Python/expected_laurel/test_boolean_logic.expected index 4c9de0ead..e6447d599 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_boolean_logic.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_boolean_logic.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_break_continue.expected b/StrataTest/Languages/Python/expected_laurel/test_break_continue.expected index d2164967d..a37faacd9 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_break_continue.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_break_continue.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_decl.expected b/StrataTest/Languages/Python/expected_laurel/test_class_decl.expected index e46180a97..567d82303 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_decl.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_decl.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_field_any.expected b/StrataTest/Languages/Python/expected_laurel/test_class_field_any.expected index 17ddd1d0b..d0aab6531 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_field_any.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_field_any.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_field_init.expected b/StrataTest/Languages/Python/expected_laurel/test_class_field_init.expected index f7239371b..8489ed783 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_field_init.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_field_init.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_field_use.expected b/StrataTest/Languages/Python/expected_laurel/test_class_field_use.expected index 09301f4d1..3b635d102 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_field_use.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_field_use.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_methods.expected b/StrataTest/Languages/Python/expected_laurel/test_class_methods.expected index 4aa4907d4..ca5fb357a 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_methods.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_methods.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_with_methods.expected b/StrataTest/Languages/Python/expected_laurel/test_class_with_methods.expected index 6f7b119a4..0cadb350f 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_with_methods.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_with_methods.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_comparisons.expected b/StrataTest/Languages/Python/expected_laurel/test_comparisons.expected index a0f88c08d..5f6f47229 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_comparisons.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_comparisons.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_control_flow.expected b/StrataTest/Languages/Python/expected_laurel/test_control_flow.expected index c25b96d93..4b20055a0 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_control_flow.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_control_flow.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_datetime.expected b/StrataTest/Languages/Python/expected_laurel/test_datetime.expected index 81dbe702f..7b1ee0610 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_datetime.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_datetime.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_default_params.expected b/StrataTest/Languages/Python/expected_laurel/test_default_params.expected index bbaf65100..c5e0aab36 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_default_params.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_default_params.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_dict_operations.expected b/StrataTest/Languages/Python/expected_laurel/test_dict_operations.expected index fbc461f60..589433d00 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_dict_operations.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_dict_operations.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_for_loop.expected b/StrataTest/Languages/Python/expected_laurel/test_for_loop.expected index aa24a4c24..0c67ed6a1 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_for_loop.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_for_loop.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_function_def_calls.expected b/StrataTest/Languages/Python/expected_laurel/test_function_def_calls.expected index 33dce5fe9..c391ab7f6 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_function_def_calls.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_function_def_calls.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_if_elif.expected b/StrataTest/Languages/Python/expected_laurel/test_if_elif.expected index 972ba03df..fd4b6c023 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_if_elif.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_if_elif.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_ifexpr.expected b/StrataTest/Languages/Python/expected_laurel/test_ifexpr.expected index 09c5b9d27..0b5ed654e 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_ifexpr.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_ifexpr.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_list.expected b/StrataTest/Languages/Python/expected_laurel/test_list.expected index 2c5d53180..110c04a04 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_list.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_list.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_list_slice.expected b/StrataTest/Languages/Python/expected_laurel/test_list_slice.expected index a68a2b2b6..355581294 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_list_slice.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_list_slice.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_loops.expected b/StrataTest/Languages/Python/expected_laurel/test_loops.expected index a7f9e123e..385e165bc 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_loops.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_loops.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected b/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected index bbf59c8d4..f0dbf81d8 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_module_level.expected b/StrataTest/Languages/Python/expected_laurel/test_module_level.expected index 580bd2cf4..eaa245ae1 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_module_level.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_module_level.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_multi_function.expected b/StrataTest/Languages/Python/expected_laurel/test_multi_function.expected index fd4974637..5591bf229 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_multi_function.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_multi_function.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_multiple_except.expected b/StrataTest/Languages/Python/expected_laurel/test_multiple_except.expected index e6f2afc48..38439b2ea 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_multiple_except.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_multiple_except.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_nested_calls.expected b/StrataTest/Languages/Python/expected_laurel/test_nested_calls.expected index 13b889375..9d840b2be 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_nested_calls.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_nested_calls.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_pin_any.expected b/StrataTest/Languages/Python/expected_laurel/test_pin_any.expected index cce226d30..d494f7cd4 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_pin_any.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_pin_any.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (❗path unreachable) (in prelude file) -List_get_body_calls_List_get_0: ✔️ always true if reached List_take_body_calls_List_take_0: ✔️ always true if reached List_take_len_post_postcondition_calls_List_take_0: ✔️ always true if reached (in prelude file) postcondition: ✅ pass (❗path unreachable) (in prelude file) List_drop_body_calls_List_drop_0: ✔️ always true if reached List_drop_len_post_postcondition_calls_List_drop_0: ✔️ always true if reached (in prelude file) postcondition: ✅ pass (❗path unreachable) (in prelude file) +postcondition: ✅ pass (❗path unreachable) (in prelude file) +List_get_body_calls_List_get_0: ✔️ always true if reached List_slice_body_calls_List_drop_0: ✔️ always true if reached (in prelude file) List_slice_body_calls_List_take_1: ✔️ always true if reached (in prelude file) List_set_body_calls_List_set_0: ✔️ always true if reached @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ always true and is reachable from declar PFloorDiv_body_calls_Int.SafeDiv_3: ✅ always true and is reachable from declaration entry (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ always true and is reachable from declaration entry (in prelude file) POr_body_calls_Any_to_bool_0: ✅ always true and is reachable from declaration entry (in prelude file) -postcondition: ✅ pass (❗path unreachable) (in prelude file) ret_type: ✅ always true and is reachable from declaration entry (in prelude file) ret_type: ✅ always true and is reachable from declaration entry (in prelude file) ret_pos: ✅ always true and is reachable from declaration entry (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected b/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected index 00a1b16d3..a9888095a 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected b/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected index f9b043bbc..876fbbd58 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected b/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected index 58f03dd38..49daf52c4 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_return_types.expected b/StrataTest/Languages/Python/expected_laurel/test_return_types.expected index bb71e8622..ba5a8feb7 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_return_types.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_return_types.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_strings.expected b/StrataTest/Languages/Python/expected_laurel/test_strings.expected index 6c7676010..21b6aa5ff 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_strings.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_strings.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_subscription.expected b/StrataTest/Languages/Python/expected_laurel/test_subscription.expected index 5eead29c1..b5acea990 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_subscription.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_subscription.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_try_except.expected b/StrataTest/Languages/Python/expected_laurel/test_try_except.expected index 575de8da9..e97946e6c 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_try_except.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_try_except.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected b/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected index 2dcd726ba..77d08ec12 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_variable_reassign.expected b/StrataTest/Languages/Python/expected_laurel/test_variable_reassign.expected index 4c92863ec..9bfe058bd 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_variable_reassign.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_variable_reassign.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_while_loop.expected b/StrataTest/Languages/Python/expected_laurel/test_while_loop.expected index 6863e4d27..235536c49 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_while_loop.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_while_loop.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) diff --git a/StrataTest/Languages/Python/expected_laurel/test_with_statement.expected b/StrataTest/Languages/Python/expected_laurel/test_with_statement.expected index b3b2db8b1..b07d02da0 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_with_statement.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_with_statement.expected @@ -1,13 +1,14 @@ ==== Verification Results ==== postcondition: ✅ pass (in prelude file) -List_get_body_calls_List_get_0: ✅ pass List_take_body_calls_List_take_0: ✅ pass List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) List_drop_body_calls_List_drop_0: ✅ pass List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) List_set_body_calls_List_set_0: ✅ pass @@ -27,7 +28,6 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_type: ✅ pass (in prelude file) ret_pos: ✅ pass (in prelude file) From 72dbfeeeb8c7e8683e7681f15c7357499759bfed Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 27 Mar 2026 14:26:32 +0100 Subject: [PATCH 65/79] Remove partial --- .../Laurel/CoreGroupingAndOrdering.lean | 87 +++++++++++-------- 1 file changed, 52 insertions(+), 35 deletions(-) diff --git a/Strata/Languages/Laurel/CoreGroupingAndOrdering.lean b/Strata/Languages/Laurel/CoreGroupingAndOrdering.lean index e659cc946..80d40312e 100644 --- a/Strata/Languages/Laurel/CoreGroupingAndOrdering.lean +++ b/Strata/Languages/Laurel/CoreGroupingAndOrdering.lean @@ -79,43 +79,60 @@ namespace Strata.Laurel Collect all `StaticCall` callee names referenced anywhere in a `StmtExpr`. Used to build the call graph for SCC-based procedure ordering. -/ -partial def collectStaticCallNames (expr : StmtExpr) : List String := +def collectStaticCallNames (expr : StmtExprMd) : List String := match expr with + | WithMetadata.mk val _ => + match val with | .StaticCall callee args => - callee.text :: args.flatMap (fun a => collectStaticCallNames a.val) - | .PrimitiveOp _ args => args.flatMap (fun a => collectStaticCallNames a.val) + callee.text :: args.flatMap (fun a => collectStaticCallNames a) + | .PrimitiveOp _ args => args.flatMap (fun a => collectStaticCallNames a) | .IfThenElse cond t e => - collectStaticCallNames cond.val ++ - collectStaticCallNames t.val ++ - (e.toList.flatMap (fun x => collectStaticCallNames x.val)) - | .Block stmts _ => stmts.flatMap (fun s => collectStaticCallNames s.val) + collectStaticCallNames cond ++ + collectStaticCallNames t ++ + match e with + | some eelse => collectStaticCallNames eelse + | none => [] + | .Block stmts _ => stmts.flatMap (fun s => collectStaticCallNames s) | .Assign targets v => - targets.flatMap (fun t => collectStaticCallNames t.val) ++ - collectStaticCallNames v.val - | .LocalVariable _ _ init => init.toList.flatMap (fun i => collectStaticCallNames i.val) - | .Return v => v.toList.flatMap (fun x => collectStaticCallNames x.val) + targets.flatMap (fun t => collectStaticCallNames t) ++ + collectStaticCallNames v + | .LocalVariable _ _ initOption => + match initOption with + | some init => collectStaticCallNames init + | none => [] + | .Return v => + match v with + | some x => collectStaticCallNames x + | none => [] | .While cond invs dec body => - collectStaticCallNames cond.val ++ - invs.flatMap (fun i => collectStaticCallNames i.val) ++ - dec.toList.flatMap (fun d => collectStaticCallNames d.val) ++ - collectStaticCallNames body.val + collectStaticCallNames cond ++ + invs.flatMap (fun i => collectStaticCallNames i) ++ + (match dec with + | some d => collectStaticCallNames d + | none => []) ++ + collectStaticCallNames body | .Forall _ trig body => - trig.toList.flatMap (fun t => collectStaticCallNames t.val) ++ - collectStaticCallNames body.val + (match trig with + | some t => collectStaticCallNames t + | none => []) ++ + collectStaticCallNames body | .Exists _ trig body => - trig.toList.flatMap (fun t => collectStaticCallNames t.val) ++ - collectStaticCallNames body.val - | .FieldSelect t _ => collectStaticCallNames t.val - | .PureFieldUpdate t _ v => collectStaticCallNames t.val ++ collectStaticCallNames v.val + (match trig with + | some t => collectStaticCallNames t + | none => []) ++ + collectStaticCallNames body + | .FieldSelect t _ => collectStaticCallNames t + | .PureFieldUpdate t _ v => collectStaticCallNames t ++ collectStaticCallNames v | .InstanceCall t _ args => - collectStaticCallNames t.val ++ args.flatMap (fun a => collectStaticCallNames a.val) - | .Old v | .Fresh v | .Assert v | .Assume v => collectStaticCallNames v.val - | .ProveBy v p => collectStaticCallNames v.val ++ collectStaticCallNames p.val - | .ReferenceEquals l r => collectStaticCallNames l.val ++ collectStaticCallNames r.val - | .AsType t _ | .IsType t _ => collectStaticCallNames t.val - | .ContractOf _ f => collectStaticCallNames f.val - | .Assigned v => collectStaticCallNames v.val + collectStaticCallNames t ++ args.flatMap (fun a => collectStaticCallNames a) + | .Old v | .Fresh v | .Assert v | .Assume v => collectStaticCallNames v + | .ProveBy v p => collectStaticCallNames v ++ collectStaticCallNames p + | .ReferenceEquals l r => collectStaticCallNames l ++ collectStaticCallNames r + | .AsType t _ | .IsType t _ => collectStaticCallNames t + | .ContractOf _ f => collectStaticCallNames f + | .Assigned v => collectStaticCallNames v | _ => [] +termination_by sizeOf expr /-- Build the procedure call graph, run Tarjan's SCC algorithm, and return each SCC @@ -147,14 +164,14 @@ public def computeSccDecls (program : Program) : List (List Procedure × Bool) : -- Collect all callee names from a procedure's body and contracts. let procCallees (proc : Procedure) : List String := - let bodyExprs : List StmtExpr := match proc.body with - | .Transparent b => [b.val] - | .Opaque postconds (some impl) _ => postconds.map (·.val) ++ [impl.val] - | .Opaque postconds none _ => postconds.map (·.val) + let bodyExprs : List StmtExprMd := match proc.body with + | .Transparent b => [b] + | .Opaque postconds (some impl) _ => postconds ++ [impl] + | .Opaque postconds none _ => postconds | _ => [] - let contractExprs : List StmtExpr := - proc.preconditions.map (·.val) ++ - proc.invokeOn.toList.map (·.val) + let contractExprs : List StmtExprMd := + proc.preconditions ++ + proc.invokeOn.toList (bodyExprs ++ contractExprs).flatMap collectStaticCallNames -- Build the OutGraph for Tarjan. From e4ba5e4d11971d70b287d7c84c0509203aa575a1 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 27 Mar 2026 16:27:25 +0100 Subject: [PATCH 66/79] Review fixes --- Strata/Languages/Python/PySpecPipeline.lean | 21 +++++++------------ .../Python/PythonRuntimeLaurelPart.lean | 6 ------ 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/Strata/Languages/Python/PySpecPipeline.lean b/Strata/Languages/Python/PySpecPipeline.lean index 9ce927dc6..67b136446 100644 --- a/Strata/Languages/Python/PySpecPipeline.lean +++ b/Strata/Languages/Python/PySpecPipeline.lean @@ -317,25 +317,20 @@ public def splitProcNames (prog : Core.Program) d.getProc?.map (Core.CoreIdent.toPretty ·.header.name) (preludeNames, userProcNames) -/-- Translate a combined Laurel program to Core and prepend the full - runtime prelude. Resolution errors are suppressed because PySpec - Laurel procedures reference names defined in the Core prelude - (`from_none`, `from_string`, `NoError`, etc.) which the Laurel - resolver cannot see — they are merged after translation. Once the - Python Core prelude is ported to Laurel, this suppression can be - removed. -/ -public def translateCombinedLaurel (combined : Laurel.Program) - : (Option Core.Program × List DiagnosticModel) := - let (coreOption, errors) := Laurel.translate { inlineFunctionsWhenPossible := true } combined - (coreOption.map appendCorePartOfRuntime, errors) - /-- Like `translateCombinedLaurel` but also returns the lowered Laurel program (after all Laurel-to-Laurel passes, before translation to Core). -/ public def translateCombinedLaurelWithLowered (combined : Laurel.Program) : (Option Core.Program × List DiagnosticModel × Laurel.Program) := - let (coreOption, errors, lowered) := Laurel.translateWithLaurel { emitResolutionErrors := false } combined + let (coreOption, errors, lowered) := Laurel.translateWithLaurel { inlineFunctionsWhenPossible := true } combined (coreOption.map appendCorePartOfRuntime, errors, lowered) +/-- Translate a combined Laurel program to Core and prepend the full + runtime prelude. -/ +public def translateCombinedLaurel (combined : Laurel.Program) + : (Option Core.Program × List DiagnosticModel) := + let (coreOption, errors, _) := translateCombinedLaurelWithLowered combined + (coreOption, errors) + /-- Errors from the pyAnalyzeLaurel pipeline. -/ public inductive PipelineError where /-- The Python source contains invalid code (bad method name, wrong arguments, etc.). -/ diff --git a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean index 35fafbbee..9344e147e 100644 --- a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean +++ b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean @@ -866,7 +866,6 @@ function POr (v1: Any, v2: Any) : Any if Any_to_bool (v1) then v1 else v2 }; - // ///////////////////////////////////////////////////////////////////////////////////// // Modelling of other Python operations, currrently unsupported // ///////////////////////////////////////////////////////////////////////////////////// @@ -880,11 +879,6 @@ function PMod (v1: Any, v2: Any) : Any exception(UnimplementedError ("Mod operator is not supported")) }; -// ///////////////////////////////////////////////////////////////////////////////////// -// Modelling of Python Boolean operations And and Or -// ///////////////////////////////////////////////////////////////////////////////////// - - // ///////////////////////////////////////////////////////////////////////////////////// // Modelling some datetime-related Python operations, for testing purpose // ///////////////////////////////////////////////////////////////////////////////////// From efc95fc0965f10cee8a5cf00541888294348b092 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 27 Mar 2026 18:08:21 +0100 Subject: [PATCH 67/79] Fix related to ||,&&,==> --- .../Laurel/LaurelToCoreTranslator.lean | 6 +- .../Fundamentals/T15_ShortCircuit.lean | 8 + .../Languages/Python/PreludeVerifyTest.lean | 6 +- .../test_regex_positive.expected | 284 +++++++++--------- 4 files changed, 156 insertions(+), 148 deletions(-) diff --git a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean index 6fea9ad2c..cf01b6ae8 100644 --- a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean +++ b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean @@ -185,9 +185,9 @@ def translateExpr (expr : StmtExprMd) | .Neq => return .app () boolNotOp (.eq () re1 re2) | .And => return binOp boolAndOp | .Or => return binOp boolOrOp - | .AndThen => return .ite () re1 re2 (.boolConst () false) - | .OrElse => return .ite () re1 (.boolConst () true) re2 - | .Implies => return .ite () re1 re2 (.boolConst () true) + | .AndThen => return binOp boolAndOp + | .OrElse => return binOp boolOrOp + | .Implies => return binOp boolImpliesOp | .Add => return binOp (if isReal then realAddOp else intAddOp) | .Sub => return binOp (if isReal then realSubOp else intSubOp) | .Mul => return binOp (if isReal then realMulOp else intMulOp) diff --git a/StrataTest/Languages/Laurel/Examples/Fundamentals/T15_ShortCircuit.lean b/StrataTest/Languages/Laurel/Examples/Fundamentals/T15_ShortCircuit.lean index 25149623e..3f53a1d28 100644 --- a/StrataTest/Languages/Laurel/Examples/Fundamentals/T15_ShortCircuit.lean +++ b/StrataTest/Languages/Laurel/Examples/Fundamentals/T15_ShortCircuit.lean @@ -27,11 +27,15 @@ procedure mustNotCallProc(): int procedure testAndThenFunc() { var b: bool := false && mustNotCallFunc(0) > 0; +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: assertion does not hold +// TODO caused by a bug in Core. assert !b }; procedure testOrElseFunc() { var b: bool := true || mustNotCallFunc(0) > 0; +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: assertion does not hold +// TODO caused by a bug in Core. assert b }; @@ -44,10 +48,14 @@ procedure testImpliesFunc() { procedure testAndThenDivByZero() { assert !(false && 1 / 0 > 0) +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: assertion does not hold +// TODO caused by a bug in Core. }; procedure testOrElseDivByZero() { assert true || 1 / 0 > 0 +//^^^^^^^^^^^^^^^^^^^^^^^^ error: assertion does not hold +// TODO caused by a bug in Core. }; procedure testImpliesDivByZero() { diff --git a/StrataTest/Languages/Python/PreludeVerifyTest.lean b/StrataTest/Languages/Python/PreludeVerifyTest.lean index d0599d9ff..6aec5a6c5 100644 --- a/StrataTest/Languages/Python/PreludeVerifyTest.lean +++ b/StrataTest/Languages/Python/PreludeVerifyTest.lean @@ -157,15 +157,15 @@ Obligation: postcondition Property: assert Result: ✅ pass -Obligation: assert(40598) +Obligation: assert(40364) Property: assert Result: ✅ pass -Obligation: assert(40668) +Obligation: assert(40434) Property: assert Result: ✅ pass -Obligation: assert(40779) +Obligation: assert(40545) Property: assert Result: ✅ pass diff --git a/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected b/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected index 49daf52c4..e0e9cbe0f 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected @@ -37,427 +37,427 @@ assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(215)_calls_Any_to_bool_0: ✅ pass (at line 8, col 4) -assert(215): ❓ unknown (at line 8, col 4) +assert(215): ✅ pass (at line 8, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(308)_calls_Any_to_bool_0: ✅ pass (at line 11, col 4) -assert(308): ❓ unknown (at line 11, col 4) +assert(308): ✅ pass (at line 11, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(440)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) -assert(440): ❓ unknown (at line 15, col 4) +assert(440): ✅ pass (at line 15, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(540)_calls_Any_to_bool_0: ✅ pass (at line 18, col 4) -assert(540): ❓ unknown (at line 18, col 4) +assert(540): ✅ pass (at line 18, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(672)_calls_Any_to_bool_0: ✅ pass (at line 22, col 4) -assert(672): ❓ unknown (at line 22, col 4) +assert(672): ✅ pass (at line 22, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(790)_calls_Any_to_bool_0: ✅ pass (at line 25, col 4) -assert(790): ❓ unknown (at line 25, col 4) +assert(790): ✅ pass (at line 25, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(921)_calls_Any_to_bool_0: ✅ pass (at line 29, col 4) -assert(921): ❓ unknown (at line 29, col 4) +assert(921): ✅ pass (at line 29, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(1021)_calls_Any_to_bool_0: ✅ pass (at line 32, col 4) -assert(1021): ❓ unknown (at line 32, col 4) +assert(1021): ✅ pass (at line 32, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(1147)_calls_Any_to_bool_0: ✅ pass (at line 36, col 4) -assert(1147): ❓ unknown (at line 36, col 4) +assert(1147): ✅ pass (at line 36, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(1239)_calls_Any_to_bool_0: ✅ pass (at line 39, col 4) -assert(1239): ❓ unknown (at line 39, col 4) +assert(1239): ✅ pass (at line 39, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(1332)_calls_Any_to_bool_0: ✅ pass (at line 42, col 4) -assert(1332): ❓ unknown (at line 42, col 4) +assert(1332): ✅ pass (at line 42, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(1446)_calls_Any_to_bool_0: ✅ pass (at line 46, col 4) -assert(1446): ❓ unknown (at line 46, col 4) +assert(1446): ✅ pass (at line 46, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(1539)_calls_Any_to_bool_0: ✅ pass (at line 49, col 4) -assert(1539): ❓ unknown (at line 49, col 4) +assert(1539): ✅ pass (at line 49, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(1666)_calls_Any_to_bool_0: ✅ pass (at line 53, col 4) -assert(1666): ❓ unknown (at line 53, col 4) +assert(1666): ✅ pass (at line 53, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(1766)_calls_Any_to_bool_0: ✅ pass (at line 56, col 4) -assert(1766): ❓ unknown (at line 56, col 4) +assert(1766): ✅ pass (at line 56, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(1864)_calls_Any_to_bool_0: ✅ pass (at line 59, col 4) -assert(1864): ❓ unknown (at line 59, col 4) +assert(1864): ✅ pass (at line 59, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(1984)_calls_Any_to_bool_0: ✅ pass (at line 63, col 4) -assert(1984): ❓ unknown (at line 63, col 4) +assert(1984): ✅ pass (at line 63, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(2090)_calls_Any_to_bool_0: ✅ pass (at line 66, col 4) -assert(2090): ❓ unknown (at line 66, col 4) +assert(2090): ✅ pass (at line 66, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(2198)_calls_Any_to_bool_0: ✅ pass (at line 69, col 4) -assert(2198): ❓ unknown (at line 69, col 4) +assert(2198): ✅ pass (at line 69, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(2333)_calls_Any_to_bool_0: ✅ pass (at line 73, col 4) -assert(2333): ❓ unknown (at line 73, col 4) +assert(2333): ✅ pass (at line 73, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(2436)_calls_Any_to_bool_0: ✅ pass (at line 76, col 4) -assert(2436): ❓ unknown (at line 76, col 4) +assert(2436): ✅ pass (at line 76, col 4) set_m_calls_re_match_0: ✅ pass assert_assert(2696)_calls_Any_to_bool_0: ✅ pass (at line 81, col 4) -assert(2696): ❓ unknown (at line 81, col 4) +assert(2696): ✅ pass (at line 81, col 4) set_m_calls_re_match_0: ✅ pass assert_assert(2787)_calls_Any_to_bool_0: ✅ pass (at line 84, col 4) -assert(2787): ❓ unknown (at line 84, col 4) +assert(2787): ✅ pass (at line 84, col 4) set_m_calls_re_match_0: ✅ pass assert_assert(2892)_calls_Any_to_bool_0: ✅ pass (at line 87, col 4) -assert(2892): ❓ unknown (at line 87, col 4) +assert(2892): ✅ pass (at line 87, col 4) set_m_calls_re_match_0: ✅ pass assert_assert(2985)_calls_Any_to_bool_0: ✅ pass (at line 90, col 4) -assert(2985): ❓ unknown (at line 90, col 4) +assert(2985): ✅ pass (at line 90, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(3241)_calls_Any_to_bool_0: ✅ pass (at line 95, col 4) -assert(3241): ❓ unknown (at line 95, col 4) +assert(3241): ✅ pass (at line 95, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(3341)_calls_Any_to_bool_0: ✅ pass (at line 98, col 4) -assert(3341): ❓ unknown (at line 98, col 4) +assert(3341): ✅ pass (at line 98, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(3441)_calls_Any_to_bool_0: ✅ pass (at line 101, col 4) -assert(3441): ❓ unknown (at line 101, col 4) +assert(3441): ✅ pass (at line 101, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(3531)_calls_Any_to_bool_0: ✅ pass (at line 104, col 4) -assert(3531): ❓ unknown (at line 104, col 4) +assert(3531): ✅ pass (at line 104, col 4) set_p_calls_re_compile_0: ✅ pass set_m_calls_re_fullmatch_0: ✅ pass assert_assert(3791)_calls_Any_to_bool_0: ✅ pass (at line 111, col 4) -assert(3791): ❓ unknown (at line 111, col 4) +assert(3791): ✅ pass (at line 111, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(3881)_calls_Any_to_bool_0: ✅ pass (at line 114, col 4) -assert(3881): ❓ unknown (at line 114, col 4) +assert(3881): ✅ pass (at line 114, col 4) set_m_calls_re_match_0: ✅ pass assert_assert(3981)_calls_Any_to_bool_0: ✅ pass (at line 117, col 4) -assert(3981): ❓ unknown (at line 117, col 4) +assert(3981): ✅ pass (at line 117, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(4077)_calls_Any_to_bool_0: ✅ pass (at line 120, col 4) -assert(4077): ❓ unknown (at line 120, col 4) +assert(4077): ✅ pass (at line 120, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(4378)_calls_Any_to_bool_0: ✅ pass (at line 126, col 4) -assert(4378): ❓ unknown (at line 126, col 4) +assert(4378): ✅ pass (at line 126, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(4474)_calls_Any_to_bool_0: ✅ pass (at line 129, col 4) -assert(4474): ❓ unknown (at line 129, col 4) +assert(4474): ✅ pass (at line 129, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(4593)_calls_Any_to_bool_0: ✅ pass (at line 133, col 4) -assert(4593): ❓ unknown (at line 133, col 4) +assert(4593): ✅ pass (at line 133, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(4672)_calls_Any_to_bool_0: ✅ pass (at line 136, col 4) -assert(4672): ❓ unknown (at line 136, col 4) +assert(4672): ✅ pass (at line 136, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(4794)_calls_Any_to_bool_0: ✅ pass (at line 140, col 4) -assert(4794): ❓ unknown (at line 140, col 4) +assert(4794): ✅ pass (at line 140, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(4886)_calls_Any_to_bool_0: ✅ pass (at line 143, col 4) -assert(4886): ❓ unknown (at line 143, col 4) +assert(4886): ✅ pass (at line 143, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(5008)_calls_Any_to_bool_0: ✅ pass (at line 147, col 4) -assert(5008): ❓ unknown (at line 147, col 4) +assert(5008): ✅ pass (at line 147, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(5092)_calls_Any_to_bool_0: ✅ pass (at line 150, col 4) -assert(5092): ❓ unknown (at line 150, col 4) +assert(5092): ✅ pass (at line 150, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(5173)_calls_Any_to_bool_0: ✅ pass (at line 153, col 4) -assert(5173): ❓ unknown (at line 153, col 4) +assert(5173): ✅ pass (at line 153, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(5264)_calls_Any_to_bool_0: ✅ pass (at line 156, col 4) -assert(5264): ❓ unknown (at line 156, col 4) +assert(5264): ✅ pass (at line 156, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(5373)_calls_Any_to_bool_0: ✅ pass (at line 160, col 4) -assert(5373): ❓ unknown (at line 160, col 4) +assert(5373): ✅ pass (at line 160, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(5464)_calls_Any_to_bool_0: ✅ pass (at line 163, col 4) -assert(5464): ❓ unknown (at line 163, col 4) +assert(5464): ✅ pass (at line 163, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(5563)_calls_Any_to_bool_0: ✅ pass (at line 166, col 4) -assert(5563): ❓ unknown (at line 166, col 4) +assert(5563): ✅ pass (at line 166, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(5657)_calls_Any_to_bool_0: ✅ pass (at line 169, col 4) -assert(5657): ❓ unknown (at line 169, col 4) +assert(5657): ✅ pass (at line 169, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(5960)_calls_Any_to_bool_0: ✅ pass (at line 175, col 4) -assert(5960): ❓ unknown (at line 175, col 4) +assert(5960): ✅ pass (at line 175, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(6038)_calls_Any_to_bool_0: ✅ pass (at line 178, col 4) -assert(6038): ❓ unknown (at line 178, col 4) +assert(6038): ✅ pass (at line 178, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(6116)_calls_Any_to_bool_0: ✅ pass (at line 181, col 4) -assert(6116): ❓ unknown (at line 181, col 4) +assert(6116): ✅ pass (at line 181, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(6194)_calls_Any_to_bool_0: ✅ pass (at line 184, col 4) -assert(6194): ❓ unknown (at line 184, col 4) +assert(6194): ✅ pass (at line 184, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(6273)_calls_Any_to_bool_0: ✅ pass (at line 187, col 4) -assert(6273): ❓ unknown (at line 187, col 4) +assert(6273): ✅ pass (at line 187, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(6353)_calls_Any_to_bool_0: ✅ pass (at line 190, col 4) -assert(6353): ❓ unknown (at line 190, col 4) +assert(6353): ✅ pass (at line 190, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(6443)_calls_Any_to_bool_0: ✅ pass (at line 193, col 4) -assert(6443): ❓ unknown (at line 193, col 4) +assert(6443): ✅ pass (at line 193, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(6568)_calls_Any_to_bool_0: ✅ pass (at line 197, col 4) -assert(6568): ❓ unknown (at line 197, col 4) +assert(6568): ✅ pass (at line 197, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(6648)_calls_Any_to_bool_0: ✅ pass (at line 200, col 4) -assert(6648): ❓ unknown (at line 200, col 4) +assert(6648): ✅ pass (at line 200, col 4) set_m_calls_re_match_0: ✅ pass assert_assert(6727)_calls_Any_to_bool_0: ✅ pass (at line 203, col 4) -assert(6727): ❓ unknown (at line 203, col 4) +assert(6727): ✅ pass (at line 203, col 4) set_m_calls_re_match_0: ✅ pass assert_assert(6799)_calls_Any_to_bool_0: ✅ pass (at line 206, col 4) -assert(6799): ❓ unknown (at line 206, col 4) +assert(6799): ✅ pass (at line 206, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(6875)_calls_Any_to_bool_0: ✅ pass (at line 209, col 4) -assert(6875): ❓ unknown (at line 209, col 4) +assert(6875): ✅ pass (at line 209, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(6949)_calls_Any_to_bool_0: ✅ pass (at line 212, col 4) -assert(6949): ❓ unknown (at line 212, col 4) +assert(6949): ✅ pass (at line 212, col 4) set_m_calls_re_match_0: ✅ pass assert_assert(7239)_calls_Any_to_bool_0: ✅ pass (at line 218, col 4) -assert(7239): ❓ unknown (at line 218, col 4) +assert(7239): ✅ pass (at line 218, col 4) set_m_calls_re_match_0: ✅ pass assert_assert(7303)_calls_Any_to_bool_0: ✅ pass (at line 221, col 4) -assert(7303): ❓ unknown (at line 221, col 4) +assert(7303): ✅ pass (at line 221, col 4) set_m_calls_re_match_0: ✅ pass assert_assert(7379)_calls_Any_to_bool_0: ✅ pass (at line 224, col 4) -assert(7379): ❓ unknown (at line 224, col 4) +assert(7379): ✅ pass (at line 224, col 4) set_m_calls_re_match_0: ✅ pass assert_assert(7484)_calls_Any_to_bool_0: ✅ pass (at line 228, col 4) -assert(7484): ❓ unknown (at line 228, col 4) +assert(7484): ✅ pass (at line 228, col 4) set_m_calls_re_match_0: ✅ pass assert_assert(7556)_calls_Any_to_bool_0: ✅ pass (at line 231, col 4) -assert(7556): ❓ unknown (at line 231, col 4) +assert(7556): ✅ pass (at line 231, col 4) set_m_calls_re_match_0: ✅ pass assert_assert(7636)_calls_Any_to_bool_0: ✅ pass (at line 234, col 4) -assert(7636): ❓ unknown (at line 234, col 4) +assert(7636): ✅ pass (at line 234, col 4) set_m_calls_re_match_0: ✅ pass assert_assert(7706)_calls_Any_to_bool_0: ✅ pass (at line 237, col 4) -assert(7706): ❓ unknown (at line 237, col 4) +assert(7706): ✅ pass (at line 237, col 4) set_m_calls_re_match_0: ✅ pass assert_assert(7790)_calls_Any_to_bool_0: ✅ pass (at line 240, col 4) -assert(7790): ❓ unknown (at line 240, col 4) +assert(7790): ✅ pass (at line 240, col 4) set_m_calls_re_match_0: ✅ pass assert_assert(7865)_calls_Any_to_bool_0: ✅ pass (at line 243, col 4) -assert(7865): ❓ unknown (at line 243, col 4) +assert(7865): ✅ pass (at line 243, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(8114)_calls_Any_to_bool_0: ✅ pass (at line 249, col 4) -assert(8114): ❓ unknown (at line 249, col 4) +assert(8114): ✅ pass (at line 249, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(8189)_calls_Any_to_bool_0: ✅ pass (at line 252, col 4) -assert(8189): ❓ unknown (at line 252, col 4) +assert(8189): ✅ pass (at line 252, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(8294)_calls_Any_to_bool_0: ✅ pass (at line 256, col 4) -assert(8294): ❓ unknown (at line 256, col 4) +assert(8294): ✅ pass (at line 256, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(8371)_calls_Any_to_bool_0: ✅ pass (at line 259, col 4) -assert(8371): ❓ unknown (at line 259, col 4) +assert(8371): ✅ pass (at line 259, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(8453)_calls_Any_to_bool_0: ✅ pass (at line 262, col 4) -assert(8453): ❓ unknown (at line 262, col 4) +assert(8453): ✅ pass (at line 262, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(8554)_calls_Any_to_bool_0: ✅ pass (at line 266, col 4) -assert(8554): ❓ unknown (at line 266, col 4) +assert(8554): ✅ pass (at line 266, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(8627)_calls_Any_to_bool_0: ✅ pass (at line 269, col 4) -assert(8627): ❓ unknown (at line 269, col 4) +assert(8627): ✅ pass (at line 269, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(8711)_calls_Any_to_bool_0: ✅ pass (at line 272, col 4) -assert(8711): ❓ unknown (at line 272, col 4) +assert(8711): ✅ pass (at line 272, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(8790)_calls_Any_to_bool_0: ✅ pass (at line 275, col 4) -assert(8790): ❓ unknown (at line 275, col 4) +assert(8790): ✅ pass (at line 275, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(8914)_calls_Any_to_bool_0: ✅ pass (at line 279, col 4) -assert(8914): ❓ unknown (at line 279, col 4) +assert(8914): ✅ pass (at line 279, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(8988)_calls_Any_to_bool_0: ✅ pass (at line 282, col 4) -assert(8988): ❓ unknown (at line 282, col 4) +assert(8988): ✅ pass (at line 282, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(9070)_calls_Any_to_bool_0: ✅ pass (at line 285, col 4) -assert(9070): ❓ unknown (at line 285, col 4) +assert(9070): ✅ pass (at line 285, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(9300)_calls_Any_to_bool_0: ✅ pass (at line 290, col 4) -assert(9300): ❓ unknown (at line 290, col 4) +assert(9300): ✅ pass (at line 290, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(9381)_calls_Any_to_bool_0: ✅ pass (at line 293, col 4) -assert(9381): ❓ unknown (at line 293, col 4) +assert(9381): ✅ pass (at line 293, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(9472)_calls_Any_to_bool_0: ✅ pass (at line 296, col 4) -assert(9472): ❓ unknown (at line 296, col 4) +assert(9472): ✅ pass (at line 296, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(9551)_calls_Any_to_bool_0: ✅ pass (at line 299, col 4) -assert(9551): ❓ unknown (at line 299, col 4) +assert(9551): ✅ pass (at line 299, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(9638)_calls_Any_to_bool_0: ✅ pass (at line 302, col 4) -assert(9638): ❓ unknown (at line 302, col 4) +assert(9638): ✅ pass (at line 302, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(9718)_calls_Any_to_bool_0: ✅ pass (at line 305, col 4) -assert(9718): ❓ unknown (at line 305, col 4) +assert(9718): ✅ pass (at line 305, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(9806)_calls_Any_to_bool_0: ✅ pass (at line 308, col 4) -assert(9806): ❓ unknown (at line 308, col 4) +assert(9806): ✅ pass (at line 308, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(10048)_calls_Any_to_bool_0: ✅ pass (at line 313, col 4) -assert(10048): ❓ unknown (at line 313, col 4) +assert(10048): ✅ pass (at line 313, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(10134)_calls_Any_to_bool_0: ✅ pass (at line 316, col 4) -assert(10134): ❓ unknown (at line 316, col 4) +assert(10134): ✅ pass (at line 316, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(10224)_calls_Any_to_bool_0: ✅ pass (at line 319, col 4) -assert(10224): ❓ unknown (at line 319, col 4) +assert(10224): ✅ pass (at line 319, col 4) set_m_calls_re_match_0: ✅ pass assert_assert(10310)_calls_Any_to_bool_0: ✅ pass (at line 322, col 4) -assert(10310): ❓ unknown (at line 322, col 4) +assert(10310): ✅ pass (at line 322, col 4) set_m_calls_re_match_0: ✅ pass assert_assert(10390)_calls_Any_to_bool_0: ✅ pass (at line 325, col 4) -assert(10390): ❓ unknown (at line 325, col 4) +assert(10390): ✅ pass (at line 325, col 4) set_m_calls_re_match_0: ✅ pass assert_assert(10478)_calls_Any_to_bool_0: ✅ pass (at line 328, col 4) -assert(10478): ❓ unknown (at line 328, col 4) +assert(10478): ✅ pass (at line 328, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(10718)_calls_Any_to_bool_0: ✅ pass (at line 333, col 4) -assert(10718): ❓ unknown (at line 333, col 4) +assert(10718): ✅ pass (at line 333, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(10808)_calls_Any_to_bool_0: ✅ pass (at line 336, col 4) -assert(10808): ❓ unknown (at line 336, col 4) +assert(10808): ✅ pass (at line 336, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(10898)_calls_Any_to_bool_0: ✅ pass (at line 339, col 4) -assert(10898): ❓ unknown (at line 339, col 4) +assert(10898): ✅ pass (at line 339, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(10988)_calls_Any_to_bool_0: ✅ pass (at line 342, col 4) -assert(10988): ❓ unknown (at line 342, col 4) +assert(10988): ✅ pass (at line 342, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(11071)_calls_Any_to_bool_0: ✅ pass (at line 345, col 4) -assert(11071): ❓ unknown (at line 345, col 4) +assert(11071): ✅ pass (at line 345, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(11162)_calls_Any_to_bool_0: ✅ pass (at line 348, col 4) -assert(11162): ❓ unknown (at line 348, col 4) +assert(11162): ✅ pass (at line 348, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(11245)_calls_Any_to_bool_0: ✅ pass (at line 351, col 4) -assert(11245): ❓ unknown (at line 351, col 4) +assert(11245): ✅ pass (at line 351, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(11339)_calls_Any_to_bool_0: ✅ pass (at line 354, col 4) -assert(11339): ❓ unknown (at line 354, col 4) +assert(11339): ✅ pass (at line 354, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(11429)_calls_Any_to_bool_0: ✅ pass (at line 357, col 4) -assert(11429): ❓ unknown (at line 357, col 4) +assert(11429): ✅ pass (at line 357, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(11521)_calls_Any_to_bool_0: ✅ pass (at line 360, col 4) -assert(11521): ❓ unknown (at line 360, col 4) +assert(11521): ✅ pass (at line 360, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(11606)_calls_Any_to_bool_0: ✅ pass (at line 363, col 4) -assert(11606): ❓ unknown (at line 363, col 4) +assert(11606): ✅ pass (at line 363, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(11701)_calls_Any_to_bool_0: ✅ pass (at line 366, col 4) -assert(11701): ❓ unknown (at line 366, col 4) +assert(11701): ✅ pass (at line 366, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(11829)_calls_Any_to_bool_0: ✅ pass (at line 370, col 4) -assert(11829): ❓ unknown (at line 370, col 4) +assert(11829): ✅ pass (at line 370, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(11910)_calls_Any_to_bool_0: ✅ pass (at line 373, col 4) -assert(11910): ❓ unknown (at line 373, col 4) +assert(11910): ✅ pass (at line 373, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(11995)_calls_Any_to_bool_0: ✅ pass (at line 376, col 4) -assert(11995): ❓ unknown (at line 376, col 4) +assert(11995): ✅ pass (at line 376, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(12253)_calls_Any_to_bool_0: ✅ pass (at line 381, col 4) -assert(12253): ❓ unknown (at line 381, col 4) +assert(12253): ✅ pass (at line 381, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(12333)_calls_Any_to_bool_0: ✅ pass (at line 384, col 4) -assert(12333): ❓ unknown (at line 384, col 4) +assert(12333): ✅ pass (at line 384, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(12428)_calls_Any_to_bool_0: ✅ pass (at line 387, col 4) -assert(12428): ❓ unknown (at line 387, col 4) +assert(12428): ✅ pass (at line 387, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(12519)_calls_Any_to_bool_0: ✅ pass (at line 390, col 4) -assert(12519): ❓ unknown (at line 390, col 4) +assert(12519): ✅ pass (at line 390, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(12611)_calls_Any_to_bool_0: ✅ pass (at line 393, col 4) -assert(12611): ❓ unknown (at line 393, col 4) +assert(12611): ✅ pass (at line 393, col 4) set_m_calls_re_match_0: ✅ pass assert_assert(12702)_calls_Any_to_bool_0: ✅ pass (at line 396, col 4) -assert(12702): ❓ unknown (at line 396, col 4) +assert(12702): ✅ pass (at line 396, col 4) set_m_calls_re_match_0: ✅ pass assert_assert(12796)_calls_Any_to_bool_0: ✅ pass (at line 399, col 4) -assert(12796): ❓ unknown (at line 399, col 4) +assert(12796): ✅ pass (at line 399, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(13063)_calls_Any_to_bool_0: ✅ pass (at line 404, col 4) -assert(13063): ❓ unknown (at line 404, col 4) +assert(13063): ✅ pass (at line 404, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(13156)_calls_Any_to_bool_0: ✅ pass (at line 407, col 4) -assert(13156): ❓ unknown (at line 407, col 4) +assert(13156): ✅ pass (at line 407, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(13253)_calls_Any_to_bool_0: ✅ pass (at line 410, col 4) -assert(13253): ❓ unknown (at line 410, col 4) +assert(13253): ✅ pass (at line 410, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(13345)_calls_Any_to_bool_0: ✅ pass (at line 413, col 4) -assert(13345): ❓ unknown (at line 413, col 4) +assert(13345): ✅ pass (at line 413, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(13455)_calls_Any_to_bool_0: ✅ pass (at line 417, col 4) -assert(13455): ❓ unknown (at line 417, col 4) +assert(13455): ✅ pass (at line 417, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(13541)_calls_Any_to_bool_0: ✅ pass (at line 420, col 4) -assert(13541): ❓ unknown (at line 420, col 4) +assert(13541): ✅ pass (at line 420, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(13631)_calls_Any_to_bool_0: ✅ pass (at line 423, col 4) -assert(13631): ❓ unknown (at line 423, col 4) +assert(13631): ✅ pass (at line 423, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(13724)_calls_Any_to_bool_0: ✅ pass (at line 426, col 4) -assert(13724): ❓ unknown (at line 426, col 4) +assert(13724): ✅ pass (at line 426, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(13954)_calls_Any_to_bool_0: ✅ pass (at line 431, col 4) -assert(13954): ❓ unknown (at line 431, col 4) +assert(13954): ✅ pass (at line 431, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(14044)_calls_Any_to_bool_0: ✅ pass (at line 434, col 4) -assert(14044): ❓ unknown (at line 434, col 4) +assert(14044): ✅ pass (at line 434, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(14136)_calls_Any_to_bool_0: ✅ pass (at line 437, col 4) -assert(14136): ❓ unknown (at line 437, col 4) +assert(14136): ✅ pass (at line 437, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(14220)_calls_Any_to_bool_0: ✅ pass (at line 440, col 4) -assert(14220): ❓ unknown (at line 440, col 4) +assert(14220): ✅ pass (at line 440, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(14307)_calls_Any_to_bool_0: ✅ pass (at line 443, col 4) -assert(14307): ❓ unknown (at line 443, col 4) +assert(14307): ✅ pass (at line 443, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(14392)_calls_Any_to_bool_0: ✅ pass (at line 446, col 4) -assert(14392): ❓ unknown (at line 446, col 4) +assert(14392): ✅ pass (at line 446, col 4) set_p_calls_re_compile_0: ✅ pass set_m_calls_re_fullmatch_0: ✅ pass assert_assert(14608)_calls_Any_to_bool_0: ✅ pass (at line 453, col 4) -assert(14608): ❓ unknown (at line 453, col 4) +assert(14608): ✅ pass (at line 453, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(14686)_calls_Any_to_bool_0: ✅ pass (at line 456, col 4) -assert(14686): ❓ unknown (at line 456, col 4) +assert(14686): ✅ pass (at line 456, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(14768)_calls_Any_to_bool_0: ✅ pass (at line 459, col 4) -assert(14768): ❓ unknown (at line 459, col 4) +assert(14768): ✅ pass (at line 459, col 4) set_m_calls_re_match_0: ✅ pass assert_assert(14856)_calls_Any_to_bool_0: ✅ pass (at line 462, col 4) -assert(14856): ❓ unknown (at line 462, col 4) +assert(14856): ✅ pass (at line 462, col 4) set_m_calls_re_match_0: ✅ pass assert_assert(14936)_calls_Any_to_bool_0: ✅ pass (at line 465, col 4) -assert(14936): ❓ unknown (at line 465, col 4) +assert(14936): ✅ pass (at line 465, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(15360)_calls_Any_to_bool_0: ✅ pass (at line 473, col 4) -assert(15360): ❓ unknown (at line 473, col 4) +assert(15360): ✅ pass (at line 473, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(15469)_calls_Any_to_bool_0: ✅ pass (at line 476, col 4) -assert(15469): ❓ unknown (at line 476, col 4) +assert(15469): ✅ pass (at line 476, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(15585)_calls_Any_to_bool_0: ✅ pass (at line 479, col 4) -assert(15585): ❓ unknown (at line 479, col 4) +assert(15585): ✅ pass (at line 479, col 4) set_m_calls_re_search_0: ✅ pass assert_assert(15691)_calls_Any_to_bool_0: ✅ pass (at line 482, col 4) -assert(15691): ❓ unknown (at line 482, col 4) +assert(15691): ✅ pass (at line 482, col 4) set_m_calls_re_match_0: ✅ pass assert_assert(15806)_calls_Any_to_bool_0: ✅ pass (at line 485, col 4) -assert(15806): ❓ unknown (at line 485, col 4) +assert(15806): ✅ pass (at line 485, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 487, col 0) -DETAIL: 318 passed, 0 failed, 140 inconclusive -RESULT: Inconclusive +DETAIL: 458 passed, 0 failed, 0 inconclusive +RESULT: Analysis success From a779e734a35b60b41d74a030d37fcad83ed32755 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 27 Mar 2026 18:31:02 +0100 Subject: [PATCH 68/79] update expect files --- .../expected_laurel/test_if_elif.expected | 4 +- .../expected_laurel/test_loops.expected | 8 +- .../test_missing_models.expected | 20 +-- .../test_multiple_except.expected | 14 +- .../expected_laurel/test_pin_any.expected | 2 +- .../test_regex_negative.expected | 142 +----------------- .../expected_laurel/test_try_except.expected | 8 +- .../test_try_except_scoping.expected | 26 +--- .../test_variable_reassign.expected | 6 +- .../expected_laurel/test_while_loop.expected | 10 +- 10 files changed, 18 insertions(+), 222 deletions(-) diff --git a/StrataTest/Languages/Python/expected_laurel/test_if_elif.expected b/StrataTest/Languages/Python/expected_laurel/test_if_elif.expected index fd4b6c023..786d28136 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_if_elif.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_if_elif.expected @@ -37,7 +37,7 @@ assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) Assertion failed at line 2, col 4: ite_cond_calls_Any_to_bool_0: ❌ fail ite_cond_calls_Any_to_bool_0: ✅ pass (at line 4, col 4) -Assertion failed at line 6, col 4: ite_cond_calls_Any_to_bool_0: ❌ fail +ite_cond_calls_Any_to_bool_0: ❓ unknown (at line 6, col 4) assert_assert(225)_calls_Any_to_bool_0: ✅ pass (at line 13, col 4) assert(225): ❓ unknown (at line 13, col 4) assert_assert(302)_calls_Any_to_bool_0: ✅ pass (at line 16, col 4) @@ -48,5 +48,5 @@ assert_assert(444)_calls_Any_to_bool_0: ✅ pass (at line 22, col 4) assert(444): ❓ unknown (at line 22, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 24, col 0) -DETAIL: 41 passed, 2 failed, 4 inconclusive +DETAIL: 41 passed, 1 failed, 5 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_loops.expected b/StrataTest/Languages/Python/expected_laurel/test_loops.expected index 385e165bc..4315cdd9c 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_loops.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_loops.expected @@ -49,8 +49,8 @@ assert_assert(409)_calls_Any_to_bool_0: ✅ pass (at line 18, col 4) assert(409): ✅ pass (at line 18, col 4) loop_guard_calls_Any_to_bool_0: ✅ pass (at line 22, col 4) loop_guard_end_calls_Any_to_bool_0: ✅ pass (at line 22, col 4) -Assertion failed at line 24, col 4: assert_assert(531)_calls_Any_to_bool_0: ❌ fail -Assertion failed at line 24, col 4: assert(531): ❌ fail +assert_assert(531)_calls_Any_to_bool_0: ❓ unknown (at line 24, col 4) +assert(531): ❓ unknown (at line 24, col 4) -DETAIL: 43 passed, 2 failed, 6 inconclusive -RESULT: Failures found +DETAIL: 43 passed, 0 failed, 8 inconclusive +RESULT: Inconclusive diff --git a/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected b/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected index f0dbf81d8..b43378a13 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected @@ -35,27 +35,9 @@ assert_name_is_foo: ✅ pass (in prelude file) assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) -callElimAssert_requires_0_13: ✅ pass (at line 12, col 4) -callElimAssert_requires_1_14: ✅ pass (at line 12, col 4) -callElimAssert_requires_2_15: ✅ pass (at line 12, col 4) -callElimAssert_requires_0_4: ✅ pass (at line 15, col 4) -callElimAssert_requires_1_5: ✅ pass (at line 15, col 4) -callElimAssert_requires_2_6: ✅ pass (at line 15, col 4) -callElimAssert_requires_0_13: ✅ pass (at line 12, col 4) -callElimAssert_requires_1_14: ✅ pass (at line 12, col 4) -callElimAssert_requires_2_15: ✅ pass (at line 12, col 4) -callElimAssert_requires_0_4: ✅ pass (at line 15, col 4) -callElimAssert_requires_1_5: ✅ pass (at line 15, col 4) -callElimAssert_requires_2_6: ✅ pass (at line 15, col 4) Assertion failed at line 9, col 4: callElimAssert_requires_0_22: ❌ fail callElimAssert_requires_1_23: ✅ pass (at line 9, col 4) callElimAssert_requires_2_24: ✅ pass (at line 9, col 4) -callElimAssert_requires_0_13: ✅ pass (at line 12, col 4) -callElimAssert_requires_1_14: ✅ pass (at line 12, col 4) -callElimAssert_requires_2_15: ✅ pass (at line 12, col 4) -callElimAssert_requires_0_4: ✅ pass (at line 15, col 4) -callElimAssert_requires_1_5: ✅ pass (at line 15, col 4) -callElimAssert_requires_2_6: ✅ pass (at line 15, col 4) -DETAIL: 55 passed, 1 failed, 0 inconclusive +DETAIL: 37 passed, 1 failed, 0 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_multiple_except.expected b/StrataTest/Languages/Python/expected_laurel/test_multiple_except.expected index 38439b2ea..ffe009b9d 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_multiple_except.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_multiple_except.expected @@ -36,23 +36,11 @@ assert_opt_name_none_or_str: ✅ pass (in prelude file) assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) assert_assert(170)_calls_Any_to_bool_0: ✅ pass (at line 8, col 4) -assert(170): ✅ pass (at line 8, col 4) -assert_assert(170)_calls_Any_to_bool_0: ✅ pass (at line 8, col 4) -assert(170): ✅ pass (at line 8, col 4) -assert_assert(170)_calls_Any_to_bool_0: ✅ pass (at line 8, col 4) Assertion failed at line 8, col 4: assert(170): ❌ fail assert_assert(471)_calls_Any_to_bool_0: ✅ pass (at line 21, col 4) -assert(471): ✅ pass (at line 21, col 4) -assert_assert(471)_calls_Any_to_bool_0: ✅ pass (at line 21, col 4) -assert(471): ✅ pass (at line 21, col 4) -assert_assert(471)_calls_Any_to_bool_0: ✅ pass (at line 21, col 4) -assert(471): ✅ pass (at line 21, col 4) -assert_assert(471)_calls_Any_to_bool_0: ✅ pass (at line 21, col 4) Assertion failed at line 21, col 4: assert(471): ❌ fail assert_assert(693)_calls_Any_to_bool_0: ✅ pass (at line 31, col 4) assert(693): ✅ pass (at line 31, col 4) -assert_assert(693)_calls_Any_to_bool_0: ✅ pass (at line 31, col 4) -assert(693): ✅ pass (at line 31, col 4) -DETAIL: 51 passed, 2 failed, 0 inconclusive +DETAIL: 39 passed, 2 failed, 0 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_pin_any.expected b/StrataTest/Languages/Python/expected_laurel/test_pin_any.expected index d494f7cd4..8308fb062 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_pin_any.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_pin_any.expected @@ -36,7 +36,7 @@ assert_opt_name_none_or_str: ✔️ always true if reached (in prelude file) assert_opt_name_none_or_bar: ✔️ always true if reached (in prelude file) ensures_maybe_except_none: ✔️ always true if reached (in prelude file) ite_cond_calls_Any_to_bool_0: 🔶 can be both true and false and is reachable from declaration entry (at line 3, col 4) -assert_assert(124)_calls_PIn_0: 🔶 can be both true and false and is reachable from declaration entry (at line 4, col 8) +assert_assert(124)_calls_PIn_0: ❓ unknown (at line 4, col 8) assert_assert(124)_calls_Any_to_bool_1: ✔️ always true if reached (at line 4, col 8) assert(124): ❓ unknown (at line 4, col 8) diff --git a/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected b/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected index 876fbbd58..51716f404 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected @@ -65,160 +65,20 @@ assert_assert(1133)_calls_Any_to_bool_0: ✅ pass (at line 37, col 4) assert(1133): ❓ unknown (at line 37, col 4) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(1495)_calls_Any_to_bool_0: ✅ pass (at line 47, col 4) -assert(1495): ✅ pass (at line 47, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(1667)_calls_Any_to_bool_0: ✅ pass (at line 54, col 4) -assert(1667): ✅ pass (at line 54, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(1846)_calls_Any_to_bool_0: ✅ pass (at line 61, col 4) -assert(1846): ✅ pass (at line 61, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) -assert(2015): ✅ pass (at line 68, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) -assert(2015): ✅ pass (at line 68, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(1846)_calls_Any_to_bool_0: ✅ pass (at line 61, col 4) -assert(1846): ✅ pass (at line 61, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) -assert(2015): ✅ pass (at line 68, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) -assert(2015): ✅ pass (at line 68, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(1667)_calls_Any_to_bool_0: ✅ pass (at line 54, col 4) -assert(1667): ✅ pass (at line 54, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(1846)_calls_Any_to_bool_0: ✅ pass (at line 61, col 4) -assert(1846): ✅ pass (at line 61, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) -assert(2015): ✅ pass (at line 68, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) -assert(2015): ✅ pass (at line 68, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(1846)_calls_Any_to_bool_0: ✅ pass (at line 61, col 4) -assert(1846): ✅ pass (at line 61, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) -assert(2015): ✅ pass (at line 68, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) -assert(2015): ✅ pass (at line 68, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(1495)_calls_Any_to_bool_0: ✅ pass (at line 47, col 4) Assertion failed at line 47, col 4: assert(1495): ❌ fail set_m_calls_re_fullmatch_0: ✅ pass assert_assert(1667)_calls_Any_to_bool_0: ✅ pass (at line 54, col 4) -assert(1667): ✅ pass (at line 54, col 4) -set_m_calls_re_fullmatch_0: ✅ pass -assert_assert(1846)_calls_Any_to_bool_0: ✅ pass (at line 61, col 4) -assert(1846): ✅ pass (at line 61, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) -assert(2015): ✅ pass (at line 68, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) -assert(2015): ✅ pass (at line 68, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(1846)_calls_Any_to_bool_0: ✅ pass (at line 61, col 4) -assert(1846): ✅ pass (at line 61, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) -assert(2015): ✅ pass (at line 68, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) -assert(2015): ✅ pass (at line 68, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(1667)_calls_Any_to_bool_0: ✅ pass (at line 54, col 4) Assertion failed at line 54, col 4: assert(1667): ❌ fail set_m_calls_re_fullmatch_0: ✅ pass assert_assert(1846)_calls_Any_to_bool_0: ✅ pass (at line 61, col 4) -assert(1846): ✅ pass (at line 61, col 4) -set_m_calls_re_search_0: ✅ pass -assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) -assert(2015): ✅ pass (at line 68, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) -assert(2015): ✅ pass (at line 68, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(1846)_calls_Any_to_bool_0: ✅ pass (at line 61, col 4) Assertion failed at line 61, col 4: assert(1846): ❌ fail set_m_calls_re_search_0: ✅ pass assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) -assert(2015): ✅ pass (at line 68, col 4) -set_m_calls_re_match_0: ✅ pass -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(2015)_calls_Any_to_bool_0: ✅ pass (at line 68, col 4) Assertion failed at line 68, col 4: assert(2015): ❌ fail set_m_calls_re_match_0: ✅ pass assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) -assert(2193): ✅ pass (at line 75, col 4) -assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) Assertion failed at line 75, col 4: assert(2193): ❌ fail ite_cond_calls_Any_to_bool_0: ✅ pass (at line 77, col 0) -DETAIL: 205 passed, 5 failed, 9 inconclusive +DETAIL: 65 passed, 5 failed, 9 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_try_except.expected b/StrataTest/Languages/Python/expected_laurel/test_try_except.expected index e97946e6c..edac5e413 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_try_except.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_try_except.expected @@ -37,14 +37,8 @@ assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) assert_assert(129)_calls_Any_to_bool_0: ✅ pass (at line 7, col 4) assert(129): ✅ pass (at line 7, col 4) -assert_assert(129)_calls_Any_to_bool_0: ✅ pass (at line 7, col 4) -assert(129): ✅ pass (at line 7, col 4) -assert_assert(358)_calls_Any_to_bool_0: ✅ pass (at line 17, col 4) -assert(358): ✅ pass (at line 17, col 4) -assert_assert(358)_calls_Any_to_bool_0: ✅ pass (at line 17, col 4) -assert(358): ✅ pass (at line 17, col 4) assert_assert(358)_calls_Any_to_bool_0: ✅ pass (at line 17, col 4) Assertion failed at line 17, col 4: assert(358): ❌ fail -DETAIL: 44 passed, 1 failed, 0 inconclusive +DETAIL: 38 passed, 1 failed, 0 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected b/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected index 77d08ec12..8f4a07c74 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected @@ -37,34 +37,10 @@ assert_opt_name_none_or_bar: ✅ pass (in prelude file) ensures_maybe_except_none: ✅ pass (in prelude file) assert_assert(355)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) assert(355): ✅ pass (at line 15, col 4) -assert_assert(355)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) -assert(355): ✅ pass (at line 15, col 4) -assert_assert(355)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) -assert(355): ✅ pass (at line 15, col 4) -assert_assert(355)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) -assert(355): ✅ pass (at line 15, col 4) -assert_assert(355)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) -assert(355): ✅ pass (at line 15, col 4) -assert_assert(355)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) -assert(355): ✅ pass (at line 15, col 4) -assert_assert(355)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) -assert(355): ✅ pass (at line 15, col 4) -assert_assert(355)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) -assert(355): ✅ pass (at line 15, col 4) -assert_assert(355)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) -assert(355): ✅ pass (at line 15, col 4) -assert_assert(355)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) -assert(355): ✅ pass (at line 15, col 4) assert_assert(638)_calls_Any_to_bool_0: ✅ pass (at line 24, col 4) assert(638): ✅ pass (at line 24, col 4) -assert_assert(638)_calls_Any_to_bool_0: ✅ pass (at line 24, col 4) -assert(638): ✅ pass (at line 24, col 4) -assert_assert(952)_calls_Any_to_bool_0: ✅ pass (at line 35, col 4) -assert(952): ✅ pass (at line 35, col 4) -assert_assert(952)_calls_Any_to_bool_0: ✅ pass (at line 35, col 4) -assert(952): ✅ pass (at line 35, col 4) assert_assert(952)_calls_Any_to_bool_0: ✅ pass (at line 35, col 4) assert(952): ✅ pass (at line 35, col 4) -DETAIL: 65 passed, 0 failed, 0 inconclusive +DETAIL: 41 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_variable_reassign.expected b/StrataTest/Languages/Python/expected_laurel/test_variable_reassign.expected index 9bfe058bd..96412e8f7 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_variable_reassign.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_variable_reassign.expected @@ -44,7 +44,7 @@ assert(158): ✅ pass (at line 8, col 4) loop_guard_calls_Any_to_bool_0: ✅ pass (at line 13, col 4) loop_guard_end_calls_Any_to_bool_0: ✅ pass (at line 13, col 4) assert_assert(318)_calls_Any_to_bool_0: ✅ pass (at line 16, col 4) -Assertion failed at line 16, col 4: assert(318): ❌ fail +assert(318): ❓ unknown (at line 16, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 21, col 4) assert_assert(496)_calls_Any_to_bool_0: ✅ pass (at line 25, col 4) assert(496): ✅ pass (at line 25, col 4) @@ -53,5 +53,5 @@ assert_assert(612)_calls_Any_to_bool_0: ✅ pass (at line 32, col 4) assert(612): ✅ pass (at line 32, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 34, col 0) -DETAIL: 51 passed, 1 failed, 0 inconclusive -RESULT: Failures found +DETAIL: 51 passed, 0 failed, 1 inconclusive +RESULT: Inconclusive diff --git a/StrataTest/Languages/Python/expected_laurel/test_while_loop.expected b/StrataTest/Languages/Python/expected_laurel/test_while_loop.expected index 235536c49..b974b084d 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_while_loop.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_while_loop.expected @@ -38,7 +38,7 @@ ensures_maybe_except_none: ✅ pass (in prelude file) loop_guard_calls_Any_to_bool_0: ✅ pass (at line 4, col 4) loop_guard_end_calls_Any_to_bool_0: ✅ pass (at line 4, col 4) assert_assert(134)_calls_Any_to_bool_0: ✅ pass (at line 7, col 4) -Assertion failed at line 7, col 4: assert(134): ❌ fail +assert(134): ❓ unknown (at line 7, col 4) loop_guard_calls_Any_to_bool_0: ✅ pass (at line 12, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 14, col 8) assert_assert(344)_calls_Any_to_bool_0: ✅ pass (at line 16, col 4) @@ -46,8 +46,6 @@ assert(344): ✅ pass (at line 16, col 4) loop_guard_end_calls_Any_to_bool_0: ✅ pass (at line 12, col 4) assert_assert(344)_calls_Any_to_bool_0: ✅ pass (at line 16, col 4) assert(344): ✅ pass (at line 16, col 4) -assert_assert(344)_calls_Any_to_bool_0: ✅ pass (at line 16, col 4) -assert(344): ✅ pass (at line 16, col 4) loop_guard_calls_Any_to_bool_0: ✅ pass (at line 22, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 24, col 8) loop_guard_end_calls_Any_to_bool_0: ✅ pass (at line 22, col 4) @@ -56,8 +54,6 @@ assert(589): ❓ unknown (at line 27, col 4) loop_guard_end_calls_Any_to_bool_0: ✅ pass (at line 22, col 4) assert_assert(589)_calls_Any_to_bool_0: ✅ pass (at line 27, col 4) assert(589): ❓ unknown (at line 27, col 4) -assert_assert(589)_calls_Any_to_bool_0: ✅ pass (at line 27, col 4) -assert(589): ✅ pass (at line 27, col 4) -DETAIL: 55 passed, 1 failed, 2 inconclusive -RESULT: Failures found +DETAIL: 51 passed, 0 failed, 3 inconclusive +RESULT: Inconclusive From 74b77764d42870bb6690416adddbfb0677926e7f Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 27 Mar 2026 19:46:18 +0100 Subject: [PATCH 69/79] update new test --- .../test_method_param_reassign.expected | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/StrataTest/Languages/Python/expected_laurel/test_method_param_reassign.expected b/StrataTest/Languages/Python/expected_laurel/test_method_param_reassign.expected index 4df756abd..d51b9abd5 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_method_param_reassign.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_method_param_reassign.expected @@ -1,12 +1,18 @@ ==== Verification Results ==== -List_get_body_calls_List_get_0: ✅ pass (in prelude file) -List_take_body_calls_List_take_0: ✅ pass (in prelude file) -List_drop_body_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) +List_set_body_calls_List_set_0: ✅ pass +DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) @@ -22,6 +28,13 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) +ret_type: ✅ pass (in prelude file) +ret_type: ✅ pass (in prelude file) +ret_pos: ✅ pass (in prelude file) +assert_name_is_foo: ✅ pass (in prelude file) +assert_opt_name_none_or_str: ✅ pass (in prelude file) +assert_opt_name_none_or_bar: ✅ pass (in prelude file) +ensures_maybe_except_none: ✅ pass (in prelude file) -DETAIL: 22 passed, 0 failed, 0 inconclusive +DETAIL: 35 passed, 0 failed, 0 inconclusive RESULT: Analysis success From 9c6e9ca30133d59802309be50cc9a35f7b2fd0e3 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Sat, 28 Mar 2026 10:17:19 +0100 Subject: [PATCH 70/79] Update new tests --- .../expected_laurel/test_fstrings.expected | 25 ++++++++++++++----- .../test_variable_in_nested_block.expected | 25 ++++++++++++++----- 2 files changed, 38 insertions(+), 12 deletions(-) diff --git a/StrataTest/Languages/Python/expected_laurel/test_fstrings.expected b/StrataTest/Languages/Python/expected_laurel/test_fstrings.expected index 37661df17..afa83b4e3 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_fstrings.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_fstrings.expected @@ -1,12 +1,18 @@ ==== Verification Results ==== -List_get_body_calls_List_get_0: ✅ pass (in prelude file) -List_take_body_calls_List_take_0: ✅ pass (in prelude file) -List_drop_body_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) +List_set_body_calls_List_set_0: ✅ pass +DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) @@ -22,6 +28,13 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) +ret_type: ✅ pass (in prelude file) +ret_type: ✅ pass (in prelude file) +ret_pos: ✅ pass (in prelude file) +assert_name_is_foo: ✅ pass (in prelude file) +assert_opt_name_none_or_str: ✅ pass (in prelude file) +assert_opt_name_none_or_bar: ✅ pass (in prelude file) +ensures_maybe_except_none: ✅ pass (in prelude file) assert_assert(196)_calls_Any_to_bool_0: ✅ pass (at line 6, col 4) assert(196): ❓ unknown (at line 6, col 4) assert_assert(430)_calls_Any_to_bool_0: ✅ pass (at line 13, col 4) @@ -30,5 +43,5 @@ assert_assert(511)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) assert(511): ✅ pass (at line 15, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 17, col 0) -DETAIL: 28 passed, 0 failed, 1 inconclusive +DETAIL: 41 passed, 0 failed, 1 inconclusive RESULT: Inconclusive diff --git a/StrataTest/Languages/Python/expected_laurel/test_variable_in_nested_block.expected b/StrataTest/Languages/Python/expected_laurel/test_variable_in_nested_block.expected index 25a14ec45..5565a9b59 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_variable_in_nested_block.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_variable_in_nested_block.expected @@ -1,12 +1,18 @@ ==== Verification Results ==== -List_get_body_calls_List_get_0: ✅ pass (in prelude file) -List_take_body_calls_List_take_0: ✅ pass (in prelude file) -List_drop_body_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_take_body_calls_List_take_0: ✅ pass +List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_drop_body_calls_List_drop_0: ✅ pass +List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +postcondition: ✅ pass (in prelude file) +List_get_body_calls_List_get_0: ✅ pass List_slice_body_calls_List_drop_0: ✅ pass (in prelude file) List_slice_body_calls_List_take_1: ✅ pass (in prelude file) -List_set_body_calls_List_set_0: ✅ pass (in prelude file) -DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) +List_set_body_calls_List_set_0: ✅ pass +DictStrAny_get_body_calls_DictStrAny_get_0: ✅ pass DictStrAny_get_or_none_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_DictStrAny_get_0: ✅ pass (in prelude file) Any_get_body_calls_List_get_1: ✅ pass (in prelude file) @@ -22,10 +28,17 @@ PFloorDiv_body_calls_Int.SafeDiv_2: ✅ pass (in prelude file) PFloorDiv_body_calls_Int.SafeDiv_3: ✅ pass (in prelude file) PAnd_body_calls_Any_to_bool_0: ✅ pass (in prelude file) POr_body_calls_Any_to_bool_0: ✅ pass (in prelude file) +ret_type: ✅ pass (in prelude file) +ret_type: ✅ pass (in prelude file) +ret_pos: ✅ pass (in prelude file) +assert_name_is_foo: ✅ pass (in prelude file) +assert_opt_name_none_or_str: ✅ pass (in prelude file) +assert_opt_name_none_or_bar: ✅ pass (in prelude file) +ensures_maybe_except_none: ✅ pass (in prelude file) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 2, col 0) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 3, col 4) assert_assert(91)_calls_Any_to_bool_0: ✅ pass (at line 8, col 0) assert(91): ✅ pass (at line 8, col 0) -DETAIL: 26 passed, 0 failed, 0 inconclusive +DETAIL: 39 passed, 0 failed, 0 inconclusive RESULT: Analysis success From 4a1375c1ec1136f2f54d3b23d4894662ac6ca3d2 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Sat, 28 Mar 2026 10:21:33 +0100 Subject: [PATCH 71/79] Refer to GH issue for Core bug --- .../Laurel/Examples/Fundamentals/T15_ShortCircuit.lean | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/StrataTest/Languages/Laurel/Examples/Fundamentals/T15_ShortCircuit.lean b/StrataTest/Languages/Laurel/Examples/Fundamentals/T15_ShortCircuit.lean index 3f53a1d28..2fd2ad42e 100644 --- a/StrataTest/Languages/Laurel/Examples/Fundamentals/T15_ShortCircuit.lean +++ b/StrataTest/Languages/Laurel/Examples/Fundamentals/T15_ShortCircuit.lean @@ -28,14 +28,14 @@ procedure mustNotCallProc(): int procedure testAndThenFunc() { var b: bool := false && mustNotCallFunc(0) > 0; //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: assertion does not hold -// TODO caused by a bug in Core. +// TODO caused by a bug in Core: https://github.com/strata-org/Strata/issues/700 assert !b }; procedure testOrElseFunc() { var b: bool := true || mustNotCallFunc(0) > 0; //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: assertion does not hold -// TODO caused by a bug in Core. +// TODO caused by a bug in Core: https://github.com/strata-org/Strata/issues/700 assert b }; @@ -55,7 +55,7 @@ procedure testAndThenDivByZero() { procedure testOrElseDivByZero() { assert true || 1 / 0 > 0 //^^^^^^^^^^^^^^^^^^^^^^^^ error: assertion does not hold -// TODO caused by a bug in Core. +// TODO caused by a bug in Core: https://github.com/strata-org/Strata/issues/700 }; procedure testImpliesDivByZero() { From 25e5a5255e9e6261668279762d9e957d683bd1f8 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Sat, 28 Mar 2026 10:25:30 +0100 Subject: [PATCH 72/79] Change url --- .../Laurel/Examples/Fundamentals/T15_ShortCircuit.lean | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/StrataTest/Languages/Laurel/Examples/Fundamentals/T15_ShortCircuit.lean b/StrataTest/Languages/Laurel/Examples/Fundamentals/T15_ShortCircuit.lean index 2fd2ad42e..fbb1c1f36 100644 --- a/StrataTest/Languages/Laurel/Examples/Fundamentals/T15_ShortCircuit.lean +++ b/StrataTest/Languages/Laurel/Examples/Fundamentals/T15_ShortCircuit.lean @@ -28,14 +28,14 @@ procedure mustNotCallProc(): int procedure testAndThenFunc() { var b: bool := false && mustNotCallFunc(0) > 0; //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: assertion does not hold -// TODO caused by a bug in Core: https://github.com/strata-org/Strata/issues/700 +// TODO caused by a bug in Core: https://github.com/strata-org/Strata/issues/697 assert !b }; procedure testOrElseFunc() { var b: bool := true || mustNotCallFunc(0) > 0; //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: assertion does not hold -// TODO caused by a bug in Core: https://github.com/strata-org/Strata/issues/700 +// TODO caused by a bug in Core: https://github.com/strata-org/Strata/issues/697 assert b }; @@ -55,7 +55,7 @@ procedure testAndThenDivByZero() { procedure testOrElseDivByZero() { assert true || 1 / 0 > 0 //^^^^^^^^^^^^^^^^^^^^^^^^ error: assertion does not hold -// TODO caused by a bug in Core: https://github.com/strata-org/Strata/issues/700 +// TODO caused by a bug in Core: https://github.com/strata-org/Strata/issues/697 }; procedure testImpliesDivByZero() { From aab28d51dbe3ce55b67e3514df9df7c7618e8345 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Sat, 28 Mar 2026 10:37:11 +0100 Subject: [PATCH 73/79] expect file update --- StrataTest/Languages/Python/PreludeVerifyTest.lean | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/StrataTest/Languages/Python/PreludeVerifyTest.lean b/StrataTest/Languages/Python/PreludeVerifyTest.lean index 6aec5a6c5..47185ab5f 100644 --- a/StrataTest/Languages/Python/PreludeVerifyTest.lean +++ b/StrataTest/Languages/Python/PreludeVerifyTest.lean @@ -157,15 +157,15 @@ Obligation: postcondition Property: assert Result: ✅ pass -Obligation: assert(40364) +Obligation: assert(40369) Property: assert Result: ✅ pass -Obligation: assert(40434) +Obligation: assert(40439) Property: assert Result: ✅ pass -Obligation: assert(40545) +Obligation: assert(40550) Property: assert Result: ✅ pass From 6bc6f5043bc43d39d269ea05b04cf74a4e798af0 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Mon, 30 Mar 2026 16:38:44 +0200 Subject: [PATCH 74/79] Do not verify prelude things --- .../Languages/Laurel/LaurelToCoreTranslator.lean | 2 +- Strata/Languages/Python/PySpecPipeline.lean | 12 ++++++------ .../expected_laurel/test_arithmetic.expected | 15 +-------------- .../test_augmented_assign.expected | 15 +-------------- .../expected_laurel/test_boolean_logic.expected | 15 +-------------- .../expected_laurel/test_break_continue.expected | 15 +-------------- .../expected_laurel/test_class_decl.expected | 15 +-------------- .../expected_laurel/test_class_field_any.expected | 15 +-------------- .../test_class_field_init.expected | 15 +-------------- .../expected_laurel/test_class_field_use.expected | 15 +-------------- .../expected_laurel/test_class_methods.expected | 15 +-------------- .../test_class_with_methods.expected | 15 +-------------- .../expected_laurel/test_comparisons.expected | 15 +-------------- .../expected_laurel/test_control_flow.expected | 15 +-------------- .../Python/expected_laurel/test_datetime.expected | 15 +-------------- .../expected_laurel/test_default_params.expected | 15 +-------------- .../expected_laurel/test_dict_operations.expected | 15 +-------------- .../Python/expected_laurel/test_for_loop.expected | 15 +-------------- .../Python/expected_laurel/test_fstrings.expected | 15 +-------------- .../test_function_def_calls.expected | 15 +-------------- .../Python/expected_laurel/test_if_elif.expected | 15 +-------------- .../Python/expected_laurel/test_ifexpr.expected | 15 +-------------- .../Python/expected_laurel/test_list.expected | 15 +-------------- .../expected_laurel/test_list_slice.expected | 15 +-------------- .../Python/expected_laurel/test_loops.expected | 15 +-------------- .../test_method_param_reassign.expected | 15 +-------------- .../expected_laurel/test_missing_models.expected | 15 +-------------- .../expected_laurel/test_module_level.expected | 15 +-------------- .../expected_laurel/test_multi_function.expected | 15 +-------------- .../expected_laurel/test_multiple_except.expected | 15 +-------------- .../expected_laurel/test_nested_calls.expected | 15 +-------------- .../Python/expected_laurel/test_pin_any.expected | 15 +-------------- .../test_precondition_verification.expected | 15 +-------------- .../expected_laurel/test_regex_negative.expected | 15 +-------------- .../expected_laurel/test_regex_positive.expected | 15 +-------------- .../expected_laurel/test_return_types.expected | 15 +-------------- .../Python/expected_laurel/test_strings.expected | 15 +-------------- .../expected_laurel/test_subscription.expected | 15 +-------------- .../expected_laurel/test_try_except.expected | 15 +-------------- .../test_try_except_scoping.expected | 15 +-------------- .../test_variable_in_nested_block.expected | 15 +-------------- .../test_variable_reassign.expected | 15 +-------------- .../expected_laurel/test_while_loop.expected | 15 +-------------- .../expected_laurel/test_with_statement.expected | 15 +-------------- 44 files changed, 49 insertions(+), 595 deletions(-) diff --git a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean index cf01b6ae8..eb0430ed5 100644 --- a/Strata/Languages/Laurel/LaurelToCoreTranslator.lean +++ b/Strata/Languages/Laurel/LaurelToCoreTranslator.lean @@ -774,7 +774,7 @@ def translateWithLaurel (options: LaurelTranslateOptions) (program : Program): T let axDecl? ← translateInvokeOnAxiom proc trigger pure axDecl?.toList let procDecl ← translateProcedure proc - return [Core.Decl.proc procDecl .empty] ++ axiomDecls + return [Core.Decl.proc procDecl proc.md] ++ axiomDecls ) -- Translate Laurel constants to Core function declarations (0-ary functions) diff --git a/Strata/Languages/Python/PySpecPipeline.lean b/Strata/Languages/Python/PySpecPipeline.lean index b663bad18..c88348cc1 100644 --- a/Strata/Languages/Python/PySpecPipeline.lean +++ b/Strata/Languages/Python/PySpecPipeline.lean @@ -311,14 +311,14 @@ private def appendCorePartOfRuntime (coreFromLaurel : Core.Program) : Core.Progr { decls := coreFromLaurel.decls ++ Python.coreOnlyFromRuntimeCorePart } /-- Split procedure names in a Core program into prelude names - (before `FIRST_END_MARKER`) and user names (after it). - If `FIRST_END_MARKER` is absent, nothing is considered prelude. -/ + (no file range or empty file) and user names (all others). -/ public def splitProcNames (prog : Core.Program) : Std.HashSet String × List String := - let (before, rest) := prog.decls.span (fun d => toString d.name != "FIRST_END_MARKER") - let (preludeDecls, userDecls) := match rest with - | _ :: tl => (before, tl) -- marker found: before is prelude, after is user - | [] => ([], before) -- no marker: everything is user + let isPrelude := fun d => + match Imperative.getFileRange (P := Core.Expression) d.metadata with + | none => true + | some fr => fr.file == .file "" + let (preludeDecls, userDecls) := prog.decls.partition isPrelude let preludeNames := preludeDecls.foldl (init := ({} : Std.HashSet String)) fun s d => match d.getProc? with | some p => s.insert (Core.CoreIdent.toPretty p.header.name) diff --git a/StrataTest/Languages/Python/expected_laurel/test_arithmetic.expected b/StrataTest/Languages/Python/expected_laurel/test_arithmetic.expected index d23a60451..e62efecf7 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_arithmetic.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_arithmetic.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) assert_assert(102)_calls_Any_to_bool_0: ✅ pass (at line 7, col 4) assert(102): ✅ pass (at line 7, col 4) assert_assert(226)_calls_Any_to_bool_0: ✅ pass (at line 12, col 4) @@ -26,5 +13,5 @@ assert_assert(567)_calls_Any_to_bool_0: ✅ pass (at line 24, col 4) assert(567): ✅ pass (at line 24, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 26, col 0) -DETAIL: 25 passed, 0 failed, 0 inconclusive +DETAIL: 12 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_augmented_assign.expected b/StrataTest/Languages/Python/expected_laurel/test_augmented_assign.expected index f1005895b..2a1ad3894 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_augmented_assign.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_augmented_assign.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) assert_assert(81)_calls_Any_to_bool_0: ✅ pass (at line 5, col 4) assert(81): ✅ pass (at line 5, col 4) assert_assert(124)_calls_Any_to_bool_0: ✅ pass (at line 7, col 4) @@ -20,5 +7,5 @@ assert(124): ✅ pass (at line 7, col 4) assert_assert(167)_calls_Any_to_bool_0: ✅ pass (at line 9, col 4) assert(167): ✅ pass (at line 9, col 4) -DETAIL: 19 passed, 0 failed, 0 inconclusive +DETAIL: 6 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_boolean_logic.expected b/StrataTest/Languages/Python/expected_laurel/test_boolean_logic.expected index d35f69302..98c72823d 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_boolean_logic.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_boolean_logic.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) assert_assert(73)_calls_PAnd_0: ✅ pass (at line 5, col 4) assert_assert(73)_calls_Any_to_bool_1: ✅ pass (at line 5, col 4) assert(73): ✅ pass (at line 5, col 4) @@ -42,5 +29,5 @@ assert_assert(825)_calls_Any_to_bool_0: ✅ pass (at line 37, col 4) assert(825): ✅ pass (at line 37, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 39, col 0) -DETAIL: 41 passed, 0 failed, 0 inconclusive +DETAIL: 28 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_break_continue.expected b/StrataTest/Languages/Python/expected_laurel/test_break_continue.expected index 18a7a87db..00a8205c2 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_break_continue.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_break_continue.expected @@ -1,21 +1,8 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) loop_guard_calls_Any_to_bool_0: ✅ pass (at line 3, col 4) loop_guard_calls_Any_to_bool_0: ✅ pass (at line 8, col 4) loop_guard_end_calls_Any_to_bool_0: ✅ pass (at line 8, col 4) -DETAIL: 16 passed, 0 failed, 0 inconclusive +DETAIL: 3 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_decl.expected b/StrataTest/Languages/Python/expected_laurel/test_class_decl.expected index e463dee04..02e41a188 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_decl.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_decl.expected @@ -1,20 +1,7 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) callElimAssert_requires_4: ✅ pass ite_cond_calls_Any_to_bool_0: ✅ pass (at line 13, col 0) -DETAIL: 15 passed, 0 failed, 0 inconclusive +DETAIL: 2 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_field_any.expected b/StrataTest/Languages/Python/expected_laurel/test_class_field_any.expected index e3475753d..2373bfc4b 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_field_any.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_field_any.expected @@ -1,21 +1,8 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) callElimAssert_requires_3: ✅ pass assert_assert(113)_calls_Any_to_bool_0: ✅ pass (at line 6, col 0) assert(113): ❓ unknown (at line 6, col 0) -DETAIL: 15 passed, 0 failed, 1 inconclusive +DETAIL: 2 passed, 0 failed, 1 inconclusive RESULT: Inconclusive diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_field_init.expected b/StrataTest/Languages/Python/expected_laurel/test_class_field_init.expected index e51e967d2..11dfb812f 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_field_init.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_field_init.expected @@ -1,20 +1,7 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) callElimAssert_requires_5: ✅ pass ite_cond_calls_Any_to_bool_0: ✅ pass (at line 13, col 0) -DETAIL: 15 passed, 0 failed, 0 inconclusive +DETAIL: 2 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_field_use.expected b/StrataTest/Languages/Python/expected_laurel/test_class_field_use.expected index 89f4ac562..771f2ea1c 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_field_use.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_field_use.expected @@ -1,21 +1,8 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) callElimAssert_requires_7: ✅ pass assert_assert(285)_calls_Any_to_bool_0: ✅ pass (at line 14, col 4) Assertion failed at line 14, col 4: assert(285): ❌ fail -DETAIL: 15 passed, 1 failed, 0 inconclusive +DETAIL: 2 passed, 1 failed, 0 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_methods.expected b/StrataTest/Languages/Python/expected_laurel/test_class_methods.expected index 57a3818ce..7ba4fea44 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_methods.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_methods.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) callElimAssert_requires_12: ✅ pass assert_assert(445)_calls_Any_to_bool_0: ✅ pass (at line 21, col 4) assert(445): ❓ unknown (at line 21, col 4) @@ -25,5 +12,5 @@ callElimAssert_requires_1_5: ✅ pass (at line 30, col 4) callElimAssert_requires_2_6: ✅ pass (at line 30, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 32, col 0) -DETAIL: 21 passed, 2 failed, 1 inconclusive +DETAIL: 8 passed, 2 failed, 1 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_class_with_methods.expected b/StrataTest/Languages/Python/expected_laurel/test_class_with_methods.expected index de5e1fad9..9ed3eb2b2 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_class_with_methods.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_class_with_methods.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) callElimAssert_requires_11: ✅ pass assert_assert(459)_calls_Any_to_bool_0: ✅ pass (at line 23, col 4) Assertion failed at line 23, col 4: assert(459): ❌ fail @@ -23,5 +10,5 @@ callElimAssert_requires_1_5: ✅ pass (at line 28, col 4) callElimAssert_requires_2_6: ✅ pass (at line 28, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 30, col 0) -DETAIL: 20 passed, 1 failed, 1 inconclusive +DETAIL: 7 passed, 1 failed, 1 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_comparisons.expected b/StrataTest/Languages/Python/expected_laurel/test_comparisons.expected index e6196f4d4..b123e4894 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_comparisons.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_comparisons.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) assert_assert(89)_calls_Any_to_bool_0: ✅ pass (at line 5, col 4) assert(89): ✅ pass (at line 5, col 4) assert_assert(190)_calls_Any_to_bool_0: ✅ pass (at line 9, col 4) @@ -27,5 +14,5 @@ assert_assert(506)_calls_Any_to_bool_0: ✅ pass (at line 17, col 4) assert(506): ✅ pass (at line 17, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 19, col 0) -DETAIL: 26 passed, 0 failed, 0 inconclusive +DETAIL: 13 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_control_flow.expected b/StrataTest/Languages/Python/expected_laurel/test_control_flow.expected index c236b7c46..cef0d0654 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_control_flow.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_control_flow.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 6, col 4) assert_assert(154)_calls_Any_to_bool_0: ✅ pass (at line 11, col 4) assert(154): ✅ pass (at line 11, col 4) @@ -35,5 +22,5 @@ assert_assert(1224)_calls_Any_to_bool_0: ✅ pass (at line 72, col 4) assert(1224): ✅ pass (at line 72, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 74, col 0) -DETAIL: 34 passed, 0 failed, 0 inconclusive +DETAIL: 21 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_datetime.expected b/StrataTest/Languages/Python/expected_laurel/test_datetime.expected index add0448d7..22f65503b 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_datetime.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_datetime.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) callElimAssert_requires_12: ✅ pass callElimAssert_requires_0_4: ✅ pass callElimAssert_requires_1_5: ✅ pass @@ -27,5 +14,5 @@ assert(758): ✅ pass (at line 27, col 0) assert_assert(859)_calls_Any_to_bool_0: ✅ pass (at line 30, col 0) assert(859): ✅ pass (at line 30, col 0) -DETAIL: 26 passed, 0 failed, 0 inconclusive +DETAIL: 13 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_default_params.expected b/StrataTest/Languages/Python/expected_laurel/test_default_params.expected index ed2e07e0e..09cf901ad 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_default_params.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_default_params.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) Assertion failed at line 8, col 4: loop_guard_calls_Any_to_bool_0: ❌ fail loop_guard_end_calls_Any_to_bool_0: ✅ pass (at line 8, col 4) assert_assert(325)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) @@ -25,5 +12,5 @@ assert_assert(571)_calls_Any_to_bool_0: ✅ pass (at line 24, col 4) Assertion failed at line 24, col 4: assert(571): ❌ fail ite_cond_calls_Any_to_bool_0: ✅ pass (at line 26, col 0) -DETAIL: 19 passed, 3 failed, 2 inconclusive +DETAIL: 6 passed, 3 failed, 2 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_dict_operations.expected b/StrataTest/Languages/Python/expected_laurel/test_dict_operations.expected index 137ea0eb3..369218179 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_dict_operations.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_dict_operations.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) assert_assert(81)_calls_Any_get_0: ✅ pass (at line 7, col 0) assert_assert(81)_calls_Any_to_bool_1: ✅ pass (at line 7, col 0) assert(81): ✅ pass (at line 7, col 0) @@ -44,5 +31,5 @@ assert_assert(557)_calls_Any_get_2: ✅ pass (at line 27, col 0) assert_assert(557)_calls_Any_to_bool_3: ✅ pass (at line 27, col 0) assert(557): ✅ pass (at line 27, col 0) -DETAIL: 43 passed, 0 failed, 0 inconclusive +DETAIL: 30 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_for_loop.expected b/StrataTest/Languages/Python/expected_laurel/test_for_loop.expected index e13126e1f..8a80af716 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_for_loop.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_for_loop.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) assert_assert(129)_calls_Any_to_bool_0: ✅ pass (at line 6, col 4) assert(129): ❓ unknown (at line 6, col 4) Assertion failed at line 13, col 8: ite_cond_calls_Any_to_bool_0: ❌ fail @@ -24,5 +11,5 @@ assert(611): ✅ pass (at line 25, col 4) assert_assert(611)_calls_Any_to_bool_0: ✅ pass (at line 25, col 4) Assertion failed at line 25, col 4: assert(611): ❌ fail -DETAIL: 19 passed, 2 failed, 2 inconclusive +DETAIL: 6 passed, 2 failed, 2 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_fstrings.expected b/StrataTest/Languages/Python/expected_laurel/test_fstrings.expected index 9c39e8778..fb1748f0a 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_fstrings.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_fstrings.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) assert_assert(196)_calls_Any_to_bool_0: ✅ pass (at line 6, col 4) assert(196): ❓ unknown (at line 6, col 4) assert_assert(430)_calls_Any_to_bool_0: ✅ pass (at line 13, col 4) @@ -21,5 +8,5 @@ assert_assert(511)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) assert(511): ✅ pass (at line 15, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 17, col 0) -DETAIL: 19 passed, 0 failed, 1 inconclusive +DETAIL: 6 passed, 0 failed, 1 inconclusive RESULT: Inconclusive diff --git a/StrataTest/Languages/Python/expected_laurel/test_function_def_calls.expected b/StrataTest/Languages/Python/expected_laurel/test_function_def_calls.expected index e060e782a..7c64f8fbf 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_function_def_calls.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_function_def_calls.expected @@ -1,22 +1,9 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) callElimAssert_requires_0_4: ❓ unknown (at line 6, col 4) callElimAssert_requires_1_5: ✅ pass (at line 6, col 4) callElimAssert_requires_2_6: ✅ pass (at line 6, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 11, col 0) -DETAIL: 16 passed, 0 failed, 1 inconclusive +DETAIL: 3 passed, 0 failed, 1 inconclusive RESULT: Inconclusive diff --git a/StrataTest/Languages/Python/expected_laurel/test_if_elif.expected b/StrataTest/Languages/Python/expected_laurel/test_if_elif.expected index 9520c5c25..ca1986526 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_if_elif.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_if_elif.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) Assertion failed at line 2, col 4: ite_cond_calls_Any_to_bool_0: ❌ fail ite_cond_calls_Any_to_bool_0: ✅ pass (at line 4, col 4) ite_cond_calls_Any_to_bool_0: ❓ unknown (at line 6, col 4) @@ -26,5 +13,5 @@ assert_assert(444)_calls_Any_to_bool_0: ✅ pass (at line 22, col 4) assert(444): ❓ unknown (at line 22, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 24, col 0) -DETAIL: 19 passed, 1 failed, 5 inconclusive +DETAIL: 6 passed, 1 failed, 5 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_ifexpr.expected b/StrataTest/Languages/Python/expected_laurel/test_ifexpr.expected index b8c2d5b6c..6df39f3cb 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_ifexpr.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_ifexpr.expected @@ -1,21 +1,8 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) set_result_calls_Any_to_bool_0: ✅ pass assert_assert(56)_calls_Any_to_bool_0: ✅ pass (at line 3, col 0) assert(56): ✅ pass (at line 3, col 0) -DETAIL: 16 passed, 0 failed, 0 inconclusive +DETAIL: 3 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_list.expected b/StrataTest/Languages/Python/expected_laurel/test_list.expected index bc11bc873..42ce5bac0 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_list.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_list.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) assert_assert(32)_calls_PIn_0: ✅ pass (at line 3, col 0) assert_assert(32)_calls_Any_to_bool_1: ✅ pass (at line 3, col 0) assert(32): ✅ pass (at line 3, col 0) @@ -27,5 +14,5 @@ assert_assert(200)_calls_Any_get_1: ✅ pass (at line 17, col 0) assert_assert(200)_calls_Any_to_bool_2: ✅ pass (at line 17, col 0) assert(200): ✅ pass (at line 17, col 0) -DETAIL: 26 passed, 0 failed, 0 inconclusive +DETAIL: 13 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_list_slice.expected b/StrataTest/Languages/Python/expected_laurel/test_list_slice.expected index eb09c31fa..b1b66b3fa 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_list_slice.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_list_slice.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) assert_assert(32)_calls_Any_get_0: ✅ pass (at line 3, col 0) assert_assert(32)_calls_Any_get_1: ✅ pass (at line 3, col 0) assert_assert(32)_calls_Any_to_bool_2: ✅ pass (at line 3, col 0) @@ -26,5 +13,5 @@ assert_assert(187)_calls_Any_get_0: ✅ pass (at line 9, col 0) assert_assert(187)_calls_Any_to_bool_1: ✅ pass (at line 9, col 0) assert(187): ✅ pass (at line 9, col 0) -DETAIL: 25 passed, 0 failed, 0 inconclusive +DETAIL: 12 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_loops.expected b/StrataTest/Languages/Python/expected_laurel/test_loops.expected index 81b76b925..0c0a3532d 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_loops.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_loops.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) assert_assert(95)_calls_Any_to_bool_0: ✅ pass (at line 6, col 4) assert(95): ✅ pass (at line 6, col 4) set_a_calls_Any_get_0: ❓ unknown @@ -30,5 +17,5 @@ loop_guard_end_calls_Any_to_bool_0: ✅ pass (at line 22, col 4) assert_assert(531)_calls_Any_to_bool_0: ❓ unknown (at line 24, col 4) assert(531): ❓ unknown (at line 24, col 4) -DETAIL: 21 passed, 0 failed, 8 inconclusive +DETAIL: 8 passed, 0 failed, 8 inconclusive RESULT: Inconclusive diff --git a/StrataTest/Languages/Python/expected_laurel/test_method_param_reassign.expected b/StrataTest/Languages/Python/expected_laurel/test_method_param_reassign.expected index 3ed2d949b..48e1e59f9 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_method_param_reassign.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_method_param_reassign.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) -DETAIL: 13 passed, 0 failed, 0 inconclusive +DETAIL: 0 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected b/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected index 23596aebf..887c5ac8a 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected @@ -1,23 +1,10 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) init_calls_Any_get_0: ❓ unknown (at line 8, col 4) init_calls_Any_get_1: ❓ unknown (at line 8, col 4) Assertion failed at line 9, col 4: callElimAssert_requires_0_22: ❌ fail callElimAssert_requires_1_23: ✅ pass (at line 9, col 4) callElimAssert_requires_2_24: ✅ pass (at line 9, col 4) -DETAIL: 15 passed, 1 failed, 2 inconclusive +DETAIL: 2 passed, 1 failed, 2 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_module_level.expected b/StrataTest/Languages/Python/expected_laurel/test_module_level.expected index 29e5ec477..d3f1a39af 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_module_level.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_module_level.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) assert_assert(115)_calls_Any_get_0: ✅ pass (at line 9, col 0) assert_assert(115)_calls_Any_to_bool_1: ✅ pass (at line 9, col 0) assert(115): ✅ pass (at line 9, col 0) @@ -29,5 +16,5 @@ assert_assert(258)_calls_PNotIn_0: ✅ pass (at line 15, col 0) assert_assert(258)_calls_Any_to_bool_1: ✅ pass (at line 15, col 0) assert(258): ✅ pass (at line 15, col 0) -DETAIL: 28 passed, 0 failed, 0 inconclusive +DETAIL: 15 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_multi_function.expected b/StrataTest/Languages/Python/expected_laurel/test_multi_function.expected index 538d7b251..36f0f7d98 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_multi_function.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_multi_function.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) Assertion failed at line 9, col 4: ite_cond_calls_PNotIn_0: ❌ fail ite_cond_calls_Any_to_bool_1: ✅ pass (at line 9, col 4) ite_cond_calls_PNotIn_0: ❓ unknown (at line 11, col 4) @@ -26,5 +13,5 @@ callElimAssert_requires_1_10: ✅ pass (at line 26, col 4) callElimAssert_requires_2_11: ✅ pass (at line 26, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 28, col 0) -DETAIL: 20 passed, 2 failed, 3 inconclusive +DETAIL: 7 passed, 2 failed, 3 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_multiple_except.expected b/StrataTest/Languages/Python/expected_laurel/test_multiple_except.expected index cc00941e8..069c83677 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_multiple_except.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_multiple_except.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) assert_assert(170)_calls_Any_to_bool_0: ✅ pass (at line 8, col 4) Assertion failed at line 8, col 4: assert(170): ❌ fail assert_assert(471)_calls_Any_to_bool_0: ✅ pass (at line 21, col 4) @@ -20,5 +7,5 @@ Assertion failed at line 21, col 4: assert(471): ❌ fail assert_assert(693)_calls_Any_to_bool_0: ✅ pass (at line 31, col 4) assert(693): ✅ pass (at line 31, col 4) -DETAIL: 17 passed, 2 failed, 0 inconclusive +DETAIL: 4 passed, 2 failed, 0 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_nested_calls.expected b/StrataTest/Languages/Python/expected_laurel/test_nested_calls.expected index f7abdaf23..27ce8d9fa 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_nested_calls.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_nested_calls.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) assert_assert(153)_calls_Any_to_bool_0: ✅ pass (at line 10, col 4) Assertion failed at line 10, col 4: assert(153): ❌ fail assert_assert(254)_calls_Any_to_bool_0: ✅ pass (at line 14, col 4) @@ -21,5 +8,5 @@ assert_assert(356)_calls_Any_to_bool_0: ✅ pass (at line 18, col 4) Assertion failed at line 18, col 4: assert(356): ❌ fail ite_cond_calls_Any_to_bool_0: ✅ pass (at line 20, col 0) -DETAIL: 17 passed, 3 failed, 0 inconclusive +DETAIL: 4 passed, 3 failed, 0 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_pin_any.expected b/StrataTest/Languages/Python/expected_laurel/test_pin_any.expected index 3922ce670..499a03261 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_pin_any.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_pin_any.expected @@ -1,22 +1,9 @@ ==== Verification Results ==== -postcondition: ✅ pass (❗path unreachable) (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✔️ always true if reached (in prelude file) -postcondition: ✅ pass (❗path unreachable) (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✔️ always true if reached (in prelude file) -postcondition: ✅ pass (❗path unreachable) (in prelude file) -postcondition: ✅ pass (❗path unreachable) (in prelude file) -ret_type: ✅ always true and is reachable from declaration entry (in prelude file) -ret_type: ✅ always true and is reachable from declaration entry (in prelude file) -ret_pos: ✅ always true and is reachable from declaration entry (in prelude file) -assert_name_is_foo: ✔️ always true if reached (in prelude file) -assert_opt_name_none_or_str: ✔️ always true if reached (in prelude file) -assert_opt_name_none_or_bar: ✔️ always true if reached (in prelude file) -ensures_maybe_except_none: ✔️ always true if reached (in prelude file) ite_cond_calls_Any_to_bool_0: 🔶 can be both true and false and is reachable from declaration entry (at line 3, col 4) assert_assert(124)_calls_PIn_0: ❓ unknown (at line 4, col 8) assert_assert(124)_calls_Any_to_bool_1: ✔️ always true if reached (at line 4, col 8) assert(124): ❓ unknown (at line 4, col 8) -DETAIL: 14 passed, 0 failed, 3 inconclusive, 4 unreachable +DETAIL: 1 passed, 0 failed, 3 inconclusive RESULT: Inconclusive diff --git a/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected b/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected index 7eb5da9a9..86e5f53f2 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_precondition_verification.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) callElimAssert_requires_0_28: ✅ pass (at line 8, col 4) callElimAssert_requires_1_29: ✅ pass (at line 8, col 4) callElimAssert_requires_2_30: ✅ pass (at line 8, col 4) @@ -27,5 +14,5 @@ callElimAssert_requires_1_5: ✅ pass (at line 17, col 4) Assertion failed at line 17, col 4: callElimAssert_requires_2_6: ❌ fail ite_cond_calls_Any_to_bool_0: ✅ pass (at line 19, col 0) -DETAIL: 24 passed, 2 failed, 0 inconclusive +DETAIL: 11 passed, 2 failed, 0 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected b/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected index a01d90e4b..53acf7b36 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_regex_negative.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(272)_calls_Any_to_bool_0: ✅ pass (at line 10, col 4) assert(272): ❓ unknown (at line 10, col 4) @@ -58,5 +45,5 @@ assert_assert(2193)_calls_Any_to_bool_0: ✅ pass (at line 75, col 4) Assertion failed at line 75, col 4: assert(2193): ❌ fail ite_cond_calls_Any_to_bool_0: ✅ pass (at line 77, col 0) -DETAIL: 43 passed, 5 failed, 9 inconclusive +DETAIL: 30 passed, 5 failed, 9 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected b/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected index cb1d5b5ca..ce8d88440 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_regex_positive.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) set_m_calls_re_fullmatch_0: ✅ pass assert_assert(215)_calls_Any_to_bool_0: ✅ pass (at line 8, col 4) assert(215): ✅ pass (at line 8, col 4) @@ -437,5 +424,5 @@ assert_assert(15806)_calls_Any_to_bool_0: ✅ pass (at line 485, col 4) assert(15806): ✅ pass (at line 485, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 487, col 0) -DETAIL: 436 passed, 0 failed, 0 inconclusive +DETAIL: 423 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_return_types.expected b/StrataTest/Languages/Python/expected_laurel/test_return_types.expected index 36510762f..baadebd4f 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_return_types.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_return_types.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) assert_assert(304)_calls_Any_to_bool_0: ✅ pass (at line 20, col 4) Assertion failed at line 20, col 4: assert(304): ❌ fail assert_assert(387)_calls_Any_to_bool_0: ✅ pass (at line 23, col 4) @@ -23,5 +10,5 @@ assert_assert(558)_calls_Any_to_bool_0: ✅ pass (at line 29, col 4) Assertion failed at line 29, col 4: assert(558): ❌ fail ite_cond_calls_Any_to_bool_0: ✅ pass (at line 31, col 0) -DETAIL: 18 passed, 3 failed, 1 inconclusive +DETAIL: 5 passed, 3 failed, 1 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_strings.expected b/StrataTest/Languages/Python/expected_laurel/test_strings.expected index 4d8991a5a..40fedf5b9 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_strings.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_strings.expected @@ -1,23 +1,10 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) assert_assert(114)_calls_Any_to_bool_0: ✅ pass (at line 6, col 4) assert(114): ✅ pass (at line 6, col 4) assert_assert(264)_calls_Any_to_bool_0: ✅ pass (at line 11, col 4) assert(264): ✅ pass (at line 11, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 13, col 0) -DETAIL: 18 passed, 0 failed, 0 inconclusive +DETAIL: 5 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_subscription.expected b/StrataTest/Languages/Python/expected_laurel/test_subscription.expected index 8a7129d27..24ad83329 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_subscription.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_subscription.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) assert_assert(421)_calls_Any_get_0: ✅ pass (at line 16, col 0) assert_assert(421)_calls_Any_get_1: ✅ pass (at line 16, col 0) assert_assert(421)_calls_Any_get_2: ✅ pass (at line 16, col 0) @@ -29,5 +16,5 @@ assert_assert(554)_calls_PIn_0: ✅ pass (at line 20, col 0) assert_assert(554)_calls_Any_to_bool_1: ✅ pass (at line 20, col 0) assert(554): ✅ pass (at line 20, col 0) -DETAIL: 28 passed, 0 failed, 0 inconclusive +DETAIL: 15 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_try_except.expected b/StrataTest/Languages/Python/expected_laurel/test_try_except.expected index 91cb40a76..4c12241f5 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_try_except.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_try_except.expected @@ -1,22 +1,9 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) assert_assert(129)_calls_Any_to_bool_0: ✅ pass (at line 7, col 4) assert(129): ✅ pass (at line 7, col 4) assert_assert(358)_calls_Any_to_bool_0: ✅ pass (at line 17, col 4) Assertion failed at line 17, col 4: assert(358): ❌ fail -DETAIL: 16 passed, 1 failed, 0 inconclusive +DETAIL: 3 passed, 1 failed, 0 inconclusive RESULT: Failures found diff --git a/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected b/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected index 73ce75470..0b2ffe8cc 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_try_except_scoping.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) assert_assert(355)_calls_Any_to_bool_0: ✅ pass (at line 15, col 4) assert(355): ✅ pass (at line 15, col 4) assert_assert(638)_calls_Any_to_bool_0: ✅ pass (at line 24, col 4) @@ -20,5 +7,5 @@ assert(638): ✅ pass (at line 24, col 4) assert_assert(952)_calls_Any_to_bool_0: ✅ pass (at line 35, col 4) assert(952): ✅ pass (at line 35, col 4) -DETAIL: 19 passed, 0 failed, 0 inconclusive +DETAIL: 6 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_variable_in_nested_block.expected b/StrataTest/Languages/Python/expected_laurel/test_variable_in_nested_block.expected index 172d9c6c4..b066b0fa1 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_variable_in_nested_block.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_variable_in_nested_block.expected @@ -1,22 +1,9 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 2, col 0) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 3, col 4) assert_assert(91)_calls_Any_to_bool_0: ✅ pass (at line 8, col 0) assert(91): ✅ pass (at line 8, col 0) -DETAIL: 17 passed, 0 failed, 0 inconclusive +DETAIL: 4 passed, 0 failed, 0 inconclusive RESULT: Analysis success diff --git a/StrataTest/Languages/Python/expected_laurel/test_variable_reassign.expected b/StrataTest/Languages/Python/expected_laurel/test_variable_reassign.expected index f46a89d3e..361922591 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_variable_reassign.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_variable_reassign.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) assert_assert(59)_calls_Any_to_bool_0: ✅ pass (at line 4, col 4) assert(59): ✅ pass (at line 4, col 4) assert_assert(104)_calls_Any_to_bool_0: ✅ pass (at line 6, col 4) @@ -31,5 +18,5 @@ assert_assert(612)_calls_Any_to_bool_0: ✅ pass (at line 32, col 4) assert(612): ✅ pass (at line 32, col 4) ite_cond_calls_Any_to_bool_0: ✅ pass (at line 34, col 0) -DETAIL: 29 passed, 0 failed, 1 inconclusive +DETAIL: 16 passed, 0 failed, 1 inconclusive RESULT: Inconclusive diff --git a/StrataTest/Languages/Python/expected_laurel/test_while_loop.expected b/StrataTest/Languages/Python/expected_laurel/test_while_loop.expected index 6d7dd4dcc..13b227fa4 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_while_loop.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_while_loop.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) loop_guard_calls_Any_to_bool_0: ✅ pass (at line 4, col 4) loop_guard_end_calls_Any_to_bool_0: ✅ pass (at line 4, col 4) assert_assert(134)_calls_Any_to_bool_0: ✅ pass (at line 7, col 4) @@ -33,5 +20,5 @@ loop_guard_end_calls_Any_to_bool_0: ✅ pass (at line 22, col 4) assert_assert(589)_calls_Any_to_bool_0: ✅ pass (at line 27, col 4) assert(589): ❓ unknown (at line 27, col 4) -DETAIL: 29 passed, 0 failed, 3 inconclusive +DETAIL: 16 passed, 0 failed, 3 inconclusive RESULT: Inconclusive diff --git a/StrataTest/Languages/Python/expected_laurel/test_with_statement.expected b/StrataTest/Languages/Python/expected_laurel/test_with_statement.expected index 055496885..56a2a5618 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_with_statement.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_with_statement.expected @@ -1,18 +1,5 @@ ==== Verification Results ==== -postcondition: ✅ pass (in prelude file) -List_take_len_post_postcondition_calls_List_take_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -List_drop_len_post_postcondition_calls_List_drop_0: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -postcondition: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_type: ✅ pass (in prelude file) -ret_pos: ✅ pass (in prelude file) -assert_name_is_foo: ✅ pass (in prelude file) -assert_opt_name_none_or_str: ✅ pass (in prelude file) -assert_opt_name_none_or_bar: ✅ pass (in prelude file) -ensures_maybe_except_none: ✅ pass (in prelude file) callElimAssert_requires_9: ✅ pass callElimAssert_requires_5: ✅ pass callElimAssert_requires_2: ✅ pass @@ -32,5 +19,5 @@ assert(666): ❓ unknown (at line 32, col 8) callElimAssert_requires_25: ✅ pass callElimAssert_requires_22: ✅ pass -DETAIL: 28 passed, 2 failed, 1 inconclusive +DETAIL: 15 passed, 2 failed, 1 inconclusive RESULT: Failures found From 14dd5bac99aa870887083b234eb23a72bebcc4ef Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Mon, 30 Mar 2026 16:51:51 +0200 Subject: [PATCH 75/79] Add missing md --- Strata/Languages/Python/Specs/ToLaurel.lean | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Strata/Languages/Python/Specs/ToLaurel.lean b/Strata/Languages/Python/Specs/ToLaurel.lean index c78d0173c..f4edd619f 100644 --- a/Strata/Languages/Python/Specs/ToLaurel.lean +++ b/Strata/Languages/Python/Specs/ToLaurel.lean @@ -469,6 +469,7 @@ def funcDeclToLaurel (procName : String) (func : FunctionDecl) pure (anyInputs, anyOutputs, body) else pure (inputs, outputs, Body.Opaque [] none []) + let md ← mkMdWithFileRange func.loc return { name := procName inputs := inputs.toList @@ -478,7 +479,7 @@ def funcDeclToLaurel (procName : String) (func : FunctionDecl) decreases := none isFunctional := false body := body - md := .empty + md := md } /-- Convert a class definition to Laurel types and procedures. -/ From 116e3936ae49dcf90a390f51d99c2dd093db246e Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Mon, 30 Mar 2026 17:31:18 +0200 Subject: [PATCH 76/79] Add missing TODO comment --- Strata/Languages/Python/PythonToLaurel.lean | 1 + 1 file changed, 1 insertion(+) diff --git a/Strata/Languages/Python/PythonToLaurel.lean b/Strata/Languages/Python/PythonToLaurel.lean index c6dc65946..4bb9d71f9 100644 --- a/Strata/Languages/Python/PythonToLaurel.lean +++ b/Strata/Languages/Python/PythonToLaurel.lean @@ -1661,6 +1661,7 @@ def translateClass (ctx : TranslationContext) (classStmt : Python.stmt SourceRan for stmt in body do if let .FunctionDef .. := stmt then let proc ← translateMethod ctx className stmt + -- TODO stop replacing the body of instance proceduces with an empty one instanceProcedures := instanceProcedures.push { proc with body := .Opaque [] .none [] } return ({ From 5e7f8e9a0df717f89cf8231a48803ed5cbe6d6e8 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Mon, 30 Mar 2026 17:31:58 +0200 Subject: [PATCH 77/79] Cleanup --- Strata/Languages/Python/PythonRuntimeLaurelPart.lean | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean index 59a789054..42dfaba94 100644 --- a/Strata/Languages/Python/PythonRuntimeLaurelPart.lean +++ b/Strata/Languages/Python/PythonRuntimeLaurelPart.lean @@ -425,7 +425,7 @@ function Any_get_or_none (dict: Any, key: Any) : Any DictStrAny_get_or_none(Any..as_Dict!(dict), Any..as_string!(key)) }; -function DictStrAny_insert (/* */ d : DictStrAny, key: string, val: Any) : DictStrAny +function DictStrAny_insert (d : DictStrAny, key: string, val: Any) : DictStrAny { if DictStrAny..isDictStrAny_empty(d) then DictStrAny_cons(key, val, DictStrAny_empty()) else if DictStrAny..key!(d) == key then DictStrAny_cons(key, val, DictStrAny..tail!(d)) From c644bd6c01f91201f42bd74c55b41a53b633f056 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Mon, 30 Mar 2026 20:33:48 +0200 Subject: [PATCH 78/79] Bring back expected diagnostics for test_missing_models --- .../expected_laurel/test_missing_models.expected | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected b/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected index 887c5ac8a..360a1cd14 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected @@ -2,9 +2,15 @@ ==== Verification Results ==== init_calls_Any_get_0: ❓ unknown (at line 8, col 4) init_calls_Any_get_1: ❓ unknown (at line 8, col 4) -Assertion failed at line 9, col 4: callElimAssert_requires_0_22: ❌ fail -callElimAssert_requires_1_23: ✅ pass (at line 9, col 4) -callElimAssert_requires_2_24: ✅ pass (at line 9, col 4) +Assertion failed at line 9, col 4: callElimAssert_req_name_is_foo_22: ❌ fail +callElimAssert_req_opt_name_none_or_str_23: ✅ pass (at line 9, col 4) +callElimAssert_req_opt_name_none_or_bar_24: ✅ pass (at line 9, col 4) +callElimAssert_req_name_is_foo_13: ✅ pass (at line 12, col 4) +callElimAssert_req_opt_name_none_or_str_14: ✅ pass (at line 12, col 4) +callElimAssert_req_opt_name_none_or_bar_15: ✅ pass (at line 12, col 4) +callElimAssert_req_name_is_foo_4: ✅ pass (at line 15, col 4) +callElimAssert_req_opt_name_none_or_str_5: ✅ pass (at line 15, col 4) +callElimAssert_req_opt_name_none_or_bar_6: ✅ pass (at line 15, col 4) -DETAIL: 2 passed, 1 failed, 2 inconclusive +DETAIL: 8 passed, 1 failed, 2 inconclusive RESULT: Failures found From 53d975a30c202853679c84f8f57f95d58e974f32 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Mon, 30 Mar 2026 21:07:52 +0200 Subject: [PATCH 79/79] Update expect files --- StrataTest/Languages/Python/PreludeVerifyTest.lean | 6 +++--- .../expected_laurel/test_missing_models.expected | 14 ++++---------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/StrataTest/Languages/Python/PreludeVerifyTest.lean b/StrataTest/Languages/Python/PreludeVerifyTest.lean index 47185ab5f..664163cf2 100644 --- a/StrataTest/Languages/Python/PreludeVerifyTest.lean +++ b/StrataTest/Languages/Python/PreludeVerifyTest.lean @@ -157,15 +157,15 @@ Obligation: postcondition Property: assert Result: ✅ pass -Obligation: assert(40369) +Obligation: assert(40418) Property: assert Result: ✅ pass -Obligation: assert(40439) +Obligation: assert(40488) Property: assert Result: ✅ pass -Obligation: assert(40550) +Obligation: assert(40599) Property: assert Result: ✅ pass diff --git a/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected b/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected index 360a1cd14..887c5ac8a 100644 --- a/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected +++ b/StrataTest/Languages/Python/expected_laurel/test_missing_models.expected @@ -2,15 +2,9 @@ ==== Verification Results ==== init_calls_Any_get_0: ❓ unknown (at line 8, col 4) init_calls_Any_get_1: ❓ unknown (at line 8, col 4) -Assertion failed at line 9, col 4: callElimAssert_req_name_is_foo_22: ❌ fail -callElimAssert_req_opt_name_none_or_str_23: ✅ pass (at line 9, col 4) -callElimAssert_req_opt_name_none_or_bar_24: ✅ pass (at line 9, col 4) -callElimAssert_req_name_is_foo_13: ✅ pass (at line 12, col 4) -callElimAssert_req_opt_name_none_or_str_14: ✅ pass (at line 12, col 4) -callElimAssert_req_opt_name_none_or_bar_15: ✅ pass (at line 12, col 4) -callElimAssert_req_name_is_foo_4: ✅ pass (at line 15, col 4) -callElimAssert_req_opt_name_none_or_str_5: ✅ pass (at line 15, col 4) -callElimAssert_req_opt_name_none_or_bar_6: ✅ pass (at line 15, col 4) +Assertion failed at line 9, col 4: callElimAssert_requires_0_22: ❌ fail +callElimAssert_requires_1_23: ✅ pass (at line 9, col 4) +callElimAssert_requires_2_24: ✅ pass (at line 9, col 4) -DETAIL: 8 passed, 1 failed, 2 inconclusive +DETAIL: 2 passed, 1 failed, 2 inconclusive RESULT: Failures found