ppolinsky/cs61bl-proof-checker — pull request #9 by chashemi (2013-07-28 00:14:54+00:00)
Title: Update Expression.java

Added replaceLeaves(), creates a new Expression with the leaves of the source replaced by the node at the corresponding position of input.

Added isApplicable(), calls replaceLeaves to put the input expression in "theorem form". Then compares the input to the new expression: if equal, then the theorem is properly called. If not, the theorem doesn't apply to the called expression.

changed ExpHelper to better deal with one or more ~ operators.

changed ExpNode -- String myItem instead of Object myItem.

Bug warning -- Make sure to use str.substring() instead of charAt(i) when setting myItem and call string instead of char methods to get and set myItem.