solver,isabelle,associativity,commutativity
Reasoning upto associativity and commutativity is usually done in Isabelle with the simplifier and ordered rewriting. In your example, you provide the simplifier with the associativity rule (oriented from left to right), the commutativity rule, and the left-commutativity rule. The details are explained in the Tutorial on Isabelle/HOL (Section 9.1,...
javascript,reduce,fold,associativity,commutativity
Doesn't it indeed make more sense for reduceRight to be implemented the way I did? Maybe. However, the JavaScript array iterators do not come from a pure functional programming background. Why is the native reduceRight not implemented the way I did? Because it's simpler (easier to remember) to have...
java,php,encryption,blowfish,commutativity
Using the XOR function provided by a user in this thread Encrypt/Decrypt with XOR in php function xor_this($string,$key) { // Our plaintext/ciphertext $text =$string; // Our output text $outText = ''; // Iterate through each character for($i=0;$i<strlen($text);) { for($j=0;($j<strlen($key) && $i<strlen($text));$j++,$i++) { $outText .= $text{$i} ^ $key{$j}; //echo 'i='.$i.', '.'j='.$j.',...