ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
import.h File Reference
#include "global.h"
Include dependency graph for import.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

unsigned kissat_import_literal (struct kissat *solver, int lit)
 
unsigned kissat_fresh_literal (struct kissat *solver)
 

Function Documentation

◆ kissat_fresh_literal()

unsigned kissat_fresh_literal ( struct kissat * solver)

Definition at line 84 of file import.c.

84 {
85 size_t imported = SIZE_STACK (solver->import);
86 KISSAT_assert (imported <= EXTERNAL_MAX_VAR);
87 if (imported == EXTERNAL_MAX_VAR) {
88 LOG ("can not get another external variable");
89 return INVALID_LIT;
90 }
91 KISSAT_assert (imported <= (unsigned) INT_MAX);
92 int eidx = (int) imported;
93 unsigned res = import_literal (solver, eidx, true);
94#ifndef KISSAT_NDEBUG
95 struct import *import = &PEEK_STACK (solver->import, imported);
98#endif
99 INC (fresh);
101 return res;
102}
#define SIZE_STACK(S)
Definition stack.h:19
#define INVALID_LIT
#define INC(NAME)
#define LOG(...)
void kissat_activate_literal(kissat *solver, unsigned lit)
Definition flags.c:52
#define KISSAT_assert(ignore)
Definition global.h:13
#define solver
Definition kitten.c:211
#define EXTERNAL_MAX_VAR
Definition literal.h:12
bool extension
Definition internal.h:50
bool imported
Definition internal.h:51
Here is the call graph for this function:

◆ kissat_import_literal()

unsigned kissat_import_literal ( struct kissat * solver,
int lit )

Definition at line 60 of file import.c.

60 {
62 if (GET_OPTION (tumble))
63 return import_literal (solver, elit, false);
64 const unsigned eidx = ABS (elit);
65 KISSAT_assert (SIZE_STACK (solver->import) <= UINT_MAX);
66 unsigned other = SIZE_STACK (solver->import);
67 if (eidx < other)
68 return import_literal (solver, elit, false);
69 if (!other)
70 adjust_imports_for_external_literal (solver, other++);
71
72 unsigned ilit = 0;
73 do {
75 ilit = import_literal (solver, other, false);
76 } while (other++ < eidx);
77
78 if (elit < 0)
79 ilit = NOT (ilit);
80
81 return ilit;
82}
#define GET_OPTION(N)
Definition options.h:295
#define VALID_EXTERNAL_LITERAL(LIT)
Definition literal.h:25
#define NOT(LIT)
Definition literal.h:33
#define ABS(a)
Definition util_old.h:250
Here is the caller graph for this function: