anchor.diff:  ; and a value for this variable, a variable v2 and a
   ; value for that variable, and returns two values.
   
  -(defun psr-atribuicoes-consistentes-arco-p (psr var1 val1 var2 val2)
  -	(let
  -		(
  -			(psr1 (cria-psr
  -							(PSR-listvars psr)
  -							(PSR-listdomains psr)
  -							(intersection
  -								(psr-variavel-restricoes psr var1)
  -								(psr-variavel-restricoes psr var2)
  +(defun psr-atribuicoes-consistentes-arco-p (psr var1 v1 var2 v2)
  +	(if (equal (psr-listconstrains psr) nil)
  +		(return-from
  +			psr-atribuicoes-consistentes-arco-p
  +				(values T 0)
  +		)
  +	)
  +
  +	(let
  +		(
  +			(testes 0)
  +			(aux1 (psr-variavel-valor psr var1))
  +			(aux2 (psr-variavel-valor psr var2))
  +		)
  +		
  +		(if (equal aux1 nil)
  +			(setf aux1 nil)
  +		)
  +		
  +		(if (equal aux2 nil)
  +			(setf aux2 nil)
  +		)
  +
  +		(psr-adiciona-atribuicao! psr var1 v1)
  +		(psr-adiciona-atribuicao! psr var2 v2)
  +		
  +		(dolist (r (psr-variavel-restricoes psr var1))
  +			(cond
  +				(
  +					(membro var2 (restricao-variaveis r))
  +					(incf testes)
  +					(cond
  +						(
  +							(not (funcall (restricao-funcao-validacao r) psr))
  +							(psr-adiciona-atribuicao! psr var1 aux1)
  +							(psr-adiciona-atribuicao! psr var2 aux2)
  +							(return-from
  +								psr-atribuicoes-consistentes-arco-p
  +									(values nil testes)
   							)
   						)
  -			)
  -			(oldval1 (psr-variavel-valor psr var1))
  -			(sz (list-length (PSR-listvalues psr)))
  -			(oldval2 (psr-variavel-valor psr var2))
  -			(result NIL)
  -		)
  -		(dotimes (i sz)
  -			(setf
  -				(nth i (PSR-listvalues psr1))
  -				(nth i (PSR-listvalues psr))
  -			)
  -		)
  -
  -		(psr-adiciona-atribuicao! psr1 var1 val1)
  -		(psr-adiciona-atribuicao! psr1 var2 val2)
  -		
  -		(setf
  -			result
  -			(multiple-value-list
  -				(psr-consistente-p psr1)
  -			)
  -		)
  -		
  -		(if oldval1 (psr-adiciona-atribuicao! psr var1 oldval1)
  -			(psr-remove-atribuicao! psr var1)
  -		)
  -		(if oldval2 (psr-adiciona-atribuicao! psr var2 oldval2)
  -			(psr-remove-atribuicao! psr var2)
  -		)
  -		
  -		(values
  -			(car result)
  -			(car (cdr result))
  -		)
  +				  )
  +				)
  +			)
  +		)
  +		(psr-adiciona-atribuicao! psr var1 aux1)
  +		(psr-adiciona-atribuicao! psr var2 aux2)
  +		(values T testes)
   	)
   )
   
  
positive.code: ; Search for regression solving the CSP used by MAC (Maintain Arc Consistency)
  ; function and applying MRV heuristic model.
  
  (defun procura-retrocesso-mac-mrv(psr)
  	(let ((testesTotais 0) (res nil) (res1 nil) (var nil) (inf nil))
  		(cond ((psr-completo-p psr) 
  			(return-from procura-retrocesso-mac-mrv (values psr testesTotais))))
  
negative.code: ; This test receives an RSP, a variable and a value,
  ; and returns 2 values.
  
  (defun psr-atribuicao-consistente-p(psr var valor)
  	(if (equal (psr-listconstrains psr) nil)
  		(return-from
  			psr-atribuicao-consistente-p
  				(values T 0)
  		)
  	)
  	
  	(let
  		(
  			(res nil)
  			(aux (psr-variavel-valor psr var))
  		)
  		(cond
  			(
  				(equal aux nil) 
  				(setf aux nil)
  			)
  		)
  		
  		(psr-adiciona-atribuicao! psr var valor)
  		
  		(setf
  			res
  			(multiple-value-list
  				(psr-variavel-consistente-p psr var)
  			)
  		)
  		
  		(psr-adiciona-atribuicao! psr var aux)
  		
  		(return-from
  			psr-atribuicao-consistente-p
  				(values (nth 0 res) (nth 1 res))
  		)
  	)
  )
  