github.com/DARA-Project/GoDist-Scheduler@v0.0.0-20201030134746-668de4acea0d/u-benchmarks/propchecker/sample5.prop (about) 1 package property 2 //Sample Property file 3 //A property file should only have function definitions 4 //and comment for the function. The definition corresponds 5 //to the property to be checked. The comment provides 6 //the meta information: Property name and full qualified 7 //path of each variable in the source package. The full 8 //qualified path is used for data collection 9 //Caveat: The variables used in the property must start 10 //with an uppercase letter 11 12 //Equality 13 //main.a 14 //main.b 15 func equality(A int, B int) { 16 return A == B 17 } 18 19 //SumZero 20 //main.a 21 //main.b 22 func sumZero(A int, B int) { 23 return A + B == 0 24 } 25 26 //DiffZero 27 //main.a 28 //main.b 29 func diffZero(A int, B int) { 30 return A - B == 0 31 } 32 33 //MultipleZero 34 //main.a 35 //main.b 36 func multipleZero(A int, B int) { 37 return A == 0 && B == 0 38 } 39 40 //OnlyOneZero 41 //main.a 42 //main.b 43 func onlyOneZero(A int, B int) { 44 if A == 0 && B != 0 { 45 return true 46 } 47 if B == 0 && A != 0 { 48 return true 49 } 50 51 return false 52 }