Difference between revisions of "Array.branch()"

From ZCubes Wiki
Jump to navigation Jump to search
(Created page with " * << Z3 Home * Z3 Language Documentation * Z%5E3_Array_Manipulation_Member_Functions | Listing of Z3 Array Manipulation Member...")
 
Line 4: Line 4:
 
*[[ Z%5E3_Array_Manipulation_Member_Functions | Listing of Z3 Array Manipulation Member Functions]]
 
*[[ Z%5E3_Array_Manipulation_Member_Functions | Listing of Z3 Array Manipulation Member Functions]]
  
 +
 +
*[[ Z3 | << Z3 Home ]]
 +
*[[ Z%5E3_Language_Documentation | Z3 Language Documentation]]
 +
*[[ Z%5E3_Array_Manipulation_Member_Functions | Listing of Z3 Array Manipulation Member Functions]]
  
 
==Array.branch(SomeOnlyMatches)==
 
==Array.branch(SomeOnlyMatches)==
Line 9: Line 13:
 
Split values into negative, zero and positive values. Return the true/false of the match result. Show all (with null for non-matches) or matches only based on SomeOnlyMatches.  
 
Split values into negative, zero and positive values. Return the true/false of the match result. Show all (with null for non-matches) or matches only based on SomeOnlyMatches.  
  
[[1,-2],[3,3],[0,44,-44]].branch(true)
+
[[1,-2],[3,3],[0,44,-44]].branch(true).print()
 +
 
 +
[
 +
[
 +
[false,true ],
 +
 +
[false,false ],
 +
 +
[false,false,true ]
 +
],
 +
 
 +
[
 +
[false,false ],
 +
 +
[false,false ],
 +
 +
[true,false,false ]
 +
],
 +
 
 +
[
 +
[true,false ],
 +
 +
[true,true ],
 +
 +
[false,true,false ]
 +
]
 +
]
 +
 
 +
 
 +
[-5..5].branch(true)
 +
 
 +
true true true true true false false false false false false
 +
 
 +
false false false false false true false false false false false
 +
 
 +
false false false false false false true true true true true
 +
 
 +
 
 +
[-5..5].branchvalues(true)
 +
 
 +
-5 -4 -3 -2 -1
 +
 
 +
0
 +
 
 +
1 2 3 4 5

Revision as of 12:26, 4 February 2020


Array.branch(SomeOnlyMatches)

Split values into negative, zero and positive values. Return the true/false of the match result. Show all (with null for non-matches) or matches only based on SomeOnlyMatches.

[[1,-2],[3,3],[0,44,-44]].branch(true).print()

[ [ [false,true ],

[false,false ],

[false,false,true ] ],

[ [false,false ],

[false,false ],

[true,false,false ] ],

[ [true,false ],

[true,true ],

[false,true,false ] ] ]


[-5..5].branch(true)

true true true true true false false false false false false

false false false false false true false false false false false

false false false false false false true true true true true


[-5..5].branchvalues(true)

-5 -4 -3 -2 -1

0

1 2 3 4 5