逻辑信息模型(Logical Information Model) for Java:Example 10_2

逻辑信息模型(Logical Information Model) for Java:Example 10_2

"lim4j-samples": Example 10_2

逻辑信息模型(Logical Information Model) for Java:Example 10_2_第1张图片

 逻辑信息模型(Logical Information Model) for Java:Example 10_2_第2张图片


sample代码如下:

	public static void main(String[] args) throws Exception {
		MixedHypotheticalSyllogism mhsy1 = new MixedHypotheticalSyllogism("③ If the second soldier tells the truth, then this is the gate of life. "
				+ "The second soldier tells the truth. Therefore, this is the gate of life.");

		HypotheticalProposition hpp1 = new HypotheticalProposition("If the second soldier tells the truth, then this is the gate of life.");

		Statement s1 = new Statement("the second soldier tells the truth");

		JudgedStatement js1 = new Proposition("this is the gate of life");
		JudgedStatement js2 = new Proposition("the second soldier tells the truth");
		JudgedStatement js3 = new Proposition("This is the gate of life.");

		HypotheticalCondition hcd1 = new HypotheticalCondition(s1);

		hpp1.setAntecedentAndConsequent(hcd1, js1);

		mhsy1.setElementsOfSyllogism(hpp1, js2, js3);
		mhsy1.addCondition(hcd1);

		Root root = new Root(mhsy1);

		root.marshalToXml(true, System.out);
	}


输出结果:



    
        
            
            
            
        
        
        ③ If the second soldier tells the truth, then this is the gate of life. The second soldier tells the truth. Therefore, this is the gate of life.
        
        
        
        
    
    
        
            
            
        
        If the second soldier tells the truth, then this is the gate of life.
    
    
        the second soldier tells the truth
    
    
        this is the gate of life
    
    
        the second soldier tells the truth
    
    
        This is the gate of life.
    
    
        
            
        
    
    
        
            
            
            
        
    
    
        
            
            
        
        
    
    
        
        
    
    
        
            
            
        
    
    
        
            
            
        
    
    
        
            
            
        
    
    
        
            
        
    
    
        
            
        
        
    
    
        
        
    
    
        
            
            
        
    
    
        
            
        
    
    
        
            
            
        
    
    
        
            
        
    
    
        
            
        
    
    
        
            
        
    

=============================

源代码:
lim4j-samples:https://github.com/CodeJStudio/lim4j-samples
lim4j:        https://github.com/CodeJStudio/lim4j

参考文献:
《逻辑信息模型与逻辑信息网络》 / "Theory of Logical Information Model & Logical Information Network"
《从逻辑信息模型,到逻辑信息网络,直至实现通用人工智能》
 

你可能感兴趣的:(通用人工智能,Java,逻辑学,java,人工智能,数据结构,图论,知识图谱)