Rev | Line | |
---|
[37] | 1 | function used = getvariables(F) |
---|
| 2 | |
---|
| 3 | used = recursivegetvariables(F,1,length(F.clauses)); |
---|
| 4 | return |
---|
| 5 | |
---|
| 6 | m = length(F.clauses); |
---|
| 7 | if m == 1 |
---|
| 8 | used = getvariables(F.clauses{1}.data); |
---|
| 9 | else |
---|
| 10 | if m>50 |
---|
| 11 | for i = 1:m |
---|
| 12 | Fivars = getvariables(F.clauses{i}.data); |
---|
| 13 | used = [used Fivars(:)']; |
---|
| 14 | end |
---|
| 15 | used = uniquestripped(used); |
---|
| 16 | else |
---|
| 17 | for i = 1:m |
---|
| 18 | Fivars = getvariables(F.clauses{i}.data); |
---|
| 19 | used = uniquestripped([used Fivars(:)']); |
---|
| 20 | end |
---|
| 21 | end |
---|
| 22 | end |
---|
| 23 | |
---|
| 24 | |
---|
| 25 | function used = recursivegetvariables(F,startindex,endindex) |
---|
| 26 | |
---|
| 27 | if endindex-startindex>50 |
---|
| 28 | newstart = startindex; |
---|
| 29 | mid = ceil((startindex + endindex)/2); |
---|
| 30 | newend = endindex; |
---|
| 31 | used1 = recursivegetvariables(F,newstart,mid); |
---|
| 32 | used2 = recursivegetvariables(F,mid+1,newend); |
---|
| 33 | used = uniquestripped([used1 used2]); |
---|
| 34 | else |
---|
| 35 | used = []; |
---|
| 36 | for i = startindex:endindex |
---|
| 37 | Fivars = getvariables(F.clauses{i}.data); |
---|
| 38 | used = [used Fivars(:)']; |
---|
| 39 | end |
---|
| 40 | used = uniquestripped(used); |
---|
| 41 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.