CN104123503B - CNF formula data protection method in SAT problem solving outsourcing process - Google Patents
CNF formula data protection method in SAT problem solving outsourcing process Download PDFInfo
- Publication number
- CN104123503B CN104123503B CN201410292502.6A CN201410292502A CN104123503B CN 104123503 B CN104123503 B CN 104123503B CN 201410292502 A CN201410292502 A CN 201410292502A CN 104123503 B CN104123503 B CN 104123503B
- Authority
- CN
- China
- Prior art keywords
- formula
- clause
- cnf
- variable
- word
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 69
- 238000012946 outsourcing Methods 0.000 title claims abstract description 25
- 230000008569 process Effects 0.000 title abstract description 6
- 239000010903 husk Substances 0.000 claims abstract description 167
- 238000013507 mapping Methods 0.000 claims abstract description 86
- 238000002156 mixing Methods 0.000 claims description 16
- 230000008707 rearrangement Effects 0.000 claims description 16
- 101100377706 Escherichia phage T5 A2.2 gene Proteins 0.000 claims description 3
- 235000013399 edible fruits Nutrition 0.000 claims description 3
- 238000010304 firing Methods 0.000 claims 1
- 238000012795 verification Methods 0.000 abstract description 5
- 239000000243 solution Substances 0.000 abstract 4
- 239000011259 mixed solution Substances 0.000 abstract 3
- 238000002372 labelling Methods 0.000 description 15
- 230000008859 change Effects 0.000 description 8
- 239000000203 mixture Substances 0.000 description 7
- 238000001514 detection method Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 238000011084 recovery Methods 0.000 description 4
- 230000015572 biosynthetic process Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 201000004569 Blindness Diseases 0.000 description 1
- KARQLFDESQCUJT-UHFFFAOYSA-N [Mg].[Si].[Ca].[Fe] Chemical compound [Mg].[Si].[Ca].[Fe] KARQLFDESQCUJT-UHFFFAOYSA-N 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 238000000354 decomposition reaction Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 230000001737 promoting effect Effects 0.000 description 1
- 238000000638 solvent extraction Methods 0.000 description 1
- 239000000126 substance Substances 0.000 description 1
- 230000017423 tissue regeneration Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/10—Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
- G06F21/12—Protecting executable software
- G06F21/14—Protecting executable software against software analysis or reverse engineering, e.g. by obfuscation
Abstract
The invention discloses a CNF formula data protection method in the SAT problem solving outsourcing process. The method includes the following implementation steps that a Husk formula S2 and a Husk solution Hr are generated; an original CNF formula S1 and an original CNF formula S2 are mixed to generate a novel CNF formula S and a variable mapping table M on the premise that solution space is kept unchanged; data to be solved are converted into CNF formula data through the novel CNF formula S to be outsourced to a far-end server, and the received CNF formula data are solved through the far-end server to acquire a mixed solution Or; the mixed solution Or is de-mapped based on the variable mapping table M, an actual variable which is marked and mapped to the original CNF formula S1 in the variable mapping table M in the de-mapping process is filled into an original solution R to conduct correctness verification, and finally the original solution R corresponding to the mixed solution Or is acquired. By means of the CNF formula data protection method, any CNF formula S1 can be mixed so as to hide the structural information included in the CNF formula S1, it is guaranteed that the mixed CNF formula S can use an original SAT solver for solving, and correctness verification can further be conducted on outsourcing computational results.
Description
Technical field
The present invention relates to calculating the data-privacy resist technology of outsourcing under cloud computing environment and in particular to a kind of SAT problem
Solve the CNF formula data guard method in sub-contract management.
Background technology
The solution of SAT (proposition can meet) problem is used widely in software and hardware checking field at present.In recent years,
On the one hand with the expanding day of software and hardware scale, the SAT problem scale serving hardware verification also drastically expands therewith, thus
Stern challenge is defined to the computing basic facility of user.On the other hand, cloud computing ripe at present and grid computing pattern
The computing resource of elasticity can be provided according to application scale, thus becoming the effective means tackling this challenge.Therefore, using cloud
Calculate or SAT problem is distributed in the solution rule that Parallel implementation in the multicomputer system of far-end to improve problem by grid computing
Mould, thus becoming a kind of new trend using the outsourcing that calculates of the computing basic facilities such as cloud or grid.
Under cloud computing and grid computing pattern, SAT solver is deployed on node server or the Cloud Server of far-end, will
The CNF formula data that hardware circuit is transformed is transferred to be existed on the server being located at far-end, by running on the server
SAT solver solves;And obtain solving result.CNF formula is the conjunction of some clauses;Clause is extracting of some words;Literary composition
Word is Boolean variable or its is anti-.In lower example formula (1)It is a typical CNF formula.
In formula (1),Comprise 4 variables x1, x2, x3, x4 and four clauses(x2∨x3)、 Wherein x2 is referred to as the text word of variable x2,The referred to as negative word of variable x2;Clause
In the quantity of word that comprises be referred to as the length of clause, the length of clause C is denoted as | C |, clauseComprise two literary compositions
Word, its length
The target that SAT solves is exactly to find the assignment of one group of variable so that arbitrary clause all values are true (T);And make one
Individual clause is true, then require at least one word value in clause to be true.In if clause, all words all values are false
(F), then this clause's value is false;If arbitrary clause's value is false in CNF formula, this CNF formula value is false, true (T)
Available digital 1 represents, false (F) can use 0 expression.In upper example formula (1), one group of assignment { x1=1, x2=1, x3=0, x4=0 }
Each clause's value can be made to be true, therefore this group assignment is a solution of SAT;Another group of assignment x1=1, x2=1, x3=0,
X4=1 } each clause can also be made to be true, therefore this group assignment is also a solution of CNF formula.This two groups of assignment can be closed
And it is expressed as { x1=1, x2=1, x3=0 }, show x1, under such assignment, no matter x4 takes true or false, all may be used for x2, x3
Make CNF formulaValue is true.If there is making CNF formula be genuine assignment, this CNF formula is just claimed to be satiable (SAT);
Conversely, just claiming this CNF formula to be unsatisfiable (UNSAT).Obviously, the formula in formula (1)It is satiable, and lower example formula
(2) the formula ψ in is unsatisfiable.
In formula (2), the explanation referring to formula (1) understands, formula ψ comprises 5 clauses, the truth table shown in table one,
The no matter how value of variable x1 and x2 in clause, front 4 clauses can not be true simultaneously, leads to ψ can not possibly take very, therefore ψ
It is a unsatisfiable CNF formula.What this 4 clauses of contradiction were known as formula ψ each other can not meet core.
Table one:Truth table:
Arbitrarily circuit be all with (AND) or (OR), non-(NOT), XOR, with or wait combining of elementary gate.These Men Douyou
Corresponding characteristic function, following formula (3)~(7) provide the characteristic function of conventional elementary gate.
In formula (3)~(7), formula (3) is the characteristic function of not gate NOT, and formula (4) is the characteristic function with door AND, formula (5)
For the characteristic function of OR gate OR, formula (6) is the characteristic function of NAND gate NAND, and formula (7) is the characteristic function of nor gate NOR;Its
Middle xiRepresent the input variable of door, j represents the number of the input variable of door, and z represents output variable.
In example, in hardware chemical examination card, before being solved using SAT solver, need first by hardware circuit and genus to be verified
Property be converted into CNF formula, this process be referred to as Tseitin coding.Because any circuit all can be analyzed to two inputs and door (AND2)
With the combination of not gate (NOT), so be only given here AND2 and NOT Tseitin coding.For not gate z=NOT (x), by
Tseitin encodes the CNF formula producing:And for two inputs and door z=AND2 (x1,x2), by
Tseitin encodes the CNF formula producing:
There is the other kinds of door of any input and function, their Tseitin coding can be similar to and obtain.
For a complicated circuit being made up of elementary gates such as AND2 and NOT, the CNF formula that Tseitin coding produces is
The conjunction of the CNF formula of all these elementary gates.Exemplary circuit shown in Figure 1, this exemplary circuit comprises one and door & and
Individual OR gate |, variable a and b obtains intermediate variable d after carrying out " | " or computing, intermediate variable d is carrying out " & " and computing with variable c
Output variable e afterwards.Tseitin encodes by using intermediate variable set { d }, respectively the function of this two doors is expressed as OR gate
Tseitin coding:Tseitin coding with door:Totally two short sentence set.The then conjunction of this two short sentence set, has meant that whole
The function of individual circuit.For any circuit C, corresponding CNF formula can be converted to through Tseitin codingIt is designated asSoftware code encodes to the mapping ruler of CNF formula also based on Tseitin, similar to the checking of hardware logic.
Particular door is referred to as this CNF labelling by the CNF formula that Tseitin coding obtains.Each clause in labelling
It is referred to as the characterising clause of door.The clause comprising all variables in door is referred to as the key clause of door.In CNF labelling, a represents output
Variable, referred to as output variable.Taking three inputs with door (AND3) as a example, three inputs and door (AND3) encode through Tseitin, turn
It is changed to the clause set C of formula (8).
In formula (8), C is referred to as the CNF labelling of AND3 door;c1~c4Clause is referred to as characterising clause;Wherein clause c1Contain
All variables (a, b, c, d) in AND3 door, the referred to as key clause of AND3 door;A is referred to as the output variable of AND3 door.In one kind
Under coding rule, the door with same characteristic features function will necessarily be coded as identical clause set.Existing threat modeling
In, all by exploring this architectural feature with restoring circuit structure, the algorithm that they are used is based on following potential attacker
The hypergraph of definition, Directed Hypergraph and bipartite graph concept.
With the clause in CNF formula as node, variable as side, the figure of formation is referred to as hypergraph (Hypergraph).
In hypergraph G (V, E):
◆ a clause in the corresponding CNF of each node in V;
◆ a variable in the corresponding CNF of each edge in E.
If two clauses comprise identical variable, connect a line between two clauses, marked with variable.Expression side in hypergraph
Under formula, there is following situation, two doors have different CNF labellings, but hypergraph represents identical, such as AND3 and OR3.
On the basis of hypergraph, according in clause word positive and negative, add labelling for side, the figure of formation is referred to as Directed Hypergraph
(Directed Hypergraph).
Clause and variable are accordingly to be regarded as node, the membership relation of variable and clause are considered as side simultaneously, the figure of formation is referred to as
Bipartite graph (Bipartite Graph).In bipartite graph G (V, E):
◆ one of vertex correspondence CNF clause or variable in V, i.e. V=Vcls∪Vvar.Wherein VclsGather for clause,
VvarFor node set.
◆ the side in E corresponds to a clause/variable pair.If occurrences are in clause, just between variable and clause
Connect a line;Variable is that negative value then corresponds to a negative side, otherwise is positive side.
, represent by the CNF labelling of formula (8) taking AND3 door as a example, can get corresponding hypergraph (as shown in Figure 2), oriented super
Figure is (as shown in figure 3, wherein useRepresent that just ┼ represents negative), bipartite graph (as shown in Figure 4).Due to cloud computing and grid meter
Calculate the server needing to store data in far-end, the node server of Cloud Server and grid computing is made by multiple users share
With, during carrying out SAT problem solving on the server, there is undelegated third party user and access CNF formula data
Probability.And on the other hand, be the SAT example being represented with CNF formula in the hardware circuit code conversion representing netlist
During, circuit structure information can't be lost therewith, and this just provides chance for potential attacker.At present, prior art
Disclose and inquired into the method recovering circuit structure from CNF formula data, and wherein part prior art has also been returned
Complete circuit recovery algorithms are gone out.
For example, Jarrod A.Roy et al. is in " Restoring Circuit Structure from SAT
Give the electric circuit inspection algorithm for CNF, the concept based on gate circuit CNF labelling for the algorithm in an Instances " literary composition, and make
With pattern match and Subgraph Isomorphism come extraction circuit structure, basic step is as follows:
1) by examples translating for CNF be a undirected hypergraph G;
2) the CNF labelling of door is converted into subgraph g, mates in undirected hypergraph G;
3) by CNF instance transfer be bipartite graph, mate the example of each using Subgraph Isomorphism;
4) make one node of each correspondence, if door incompatible (sharing same clause), just connect a line;To construct
CNF corresponding maximum circuit problem is converted into maximum independent set and closes (MIS) problem solving.MIS problem is NP-hard problem, but
It is preferably heuristic for the presence of this problem.
Additionally, Zhaohui Fu.Sharad Malik is in " Extracting Logic Circuit Structure
Describe CNF2CKT algorithm in a from Conjunctive Normal Form Descriptions " literary composition, calculate in CNF2CKT
Continue to use the concept of CNF labelling in method, and introduced the concept of key clause, to reduce matching range, improve the efficiency of coupling, base
This step is as follows:
1) from CNF, by the pattern match of key clause, detect the circuit structure of door;
2) construct maximum no ring cover, maximized from any CNF example extract circuit structure.
In sum, the recovery of these gate structures of prior art is attempted setting up in Subgraph Isomorphism and pattern match etc.
On the basis of mature technology, make use of the graph structure characteristic that CNF formula carries, potential menace can use above-mentioned technological means
Extract door from CNF, obtain circuit structure information;The circuit structure that therefore hiding CNF comprises is to solve SAT in outsourcing to ask
The problem that topic must solve.
Content of the invention
The technical problem to be solved in the present invention is:For the problems referred to above, provide one kind can be by CNF formula data outsourcing
It is carried out deforming to before grid node or cloud computing server and obscure to hide the structural information comprising and not affect SAT
Problem normally solve, ensure that the SAT problem that CNF formula after obscuring can also be solved using original SAT solver
Calculate the CNF formula data guard method in outsourcing.
In order to solve above-mentioned technical problem, the technical solution used in the present invention is:
A kind of SAT problem calculates the CNF formula data guard method in outsourcing, and implementation step is as follows:
1) generate Husk formula S2, described Husk formula S2For only having a CNF formula that can meet solution, and described Husk
Formula S2The assignment of solution variable is not full 0 or complete 1;
2) original CNF formula S to be solved in outsourcing will be calculated1, described Husk formula S2Both are to keep solution space constant
Premised on obscure generation and have and original CNF formula S1The new CNF formula S of different CNF structures, and generate be used for recording original
CNF formula S1, Husk formula S2The variable mappings table M of mapping relations between both and its variable, in described variable mappings table M
Each list item includes var domain and formula domain Gong Liangge domain, and wherein var domain is used for storing original CNF formula S1Or Husk is public
Formula S2In original variable name, the source of the corresponding variable name of formula domain representation;Described solution space is constant to refer to original CNF formula
S1, new CNF formula S can be solved using identical SAT solver and both solutions between there is following relation:Former
Beginning CNF formula S1Can not meet, new CNF formula S can not meet, otherwise new CNF formula S can not meet then original CNF formula S1
Can not meet, if original CNF formula S1Can meet, new CNF formula S can meet, original CNF formula S1Solution can be by new
The solution of CNF formula is in original CNF formula S1Variables set on projection obtain;Described difference CNF structure refers to original CNF formula S1、
Clause's set between new CNF formula S and the word set in clause are all different;
3) data to be solved is converted to CNF formula data using new CNF formula S and is outsourced to far-end server, utilize
On far-end server, existing SAT solver solves to the CNF formula data receiving and obtains obscuring solution Or;
4) it is directed to and obscures each of solution Or solution word lit, take out solution word lit corresponding variable var, and according to solution
Word lit corresponding variable var takes out corresponding real variable rvar from variable mappings table M, if this real variable rvar
Variable mappings table M is labeled and is mapped from original CNF formula S1, then this real variable is filled to primitive solution R, finally gives
Obscure solution corresponding primitive solution R of Or.
Preferably, described step 1) also include generating Husk formula S2Husk solve Hr step;Described step 4) in root
When taking out corresponding real variable rvar according to solution word lit corresponding variable var from variable mappings table M, if this actual change
Amount rvar is labeled in variable mappings table M to be mapped from Husk formula S2, then this real variable rvar is solved Hr with described Husk
In corresponding assignment Hr [rvar] be compared checking, if checking inconsistent; judge far-end server to CNF formula data
Solve error, output error is simultaneously exited.
Preferably, described step 1) middle generation Husk formula S2Detailed step as follows:
1.1) generate a prime number, described prime number is represented in the form of binary vector;
1.2) prime number described employing binary vector being represented is squared;
1.3) value after will be squared for described prime number as the output variable of multiplier and forbids the input variable of multiplier
Equal to 1, described multiplier is converted to CNF formula, this CNF formula as generates only obtaining and can meet solution and solve
The assignment of variable is not full 0 or complete 1 Husk formula S2.
Preferably, described step 4) detailed step as follows:
4.1) from described obscure take out untreated solution word lit solution Or as currently solving word;
4.2) judge current to solve whether word lit is more than 0, if greater than 0 initial value using current solution word lit as working as
Front solution word lit corresponding variable var, as the current solution corresponding variable of word lit after otherwise negating current solution word lit
var;
4.3) described current solution word lit corresponding variable var is used as the index in var domain in variable mappings table M, from
Corresponding real variable rvar is taken out in described variable mappings table M;
4.4) judge value M in formula domain in described real variable rvar Corresponding matching list item in variable mappings table M
Whether [rvar] .formula is original CNF formula S1, if it is represent described real variable rvar in variable mappings table M
It is labeled and map to original CNF formula S1, then redirect execution step 4.5);Otherwise represent this real variable rvar in variable mappings
It is labeled in table M and map to Husk formula S2, redirect execution step 4.6);
4.5) judge current solve whether word lit is more than 0, if greater than 0, described real variable rvar is filled to former
Corresponding assignment R of real variable rvar [rvar] in the solution that begins R, fills to primitive solution after otherwise negating described real variable rvar
Corresponding assignment R of real variable rvar [rvar] in R;Redirect execution step 4.8);
4.6) judge that the current word lit that solves, whether more than 0, if currently solution word lit is more than 0, judges described reality
Whether variable rvar, real variable rvar corresponding assignment Hr [rvar] in described Husk solution Hr is consistent, redirects execution step
4.7);If currently solution word lit is not more than 0, judge described real variable rvar value of the inverted-rvar, real variable
Whether rvar corresponding assignment Hr [rvar] in described Husk solution Hr is consistent, redirects execution step 4.7);
4.7) if corresponding assignment Hr [rvar] is consistent in described Husk solution Hr with real variable rvar, redirect and hold
Row step 4.8);Otherwise judge that far-end server, to CNF formula data solving result mistake, reports an error and exits;
4.8) whether all solution words obscuring solution Or described in judgement are disposed, if being not yet disposed, redirecting and holding
Row step 4.1), otherwise represent that primitive solution R has been filled with finishing, obtain obscuring solution corresponding primitive solution R of Or.
As optional tactful one, described step 2) detailed step as follows:
A2.1) receive original CNF formula S to be solved1, Husk formula S2Solve Hr with the Husk of Husk formula, obtain original
CNF formula S1In clause's average length AL;
A2.2) from original CNF formula S1One untreated clause C is as current clause for middle taking-up;
A2.3) from described Husk solution Hr, obtain a word lit at random, be added to former after described word lit is negated
Beginning CNF formula S1Current clause C in;
A2.4) judge original CNF formula S1All clauses whether be disposed, if being not yet disposed, redirecting and continuing
Continuous execution step A2.2);Otherwise, obtain the CNF formula S that all clauses have added word1, redirect execution step A2.5);
A2.5) added the CNF formula S of word from described all clauses1Middle take out untreated clause C as working as
Front clause;
A2.6) judge whether length | C | of current clause C is less than described original CNF formula S1In clause's average length
AL, then redirects execution step A2.7 if less than described clause's average length AL), otherwise redirect execution step A2.8);
A2.7) from described Husk solution Hr, obtain an anti-word lit being not belonging in current clause C at random, will be described
Word lit is added to the CNF formula S that described all clauses have added word after negating1In current clause C in;
A2.8) judge described all clauses added word after CNF formula S1All clauses whether be disposed, such as
Fruit is not yet disposed, and redirects and continues executing with step A2.5);Otherwise obtain the CNF formula that all clauses add word again
S1, redirect execution step A2.9);
A2.9) described all clauses are added again the CNF formula S of word1In variable var, Husk formula S2In change
Amount var carries out rearrangement mixing, generates one for each variable var and describes variable var and variable var in rearrangement
Affiliated original CNF formula S before mixing1Or Husk formula S2The list item of both mapping relations, finally gives variable mappings table M;
A2.10) described all clauses are added again the CNF formula S of word1, Husk formula S2In clause's hybrid-sorting
Obtain having and original CNF formula S1The new CNF formula S of different CNF structures;
A2.11) variable mappings table M and new CNF formula S are exported.
As optional tactful two, described step 2) detailed step as follows:
B2.1) receive original CNF formula S to be solved1, Husk formula S2Solve Hr with the Husk of Husk formula;Detect and mark
Remember and original CNF formula S1In key clause and output variable, initialize clause set S3For sky;
B2.2) from original CNF formula S1One untreated clause C is as current clause for middle taking-up;
B2.3) judge whether current clause C is key clause, if current clause C is key clause, redirects and continue to hold
Row step B2.4);Otherwise redirect execution step B2.2);
B2.4) from described Husk solution Hr, obtain a word lit at random, be added to former after described word lit is negated
Beginning CNF formula S1Current clause C in;
B2.5) obtain the output character olit of current clause C, by the output character of described word lit, current clause C
Olit value of the inverted-olit combination produces new clause nC, and described new clause nC is put into clause set S3In;
B2.6) judge original CNF formula S1All clauses whether be disposed, if being not yet disposed, redirecting and continuing
Continuous execution step B2.2), otherwise, obtain the CNF formula S after all clauses have added word1With the son being made up of new clause nC
Sentence set S3, redirect execution step B2.7);
B2.7) obtain Husk formula S2In clause's average length AL;
B2.8) the CNF formula S after described all clauses have added word1With the clause set S being made up of new clause nC3
A untreated clause C is taken out as current clause in the merging set constituting;
B2.9) judge whether the length of current clause C is less than described Husk formula S2In clause's average length AL, if
Then redirect less than described clause's average length AL and continue executing with step B2.10);Otherwise redirect execution step B2.8);
B2.10) from described Husk solution Hr, obtain an anti-word lit being not belonging in current clause C at random, will be described
Word lit is respectively added to the CNF formula S after all clauses have added word after negating1, the clause set that is made up of new clause nC
Close S3In corresponding current clause C;
B2.11) judge described all clauses added word after CNF formula S1With the clause set being made up of new clause nC
Close S3Whether all clauses merging in set constituting are disposed, if being not yet disposed, redirecting and continuing executing with step
B2.8), otherwise obtain the CNF formula S that all clauses add word again1Add the clause set S of word with clause3, redirect
Execution step B2.12);
B2.12) described all clauses are added again the CNF formula S of word1In variable var, Husk formula S2In
Variable var carries out rearrangement mixing, generates one for each variable var and describes variable var and variable var and again arranging
Affiliated original CNF formula S before sequence mixing1Or Husk formula S2The list item of both mapping relations, finally gives variable mappings table M;
B2.13) described all clauses are added again the CNF formula S of word1, Husk formula S2, clause added word
Clause set S3In clause's hybrid-sorting obtain having and original CNF formula S1The new CNF formula S of different CNF structures;
B2.14) variable mappings table M and new CNF formula S are exported.
As optional tactful three, described step 2) detailed step as follows:
C2.1) receive original CNF formula S to be solved1, Husk formula S2Solve Hr with the Husk of Husk formula;Detect and mark
Remember and original CNF formula S1In key clause and output variable, initialize clause set S3For sky;
C2.2) from original CNF formula S1One untreated clause C is as current clause for middle taking-up;
C2.3) from described Husk solution Hr, obtain a word lit at random, be added to former after described word lit is negated
Beginning CNF formula S1Current clause C in;
C2.4) judge that current clause C, whether as key clause, if current clause C is key clause, obtains currently son
The output character olit of sentence C, the output character olit value of the inverted-olit combination of described word lit, current clause C is produced
Tissue regeneration promoting clause nC, described new clause nC is put into clause set S3In;
C2.5) judge original CNF formula S1All clauses whether be disposed, if being not yet disposed, redirecting and continuing
Continuous execution step C2.2), otherwise, obtain the CNF formula S after all clauses have added word1With the son being made up of new clause nC
Sentence set S3, redirect execution step C2.6);
C2.6) obtain Husk formula S2In clause's average length AL;
C2.7) the CNF formula S after described all clauses have added word1With the clause set S being made up of new clause nC3
A untreated clause C is taken out as current clause in the merging set constituting;
C2.8) judge whether the length of current clause C is less than described Husk formula S2In clause's average length AL, if
Then redirect less than described clause's average length AL and continue executing with step C2.9);Otherwise redirect execution step C2.7);
C2.9) from described Husk solution Hr, obtain an anti-word lit being not belonging in current clause C at random, will be described
Word lit is respectively added to the CNF formula S after all clauses have added word after negating1, the clause set that is made up of new clause nC
Close S3In corresponding current clause C;
C2.10) judge described all clauses added word after CNF formula S1With the clause set being made up of new clause nC
Close S3Whether all clauses merging in set constituting are disposed, if being not yet disposed, redirecting and continuing executing with step
C2.7), otherwise obtain the CNF formula S that all clauses add word again1Add the clause set S of word with clause3, redirect
Execution step C2.11);
C2.11) described all clauses are added again the CNF formula S of word1In variable var, Husk formula S2In
Variable var carries out rearrangement mixing, generates one for each variable var and describes variable var and variable var and again arranging
Affiliated original CNF formula S before sequence mixing1Or Husk formula S2The list item of both mapping relations, finally gives variable mappings table M;
C2.12) described all clauses are added again the CNF formula S of word1, Husk formula S2, clause added word
Clause set S3In clause's hybrid-sorting obtain having and original CNF formula S1The new CNF formula S of different CNF structures;
C2.13) variable mappings table M and new CNF formula S are exported.
The CNF formula data guard method tool that SAT problem disclosed by the invention calculates in outsourcing has the advantage that:This CNF
Formula data guard method, by original CNF formula S1In an embedded Husk formula S2, generate new CNF formula S, keeping
On the premise of solution space is constant, hide original CNF formula S1In structural information, it can be avoided that SAT problem calculate sub-contract management
In structural information leakage.Data after obscuring through method disclosed by the invention can be used directly original SAT algorithm and SAT asks
Solution device is calculated, without calculate after deciphering so that far-end server do not know the actual content of calculating in the case of carry
For calculating service such that it is able to help user quickly application to be deployed to the new model that cloud computing and grid computing etc. calculate outsourcing
In.
Brief description
The logical construction schematic diagram of the exemplary circuit that Fig. 1 illustrates for Tseitin coding principle.
Fig. 2 is the AND3 hypergraph of the exemplary circuit shown in Fig. 1.
Fig. 3 is the AND3 Directed Hypergraph of the exemplary circuit shown in Fig. 1.
Fig. 4 is bis- points of hypergraphs of AND3 of the exemplary circuit shown in Fig. 1.
Fig. 5 is the basic implementation process diagram of present invention method.
Fig. 6 is the system principle structural representation of application present invention method.
Fig. 7 is the schematic flow sheet generating Husk formula in the embodiment of the present invention.
Fig. 8 is embodiment of the present invention step 2) schematic flow sheet of optional implementation strategy one.
Fig. 9 is embodiment of the present invention step 2) schematic flow sheet of optional implementation strategy two.
Figure 10 is embodiment of the present invention step 2) schematic flow sheet of optional implementation strategy three.
Figure 11 be embodiment of the present invention step 4) implementation process diagram.
Specific embodiment
As shown in figure 5, the present embodiment SAT problem calculates the implementation steps of the CNF formula data guard method in outsourcing such as
Under:
1) generate Husk formula S2, Husk formula S2For only having a CNF formula that can meet solution, and Husk formula S2Solution
The assignment of variable is not full 0 or complete 1, and can meet solution is to instigate CNF formula to be really to solve;
2) original CNF formula S to be solved in outsourcing will be calculated1, Husk formula S2Both, to keep solution space not to be changed into
Premise is obscured generation and is had and original CNF formula S1The new CNF formula S of different CNF structures, and generate and be used for recording original CNF
Formula S1, Husk formula S2The variable mappings table M of mapping relations, each of variable mappings table M table between both and its variable
Item includes var domain and formula domain Gong Liangge domain, and wherein var domain is used for storing original CNF formula S1Or Husk formula S2Central Plains
The variable name beginning, the source of the corresponding variable name of formula domain representation;
3) data to be solved is converted to CNF formula data using new CNF formula S and is outsourced to far-end server, utilize
On far-end server, existing SAT solver solves to the CNF formula data receiving and obtains obscuring solution Or;
4) it is directed to and obscures each of solution Or solution word lit, take out solution word lit corresponding variable var, and according to solution
Word lit corresponding variable var takes out corresponding real variable rvar from variable mappings table M, if this real variable rvar
Variable mappings table M is labeled and is mapped from original CNF formula S1, then this real variable is filled to primitive solution R, finally gives
Obscure solution corresponding primitive solution R of Or.
The present embodiment step 2) in obscure generation and have and original CNF formula S1During the new CNF formula S of different CNF structures
Need to follow two principles:(1) original CNF formula S1, both new CNF formula S keep solution space constant;(2) original CNF formula
S1, both new CNF formula S there are different CNF structures.Solution space is constant to refer to original CNF formula S1, new CNF formula S can adopt
Exactly the same SAT solver solved and both solutions between there is following relation:Original CNF formula S1Can not meet then
New CNF formula S can not meet, otherwise new CNF formula S can not meet then original CNF formula S1Can not meet, if original CNF
Formula S1Can meet, new CNF formula S can meet, original CNF formula S1Solution can be public in original CNF by the solution of new CNF formula
Formula S1Variables set on projection obtain;Different CNF structures refer to original CNF formula S1, the clause's set between new CNF formula S with
And the word set in clause is all different.Based on above-mentioned two principle, CNF formula data can be outsourced to far-end server
Before (such as Cloud Server or grid service server), it is carried out deforming and obscure to hide the structural information comprising, not affect
The problem of SAT normally solves, ensure that the CNF formula after obscuring can also be solved using original SAT solver.
From the point of view of cryptography, Husk formula S2It is a key, be used for encrypting original CNF formula S to be solved1.
Husk formula S2The only one CNF formula that can meet solution, and solve the assignment of variable be non-specific (be not full 0 or complete
1).Husk formula S2In the variable that comprises be referred to as Husk variable.Husk formula S2In the clause that comprises be referred to as Husk clause.Composition
Those words of Husk solution, referred to as Husk word.Such as expression formulaIn,It is simplest Husk formula, wherein
Comprise two Husk variables of x1, x2, comprise x1 andTwo clauses, and only one of which solution { x1=1, x2=0 }, are expressed as
Solution written formHusk formula S is generated using based on prime factor decomposition method in the present embodiment2, as shown in fig. 7,
The present embodiment step 1) middle generation Husk formula S2Detailed step as follows:
1.1) generate a prime number p, prime number p is adopted binary vector X=<x1,x2…,xn>Form represent;
1.2) to using binary vector X=<x1,x2…,xn>The prime number p squared (O=p*p) representing;
1.3) value O after squared for the prime number as the output variable of multiplier and is forbidden that the input variable of multiplier is equal to
1 (i.e.:), multiplier is converted to CNF formula and (using Tseitin coding, multiplier is converted to
CNF formula,), this CNF formula is only one tax that can meet solution and solution variable that generation obtains
Value is not full 0 or complete 1 Husk formula S2.
In the present embodiment, step 1) also include generating Husk formula S2Husk solve Hr step, particular by Hr=p
| p is to using binary vector X=<x1,x2…,xn>The prime number p representing is calculated Husk solution Hr;Step 4) according to solution literary composition
When word lit corresponding variable var takes out corresponding real variable rvar from variable mappings table M, if this real variable rvar
Variable mappings table M is labeled and is mapped from Husk formula S2, then by this real variable rvar and corresponding tax in Husk solution Hr
Value Hr [rvar] is compared checking, if checking is inconsistent, judges that far-end server solves error to CNF formula data, defeated
Make mistake and exit.
Assume original CNF formula S1Comprise 3 variable a, b, c, Husk formula S2Comprise d, the e of 2 variables, then original CNF
Formula S1, Husk formula S2The new CNF formula S that mixing generates can comprise 5 variables.Data to be solved is being used by the present embodiment
Before new CNF formula S is converted to CNF formula data and is outsourced to far-end server, using variable mappings table M, variable name is carried out
Mapping, that is,:These variables are renamed, for example a, b, c, d, e=>3,5,2, Isosorbide-5-Nitrae, see off is exactly 1,2,3,4,5 to be
The formula of variable name.The variable mappings table M now generating is as shown in Table 2.
Table two:The content table of the variable mappings table M generating.
Obscure rear variable name | Var domain | Formula domain |
1 | d | S2 |
2 | c | S1 |
3 | a | S1 |
4 | e | S2 |
5 | b | S1 |
It should be noted that be only that the content to variable mappings table M is illustrated herein.
Because original CNF formula S1, Husk formula S2Between do not occur simultaneously clause, that is, do not exist clause both comprised former
Beginning CNF formula S1In variable, comprise Husk formula S again2In variable.If without step 2 in the present embodiment) obscure,
Then only by the mode that variable name remaps, the variable of two formula is mixed, generally with a very simple subregion
(partition) algorithm just can be by original CNF formula S1, Husk formula S2Make a distinction, so will result in original CNF public
Formula S1Intactly expose under third party's environment.Through step 2 in the present embodiment) obscure, in original CNF formula S1Clause in
Add Husk formula S2Variable, and utilize original CNF formula S1In variable and Husk formula S2In structure's variable new
Clause, the CNF formula S after obscuring1Clause, Husk formula S2And between the clause of neotectonics, can there is substantial amounts of change
Amount is occured simultaneously, so original CNF formula S1With Husk formula S2Figure (hypergraph, bipartite graph) just seamless mixing, use
Partitioning algorithm is impossible to make a distinction both.
As shown in fig. 6, the client of application the present embodiment, before carrying out calculating outsourcing, will execute step by generator first
Rapid 1), generates Husk formula S2And generate Husk formula S2Husk solution Hr;Then pass through obfuscator will wait to ask in calculating outsourcing
The original CNF formula S of solution1, Husk formula S2Both mixing generations premised on keeping solution space constant have public with original CNF
Formula S1The new CNF formula S of different CNF structures, and generate and be used for recording original CNF formula S1, Husk formula S2Both and its variable
Between mapping relations variable mappings table M;Again data to be solved is converted to CNF formula data outsourcing using new CNF formula S
To far-end server (such as Cloud Server or grid service server), using SAT solver (SAT existing on far-end server
Solver) the CNF formula data receiving is solved and obtain obscuring solution Or;Finally, client passes through de-mapping device, for obscuring solution
Each of Or solves word lit, takes out solution word lit corresponding variable var, and according to solution word lit corresponding variable var
Take out corresponding real variable rvar from variable mappings table M, if this real variable rvar is labeled in variable mappings table M
Map to original CNF formula S1, then this real variable is filled to primitive solution R, is obscured eventually through de-mapping device mapping
Solution corresponding primitive solution R of Or.Wherein, SAT solver (SAT Solver) is located at far-end server (such as Cloud Server or net
Lattice server) on, generator, obfuscator, de-mapping device are then respectively positioned in client, for calculating outsourcing service device, its
That input is the CNF formula data S after obscuring, and obscuring of output solves Or.
In the present embodiment, the Obfuscating Algorithms that obfuscator is used follow 4 rules that the embedding method table of table three provides,
Original CNF formula S1In embedded Husk formula S2In clause and variable, thus changing original CNF formula S1Clause set and
The word set of clause, generates new CNF formula S.In the present embodiment, include altogether embedding method 1.~embedding method 4. totally 4 bases
This embedding method, specifically as shown in Table 3.
Table three:Embedding method table.
In the present embodiment, based on 4 basic embedding methods in embedding method table, above-mentioned 4 basic embedding for obfuscator
Enter rule to be used alone and must be applied in combination, can be only achieved the purpose keeping solution space.For efficiency and aliasing effect
Consideration, the present embodiment can adopt following three kinds of strategies as needed.Three kinds of strategies all can change original CNF formula S1's
CNF structure, including the form of the CNF labelling of door, key clause, can effectively stop based on pattern match and Subgraph Isomorphism technology
The attack of circuit structure recovery algorithms.And, no matter any embedding strategy, it is by step 2) when that input is original CNF
Formula S1, Husk formula S2, solution Hr of Husk formula;Output obscure after new CNF formula S and variable mappings table M.
Strategy one:Strategy one employ embedding method 1., embedding method 3. with embedding method 4..Follow embedding method 1.,
For original CNF formula S to be solved1Each clause adds word, and ensures original CNF formula S1The basic phase of length of each clause
When;Follow embedding method and 3. obtain new CNF formula S;Follow embedding method and 4. obtain variable mappings table M.
As shown in figure 8, based on strategy one step 2) detailed step as follows:
A2.1) receive original CNF formula S to be solved1, Husk formula S2Solve Hr with the Husk of Husk formula, obtain original
CNF formula S1In clause's average length AL;
A2.2) from original CNF formula S1One untreated clause C is as current clause for middle taking-up;
A2.3) from Husk solution Hr, obtain a word lit at random, after word lit is negated, be added to original CNF formula
S1Current clause C in;
A2.4) judge original CNF formula S1All clauses whether be disposed, if being not yet disposed, redirecting and continuing
Continuous execution step A2.2);Otherwise, obtain the CNF formula S that all clauses have added word1, redirect execution step A2.5);
A2.5) added the CNF formula S of word from all clauses1One untreated clause C is as current son for middle taking-up
Sentence;
A2.6) judge whether length | C | of current clause C is less than original CNF formula S1In clause's average length AL, such as
Fruit then redirects execution step A2.7 less than clause's average length AL), otherwise redirect execution step A2.8);
A2.7) from Husk solution Hr, obtain an anti-word lit being not belonging in current clause C at random, word lit is taken
It is added to, after anti-, the CNF formula S that all clauses have added word1In current clause C in;
A2.8) judge all clauses added word after CNF formula S1All clauses whether be disposed, if still
Untreated finish, redirect and continue executing with step A2.5);Otherwise obtain the CNF formula S that all clauses add word again1, jump
Turn execution step A2.9);
A2.9) all clauses are added again the CNF formula S of word1In variable var, Husk formula S2In variable
Var carries out rearrangement mixing, and generating one for each variable var, to describe variable var and variable var mixed in rearrangement
Affiliated original CNF formula S before conjunction1Or Husk formula S2The list item of both mapping relations, finally gives variable mappings table M;
A2.10) all clauses are added again the CNF formula S of word1, Husk formula S2In clause's hybrid-sorting obtain
Have and original CNF formula S1The new CNF formula S of different CNF structures;
A2.11) variable mappings table M and new CNF formula S are exported.
Referring to abovementioned steps A2.1)~A2.11) understand, strategy one employ embedding method 1., embedding method 3. and embedded
Rule 4., strategy one be a kind of blindness obscure method, by random add positive and negative word by way of, randomly change each
Individual clause, changes original CNF formula S1The fact that the CNF labelling of middle same class door, certainty are identical, can effectively stop based on son
The attack of the circuit structure recovery algorithms of isomorphism of graph detection, it realizes simple, and it is little to obscure expense, only linear complexity.Strategy
One shortcoming is that graph structure is changed is fuzzy, and not as strategy two and strategy three precisely, but a tactful advantage is to obscure institute
Spend time comparatively short it is possible to prevent based on CNF labelling pattern match attack.
Strategy two:Strategy two employ embedding method 1., embedding method 2., embedding method 3. with embedding method 4..First
In original CNF formula S1Key clause and output variable that middle detection is gone out;Follow embedding method 1., to be solved original
CNF formula S1Key clause in add Husk formula S2Variable var;Follow embedding method 2., be variable var and key
The corresponding output character of sentence generates new clause, and written form in new clause for the output character determines according to key clause;Abide by
Follow embedding method and 3. obtain new CNF formula S;Follow embedding method and 4. obtain variable mappings table M.
As shown in figure 9, based on strategy two step 2) detailed step as follows:
B2.1) receive original CNF formula S to be solved1, Husk formula S2Solve Hr with the Husk of Husk formula;Detect and mark
Remember and original CNF formula S1In key clause and output variable, initialize clause set S3For sky;
B2.2) from original CNF formula S1One untreated clause C is as current clause for middle taking-up;
B2.3) judge whether current clause C is key clause, if current clause C is key clause, redirects and continue to hold
Row step B2.4);Otherwise redirect execution step B2.2);
B2.4) from Husk solution Hr, obtain a word lit at random, after word lit is negated, be added to original CNF formula
S1Current clause C in;
B2.5) obtain the output character olit of current clause C, the output character olit of word lit, current clause C is taken
Value-olit combination after anti-produces new clause nC, and new clause nC is put into clause set S3In;
B2.6) judge original CNF formula S1All clauses whether be disposed, if being not yet disposed, redirecting and continuing
Continuous execution step B2.2), otherwise, obtain the CNF formula S after all clauses have added word1With the son being made up of new clause nC
Sentence set S3, redirect execution step B2.7);
B2.7) obtain Husk formula S2In clause's average length AL;
B2.8) the CNF formula S after all clauses have added word1With the clause set S being made up of new clause nC3Constitute
Merging set in take out a untreated clause C as current clause;
B2.9) judge whether the length of current clause C is less than Husk formula S2In clause's average length AL, if less than
Clause's average length AL then redirects and continues executing with step B2.10);Otherwise redirect execution step B2.8);
B2.10) from Husk solution Hr, obtain an anti-word lit being not belonging in current clause C at random, by word lit
It is respectively added to the CNF formula S after all clauses have added word after negating1, the clause set S that is made up of new clause nC3Corresponding
Current clause C in;
B2.11) judge all clauses added word after CNF formula S1With the clause set S being made up of new clause nC3
Whether all clauses merging in set constituting are disposed, if being not yet disposed, redirecting and continuing executing with step
B2.8), otherwise obtain the CNF formula S that all clauses add word again1Add the clause set S of word with clause3, redirect
Execution step B2.12);
B2.12) all clauses are added again the CNF formula S of word1In variable var, Husk formula S2In variable
Var carries out rearrangement mixing, and generating one for each variable var, to describe variable var and variable var mixed in rearrangement
Affiliated original CNF formula S before conjunction1Or Husk formula S2The list item of both mapping relations, finally gives variable mappings table M;
B2.13) all clauses are added again the CNF formula S of word1, Husk formula S2, clause added the son of word
Sentence set S3In clause's hybrid-sorting obtain having and original CNF formula S1The new CNF formula S of different CNF structures;
B2.14) variable mappings table M and new CNF formula S are exported.
Referring to abovementioned steps B2.1)~B2.14) understand, strategy two employ embedding method 1., embedding method 2., embedded
3. with embedding method 4., the CNF labelling of a kind of is changed into another legal CNF mark pattern, pin to rule by strategy two
Corresponding new clause is constructed to key clause, former CNF formula is changed into different but legal CNF formula, is that one kind accurately changes
The method becoming graph structure;Due to the architectural characteristic of CNF formula to be obscured will be analyzed, to determine key clause and output variable, pole
The earth improves the detection difficulty of door in CNF, can achieve accurately door CNF labelling modification.
Strategy three:Strategy three also use embedding method 1., embedding method 2., embedding method 3. with embedding method 4., its
Mixing for strategy one and strategy two is realized.First in original CNF formula S to be solved1The key clause that middle detection is gone out and
Output variable;Follow embedding method 1., sequentially toward original CNF formula S1Clause add word;In original CNF formula S1In
Key clause in;Type according to key clause, it then follows 2. embedding method is to add original CNF formula S1In variable var
Output literary composition olit corresponding with keyword phrase C generates new clause, and output character is sub according to key in the written form of new clause
Sentence is determined;Follow embedding method 1., in formula S1Word is added, until clause's length is basic in clause and newly-generated clause
Quite;Follow embedding method and 3. obtain formula S;Follow embedding method and 4. obtain variable mappings table.
As shown in Figure 10, based on strategy three step 2) detailed step as follows:
C2.1) receive original CNF formula S to be solved1, Husk formula S2Solve Hr with the Husk of Husk formula;Detect and mark
Remember and original CNF formula S1In key clause and output variable, initialize clause set S3For sky;
C2.2) from original CNF formula S1One untreated clause C is as current clause for middle taking-up;
C2.3) from Husk solution Hr, obtain a word lit at random, after word lit is negated, be added to original CNF formula
S1Current clause C in;
C2.4) judge that current clause C, whether as key clause, if current clause C is key clause, obtains currently son
The output character olit of sentence C, the output character olit value of the inverted-olit combination of word lit, current clause C is produced new
Clause nC, new clause nC is put into clause set S3In;
C2.5) judge original CNF formula S1All clauses whether be disposed, if being not yet disposed, redirecting and continuing
Continuous execution step C2.2), otherwise, obtain the CNF formula S after all clauses have added word1With the son being made up of new clause nC
Sentence set S3, redirect execution step C2.6);
C2.6) obtain Husk formula S2In clause's average length AL;
C2.7) the CNF formula S after all clauses have added word1With the clause set S being made up of new clause nC3Constitute
Merging set in take out a untreated clause C as current clause;
C2.8) judge whether the length of current clause C is less than Husk formula S2In clause's average length AL, if less than
Clause's average length AL then redirects and continues executing with step C2.9);Otherwise redirect execution step C2.7);
C2.9) from Husk solution Hr, obtain an anti-word lit being not belonging in current clause C at random, word lit is taken
It is respectively added to the CNF formula S after all clauses have added word after anti-1, the clause set S that is made up of new clause nC3Corresponding
In current clause C;
C2.10) judge all clauses added word after CNF formula S1With the clause set S being made up of new clause nC3
Whether all clauses merging in set constituting are disposed, if being not yet disposed, redirecting and continuing executing with step
C2.7), otherwise obtain the CNF formula S that all clauses add word again1Add the clause set S of word with clause3, redirect
Execution step C2.11);
C2.11) all clauses are added again the CNF formula S of word1In variable var, Husk formula S2In variable
Var carries out rearrangement mixing, and generating one for each variable var, to describe variable var and variable var mixed in rearrangement
Affiliated original CNF formula S before conjunction1Or Husk formula S2The list item of both mapping relations, finally gives variable mappings table M;
C2.12) all clauses are added again the CNF formula S of word1, Husk formula S2, clause added the son of word
Sentence set S3In clause's hybrid-sorting obtain having and original CNF formula S1The new CNF formula S of different CNF structures;
C2.13) variable mappings table M and new CNF formula S are exported.
Referring to abovementioned steps C2.1)~C2.13), strategy three also use embedding method 1., embedding method 2., embedded rule
Then 3. with embedding method 4., construct corresponding new clause for key clause, strategy three is a kind of to change and fuzzy change accurate
Become the one kind combining, it, by strategy one and strategy two combination, can make full use of strategy one and the aliasing effect of strategy two,
Except constructing new CNF formula for key clause, all of clause is changed, the effect obscured is best, but the most time-consuming.
As shown in figure 11, the present embodiment pass through de-mapping device execution step 4) detailed step as follows:
4.1) take out untreated solution word lit solution Or as currently solving word from obscuring;
4.2) judge current to solve whether word lit is more than 0, if greater than 0 initial value using current solution word lit as working as
Front solution word lit corresponding variable var, as the current solution corresponding variable of word lit after otherwise negating current solution word lit
(judgment expression is var=lit to var>0?lit:-lit);
4.3) current solution word lit corresponding variable var is used as the index in var domain in variable mappings table M, from variable
Corresponding real variable rvar is taken out, i.e. rvar=M [var] .var in mapping table M;
4.4) judge value M in formula domain in real variable rvar Corresponding matching list item in variable mappings table M
Whether [rvar] .formula is original CNF formula S1(judge M [rvar] .formula==S1Whether set up), if
(i.e. M [rvar] .formula==S1Set up) then represent real variable rvar in variable mappings table M labeled map to former
Beginning CNF formula S1, then redirect execution step 4.5);Otherwise (i.e. M [rvar] .formula==S1It is false) represent this actual change
Amount rvar is labeled in variable mappings table M to map to Husk formula S2, redirect execution step 4.6);
4.5) judge that the current word lit that solves, whether more than 0, fills real variable rvar to primitive solution R if greater than 0
Corresponding assignment R [rvar] (i.e. R [rvar]=rvar) of middle real variable rvar, fills after otherwise negating real variable rvar
Corresponding assignment R of real variable rvar [rvar] (i.e. R [rvar]=- rvar) to primitive solution R, the expression formula of above-mentioned judgement can
It is expressed as (R [rvar]=(lit>0?rvar:-rvar));Redirect execution step 4.8);
4.6) judge that the current word lit that solves, whether more than 0, if currently solution word lit is more than 0, judges real variable
Whether rvar, real variable rvar corresponding assignment Hr [rvar] in Husk solution Hr is consistent, redirects execution step 4.7);If
Current solution word lit is not more than 0, then judge that real variable rvar value of the inverted-rvar, real variable rvar solve Hr in Husk
In corresponding assignment Hr [rvar] whether consistent, redirect execution step 4.7);The expression formula of above-mentioned judgement is represented by (Hr
[rvar]==(lit>0?rvar:-rvar));
4.7) if corresponding assignment Hr [rvar] is consistent in Husk solution Hr with real variable rvar, redirect and execute step
Rapid 4.8);Otherwise judge far-end server to CNF formula data solving result mistake, report an error (printout " result mistake ") and
Exit;
4.8) judge whether all solution words obscuring solution Or are disposed, if being not yet disposed, redirecting and executing step
Rapid 4.1), otherwise represent that primitive solution R has been filled with finishing, and obtain obscuring solution corresponding primitive solution R of Or.
Above-mentioned steps 4.1)~4.8) be a kind of de-mapping algorithm specially MAPPER algorithm with result verification, for from
Recover actual solution vector R of primitive solution in solution vector Or that cloud server is given.Wherein, step 4.6)~4.7) for portion
Variation per minute assignment be sampled detect, that is, to real variable rvar, real variable rvar Husk solution Hr in corresponding assignment
Hr [rvar] is sampled detecting, thus realizing the verification of correctness of cloud server result of calculation it is ensured that data is reliable.
The above is only the preferred embodiment of the present invention, and protection scope of the present invention is not limited merely to above-mentioned enforcement
Example, all technical schemes belonging under thinking of the present invention belong to protection scope of the present invention.It should be pointed out that for the art
Those of ordinary skill for, some improvements and modifications without departing from the principles of the present invention, these improvements and modifications
Should be regarded as protection scope of the present invention.
Claims (6)
1. the CNF formula data guard method in a kind of SAT problem calculating outsourcing is it is characterised in that implementation steps are as follows:
1) generate Husk formula S2, described Husk formula S2For only having a CNF formula that can meet solution, and described Husk formula
S2The assignment of solution variable is not full 0 or complete 1;
2) original CNF formula S to be solved in outsourcing will be calculated1, described Husk formula S2Before both are to keep solution space not to be changed into
Carry and obscure generation and have and original CNF formula S1The new CNF formula S of different CNF structures, and generate that to be used for recording original CNF public
Formula S1, Husk formula S2The variable mappings table M, each of described variable mappings table M of mapping relations between both and its variable
List item includes var domain and formula domain Gong Liangge domain, and wherein var domain is used for storing original CNF formula S1Or Husk formula S2In
Original variable name, the source of the corresponding variable name of formula domain representation;Described solution space is constant to refer to original CNF formula S1, new
CNF formula S can be solved using identical SAT solver and both solutions between there is following relation:Original CNF
Formula S1Can not meet, new CNF formula S can not meet, otherwise new CNF formula S can not meet then original CNF formula S1Can not expire
Foot, if original CNF formula S1Can meet, new CNF formula S can meet, original CNF formula S1Solution can pass through new CNF formula
Solution in original CNF formula S1Variables set on projection obtain;Described difference CNF structure refers to original CNF formula S1, new CNF public
Clause's set between formula S and the word set in clause are all different;
3) data to be solved is converted to CNF formula data and is outsourced to far-end server using new CNF formula S, using far-end
On server, existing SAT solver solves to the CNF formula data receiving and obtains obscuring solution Or;
4) it is directed to and obscures each of solution Or solution word lit, take out solution word lit corresponding variable var, and according to solution word
Lit corresponding variable var takes out corresponding real variable rvar from variable mappings table M, if this real variable rvar is becoming
It is labeled in amount mapping table M and be mapped from original CNF formula S1, then this real variable is filled to primitive solution R, finally gives and obscure
Solution corresponding primitive solution R of Or;
Described step 1) also include generating Husk formula S2Husk solve Hr step;Described step 4) according to solution word lit pair
When the variable var answering takes out corresponding real variable rvar from variable mappings table M, if this real variable rvar reflects in variable
It is labeled in firing table M and be mapped from Husk formula S2, then by this real variable rvar and corresponding assignment Hr in described Husk solution Hr
[rvar] is compared checking, if checking is inconsistent, judges that far-end server solves error to CNF formula data, output is wrong
Miss and exit.
2. SAT problem according to claim 1 calculates CNF formula data guard method in outsourcing it is characterised in that institute
State step 1) middle generation Husk formula S2Detailed step as follows:
1.1) generate a prime number, described prime number is represented in the form of binary vector;
1.2) prime number described employing binary vector being represented is squared;
1.3) value after will be squared for described prime number as the output variable of multiplier and forbids that the input variable of multiplier is equal to
1, described multiplier is converted to CNF formula, this CNF formula as generates only obtaining and can meet solution and solve variable
Assignment be not full 0 or complete 1 Husk formula S2.
3. SAT problem according to claim 2 calculates CNF formula data guard method in outsourcing it is characterised in that institute
State step 4) detailed step as follows:
4.1) from described obscure take out untreated solution word lit solution Or as currently solving word;
4.2) judge that the current word lit that solves, whether more than 0, solves as current if greater than 0 initial value using current solution word lit
Word lit corresponding variable var, as current solution word lit corresponding variable var after otherwise negating current solution word lit;
4.3) described current solution word lit corresponding variable var is used as the index in var domain in variable mappings table M, from described
Corresponding real variable rvar is taken out in variable mappings table M;
4.4) judge value M in formula domain in described real variable rvar Corresponding matching list item in variable mappings table M
Whether [rvar] .formula is original CNF formula S1, if it is represent described real variable rvar in variable mappings table M
It is labeled and map to original CNF formula S1, then redirect execution step 4.5);Otherwise represent this real variable rvar in variable mappings
It is labeled in table M and map to Husk formula S2, redirect execution step 4.6);
4.5) judge that the current word lit that solves, whether more than 0, fills described real variable rvar to primitive solution R if greater than 0
Corresponding assignment R [rvar] of middle real variable rvar, fills to primitive solution R real after otherwise negating described real variable rvar
Corresponding assignment R of border variable rvar [rvar];Redirect execution step 4.8);
4.6) judge that the current word lit that solves, whether more than 0, if currently solution word lit is more than 0, judges described real variable
Whether rvar, real variable rvar corresponding assignment Hr [rvar] in described Husk solution Hr is consistent, redirects execution step 4.7);
If currently solution word lit is not more than 0, judge that described real variable rvar value of the inverted-rvar, real variable rvar exist
In described Husk solution Hr, whether corresponding assignment Hr [rvar] is consistent, redirects execution step 4.7);
4.7) if corresponding assignment Hr [rvar] is consistent in described Husk solution Hr with real variable rvar, redirect and execute step
Rapid 4.8);Otherwise judge that far-end server, to CNF formula data solving result mistake, reports an error and exits;
4.8) whether all solution words obscuring solution Or described in judgement are disposed, if being not yet disposed, redirecting and executing step
Rapid 4.1), otherwise represent that primitive solution R has been filled with finishing, and obtain obscuring solution corresponding primitive solution R of Or.
4. SAT problem according to claim 3 calculates CNF formula data guard method in outsourcing it is characterised in that institute
State step 2) detailed step as follows:
A2.1) receive original CNF formula S to be solved1, Husk formula S2Solve Hr with the Husk of Husk formula, obtain original CNF
Formula S1In clause's average length AL;
A2.2) from original CNF formula S1One untreated clause C is as current clause for middle taking-up;
A2.3) from described Husk solution Hr, obtain a word lit at random, after described word lit is negated, be added to original CNF
Formula S1Current clause C in;
A2.4) judge original CNF formula S1All clauses whether be disposed, if being not yet disposed, redirecting and continuing to hold
Row step A2.2);Otherwise, obtain the CNF formula S that all clauses have added word1, redirect execution step A2.5);
A2.5) added the CNF formula S of word from described all clauses1One untreated clause C is as current son for middle taking-up
Sentence;
A2.6) judge whether length | C | of current clause C is less than described original CNF formula S1In clause's average length AL, such as
Fruit then redirects execution step A2.7 less than described clause's average length AL), otherwise redirect execution step A2.8);
A2.7) from described Husk solution Hr, obtain an anti-word lit being not belonging in current clause C at random, by described word
Lit is added to the CNF formula S that described all clauses have added word after negating1In current clause C in;
A2.8) judge described all clauses added word after CNF formula S1All clauses whether be disposed, if still
Untreated finish, redirect and continue executing with step A2.5);Otherwise obtain the CNF formula S that all clauses add word again1, jump
Turn execution step A2.9);
A2.9) described all clauses are added again the CNF formula S of word1In variable var, Husk formula S2In variable
Var carries out rearrangement mixing, and generating one for each variable var, to describe variable var and variable var mixed in rearrangement
Affiliated original CNF formula S before conjunction1Or Husk formula S2The list item of both mapping relations, finally gives variable mappings table M;
A2.10) described all clauses are added again the CNF formula S of word1, Husk formula S2In clause's hybrid-sorting obtain
Have and original CNF formula S1The new CNF formula S of different CNF structures;
A2.11) variable mappings table M and new CNF formula S are exported.
5. SAT problem according to claim 3 calculates CNF formula data guard method in outsourcing it is characterised in that institute
State step 2) detailed step as follows:
B2.1) receive original CNF formula S to be solved1, Husk formula S2Solve Hr with the Husk of Husk formula;Detect and mark
Original CNF formula S1In key clause and output variable, initialize clause set S3For sky;
B2.2) from original CNF formula S1One untreated clause C is as current clause for middle taking-up;
B2.3) judge whether current clause C is key clause, if current clause C is key clause, redirects and continue executing with step
Rapid B2.4);Otherwise redirect execution step B2.2);
B2.4) from described Husk solution Hr, obtain a word lit at random, after described word lit is negated, be added to original CNF
Formula S1Current clause C in;
B2.5) obtain the output character olit of current clause C, the output character olit of described word lit, current clause C is taken
Value-olit combination after anti-produces new clause nC, and described new clause nC is put into clause set S3In;
B2.6) judge original CNF formula S1All clauses whether be disposed, if being not yet disposed, redirecting and continuing to hold
Row step B2.2), otherwise, obtain the CNF formula S after all clauses have added word1With the clause set being made up of new clause nC
Close S3, redirect execution step B2.7);
B2.7) obtain Husk formula S2In clause's average length AL;
B2.8) the CNF formula S after described all clauses have added word1With the clause set S being made up of new clause nC3Constitute
Merging set in take out a untreated clause C as current clause;
B2.9) judge whether the length of current clause C is less than described Husk formula S2In clause's average length AL, if less than
Described clause's average length AL then redirects and continues executing with step B2.10);Otherwise redirect execution step B2.8);
B2.10) from described Husk solution Hr, obtain an anti-word lit being not belonging in current clause C at random, by described word
Lit is respectively added to the CNF formula S after all clauses have added word after negating1, the clause set S that is made up of new clause nC3
In corresponding current clause C;
B2.11) judge described all clauses added word after CNF formula S1With the clause set S being made up of new clause nC3
Whether all clauses merging in set constituting are disposed, if being not yet disposed, redirecting and continuing executing with step
B2.8), otherwise obtain the CNF formula S that all clauses add word again1Add the clause set S of word with clause3, redirect
Execution step B2.12);
B2.12) described all clauses are added again the CNF formula S of word1In variable var, Husk formula S2In variable
Var carries out rearrangement mixing, and generating one for each variable var, to describe variable var and variable var mixed in rearrangement
Affiliated original CNF formula S before conjunction1Or Husk formula S2The list item of both mapping relations, finally gives variable mappings table M;
B2.13) described all clauses are added again the CNF formula S of word1, Husk formula S2, clause added the son of word
Sentence set S3In clause's hybrid-sorting obtain having and original CNF formula S1The new CNF formula S of different CNF structures;
B2.14) variable mappings table M and new CNF formula S are exported.
6. SAT problem according to claim 3 calculates CNF formula data guard method in outsourcing it is characterised in that institute
State step 2) detailed step as follows:
C2.1) receive original CNF formula S to be solved1, Husk formula S2Solve Hr with the Husk of Husk formula;Detect and mark
Original CNF formula S1In key clause and output variable, initialize clause set S3For sky;
C2.2) from original CNF formula S1One untreated clause C is as current clause for middle taking-up;
C2.3) from described Husk solution Hr, obtain a word lit at random, after described word lit is negated, be added to original CNF
Formula S1Current clause C in;
C2.4) judge that current clause C, whether as key clause, if current clause C is key clause, obtains current clause C
Output character olit, will described word lit, current clause C output character olit value of the inverted-olit combination produce new
Clause nC, described new clause nC is put into clause set S3In;
C2.5) judge original CNF formula S1All clauses whether be disposed, if being not yet disposed, redirecting and continuing to hold
Row step C2.2), otherwise, obtain the CNF formula S after all clauses have added word1With the clause set being made up of new clause nC
Close S3, redirect execution step C2.6);
C2.6) obtain Husk formula S2In clause's average length AL;
C2.7) the CNF formula S after described all clauses have added word1With the clause set S being made up of new clause nC3Constitute
Merging set in take out a untreated clause C as current clause;
C2.8) judge whether the length of current clause C is less than described Husk formula S2In clause's average length AL, if less than
Described clause's average length AL then redirects and continues executing with step C2.9);Otherwise redirect execution step C2.7);
C2.9) from described Husk solution Hr, obtain an anti-word lit being not belonging in current clause C at random, by described word
Lit is respectively added to the CNF formula S after all clauses have added word after negating1, the clause set S that is made up of new clause nC3
In corresponding current clause C;
C2.10) judge described all clauses added word after CNF formula S1With the clause set S being made up of new clause nC3
Whether all clauses merging in set constituting are disposed, if being not yet disposed, redirecting and continuing executing with step
C2.7), otherwise obtain the CNF formula S that all clauses add word again1Add the clause set S of word with clause3, redirect
Execution step C2.11);
C2.11) described all clauses are added again the CNF formula S of word1In variable var, Husk formula S2In variable
Var carries out rearrangement mixing, and generating one for each variable var, to describe variable var and variable var mixed in rearrangement
Affiliated original CNF formula S before conjunction1Or Husk formula S2The list item of both mapping relations, finally gives variable mappings table M;
C2.12) described all clauses are added again the CNF formula S of word1, Husk formula S2, clause added the son of word
Sentence set S3In clause's hybrid-sorting obtain having and original CNF formula S1The new CNF formula S of different CNF structures;
C2.13) variable mappings table M and new CNF formula S are exported.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410292502.6A CN104123503B (en) | 2014-06-25 | 2014-06-25 | CNF formula data protection method in SAT problem solving outsourcing process |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410292502.6A CN104123503B (en) | 2014-06-25 | 2014-06-25 | CNF formula data protection method in SAT problem solving outsourcing process |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104123503A CN104123503A (en) | 2014-10-29 |
CN104123503B true CN104123503B (en) | 2017-02-15 |
Family
ID=51768911
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410292502.6A Active CN104123503B (en) | 2014-06-25 | 2014-06-25 | CNF formula data protection method in SAT problem solving outsourcing process |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104123503B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6303073B2 (en) | 2014-12-22 | 2018-03-28 | コーニンクレッカ フィリップス エヌ ヴェKoninklijke Philips N.V. | Hiding program execution |
CN107203707B (en) * | 2016-03-16 | 2020-05-12 | 阿里巴巴集团控股有限公司 | Method and system for implementing program code confusion |
CN106209774B (en) * | 2016-06-24 | 2019-02-22 | 西安电子科技大学 | The cloud service outsourcing access right control method obscured based on undistinguishable |
CN108959959B (en) * | 2018-06-15 | 2020-06-23 | 中国人民解放军国防科技大学 | Data privacy protection method and system transparent to calculation |
CN110826812A (en) * | 2019-11-13 | 2020-02-21 | 南京航空航天大学 | Target algorithm prediction method for Boolean satisfiability problem based on graph |
CN111159628B (en) * | 2019-12-31 | 2022-09-13 | 中国人民解放军国防科技大学 | Hardware SAT solver for multi-thread parallel execution |
CN117573556A (en) * | 2023-12-05 | 2024-02-20 | 中国科学院软件研究所 | Software assertion verification method, system and equipment based on incremental SMT problem solving |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1710567A (en) * | 2005-07-07 | 2005-12-21 | 复旦大学 | Sequential circuit equivalent testing and verifying |
US7441216B1 (en) * | 2008-03-31 | 2008-10-21 | International Business Machines Corporation | Applying CNF simplification techniques for SAT-based abstraction refinement |
-
2014
- 2014-06-25 CN CN201410292502.6A patent/CN104123503B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN104123503A (en) | 2014-10-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104123503B (en) | CNF formula data protection method in SAT problem solving outsourcing process | |
Boyle et al. | Is there an oblivious RAM lower bound? | |
Blanton et al. | Data-oblivious graph algorithms for secure computation and outsourcing | |
CN102938767B (en) | The fuzzy keyword search methodology that efficiently can verify that based on the outer packet system of cloud data | |
Ivanova et al. | Attack tree generation by policy invalidation | |
Alrahis et al. | UNTANGLE: Unlocking routing and logic obfuscation using graph neural networks-based link prediction | |
Chakraborty et al. | SAIL: Analyzing structural artifacts of logic locking using machine learning | |
Bruni et al. | Zero-safe nets, or transition synchronization made simple | |
Sisejkovic et al. | Logic locking at the frontiers of machine learning: A survey on developments and opportunities | |
Zhang et al. | Practical wildcard searchable encryption with tree‐based index | |
Laitinen et al. | Extending Clause Learning DPLL with Parity Reasoning. | |
Chen | Building a hybrid SAT solver via conflict-driven, look-ahead and XOR reasoning techniques | |
Dixon et al. | Generalizing boolean satisfiability II: Theory | |
Xu et al. | SWMQ: Secure wildcard pattern matching with query | |
Sisejkovic et al. | Designing ML-resilient locking at register-transfer level | |
Stark et al. | A process-algebraic language for probabilistic I/O automata | |
Ramamoorthy et al. | The state-of-the-art Boolean Satisfiability based cryptanalysis | |
CN113190841A (en) | Method for defending graph data attack by using differential privacy technology | |
Tan et al. | Spiking neural P systems with anti-spikes and without annihilating priority working in a ‘flip-flop’way | |
Zhang et al. | Constraint-based automatic symmetry detection | |
Lomuscio et al. | Model checking temporal epistemic logic | |
Huang et al. | Privacy leakage in GAN enabled load profile synthesis | |
CN108959959B (en) | Data privacy protection method and system transparent to calculation | |
Sheketa et al. | Prospective Areas of Research in the Development of Post-Quantum Cryptography. | |
Chen et al. | Forward secure dynamic searchable symmetric encryption with lighter storage |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |