func (s Sort) AsAST() AST {
	var ast AST
	s.ctx.do(func() {
		ast = wrapAST(s.ctx, C.Z3_sort_to_ast(s.ctx.c, s.c))
	})
	runtime.KeepAlive(s)
	return ast
}
AsAST returns the AST representation of s.
package z3
import (
	"runtime"
)
import "C"
type Sort struct {
	*sortImpl
	noEq
}
type sortImpl struct {
	ctx  *Context
	c    C.Z3_sort
	kind Kind
}
func wrapSort(ctx *Context, c C.Z3_sort, kind Kind) Sort {
	C.Z3_inc_ref(ctx.c, C.Z3_sort_to_ast(ctx.c, c))
	if kind == KindUnknown {
		kind = Kind(C.Z3_get_sort_kind(ctx.c, c))
	}
	impl := &sortImpl{ctx, c, kind}
	runtime.SetFinalizer(impl, func(impl *sortImpl) {
		impl.ctx.do(func() {
			C.Z3_dec_ref(impl.ctx.c, C.Z3_sort_to_ast(impl.ctx.c, impl.c))
		})
	})
	return Sort{impl, noEq{}}
}
func (s Sort) Context() *Context {
	if s.sortImpl == nil {
		return nil
	}
	return s.ctx
}
func (s Sort) String() string {
	var res string
	s.ctx.do(func() {
		res = C.GoString(C.Z3_sort_to_string(s.ctx.c, s.c))
	})
	runtime.KeepAlive(s)
	return res
}
func (s Sort) Kind() Kind {
	return s.kind
}
func (s Sort) BVSize() int {
	var size int
	s.ctx.do(func() {
		size = int(C.Z3_get_bv_sort_size(s.ctx.c, s.c))
	})
	runtime.KeepAlive(s)
	return size
}
func (s Sort) FloatSize() (ebits, sbits int) {
	s.ctx.do(func() {
		ebits = int(C.Z3_fpa_get_ebits(s.ctx.c, s.c))
		sbits = int(C.Z3_fpa_get_sbits(s.ctx.c, s.c))
	})
	runtime.KeepAlive(s)
	return
}
func (s Sort) DomainAndRange() (domain, range_ Sort) {
	s.ctx.do(func() {
		domain = wrapSort(s.ctx, C.Z3_get_array_sort_domain(s.ctx.c, s.c), KindUnknown)
		range_ = wrapSort(s.ctx, C.Z3_get_array_sort_range(s.ctx.c, s.c), KindUnknown)
	})
	runtime.KeepAlive(s)
	return
}