summaryrefslogtreecommitdiff
path: root/examples/logic/LogicI.gf
blob: 3598022ac02a3feec01623386f1c3f8bb33e1739 (plain)
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
incomplete concrete LogicI of Logic = 
  open 
    LexTheory,
    Prooftext, 
    Grammar, 
    Constructors, 
    Combinators
  in {

lincat 
  Prop  = Prooftext.Prop ;
  Proof = Prooftext.Proof ;
  Dom   = Typ ;
  Elem  = Object ;
  Hypo  = Label ;
  Text  = Section ;

lin
  ThmWithProof = theorem ;

  Conj = coord and_Conj ;
  Disj = coord or_Conj ;
  Impl = coord ifthen_DConj ;

  Abs = 
    mkS (pred have_V2 (mkNP we_Pron) (mkNP (mkDet IndefArt) contradiction_N)) ;

  Univ A B = 
    AdvS 
      (mkAdv for_Prep (mkNP all_Predet 
        (mkNP (mkDet (PlQuant IndefArt)) (mkCN A (symb B.$0)))))
      B ;

  DisjIl A B a = proof a (proof afortiori (coord or_Conj A B)) ;
  DisjIr A B b = proof b (proof afortiori (coord or_Conj A B)) ;

  DisjE A B C c d e =
    appendText
      c 
      (appendText
        (appendText
           (cases (mkNum n2)) 
           (proofs 
             (appendText (assumption A) d)
             (appendText (assumption B) e)))
        (proof therefore C)) ;

  ImplI A B b = 
    proof 
      (assumption A) 
      (appendText b (proof therefore (coord ifthen_DConj A B))) ;

  Hypoth A h = proof hypothesis A ;


lindef
  Elem = defNP ;

}