-
Notifications
You must be signed in to change notification settings - Fork 1
/
conjecture_type.jl
83 lines (72 loc) · 3.21 KB
/
conjecture_type.jl
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
module ConjectureType
export LinearConjecture
export conj_string
export conj_println
export inequality
export get_expression
mutable struct LinearConjecture
target
other
direction
m
b
hypothesis_properties
touch_number
objects
object_type
end
function conj_string(conj)
if conj.hypothesis_properties == [conj.object_type]
if conj.m == 1//1
if conj.b == 0
return "If X is a $(conj.object_type), then $(conj.target)(X) $(conj.direction) $(conj.other)(X)."
else
return "'If X is a $(conj.object_type), then $(conj.target)(X) $(conj.direction) $(conj.other)(X) + $(conj.b)."
end
else
if conj.b == 0
return "If X is a $(conj.object_type), then $(conj.target)(X) $(conj.direction) $(conj.m)*$(conj.other)(X)."
else
return "If X is a $(conj.object_type), then $(conj.target)(X) $(conj.direction) $(conj.m)*$(conj.other)(X) + $(conj.b)."
end
end
elseif length(conj.hypothesis_properties) == 1
if conj.m == 1//1
if conj.b == 0
return "If X is a $(conj.object_type) and is $(conj.hypothesis_properties[1]), then $(conj.target)(X) $(conj.direction) $(conj.other)(X)."
else
return "If X is a $(conj.object_type) and is $(conj.hypothesis_properties[1]), then $(conj.target)(X) $(conj.direction) $(conj.other)(X) + $(conj.b)."
end
else
if conj.b == 0
return "If X is a $(conj.object_type) and is $(conj.hypothesis_properties[1]), then $(conj.target)(X) $(conj.direction) $(conj.m)*$(conj.other)(X)."
else
return "If X is a $(conj.object_type) and is $(conj.hypothesis_properties[1]), then $(conj.target)(X) $(conj.direction) $(conj.m)*$(conj.other)(X) + $(conj.b)."
end
end
elseif length(conj.hypothesis_properties) == 2
if conj.m == 1//1
if conj.b == 0
return "If X is a $(conj.object_type), and is $(conj.hypothesis_properties[1]), and $(conj.hypothesis_properties[2]), then $(conj.target)(X) $(conj.direction) $(conj.other)."
else
return "If X is a $(conj.object_type), and is $(conj.hypothesis_properties[1]), and $(conj.hypothesis_properties[2]), then $(conj.target)(X) $(conj.direction) $(conj.other)(X) + $(conj.b)."
end
else
if conj.b == 0
return "If X is a $(conj.object_type), and is $(conj.hypothesis_properties[1]), and $(conj.hypothesis_properties[2]), then $(conj.target)(X) $(conj.direction) $(conj.m)*$(conj.other)(X)."
else
return "If X is a $(conj.object_type), and is $(conj.hypothesis_properties[1]), and $(conj.hypothesis_properties[2]), then $(conj.target)(X) $(conj.direction) $(conj.m)*$(conj.other)(X) + $(conj.b)."
end
end
end
end
function conj_println(conj)
println(conj_string(conj))
end
function inequality(conj)
return [conj.target, conj.direction, conj.m, conj.other, conj.b]
end
function get_expression(conj)
return "$(conj.target)(X) $(conj.direction) $(conj.m)*$(conj.other)(X) + $(conj.b)"
end
end