Skip to content

Commit efaa2b4

Browse files
authored
add Option, String and Tactic (Deducteam#34)
1 parent c65df7e commit efaa2b4

File tree

3 files changed

+101
-0
lines changed

3 files changed

+101
-0
lines changed

Option.lp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// option type
2+
3+
require open Stdlib.Set;
4+
5+
constant symbol option : SetSet;
6+
7+
constant symbol none [a] : τ (option a);
8+
constant symbol some [a] : τ a → τ (option a);

String.lp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// builtin type of strings
2+
3+
require open Stdlib.Set;
4+
5+
constant symbol String : TYPE;
6+
builtin "String"String;
7+
8+
constant symbol string : Set;
9+
rule τ stringString;

Tactic.lp

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
// define a type representing Lambdapi tactics
2+
3+
require open Stdlib.Set Stdlib.Prop Stdlib.String Stdlib.Option
4+
Stdlib.List;
5+
6+
constant symbol Tactic : TYPE;
7+
8+
// mandatory builtins
9+
10+
constant symbol #admit : Tactic;
11+
builtin "admit" ≔ #admit;
12+
13+
symbol & : TacticTacticTactic;
14+
builtin "and" ≔ &;
15+
notation & infix right 10;
16+
17+
constant symbol #apply [p] : π pTactic;
18+
builtin "apply" ≔ #apply;
19+
20+
constant symbol #assume : StringTactic;
21+
builtin "assume" ≔ #assume;
22+
23+
constant symbol #fail : Tactic;
24+
builtin "fail" ≔ #fail;
25+
26+
constant symbol #generalize : Π [a], τ aTactic;
27+
builtin "generalize" ≔ #generalize;
28+
29+
constant symbol #have : String → Π p, π pTactic;
30+
builtin "have" ≔ #have;
31+
32+
constant symbol #induction : Tactic;
33+
builtin "induction" ≔ #induction;
34+
35+
constant symbol #orelse : TacticTacticTactic;
36+
builtin "orelse" ≔ #orelse;
37+
38+
constant symbol #refine [p] : π pTactic;
39+
builtin "refine" ≔ #refine;
40+
41+
constant symbol #reflexivity : Tactic;
42+
builtin "reflexivity" ≔ #reflexivity;
43+
44+
constant symbol #remove : Π [a], π aTactic;
45+
builtin "remove" ≔ #remove;
46+
47+
constant symbol #repeat : TacticTactic;
48+
builtin "repeat" ≔ #repeat;
49+
50+
constant symbol #rewrite [p] : π pTactic;
51+
builtin "rewrite" ≔ #rewrite;
52+
53+
constant symbol #set : String → Π [a], τ aTactic;
54+
builtin "set" ≔ #set;
55+
56+
constant symbol #simplify : Tactic;
57+
builtin "simplify" ≔ #simplify;
58+
59+
constant symbol #simplify_beta : Tactic;
60+
builtin "simplify rule off" ≔ #simplify_beta;
61+
62+
constant symbol #solve : Tactic;
63+
builtin "solve" ≔ #solve;
64+
65+
constant symbol #symmetry : Tactic;
66+
builtin "symmetry" ≔ #symmetry;
67+
68+
constant symbol #try : TacticTactic;
69+
builtin "try" ≔ #try;
70+
71+
constant symbol #why3 : Tactic;
72+
builtin "why3" ≔ #why3;
73+
74+
// defined tactics
75+
76+
symbol nothing ≔ #try #fail;
77+
78+
require open Stdlib.Nat;
79+
80+
symbol times : ℕ → TacticTactic;
81+
notation times infix 20;
82+
83+
rule 0 times _ ↪ nothing
84+
with $n +1 times $t ↪ $t & $n times $t;

0 commit comments

Comments
 (0)