Branch data Line data Source code
1 : : /****************************************************************************** 2 : : * This file is part of the cvc5 project. 3 : : * 4 : : * Copyright (c) 2009-2026 by the authors listed in the file AUTHORS 5 : : * in the top-level source directory and their institutional affiliations. 6 : : * All rights reserved. See the file COPYING in the top-level source 7 : : * directory for licensing information. 8 : : * **************************************************************************** 9 : : * 10 : : * Justification info. 11 : : */ 12 : : 13 : : #include "decision/justify_info.h" 14 : : 15 : : namespace cvc5::internal { 16 : : namespace decision { 17 : : 18 : 191011 : JustifyInfo::JustifyInfo(context::Context* c) 19 : 191011 : : d_node(c), d_desiredVal(c, prop::SAT_VALUE_UNKNOWN), d_childIndex(c, 0) 20 : : { 21 : 191011 : } 22 : : 23 : 190999 : JustifyInfo::~JustifyInfo() {} 24 : : 25 : 54468101 : JustifyNode JustifyInfo::getNode() const 26 : : { 27 : 54468101 : return JustifyNode(d_node.get(), d_desiredVal.get()); 28 : : } 29 : : 30 : 55468485 : size_t JustifyInfo::getNextChildIndex() 31 : : { 32 : 55468485 : size_t i = d_childIndex.get(); 33 : 55468485 : d_childIndex = d_childIndex + 1; 34 : 55468485 : return i; 35 : : } 36 : 0 : void JustifyInfo::revertChildIndex() 37 : : { 38 : 0 : Assert(d_childIndex.get() > 0); 39 : 0 : d_childIndex = d_childIndex - 1; 40 : 0 : } 41 : 37947341 : void JustifyInfo::set(TNode n, prop::SatValue desiredVal) 42 : : { 43 : 37947341 : d_node = n; 44 : 37947341 : d_desiredVal = desiredVal; 45 : 37947341 : d_childIndex = 0; 46 : 37947341 : } 47 : : 48 : : } 49 : : } // namespace cvc5::internal