-
Notifications
You must be signed in to change notification settings - Fork 1
/
fix-aleph.py
70 lines (61 loc) · 2.32 KB
/
fix-aleph.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# # %% :- use_module(library(aleph)).
# # %% :- if(current_predicate(use_rendering/1)).
# # %% :- use_rendering(prolog).
# # %% :- endif.
# # %% :- aleph.
# # %% :-style_check(-discontiguous).
# # %% :- aleph_set(i,7).
# # %% :- aleph_set(clauselength,10).
# # %% :- aleph_set(nodes,50000).
# # %% :- modeh(*,f(+person,+person)).
# # %% :- modeb(*,movie(-movie,-person)).
# # %% :- modeb(*,actor(-person)).
# # %% :- modeb(*,director(-person)).
# # %% :- modeb(*,gender(-person, -gender)).
# # %% :- modeb(*,genre(-person, -genre)).
# # %% :- determination(f/2,movie/2).
# # %% :- determination(f/2,gender/2).
# # %% :- determination(f/2,genre/2).
# # %% :- determination(f/2,actor/1).
# # %% :- determination(f/2,dirctor/1).
# from os import listdir
# from os.path import isfile, join
# # mypath = 'data/imdb3/data/aleph/'
# # mypath = 'data/trains3/data/aleph/'
# paths = []
# # paths.append('data/dropk/data/aleph/')
# # paths.append('data/droplast/data/aleph/')
# # paths.append('data/evens/data/aleph/')
# # paths.append('data/finddup/data/aleph/')
# # paths.append('data/last/data/aleph/')
# # paths.append('data/len/data/aleph/')
# # paths.append('data/sorted/data/aleph/')
# # paths.append('data/sumlist/data/aleph/')
# # paths.append('data/iggp-coins-goal/data/aleph/')
# files = []
# for mypath in paths:
# for f in listdir(mypath):
# if not isfile(join(mypath, f)):
# continue
# files.append(join(mypath, f))
# # print(files)
# for fname in files:
# print(fname)
# with open(fname) as fread:
# x = fread.read()
# # iggp
# # x = x.replace('aleph_set(i,7).','aleph_set(i,6).')
# # x = x.replace('aleph_set(clauselength,10).','aleph_set(clauselength,7).')
# # imdb
# # x = x.replace('aleph_set(i,7).','aleph_set(i,6).')
# # x = x.replace('aleph_set(clauselength,10).','aleph_set(clauselength,7).')
# # trains
# # x = x.replace('aleph_set(clauselength,9).','aleph_set(clauselength,7).')
# # lists
# # x = x.replace('aleph_set(i,5).','aleph_set(i,6).')
# # x = x.replace('aleph_set(clauselength,9).','aleph_set(clauselength,7).')
# # x = x.replace(':- aleph_set(nodes,30000).',':- aleph_set(nodes,50000).')
# with open(fname, 'w') as fwrite:
# fwrite.write(x)
# # :-
# # :- aleph_set(clauselength,10).