#NEWLINE# def _iterate_first( first , second , bindings , used , skipped , finalize_method , debug ) : #NEWLINE# #INDENT# "\n    This method facilitates movement through the terms of 'self'\n    " #NEWLINE# debug . line ( ( 'unify(%s,%s) %s' % ( first , second , bindings ) ) ) #NEWLINE# if ( ( not len ( first ) ) or ( not len ( second ) ) ) : #NEWLINE# #INDENT# return finalize_method ( first , second , bindings , used , skipped , debug ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result = _iterate_second ( first , second , bindings , used , skipped , finalize_method , ( debug + 1 ) ) #NEWLINE# newskipped = ( ( skipped [ 0 ] + [ first [ 0 ] ] ) , skipped [ 1 ] ) #NEWLINE# result += _iterate_first ( first [ 1 : ] , second , bindings , used , newskipped , finalize_method , ( debug + 1 ) ) #NEWLINE# try : #NEWLINE# #INDENT# ( newbindings , newused , unused ) = _unify_terms ( first [ 0 ] , second [ 0 ] , bindings , used ) #NEWLINE# newfirst = ( ( first [ 1 : ] + skipped [ 0 ] ) + unused [ 0 ] ) #NEWLINE# newsecond = ( ( second [ 1 : ] + skipped [ 1 ] ) + unused [ 1 ] ) #NEWLINE# result += _iterate_first ( newfirst , newsecond , newbindings , newused , ( [ ] , [ ] ) , finalize_method , ( debug + 1 ) ) #NEWLINE# #UNINDENT# except BindingException : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# return result