3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-10 03:07:07 +00:00
z3/lib/expr_weight.cpp
Leonardo de Moura e9eab22e5c Z3 sources
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2012-10-02 11:35:25 -07:00

33 lines
528 B
C++

/*++
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;
}