smtbmc: Avoid unnecessary deep copies during unrolling

This commit is contained in:
Jannis Harder 2022-03-28 12:37:11 +02:00
parent 62b89bb0d4
commit d25daa6203
1 changed files with 6 additions and 6 deletions

View File

@ -20,7 +20,7 @@ import sys, re, os, signal
import subprocess import subprocess
if os.name == "posix": if os.name == "posix":
import resource import resource
from copy import deepcopy from copy import copy
from select import select from select import select
from time import time from time import time
from queue import Queue, Empty from queue import Queue, Empty
@ -301,7 +301,7 @@ class SmtIo:
key = tuple(stmt) key = tuple(stmt)
if key not in self.unroll_cache: if key not in self.unroll_cache:
decl = deepcopy(self.unroll_decls[key[0]]) decl = copy(self.unroll_decls[key[0]])
self.unroll_cache[key] = "|UNROLL#%d|" % self.unroll_idcnt self.unroll_cache[key] = "|UNROLL#%d|" % self.unroll_idcnt
decl[1] = self.unroll_cache[key] decl[1] = self.unroll_cache[key]
@ -442,10 +442,10 @@ class SmtIo:
if stmt == "(push 1)": if stmt == "(push 1)":
self.unroll_stack.append(( self.unroll_stack.append((
deepcopy(self.unroll_sorts), copy(self.unroll_sorts),
deepcopy(self.unroll_objs), copy(self.unroll_objs),
deepcopy(self.unroll_decls), copy(self.unroll_decls),
deepcopy(self.unroll_cache), copy(self.unroll_cache),
)) ))
if stmt == "(pop 1)": if stmt == "(pop 1)":