Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions examples/arithmetic_example.dsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// 初始事实:定义数字 1 和 2 存在
Exist(Literal(1) :: Int)
Exist(Literal(2) :: Int)

// 规则:如果 X 存在,Y 存在,且 X + Y = W,则 W 也存在
Exist(Literal(`X) :: Int), Exist(Literal(`Y) :: Int), Literal(`X) :: Int + Literal(`Y) :: Int == Literal(`W) :: Int => Exist(Literal(`W) :: Int)

// 查询:数字 5 是否存在?
Exist(Literal(5) :: Int) => Query()
97 changes: 97 additions & 0 deletions examples/geometry_for_wo_tool_complex_1.dsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
// 初始事实
Collinear(F, A, C)
Collinear(F, E, B)
Collinear(D, B, G)
Collinear(A, G, C)
Collinear(D, B, H)
Collinear(I, A, D)
Collinear(E, I, C)
Collinear(E, J, B)
Length(K, A) == Length(K, F)
Length(K, F) == Length(K, J)
Length(L, F) == Length(L, G)
Length(L, B) == Length(L, F)
Length(M, G) == Length(M, H)
Length(M, C) == Length(M, G)
Length(N, D) == Length(N, H)
Length(N, H) == Length(N, I)
Length(O, E) == Length(O, I)
Length(O, I) == Length(O, J)
Length(K, P) == Length(K, F)
Length(L, P) == Length(L, F)
Length(M, Q) == Length(M, G)
Length(L, Q) == Length(L, G)
Length(N, R) == Length(N, H)
Length(M, R) == Length(M, H)
Length(K, T) == Length(K, J)
Length(O, T) == Length(O, J)
Length(O, S) == Length(O, I)

// R1: KA=KF & KF=KJ & KT=KJ => F,A,J,T 共圆
Length(`P1, `P2) == Length(`P1, `P3), Length(`P1, `P3) == Length(`P1, `P4), Length(`P1, `P5) == Length(`P1, `P4) => Cyclic(`P3, `P2, `P4, `P5)

// R2: F,A,J,T 共圆 & KA=KF & KP=KF & KF=KJ => A,F,P,T 共圆
Cyclic(`P1, `P2, `P3, `P4), Length(`P5, `P2) == Length(`P5, `P1), Length(`P5, `P6) == Length(`P5, `P1), Length(`P5, `P1) == Length(`P5, `P3) => Cyclic(`P2, `P1, `P6, `P4)

// R3: ND=NH & NR=NH & NH=NI => D,I,R,H 共圆
Length(`P1, `P2) == Length(`P1, `P3), Length(`P1, `P4) == Length(`P1, `P3), Length(`P1, `P3) == Length(`P1, `P5) => Cyclic(`P2, `P5, `P4, `P3)

// R4: D,I,R,H 共圆 => ∠DHR=∠DIR
Cyclic(`P1, `P2, `P3, `P4) => Degree(`P1, `P4, `P3) == Degree(`P1, `P2, `P3)

// R5: MG=MH & MR=MH & MC=MG => H,C,R,G 共圆
Length(`P1, `P2) == Length(`P1, `P3), Length(`P1, `P4) == Length(`P1, `P3), Length(`P1, `P5) == Length(`P1, `P2) => Cyclic(`P3, `P5, `P4, `P2)

// R6: H,C,R,G 共圆 => ∠HGC=∠HRC
Cyclic(`P1, `P2, `P3, `P4) => Degree(`P1, `P4, `P2) == Degree(`P1, `P3, `P2)

// R7: I,A,D共线 & ∠DHR=∠DIR & D,B,H共线 & ∠HGC=∠HRC & D,B,G共线 & A,G,C共线 => ∠ACR=∠AIR
Collinear(`P1, `P2, `P3), Degree(`P3, `P4, `P5) == Degree(`P3, `P1, `P5), Collinear(`P3, `P6, `P4), Degree(`P4, `P7, `P8) == Degree(`P4, `P5, `P8), Collinear(`P3, `P6, `P7), Collinear(`P2, `P7, `P8) => Degree(`P2, `P8, `P5) == Degree(`P2, `P1, `P5)

// R8: ∠ACR=∠AIR => A,I,R,C 共圆
Degree(`P1, `P2, `P3) == Degree(`P1, `P4, `P3) => Cyclic(`P1, `P4, `P3, `P2)

// R9: OE=OI & OI=OJ & OT=OJ & OS=OI => E,I,J,T 共圆
Length(`P1, `P2) == Length(`P1, `P3), Length(`P1, `P3) == Length(`P1, `P4), Length(`P1, `P5) == Length(`P1, `P4), Length(`P1, `P6) == Length(`P1, `P3) => Cyclic(`P2, `P3, `P5, `P5)
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The conclusion has a duplicate variable P5 in Cyclic(P2, P3, P5, P5). Based on the premise conditions and comparison with similar rules (R1 at line 31), this should likely be Cyclic(P2, P3, P5, P4) or another appropriate variable representing the fourth point. The duplicate P5 will cause incorrect cyclic inference.

Suggested change
Length(`P1, `P2) == Length(`P1, `P3), Length(`P1, `P3) == Length(`P1, `P4), Length(`P1, `P5) == Length(`P1, `P4), Length(`P1, `P6) == Length(`P1, `P3) => Cyclic(`P2, `P3, `P5, `P5)
Length(`P1, `P2) == Length(`P1, `P3), Length(`P1, `P3) == Length(`P1, `P4), Length(`P1, `P5) == Length(`P1, `P4), Length(`P1, `P6) == Length(`P1, `P3) => Cyclic(`P2, `P3, `P4, `P5)

Copilot uses AI. Check for mistakes.

// R11: E,I,J,T 共圆 => ∠JTI=∠JEI
Cyclic(`P1, `P2, `P3, `P4) => Degree(`P3, `P2, `P4) == Degree(`P3, `P1, `P2)

// R12: F,A,J,T 共圆 => ∠AFJ=∠ATJ
Cyclic(`P1, `P2, `P3, `P4) => Degree(`P2, `P1, `P3) == Degree(`P2, `P4, `P3)

// R13: E,I,C共线 & ∠JTI=∠JEI & E,J,B共线 & ∠AFJ=∠ATJ & F,A,C共线 & F,E,B共线 => ∠CAT=∠CIT
Collinear(`P1, `P2, `P3), Degree(`P4, `P2, `P8) == Degree(`P4, `P1, `P2), Collinear(`P1, `P4, `P6), Degree(`P7, `P5, `P4) == Degree(`P7, `P8, `P4), Collinear(`P5, `P7, `P3), Collinear(`P5, `P1, `P6) => Degree(`P3, `P7, `P8) == Degree(`P3, `P2, `P8)

// R14: ∠CAT=∠CIT => A,I,T,C 共圆
Degree(`P1, `P2, `P3) == Degree(`P1, `P4, `P3) => Cyclic(`P2, `P4, `P3, `P1)

// R15: A,I,R,C 共圆 & A,I,T,C 共圆 => A,C,T,R 共圆
Cyclic(`P1, `P2, `P3, `P4), Cyclic(`P1, `P2, `P5, `P4) => Cyclic(`P1, `P4, `P5, `P3)

// R16: ∠AFP=∠ATP & F,A,C共线 & ∠CAT=∠CRT => ∠CRT=∠FPT
Degree(`P1, `P2, `P3) == Degree(`P1, `P4, `P3), Collinear(`P2, `P1, `P5), Degree(`P5, `P1, `P4) == Degree(`P5, `P6, `P4) => Degree(`P5, `P6, `P4) == Degree(`P2, `P3, `P4)

// R17: H,C,R,G 共圆 & MG=MH & MQ=MG & MC=MG => C,R,G,Q 共圆
Cyclic(`P1, `P2, `P3, `P4), Length(`P5, `P4) == Length(`P5, `P1), Length(`P5, `P6) == Length(`P5, `P4), Length(`P5, `P2) == Length(`P5, `P4) => Cyclic(`P2, `P3, `P4, `P6)

// R18: Q,G,C,R 共圆 => ∠QGC=∠QRC
Cyclic(`P1, `P2, `P3, `P4) => Degree(`P1, `P2, `P3) == Degree(`P1, `P4, `P3)

// R19: LP=LF & LF=LG & LQ=LG & LB=LF => F,Q,P,G 共圆
Length(`P1, `P2) == Length(`P1, `P3), Length(`P1, `P3) == Length(`P1, `P4), Length(`P1, `P5) == Length(`P1, `P4), Length(`P1, `P6) == Length(`P1, `P3) => Cyclic(`P3, `P5, `P2, `P4)

// R20: F,Q,P,G 共圆 => ∠FPQ=∠FGQ
Cyclic(`P1, `P2, `P3, `P4) => Degree(`P1, `P3, `P2) == Degree(`P1, `P4, `P2)

// R21: ∠QGC=∠QRC & A,G,C共线 & ∠FPQ=∠FGQ & F,A,C共线 => ∠FPQ=∠CRQ
Degree(`P1, `P2, `P3) == Degree(`P1, `P4, `P3), Collinear(`P6, `P2, `P3), Degree(`P5, `P7, `P1) == Degree(`P5, `P2, `P1), Collinear(`P5, `P6, `P3) => Degree(`P5, `P7, `P1) == Degree(`P3, `P4, `P1)

// R22: ∠CRT=∠FPT & ∠FPQ=∠CRQ => ∠TPQ=∠TRQ
Degree(`P1, `P2, `P3) == Degree(`P4, `P5, `P3), Degree(`P4, `P5, `P6) == Degree(`P1, `P2, `P6) => Degree(`P3, `P5, `P6) == Degree(`P3, `P2, `P6)

// R23: ∠TPQ=∠TRQ => Q,P,R,T 共圆
Degree(`P3, `P5, `P6) == Degree(`P3, `P2, `P6) => Cyclic(`P6, `P5, `P2, `P3)

// 查询:A,I,T,C 是否共圆?
Cyclic(A, I, T, C) => Query()
68 changes: 68 additions & 0 deletions examples/geometry_for_wo_tool_complex_10.dsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// 初始事实
Collinear(B, A, C)
Collinear(G, I, E)
Length(B, A) == Length(B, C)
Length(D, A) == Length(D, B)
Length(D, E) == Length(D, B)
Length(F, B) == Length(F, C)
Length(F, E) == Length(F, B)
Length(F, G) == Length(F, B)
Length(D, I) == Length(D, B)
Perp(A, G, A, D)

// R1: FB = FC & FG = FB & FE = FB ⇒ F 是 △CGE 的外心
Length(`P1, `P5) == Length(`P1, `P2), Length(`P1, `P3) == Length(`P1, `P5), Length(`P1, `P4) == Length(`P1, `P5) => Circumcenter(`P1, `P2, `P3, `P4)

// R2: FB = FC & FG = FB & FE = FB ⇒ G,B,E,C 共圆
Length(`P1, `P3) == Length(`P1, `P5), Length(`P1, `P2) == Length(`P1, `P3), Length(`P1, `P4) == Length(`P1, `P3) => Cyclic(`P2, `P3, `P4, `P5)

// R3: G,B,E,C 共圆 ⇒ ∠ECB = ∠EGB
Cyclic(`P1, `P2, `P3, `P4) => Degree(`P3, `P4, `P2) == Degree(`P3, `P1, `P2)

// R4: G,B,E,C 共圆 ⇒ ∠EBC = ∠EGC
Cyclic(`P1, `P2, `P3, `P4) => Degree(`P3, `P2, `P4) == Degree(`P3, `P1, `P4)

// R5: DA = DB & DI = DB & DE = DB ⇒ I,B,E,A 共圆
Length(`P1, `P5) == Length(`P1, `P3), Length(`P1, `P2) == Length(`P1, `P3), Length(`P1, `P4) == Length(`P1, `P3) => Cyclic(`P2, `P3, `P4, `P5)

// R6: I,B,E,A 共圆 ⇒ ∠IEB = ∠IAB
Cyclic(`P1, `P2, `P3, `P4) => Degree(`P1, `P3, `P2) == Degree(`P1, `P4, `P2)

// R7: B,A,C共线 & ∠EBC = ∠EGC & ∠IEB = ∠IAB & G,I,E共线 ⇒ ∠BAI = ∠ACG
Collinear(`P1, `P2, `P3), Degree(`P4, `P1, `P3) == Degree(`P4, `P5, `P3), Degree(`P6, `P4, `P1) == Degree(`P6, `P2, `P1), Collinear(`P5, `P6, `P4) => Degree(`P1, `P2, `P6) == Degree(`P2, `P3, `P5)

// R8: DA = DB & DI = DB ⇒ D 是 △ABI 的外心
Length(`P1, `P2) == Length(`P1, `P3), Length(`P1, `P4) == Length(`P1, `P3) => Circumcenter(`P1, `P2, `P3, `P4)

// R9: D是△ABI的外心 & AG ⟂ AD ⇒ ∠BAG = ∠BIA
Circumcenter(`P1, `P2, `P3, `P4), Perp(`P2, `P5, `P2, `P1) => Degree(`P3, `P2, `P5) == Degree(`P3, `P4, `P2)

// R10: B,A,C 共线 & ∠BIA = ∠BAG ⇒ ∠BIA = ∠CAG
Collinear(`P1, `P2, `P3), Degree(`P1, `P4, `P2) == Degree(`P1, `P2, `P5) => Degree(`P1, `P4, `P2) == Degree(`P3, `P2, `P5)

// R11: ∠BAI = ∠ACG & ∠BIA = ∠CAG => AB:CG = AI:CA
Degree(`P1, `P2, `P4) == Degree(`P2, `P3, `P5), Degree(`P1, `P4, `P2) == Degree(`P3, `P2, `P5) => Ratio(`P2, `P1, `P3, `P5) == Ratio(`P2, `P4, `P3, `P2)

// R12: AB:CG = AI:CA & BA = BC => BC:GC = IA:CA
Ratio(`P2, `P1, `P3, `P5) == Ratio(`P2, `P4, `P3, `P2), Length(`P1, `P2) == Length(`P1, `P3) => Ratio(`P1, `P3, `P5, `P3) == Ratio(`P4, `P2, `P3, `P2)

// R13: B,A,C 共线 & ∠EBC = ∠EGC & ∠IEB = ∠IAB & G,I,E 共线 => ∠BCG = ∠CAI
Collinear(`P1, `P2, `P3), Degree(`P6, `P1, `P3) == Degree(`P6, `P5, `P3), Degree(`P4, `P6, `P1) == Degree(`P4, `P2, `P1), Collinear(`P5, `P4, `P6) => Degree(`P1, `P3, `P5) == Degree(`P3, `P2, `P4)

// R14: BC:GC = IA:CA & ∠BCG = ∠CAI => ∠CBG = ∠CIA
Ratio(`P1, `P3, `P5, `P3) == Ratio(`P4, `P2, `P3, `P2), Degree(`P1, `P3, `P5) == Degree(`P3, `P2, `P4) => Degree(`P3, `P1, `P5) == Degree(`P3, `P4, `P2)

// R15: B,A,C 共线 & ∠EBC = ∠EGC & ∠IEB = ∠IAB & G,I,E 共线 => ∠(IA-BC) = ∠GCB
Collinear(`P1, `P2, `P3), Degree(`P6, `P1, `P3) == Degree(`P6, `P5, `P3), Degree(`P4, `P6, `P1) == Degree(`P4, `P2, `P1), Collinear(`P5, `P4, `P6) => Angle(`P4, `P2, `P1, `P3) == Degree(`P5, `P3, `P1)

// R16: ∠(IA-BC) = ∠GCB => IA ∥ GC
Angle(`P4, `P2, `P1, `P3) == Degree(`P5, `P3, `P1) => Para(`P4, `P2, `P5, `P3)

// R17: ∠ECB = ∠EGB & B,A,C 共线 & ∠CBG = ∠CIA & IA ∥ CG => ∠ICG = ∠CEG
Degree(`P6, `P3, `P1) == Degree(`P6, `P5, `P1), Collinear(`P1, `P2, `P3), Degree(`P3, `P1, `P5) == Degree(`P3, `P4, `P2), Para(`P4, `P2, `P5, `P3) => Degree(`P4, `P3, `P5) == Degree(`P3, `P6, `P5)

// R18: F is the circumcenter of CGE & ∠ICG = ∠CEG ⇒ CF ⟂ CI
Circumcenter(`P1, `P2, `P3, `P4), Degree(`P5, `P2, `P3) == Degree(`P2, `P4, `P3) => Perp(`P2, `P1, `P2, `P5)

// 查询:CF ⟂ CI?
Perp(C, F, C, I) => Query()
45 changes: 45 additions & 0 deletions examples/geometry_for_wo_tool_complex_2.dsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// 初始事实
Collinear(B, C, A)
Collinear(B, D, F)
Collinear(E, A, G)
Collinear(C, G, F)
Collinear(B, E, H)
Collinear(C, H, F)
Collinear(C, I, F)
Collinear(D, I, A)
Para(A, E, B, D)
Para(B, E, A, D)
Length(C, A) == Length(C, B)

// R1: B,D,F 共线 & E,A,G 共线 & AE ∥ BD => DF ∥ AG
Collinear(`P1, `P2, `P3), Collinear(`P4, `P5, `P6), Para(`P5, `P4, `P1, `P2) => Para(`P2, `P3, `P5, `P6)

// R2: C,I,F 共线 & C,G,F 共线 => I,F,G 共线
Collinear(`P1, `P2, `P3), Collinear(`P1, `P4, `P3) => Collinear(`P2, `P3, `P4)

// R3: DF ∥ AG & I,F,G 共线 & D,I,A 共线 => IF/IG = FD/GA
Para(`P1, `P2, `P3, `P4), Collinear(`P5, `P2, `P4), Collinear(`P1, `P5, `P3) => Ratio(`P5, `P2, `P5, `P4) == Ratio(`P2, `P1, `P4, `P3)

// R4: B,D,F 共线 & E,A,G 共线 & AE ∥ BD => BF ∥ AG
Collinear(`P1, `P2, `P3), Collinear(`P4, `P5, `P6), Para(`P5, `P4, `P1, `P2) => Para(`P1, `P3, `P5, `P6)

// R5: BF ∥ AG & B,C,A 共线 & C,G,F 共线 => CB/CA = BF/AG
Para(`P1, `P2, `P3, `P4), Collinear(`P1, `P5, `P3), Collinear(`P5, `P4, `P2) => Ratio(`P5, `P1, `P5, `P3) == Ratio(`P1, `P2, `P3, `P4)

// R6: B,E,H 共线 & D,I,A 共线 & BE ∥ AD => BH ∥ DI
Collinear(`P1, `P2, `P3), Collinear(`P4, `P5, `P6), Para(`P1, `P2, `P6, `P4) => Para(`P1, `P3, `P4, `P5)

// R7: C,I,F 共线 & C,H,F 共线 => F,H,I 共线
Collinear(`P1, `P2, `P3), Collinear(`P1, `P4, `P3) => Collinear(`P3, `P4, `P2)

// R8: BH ∥ DI & B,D,F 共线 & F,H,I 共线 => BF/DF = HF/IF
Para(`P1, `P2, `P3, `P4), Collinear(`P1, `P3, `P5), Collinear(`P5, `P2, `P4) => Ratio(`P1, `P5, `P3, `P5) == Ratio(`P2, `P5, `P4, `P5)

// R9: IF:IG=FD:GA & CB:CA=BF:AG & CA=CB & BF:DF=HF:IF => HF:IF=IG:IF
Ratio(`P1, `P2, `P1, `P3) == Ratio(`P2, `P4, `P3, `P5), Ratio(`P6, `P7, `P6, `P5) == Ratio(`P7, `P2, `P5, `P3), Length(`P6, `P5) == Length(`P6, `P7), Ratio(`P7, `P2, `P4, `P2) == Ratio(`P8, `P2, `P1, `P2) => Ratio(`P8, `P2, `P1, `P2) == Ratio(`P1, `P3, `P1, `P2)

// R10: HF:IF = IG:IF => HF = IG
Ratio(`P1, `P2, `P3, `P2) == Ratio(`P3, `P4, `P3, `P2) => Length(`P1, `P2) == Length(`P3, `P4)

// 查询:HF 是否等于 IG?
Length(H, F) == Length(I, G) => Query()
78 changes: 78 additions & 0 deletions examples/geometry_for_wo_tool_complex_3.dsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// 初始事实
Collinear(B, E, C)
Collinear(A, D, E)
Collinear(A, F, C)
Collinear(B, D, F)
Collinear(B, I, C)
Collinear(A, G, B)
Collinear(G, D, C)
Collinear(A, H, C)
Collinear(D, I, C)
Collinear(B, J, F)
Para(B, H, E, F)
Para(E, I, A, B)
Para(J, E, A, C)
Intro(A)
Intro(B)
Intro(C)
Intro(D)
Intro(E)
Intro(F)
Intro(G)
Intro(H)
Intro(I)
Intro(J)

// R1: A,B,G 共线 & EI ∥ AB => BG ∥ EI
Collinear(`P1, `P3, `P2), Para(`P4, `P5, `P1, `P2) => Para(`P2, `P3, `P4, `P5)

// R2: D,I,C 共线 & G,D,C 共线 => C,G,I 共线
Collinear(`P1, `P2, `P3), Collinear(`P4, `P1, `P3) => Collinear(`P3, `P4, `P2)

// R3: D,I,C 共线 & G,D,C 共线 => D,G,I 共线
Collinear(`P1, `P2, `P3), Collinear(`P4, `P1, `P3) => Collinear(`P1, `P4, `P2)

// R4: BG ∥ EI & B,E,C 共线 & C,G,I 共线 => BC:EC = BG:IE
Para(`P1, `P2, `P3, `P4), Collinear(`P1, `P3, `P5), Collinear(`P5, `P2, `P4) => Ratio(`P1, `P5, `P3, `P5) == Ratio(`P1, `P2, `P4, `P3)

// R5: A,H,C 共线 & A,F,C 共线 => C,H,F 共线
Collinear(`P1, `P2, `P3), Collinear(`P1, `P4, `P3) => Collinear(`P3, `P2, `P4)

// R6: BH ∥ EF & B,E,C 共线 & C,H,F 共线 => BC:EC = BH:EF
Para(`P1, `P2, `P3, `P4), Collinear(`P1, `P3, `P5), Collinear(`P5, `P2, `P4) => Ratio(`P1, `P5, `P3, `P5) == Ratio(`P1, `P2, `P3, `P4)

// R7: A,H,C 共线 & A,F,C 共线 & BH ∥ EF & AC ∥ EJ => ∠BHF = ∠FEJ
Collinear(`P1, `P2, `P3), Collinear(`P1, `P4, `P3), Para(`P5, `P2, `P6, `P4), Para(`P7, `P6, `P1, `P3) => Degree(`P5, `P2, `P4) == Degree(`P4, `P6, `P7)

// R8: B,D,F 共线 & A,H,C 共线 & A,F,C 共线 & B,J,F 共线 & AC ∥ EJ => ∠BFH = ∠FJE
Collinear(`P1, `P2, `P3), Collinear(`P4, `P5, `P6), Collinear(`P4, `P3, `P6), Collinear(`P1, `P7, `P3), Para(`P7, `P8, `P4, `P6) => Degree(`P1, `P3, `P5) == Degree(`P3, `P7, `P8)

// R9: ∠BHF = ∠FEJ & ∠BFH = ∠FJE => BH:EF = HF:JE
Degree(`P1, `P2, `P3) == Degree(`P3, `P4, `P5), Degree(`P1, `P3, `P2) == Degree(`P3, `P5, `P4) => Ratio(`P1, `P2, `P4, `P3) == Ratio(`P2, `P3, `P5, `P4)

// R10: 传递性推导
Ratio(`P1, `P2, `P3, `P2) == Ratio(`P1, `P4, `P5, `P3), Ratio(`P1, `P2, `P3, `P2) == Ratio(`P1, `P6, `P3, `P7), Ratio(`P1, `P6, `P3, `P7) == Ratio(`P6, `P7, `P8, `P3) => Ratio(`P6, `P7, `P8, `P3) == Ratio(`P1, `P4, `P5, `P3)

// R11: A,G,B 共线 & EI ∥ AB => AG ∥ EI
Collinear(`P1, `P2, `P3), Para(`P4, `P5, `P1, `P3) => Para(`P1, `P2, `P4, `P5)

// R12: AG ∥ EI & A,D,E 共线 & G,D,I 共线 => DE:AD = IE:AG
Para(`P1, `P2, `P3, `P4), Collinear(`P1, `P5, `P3), Collinear(`P2, `P5, `P4) => Ratio(`P5, `P3, `P1, `P5) == Ratio(`P4, `P3, `P1, `P2)

// R13: A,C,F 共线 & EJ ∥ AC => JE ∥ FA
Collinear(`P1, `P3, `P2), Para(`P4, `P5, `P1, `P2) => Para(`P4, `P5, `P3, `P1)

// R14: B,J,F 共线 & B,D,F 共线 => D,J,F 共线
Collinear(`P1, `P2, `P3), Collinear(`P1, `P4, `P3) => Collinear(`P4, `P2, `P3)

// R15: JE ∥ FA & A,D,E 共线 & D,J,F 共线 => DE:AD = JE:AF
Para(`P1, `P2, `P3, `P4), Collinear(`P4, `P5, `P2), Collinear(`P5, `P1, `P3) => Ratio(`P5, `P2, `P4, `P5) == Ratio(`P1, `P2, `P4, `P3)

// R16: 传递性推导
Ratio(`P1, `P2, `P3, `P1) == Ratio(`P4, `P2, `P3, `P5), Ratio(`P1, `P2, `P3, `P1) == Ratio(`P6, `P2, `P3, `P7) => Ratio(`P6, `P2, `P3, `P7) == Ratio(`P4, `P2, `P3, `P5)

// R17: 传递性推导
Ratio(`P1, `P2, `P3, `P4) == Ratio(`P5, `P6, `P7, `P4), Ratio(`P3, `P4, `P8, `P2) == Ratio(`P7, `P4, `P8, `P6) => Ratio(`P1, `P2, `P8, `P2) == Ratio(`P5, `P6, `P8, `P6)

// 查询:HF/AF = BG/AG ?
Ratio(H, F, A, F) == Ratio(B, G, A, G) => Query()
37 changes: 37 additions & 0 deletions examples/geometry_for_wo_tool_complex_4.dsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// 初始事实
Collinear(A, B, E)
Collinear(G, C, E)
Collinear(G, A, D)
Collinear(H, C, E)
Perp(B, C, A, D)
Perp(C, E, A, B)
Length(F, A) == Length(F, C)
Length(F, A) == Length(F, B)
Length(F, H) == Length(F, C)

// R1: G,C,E 共线 & A,B,E 共线 & H,C,E 共线 & CE ⟂ AB ⇒ ∠GEA = ∠AEH
Collinear(`P1, `P2, `P3), Collinear(`P4, `P5, `P3), Collinear(`P6, `P2, `P3), Perp(`P2, `P3, `P4, `P5) => Degree(`P1, `P3, `P4) == Degree(`P4, `P3, `P6)

// R2: FA = FC & FH = FC & FA = FB ⇒ H,A,B,C 共圆
Length(`P1, `P2) == Length(`P1, `P3), Length(`P1, `P4) == Length(`P1, `P3), Length(`P1, `P2) == Length(`P1, `P5) => Cyclic(`P4, `P2, `P5, `P3)

// R3: H,A,B,C 共圆 ⇒ ∠HAB = ∠HCB
Cyclic(`P1, `P2, `P3, `P4) => Degree(`P1, `P2, `P3) == Degree(`P1, `P4, `P3)

// R4: G,A,D 共线 & BC ⟂ AD ⇒ CB ⟂ GA
Collinear(`P1, `P2, `P3), Perp(`P4, `P5, `P2, `P3) => Perp(`P5, `P4, `P1, `P2)

// R5: H,C,E 共线 & G,C,E 共线 & CE ⟂ AB ⇒ AB ⟂ GH
Collinear(`P1, `P2, `P3), Collinear(`P4, `P2, `P3), Perp(`P2, `P3, `P5, `P6) => Perp(`P5, `P6, `P4, `P1)

// R6: CB ⟂ GA & AB ⟂ GH ⇒ ∠(CB-GH) = ∠GAB
Perp(`P1, `P2, `P3, `P4), Perp(`P4, `P2, `P3, `P5) => Angle(`P1, `P2, `P3, `P5) == Degree(`P3, `P4, `P2)

// R7: G,A,D共线 & A,B,E共线 & ∠HAB=∠HCB & H,C,E共线 & ∠(CB-GH)=∠GAB & G,C,E共线 ⇒ ∠GAE=∠EAH
Collinear(`P1, `P2, `P3), Collinear(`P2, `P4, `P5), Degree(`P6, `P2, `P4) == Degree(`P6, `P7, `P4), Collinear(`P6, `P7, `P5), Angle(`P7, `P4, `P1, `P6) == Degree(`P1, `P2, `P4), Collinear(`P1, `P7, `P5) => Degree(`P1, `P2, `P5) == Degree(`P6, `P2, `P5)

// R8: ∠GEA = ∠AEH & ∠GAE = ∠EAH ⇒ EG = EH
Degree(`P1, `P2, `P3) == Degree(`P4, `P2, `P3), Degree(`P1, `P3, `P2) == Degree(`P4, `P3, `P2) => Length(`P2, `P1) == Length(`P2, `P4)

// 查询:EG 是否等于 EH?
Length(E, G) == Length(E, H) => Query()
30 changes: 30 additions & 0 deletions examples/geometry_for_wo_tool_complex_5.dsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// 初始事实
Collinear(D, F, C)
Collinear(F, B, E)
Perp(F, H, F, G)
Length(A, C) == Length(A, B)
Length(A, D) == Length(A, B)
Length(A, E) == Length(A, B)
Length(G, F) == Length(G, B)
Length(G, D) == Length(G, F)

// 规则 R1: AD=AB, AE=AB, AC=AB => D,B,E,C 共圆
Length(`P1, `P2) == Length(`P1, `P3), Length(`P1, `P4) == Length(`P1, `P3), Length(`P1, `P5) == Length(`P1, `P3) => Cyclic(`P2, `P3, `P4, `P5)

// 规则 R2: 四点共圆 => 圆周角相等 ∠EBD = ∠ECD
Cyclic(`P1, `P2, `P3, `P4) => Degree(`P3, `P2, `P1) == Degree(`P3, `P4, `P1)

// 规则 R3: GF=GB, GD=GF => G 是 △FBD 的外心
Length(`P1, `P2) == Length(`P1, `P3), Length(`P1, `P4) == Length(`P1, `P2) => Circumcenter(`P1, `P2, `P3, `P4)

// 规则 R4: 外心 + 垂直关系 => 弦切角性质 ∠HFB = ∠FDB
Circumcenter(`P1, `P2, `P3, `P4), Perp(`P2, `P5, `P2, `P1) => Degree(`P5, `P2, `P3) == Degree(`P2, `P4, `P3)

// 规则 R5: 综合共线与角度相等推导角度关系 ∠HFD = Angle(EC, DF)
Collinear(`P1, `P2, `P3), Degree(`P4, `P5, `P1) == Degree(`P4, `P3, `P1), Degree(`P6, `P2, `P5) == Degree(`P2, `P1, `P5), Collinear(`P2, `P5, `P4) => Degree(`P6, `P2, `P1) == Angle(`P4, `P3, `P1, `P2)

// 规则 R6: 角度相等 => FH ∥ EC
Degree(`P1, `P2, `P3) == Angle(`P4, `P5, `P3, `P2) => Para(`P2, `P1, `P4, `P5)

// 查询:FH 是否平行于 EC?
Para(F, H, E, C) => Query()
Loading
Loading