#NEWLINE# def _map_predicates( self , expression , predDict ) : #NEWLINE# #INDENT# if isinstance ( expression , ApplicationExpression ) : #NEWLINE# #INDENT# ( func , args ) = expression . uncurry ( ) #NEWLINE# if isinstance ( func , AbstractVariableExpression ) : #NEWLINE# #INDENT# predDict [ func ] . append_sig ( tuple ( args ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( expression , AndExpression ) : #NEWLINE# #INDENT# self . _map_predicates ( expression . first , predDict ) #NEWLINE# self . _map_predicates ( expression . second , predDict ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( expression , AllExpression ) : #NEWLINE# #INDENT# sig = [ expression . variable ] #NEWLINE# term = expression . term #NEWLINE# while isinstance ( term , AllExpression ) : #NEWLINE# #INDENT# sig . append ( term . variable ) #NEWLINE# term = term . term #NEWLINE# #UNINDENT# if isinstance ( term , ImpExpression ) : #NEWLINE# #INDENT# if ( isinstance ( term . first , ApplicationExpression ) and isinstance ( term . second , ApplicationExpression ) ) : #NEWLINE# #INDENT# ( func1 , args1 ) = term . first . uncurry ( ) #NEWLINE# ( func2 , args2 ) = term . second . uncurry ( ) #NEWLINE# if ( isinstance ( func1 , AbstractVariableExpression ) and isinstance ( func2 , AbstractVariableExpression ) and ( sig == [ v . variable for v in args1 ] ) and ( sig == [ v . variable for v in args2 ] ) ) : #NEWLINE# #INDENT# predDict [ func2 ] . append_prop ( ( tuple ( sig ) , term . first ) ) #NEWLINE# predDict [ func1 ] . validate_sig_len ( sig )