mirror of
https://github.com/Z3Prover/z3
synced 2025-05-09 00:35:47 +00:00
Z3 sources
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
3f9edad676
commit
e9eab22e5c
1186 changed files with 381859 additions and 0 deletions
32
lib/expr_weight.cpp
Normal file
32
lib/expr_weight.cpp
Normal file
|
@ -0,0 +1,32 @@
|
|||
/*++
|
||||
Copyright (c) 2007 Microsoft Corporation
|
||||
|
||||
Module Name:
|
||||
|
||||
expr_weight.cpp
|
||||
|
||||
Abstract:
|
||||
|
||||
Functor for computing the weight of an expression.
|
||||
|
||||
Author:
|
||||
|
||||
Leonardo (leonardo) 2008-01-11
|
||||
|
||||
Notes:
|
||||
|
||||
--*/
|
||||
#include"expr_weight.h"
|
||||
#include"recurse_expr_def.h"
|
||||
|
||||
template class recurse_expr<weight, expr_weight_visitor, true>;
|
||||
|
||||
weight expr_weight_visitor::visit(app const * n, weight const * args) {
|
||||
weight r(1);
|
||||
unsigned j = n->get_num_args();
|
||||
while (j > 0) {
|
||||
--j;
|
||||
r += args[j];
|
||||
}
|
||||
return r;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue