-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathpredicates-1.3.csv
We can make this file beautiful and searchable if this error is corrected: Illegal quoting in line 5.
105 lines (101 loc) · 2.59 KB
/
predicates-1.3.csv
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
;
; predicates-1.3.csv
;
; This example data file demonstrates the learning of arithmetic
; predicates. An "arithmetic predicate" is an arithmetic expression
; that is true or false; so, for example, x + y > 0 is a predicate.
; These can be joined together using boolean operators.
;
; In this example, the dataset reflects the predicate
; (x > 1.3) AND (y > 0.0) AND g and so the combo program that should be
; learned is
; and( greater_than_zero( plus($x -1.3)) greater_than_zero($y) $g)
;
; To run, enter: "moses -H it -i predicates.csv -W1 -u pred"
;
; To run, with an example exemplar to get things started:
; moses -H it -i predicates.csv -W1 -u pred -e "or(0<( $1) 0<( $2))"
;
; Note: at this time, MOSES has great difficulty learning the above,
; desired predicate, although it does learn a different expression
; which does accurately reproduce the input table. The reason for this
; difficulty is that MOSES uses a certain binary prepresentation for
; floating-point constants. Thus, it can easily learn constants such
; as 1.0, 1.5, 1.25, 1.375, 1.125 and so on, but has difficulty with
; fractions that do not have a power-of-two denominator. Likewise, it
; represents integers in base two: so, for example, 13=8+4+1 requires
; three terms, and thus is more difficult to learn that 5=4+1 which
; has only two terms. At this time, this is a "feature/bug", and its not
; obvious how (or whether) to alter the algorithm to work around this.
;
x y g pred
2.0 1.1 1 1
1.1 1.1 1 0
0.9 2.0 1 0
0.8 -0.1 0 0
1.1 -0.1 1 0
6.6 -0.8 0 0
5.8 0.1 1 1
15.9 4.1 1 1
4.6 0.3 1 1
3.7 0.9 1 1
2.2 1.1 1 1
1.6 1.6 1 1
1.2 2.8 1 0
0.7 3.0 1 0
0.4 6.0 0 0
0.1 8.0 1 0
-0.3 11.0 0 0
-0.6 12.0 1 0
-2.0 23.0 0 0
-9.1 3.0 0 0
-49.1 9.0 0 0
-1.8 4.0 1 0
-0.1 1.0 0 0
0.9 0.2 1 0
1.01 0.1 1 0
1.29 0.05 0 0
1.3 0.05 1 0
1.31 0.05 1 1
1.9 0.01 1 1
2.1 -0.01 1 0
3.1 -0.1 0 0
4.1 -0.6 1 0
# Make sure $g plays a role ...
15.2 0.1 1 1
5.5 0.1 1 1
4.1 0.4 0 0
3.2 0.6 0 0
2.9 1.2 0 0
1.6 1.5 0 0
# Make sure -$y doesn't get used wrong...
-15.5 3.1 1 0
-5.5 0.1 1 0
-4.1 8.4 1 0
-3.2 0.6 1 0
-2.9 21.2 1 0
-1.6 1.5 1 0
# Make sure that a solution with $x * $y isn't explored
5.8 19.1 1 1
15.9 0.1 1 1
4.6 20.3 1 1
3.7 15.9 1 1
2.2 72.1 1 1
1.6 31.6 1 1
1.0 12.9 1 0
1.2 32.1 1 0
0.6 32.6 1 0
1.1 1.9 1 0
1.2 3.1 1 0
0.45 2.6 1 0
# Make sure that and(0<(+(-1.5 *(0.5 +(1 $x) $x))) 0<($x) isnt found.
# The above is actually correct in that its equivalent to 1.3027756...< $x
# but its a polynomial and we'd prefer linear terms...
# 1.305 14.1 1 1
# 1.302 0.1 1 1
# 1.301 23.3 1 1
# 1.3001 25.7 1 1
# 1.2999 2.8 1 0
# 1.2998 1.1 1 0
# 1.298 0.7 1 0
# 1.29 5.3 1 0