mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-04 13:29:11 +00:00 
			
		
		
		
	Fix uninterpreted sort definition. There was a mismatch in the behavior of the API and SMT front-ends. The SMT front-ends were using user_sorts to be able to support parametric uninterpreted sorts. After this fix, the API also creates user_sorts.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
		
							parent
							
								
									3b8d72beeb
								
							
						
					
					
						commit
						3a15db5244
					
				
					 8 changed files with 23 additions and 14 deletions
				
			
		| 
						 | 
				
			
			@ -78,7 +78,7 @@ extern "C" {
 | 
			
		|||
        Z3_TRY;
 | 
			
		||||
        LOG_Z3_mk_uninterpreted_sort(c, name);
 | 
			
		||||
        RESET_ERROR_CODE();
 | 
			
		||||
        sort* ty = mk_c(c)->m().mk_sort(to_symbol(name));
 | 
			
		||||
        sort* ty = mk_c(c)->m().mk_uninterpreted_sort(to_symbol(name));
 | 
			
		||||
        mk_c(c)->save_ast_trail(ty);
 | 
			
		||||
        RETURN_Z3(of_sort(ty));
 | 
			
		||||
        Z3_CATCH_RETURN(0);
 | 
			
		||||
| 
						 | 
				
			
			@ -620,7 +620,7 @@ extern "C" {
 | 
			
		|||
        CHECK_VALID_AST(t, Z3_UNKNOWN_SORT);
 | 
			
		||||
        family_id fid = to_sort(t)->get_family_id();
 | 
			
		||||
        decl_kind k   = to_sort(t)->get_decl_kind();
 | 
			
		||||
        if (fid == null_family_id) {
 | 
			
		||||
        if (mk_c(c)->m().is_uninterp(to_sort(t))) {
 | 
			
		||||
            return Z3_UNINTERPRETED_SORT;
 | 
			
		||||
        }
 | 
			
		||||
        else if (fid == mk_c(c)->m().get_basic_family_id() && k == BOOL_SORT) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue