Class: Z3::FuncDecl
Constant Summary
collapse
- PARAMETER_KINDS =
Decl parameters are the _-part of an indexed decl like
(_ map or), (_ extract 7 0), (_ zero_extend 8).
They have nothing to do with the domain, so they're not counted by #arity.
{
0 => :int,
1 => :double,
2 => :rational,
3 => :symbol,
4 => :sort,
5 => :ast,
6 => :func_decl,
7 => :internal,
8 => :zstring,
}
Instance Attribute Summary
Attributes inherited from AST
#_ast
Instance Method Summary
collapse
Methods inherited from AST
#arguments, #ast_kind, #eql?, #func_decl, #hash, #sexpr, #simplify
Constructor Details
#initialize(_ast) ⇒ FuncDecl
Returns a new instance of FuncDecl.
3
4
5
6
|
# File 'lib/z3/func_decl.rb', line 3
def initialize(_ast)
super(_ast)
raise Z3::Exception, "FuncDecls must have AST kind func decl" unless ast_kind == :func_decl
end
|
Instance Method Details
#arity ⇒ Object
12
13
14
|
# File 'lib/z3/func_decl.rb', line 12
def arity
LowLevel.get_arity(self)
end
|
#domain(i) ⇒ Object
16
17
18
19
20
|
# File 'lib/z3/func_decl.rb', line 16
def domain(i)
a = arity
raise Z3::Exception, "Trying to access domain #{i} but function arity is #{a}" if i < 0 or i >= a
Sort.from_pointer(LowLevel::get_domain(self, i))
end
|
#func_decl_parameter(i) ⇒ Object
#inspect ⇒ Object
60
61
62
|
# File 'lib/z3/func_decl.rb', line 60
def inspect
"Z3::FuncDecl<#{name}/#{arity}>"
end
|
#parameter_kind(i) ⇒ Object
#to_s ⇒ Object
56
57
58
|
# File 'lib/z3/func_decl.rb', line 56
def to_s
name
end
|