Skip to content

Commit

Permalink
proof script for ArrayList.add
Browse files Browse the repository at this point in the history
needs a new key version ...
  • Loading branch information
mattulbrich committed Jun 14, 2024
1 parent 2787f1c commit 1fd187d
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
\profile "Java Profile";

\settings // Proof-Settings-Config-File
{
"Choice" : {
"JavaCard" : "JavaCard:off",
"Strings" : "Strings:on",
"assertions" : "assertions:safe",
"bigint" : "bigint:on",
"floatRules" : "floatRules:strictfpOnly",
"initialisation" : "initialisation:disableStaticInitialisation",
"intRules" : "intRules:arithmeticSemanticsIgnoringOF",
"integerSimplificationRules" : "integerSimplificationRules:full",
"javaLoopTreatment" : "javaLoopTreatment:efficient",
"mergeGenerateIsWeakeningGoal" : "mergeGenerateIsWeakeningGoal:off",
"methodExpansion" : "methodExpansion:modularOnly",
"modelFields" : "modelFields:treatAsAxiom",
"moreSeqRules" : "moreSeqRules:on",
"permissions" : "permissions:off",
"programRules" : "programRules:Java",
"reach" : "reach:on",
"runtimeExceptions" : "runtimeExceptions:ban",
"sequences" : "sequences:on",
"wdChecks" : "wdChecks:off",
"wdOperator" : "wdOperator:L"
},
"Labels" : {
"UseOriginLabels" : true
},
"NewSMT" : {

},
"SMTSettings" : {
"SelectedTaclets" : [

],
"UseBuiltUniqueness" : false,
"explicitTypeHierarchy" : false,
"instantiateHierarchyAssumptions" : true,
"integersMaximum" : 2147483645,
"integersMinimum" : -2147483645,
"invariantForall" : false,
"maxGenericSorts" : 2,
"useConstantsForBigOrSmallIntegers" : true,
"useUninterpretedMultiplication" : true
},
"Strategy" : {
"ActiveStrategy" : "JavaCardDLStrategy",
"MaximumNumberOfAutomaticApplications" : 10000,
"Timeout" : -1,
"options" : {
"AUTO_INDUCTION_OPTIONS_KEY" : "AUTO_INDUCTION_OFF",
"BLOCK_OPTIONS_KEY" : "BLOCK_CONTRACT_INTERNAL",
"CLASS_AXIOM_OPTIONS_KEY" : "CLASS_AXIOM_FREE",
"DEP_OPTIONS_KEY" : "DEP_ON",
"INF_FLOW_CHECK_PROPERTY" : "INF_FLOW_CHECK_FALSE",
"LOOP_OPTIONS_KEY" : "LOOP_INVARIANT",
"METHOD_OPTIONS_KEY" : "METHOD_CONTRACT",
"MPS_OPTIONS_KEY" : "MPS_MERGE",
"NON_LIN_ARITH_OPTIONS_KEY" : "NON_LIN_ARITH_DEF_OPS",
"OSS_OPTIONS_KEY" : "OSS_ON",
"QUANTIFIERS_OPTIONS_KEY" : "QUANTIFIERS_NON_SPLITTING_WITH_PROGS",
"QUERYAXIOM_OPTIONS_KEY" : "QUERYAXIOM_OFF",
"QUERY_NEW_OPTIONS_KEY" : "QUERY_OFF",
"SPLITTING_OPTIONS_KEY" : "SPLITTING_DELAYED",
"STOPMODE_OPTIONS_KEY" : "STOPMODE_DEFAULT",
"SYMBOLIC_EXECUTION_ALIAS_CHECK_OPTIONS_KEY" : "SYMBOLIC_EXECUTION_ALIAS_CHECK_NEVER",
"SYMBOLIC_EXECUTION_NON_EXECUTION_BRANCH_HIDING_OPTIONS_KEY" : "SYMBOLIC_EXECUTION_NON_EXECUTION_BRANCH_HIDING_OFF",
"USER_TACLETS_OPTIONS_KEY1" : "USER_TACLETS_OFF",
"USER_TACLETS_OPTIONS_KEY2" : "USER_TACLETS_OFF",
"USER_TACLETS_OPTIONS_KEY3" : "USER_TACLETS_OFF",
"VBT_PHASE" : "VBT_SYM_EX"
}
}
}

\javaSource "../src";

\proofObligation
// Proof-Obligation settings
{
"class" : "de.uka.ilkd.key.proof.init.FunctionalOperationContractPO",
"contract" : "ArrayList[List::add(int)].JML normal_behavior operation contract.0",
"name" : "ArrayList[List::add(int)].JML normal_behavior operation contract.0"
}


\proofScript "
macro autopilot;
rule Class_invariant_axiom_for_ArrayList;
macro split-prop;
auto all=true steps=10000;"
6 changes: 2 additions & 4 deletions ArrayList/src/ArrayList.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class ArrayList implements List {
@*/

/*@ public normal_behaviour
@ ensures seq == \seq_empty && \fresh(footprint);
@ ensures seq == \seq() && \fresh(footprint);
@*/
public /*@ pure @*/ ArrayList() {
this.array = new int[10];
Expand Down Expand Up @@ -124,8 +124,6 @@ private void swap(int a, int b) {
int t = array[a];
array[a] = array[b];
array[b] = t;
//@ set seq = \dl_seqSwap(seq, a, b);
// @ set seq = \seq_upd(seq, a, array[a]);
// @ set seq = \seq_upd(seq, b, array[b]);
//@ set seq = \dl_seqSwap(seq, a, b);
}
}

0 comments on commit 1fd187d

Please sign in to comment.