ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
equivalences.c File Reference
#include "gates.h"
#include "inlinevector.h"
#include "logging.h"
Include dependency graph for equivalences.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START bool kissat_find_equivalence_gate (kissat *solver, unsigned lit)
 

Function Documentation

◆ kissat_find_equivalence_gate()

ABC_NAMESPACE_IMPL_START bool kissat_find_equivalence_gate ( kissat * solver,
unsigned lit )

Definition at line 7 of file equivalences.c.

7 {
8 if (!GET_OPTION (equivalences))
9 return false;
11 return false;
12 value *marks = solver->marks;
13 unsigned not_lit = NOT (lit);
14 watches *watches = &WATCHES (not_lit);
15 unsigned replace = INVALID_LIT;
17 if (!watch.type.binary)
18 continue;
19 const unsigned other = watch.binary.lit;
20 const unsigned not_other = NOT (other);
21 if (!marks[not_other])
22 continue;
23 replace = other;
24 break;
25 }
27 if (replace == INVALID_LIT)
28 return false;
29 LOG ("found equivalence gate %s = %s", LOGLIT (lit), LOGLIT (replace));
30
31 const watch watch1 = kissat_binary_watch (replace);
32 PUSH_STACK (solver->gates[1], watch1);
33
34 const watch watch0 = kissat_binary_watch (NOT (replace));
35 PUSH_STACK (solver->gates[0], watch0);
36 solver->gate_eliminated = GATE_ELIMINATED (equivalences);
37 INC (equivalences_extracted);
38 return true;
39}
#define PUSH_STACK(S, E)
Definition stack.h:39
#define INVALID_LIT
#define INC(NAME)
#define LOG(...)
ABC_NAMESPACE_IMPL_START typedef signed char value
void kissat_unmark_binaries(kissat *solver, unsigned lit)
Definition gates.c:28
ABC_NAMESPACE_IMPL_START size_t kissat_mark_binaries(kissat *solver, unsigned lit)
Definition gates.c:11
#define GATE_ELIMINATED(...)
Definition gates.h:20
#define solver
Definition kitten.c:211
#define LOGLIT(...)
Definition logging.hpp:99
#define GET_OPTION(N)
Definition options.h:295
int lit
Definition satVec.h:130
#define NOT(LIT)
Definition literal.h:33
Definition watch.h:41
watch_type type
Definition watch.h:42
binary_watch binary
Definition watch.h:43
vector watches
Definition watch.h:49
#define all_binary_large_watches(WATCH, WATCHES)
Definition watch.h:158
#define WATCHES(LIT)
Definition watch.h:137
Here is the call graph for this function:
Here is the caller graph for this function: