ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
gates.c File Reference
#include "gates.h"
#include "ands.h"
#include "definition.h"
#include "eliminate.h"
#include "equivalences.h"
#include "ifthenelse.h"
#include "inline.h"
Include dependency graph for gates.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START size_t kissat_mark_binaries (kissat *solver, unsigned lit)
 
void kissat_unmark_binaries (kissat *solver, unsigned lit)
 
bool kissat_find_gates (kissat *solver, unsigned lit)
 
void kissat_get_antecedents (kissat *solver, unsigned lit)
 

Function Documentation

◆ kissat_find_gates()

bool kissat_find_gates ( kissat * solver,
unsigned lit )

Definition at line 36 of file gates.c.

36 {
37 solver->gate_eliminated = 0;
38 solver->resolve_gate = false;
39 if (!GET_OPTION (extract))
40 return false;
41 INC (gates_checked);
42 const unsigned not_lit = NOT (lit);
43 if (EMPTY_WATCHES (WATCHES (not_lit)))
44 return false;
45 bool res = false;
47 res = true;
48 else if (kissat_find_and_gate (solver, lit, 0))
49 res = true;
50 else if (kissat_find_and_gate (solver, not_lit, 1))
51 res = true;
53 res = true;
54 else if (kissat_find_if_then_else_gate (solver, not_lit, 1))
55 res = true;
57 res = true;
58 if (res)
59 INC (gates_extracted);
60 return res;
61}
ABC_NAMESPACE_IMPL_START bool kissat_find_and_gate(kissat *solver, unsigned lit, unsigned negative)
Definition ands.c:8
#define INC(NAME)
bool kissat_find_definition(kissat *solver, unsigned lit)
Definition definition.c:93
ABC_NAMESPACE_IMPL_START bool kissat_find_equivalence_gate(kissat *solver, unsigned lit)
Definition equivalences.c:7
bool kissat_find_if_then_else_gate(kissat *solver, unsigned lit, unsigned negative)
Definition ifthenelse.c:97
#define solver
Definition kitten.c:211
#define GET_OPTION(N)
Definition options.h:295
int lit
Definition satVec.h:130
#define NOT(LIT)
Definition literal.h:33
#define EMPTY_WATCHES(W)
Definition watch.h:103
#define WATCHES(LIT)
Definition watch.h:137
Here is the call graph for this function:
Here is the caller graph for this function:

◆ kissat_get_antecedents()

void kissat_get_antecedents ( kissat * solver,
unsigned lit )

Definition at line 103 of file gates.c.

103 {
104 get_antecedents (solver, lit, 0);
105 get_antecedents (solver, NOT (lit), 1);
106}
Here is the caller graph for this function:

◆ kissat_mark_binaries()

ABC_NAMESPACE_IMPL_START size_t kissat_mark_binaries ( kissat * solver,
unsigned lit )

Definition at line 11 of file gates.c.

11 {
12 value *marks = solver->marks;
13 size_t res = 0;
16 if (!watch.type.binary)
17 continue;
18 const unsigned other = watch.binary.lit;
19 KISSAT_assert (!solver->values[other]);
20 if (marks[other])
21 continue;
22 marks[other] = 1;
23 res++;
24 }
25 return res;
26}
ABC_NAMESPACE_IMPL_START typedef signed char value
#define KISSAT_assert(ignore)
Definition global.h:13
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
Here is the caller graph for this function:

◆ kissat_unmark_binaries()

void kissat_unmark_binaries ( kissat * solver,
unsigned lit )

Definition at line 28 of file gates.c.

28 {
29 value *marks = solver->marks;
32 if (watch.type.binary)
33 marks[watch.binary.lit] = 0;
34}
Here is the caller graph for this function: