-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(数据结构): ♻️ 现在抽象陈述也有参数「陈述类型」了
外部扩展新类型陈述时,只需扩展新陈述类型并实现「新陈述具体类型 <: 抽象陈述{新陈述类型}」即可
- Loading branch information
1 parent
73cafb3
commit 3818c01
Showing
4 changed files
with
39 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
(@isdefined JuNarsese) || include("commons.jl") # 已在此中导入JuNarsese、Test | ||
|
||
@testset "types" begin | ||
|
||
# 测试各类「抽象类型」 | ||
@test Intension <: AbstractEI >: Extension | ||
@test And <: AbstractLogicOperation >: Or | ||
@test Not <: AbstractLogicOperation | ||
@test VTIndependent <: AbstractVariableType | ||
@test Sequential <: AbstractTemporalRelation >: Parallel | ||
|
||
# 测试「原子词项」 | ||
@test Word <: Atom <: Term | ||
@test IVar <: Variable{VTIndependent} <: Var <: Variable <: Atom <: Term | ||
|
||
# 测试「复合词项类型」 | ||
@test CompoundTypeTermProduct <: AbstractCompoundType | ||
CompoundTypeTermImage{Extension} <: CompoundTypeTermImage | ||
|
||
@test TermProduct <: CommonCompound{CompoundTypeTermProduct} <: AbstractCompound{CompoundTypeTermProduct} <: AbstractCompound <: AbstractTerm | ||
@test TermProduct <: CommonCompound{CompoundTypeTermProduct} <: CommonCompound <: AbstractCompound <: AbstractTerm | ||
@test ExtImage <: TermImage{Extension} <: AbstractCompound{CompoundTypeTermImage{Extension}} <: AbstractCompound{CompoundTypeTermImage{Extension}} <: AbstractCompound | ||
@test IntImage <: TermImage{Intension} <: TermImage <: AbstractCompound | ||
|
||
# 测试「陈述类型」 | ||
@test STInheritance <: AbstractStatementType | ||
@test STImplication <: StatementTypeImplication{Eternal} <: StatementTypeImplication <: AbstractStatementType | ||
@test STEquivalence <: StatementTypeEquivalence{Eternal} <: StatementTypeEquivalence <: AbstractStatementType | ||
|
||
@test Inheritance <: Statement{STInheritance} <: AbstractStatement{StatementTypeInheritance} <: AbstractStatement <: AbstractTerm | ||
@test Inheritance <: Statement{STInheritance} <: Statement <: AbstractStatement <: AbstractTerm | ||
|
||
end |