コード例 #1
0
import easyProve as ep
import fact

# a49b5
a=ep.variable('a')
b=ep.variable('b')
ep.addRule(fact.AddEq(9,a,b))
a.val=5 # tik
mid=ep.variable('')
ep.addRule(fact.MulEq(mid,b,10))
ep.addRule(fact.AddEq(45,a,mid))

ep.infer()
print(a.val)
print(b.val)
print(mid.val)
コード例 #2
0
import easyProve as ep
import fact

A = ep.point('A')
B = ep.point('B')
C = ep.point('C')
ABC = ep.triangle('ABC', A, B, C)

B_ = ep.point("B'")
C_ = ep.point("C'")

angle_BAB_= ep.angle("BAB'", B, A, B_)
angle_CAC_= ep.angle("CAC'", C, A, C_)

ep.addRule(fact.AddEq(180, angle_BAB_, angle_CAC_))
D = ep.point('D')
ep.addRule(fact.IsMidPoint(D, B_, C_))

AD = ep.lineSeg('AD', A, D)
BC = ep.lineSeg('BC', B, C)

ep.infer()
ep.ask(fact.DivEq(ep.what, AD, BC))
コード例 #3
0
def SubEq(result, op1, op2):
    conOp2 = ep.variable('')
    ep.addRule(IsContray(op2, conOp2))
    return ['AddEq', result, op1, conOp2]
コード例 #4
0
ファイル: test2.py プロジェクト: sg-first/easyProve
import easyProve as ep
import fact
import math

# 第一问
A = ep.point('A')
ep.addRule(fact.Pos(A, -4, 0))
B = ep.point('B')
ep.addRule(fact.Pos(B, 4, 8))

p = ep.paraCur('p')
ep.addRule(fact.OnCurve(p, A))
ep.addRule(fact.OnCurve(p, B))

ep.infer()
ep.ask(fact.ParaCurPar(p, a=ep.what, b=ep.what, c=ep.what))

# 第二问
l = ep.lineCur('l')
k = ep.variable('k')
ep.addRule(fact.LineCurPar(l, k, 4))

p1 = ep.point('p1')
p2 = ep.point('p2')
ep.addRule(fact.OnCurve(l, p1))
ep.addRule(fact.OnCurve(l, p2))
ep.addRule(fact.OnCurve(p, p1))
ep.addRule(fact.OnCurve(p, p2))

aval = math.sqrt(2) / 2
x1 = ep.variable('x1')
コード例 #5
0
def MulEq(result, op1, op2):
    conOp2 = ep.variable('')
    ep.addRule(IsReciprocal(op2, conOp2))
    return ['DivEq', result, op1, op2]