ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
analyze.c File Reference
#include "analyze.h"
#include "backtrack.h"
#include "bump.h"
#include "deduce.h"
#include "inline.h"
#include "learn.h"
#include "minimize.h"
#include "print.h"
#include "rank.h"
#include "shrink.h"
#include "sort.h"
#include "tiers.h"
#include <inttypes.h>
Include dependency graph for analyze.c:

Go to the source code of this file.

Macros

#define RADIX_SORT_LEVELS_LIMIT   32
 
#define RANK_LEVEL(A)
 
#define SMALLER_LEVEL(A, B)
 

Functions

void kissat_reset_only_analyzed_literals (kissat *solver)
 
int kissat_analyze (kissat *solver, clause *conflict)
 

Macro Definition Documentation

◆ RADIX_SORT_LEVELS_LIMIT

#define RADIX_SORT_LEVELS_LIMIT   32

Definition at line 216 of file analyze.c.

◆ RANK_LEVEL

#define RANK_LEVEL ( A)
Value:
(A)

Definition at line 218 of file analyze.c.

◆ SMALLER_LEVEL

#define SMALLER_LEVEL ( A,
B )
Value:
#define RANK_LEVEL(A)
Definition analyze.c:218

Definition at line 219 of file analyze.c.

Function Documentation

◆ kissat_analyze()

int kissat_analyze ( kissat * solver,
clause * conflict )

Definition at line 529 of file analyze.c.

529 {
530 if (solver->inconsistent) {
531 KISSAT_assert (!solver->level);
532 return 20;
533 }
534
535 START (analyze);
536 if (!solver->probing) {
537 update_trail_average (solver);
538 update_decision_rate_average (solver);
539#ifndef KISSAT_QUIET
540 UPDATE_AVERAGE (level, solver->level);
541#endif
542 }
543 int res;
544 do {
545 LOGCLS (conflict, "analyzing conflict %" PRIu64, CONFLICTS);
546 unsigned conflict_level;
547 if (one_literal_on_conflict_level (solver, conflict, &conflict_level))
548 res = 1;
549 else if (!conflict_level)
550 res = -1;
551 else if (conflict_level == 1) {
552 analyze_failed_literal (solver, conflict);
553 res = 1;
554 } else if ((conflict =
556 reset_analysis_but_not_analyzed_literals (solver);
557 INC (conflicts);
558 if (CONFLICTS > solver->limits.glue.conflicts)
559 update_tier_limits (solver);
560 res = 0; // And continue with new conflict analysis.
561 } else {
562 if (GET_OPTION (minimize)) {
563 sort_deduced_clause (solver);
565 if (GET_OPTION (shrink))
567 }
568 analyze_reason_side_literals (solver);
570 reset_analysis_but_not_analyzed_literals (solver);
571 res = 1;
572 }
573 if (!EMPTY_STACK (solver->analyzed)) {
574 if (!solver->probing && GET_OPTION (bump))
577 }
578 } while (!res);
579 STOP (analyze);
580 return res > 0 ? 0 : 20;
581}
void kissat_reset_only_analyzed_literals(kissat *solver)
Definition analyze.c:328
void kissat_bump_analyzed(kissat *solver)
Definition bump.c:105
#define EMPTY_STACK(S)
Definition stack.h:18
#define INC(NAME)
clause * kissat_deduce_first_uip_clause(kissat *solver, clause *conflict)
Definition deduce.c:72
#define UPDATE_AVERAGE(A, Y)
Definition ema.hpp:56
#define KISSAT_assert(ignore)
Definition global.h:13
#define solver
Definition kitten.c:211
void kissat_learn_clause(kissat *solver)
Definition learn.c:192
#define LOGCLS(...)
Definition logging.h:415
void kissat_minimize_clause(kissat *solver)
Definition minimize.c:157
#define GET_OPTION(N)
Definition options.h:295
#define STOP(P)
Definition profile.hpp:158
#define START(P)
Definition profile.hpp:150
void kissat_shrink_clause(kissat *solver)
Definition shrink.c:362
#define CONFLICTS
Definition statistics.h:335
Here is the call graph for this function:
Here is the caller graph for this function:

◆ kissat_reset_only_analyzed_literals()

void kissat_reset_only_analyzed_literals ( kissat * solver)

Definition at line 328 of file analyze.c.

328 {
329 LOG ("reset %zu analyzed variables", SIZE_STACK (solver->analyzed));
330 assigned *assigned = solver->assigned;
331 for (all_stack (unsigned, idx, solver->analyzed)) {
332 KISSAT_assert (idx < VARS);
333 struct assigned *a = assigned + idx;
337 a->analyzed = false;
338 }
339 CLEAR_STACK (solver->analyzed);
340}
#define all_stack(T, E, S)
Definition stack.h:94
#define SIZE_STACK(S)
Definition stack.h:19
#define CLEAR_STACK(S)
Definition stack.h:50
#define LOG(...)
#define VARS
Definition internal.h:250
bool analyzed
Definition assign.h:22
bool removable
Definition assign.h:25
bool poisoned
Definition assign.h:24
bool shrinkable
Definition assign.h:26
Here is the caller graph for this function: