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
3 changes: 2 additions & 1 deletion src/parsing/dkLexer.mll
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
}

let space = [' ' '\t' '\r']
let letter = ['a'-'z' 'A'-'Z' '0'-'9' '_' '!' '?' '\'' '+' '*' '~' '&' '^' '@' '=' '$' '%' '/' '<' '|' '-' '\\' '>']
let ident = letter+
let mident = ['a'-'z' 'A'-'Z' '0'-'9' '_']+
let ident = ['a'-'z' 'A'-'Z' '0'-'9' '_' '!' '?']['a'-'z' 'A'-'Z' '0'-'9' '_' '!' '?' '\'' ]*

rule token = parse
| space { token lexbuf }
Expand Down
14 changes: 7 additions & 7 deletions tests/OK/FO.dk
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,19 @@ def conj_elim_2 : A:Prop -> B:Prop -> prf (conj A B) -> prf B
:= A:Prop => B:Prop => p:prf (conj A B) => p B (_:prf A => b:prf B => b).

(; Universal quantificator ;)
def forall_intro: P:(Term->Prop) -> (t:Term -> prf (P t)) -> prf (forall P)
:= P:(Term->Prop) => p:(t:Term -> prf (P t)) => p.
def forall_intro: P:(Term -> Prop) -> (t:Term -> prf (P t)) -> prf (forall P)
:= P:(Term -> Prop) => p:(t:Term -> prf (P t)) => p.

def forall_elim: P:(Term->Prop) -> t:Term -> prf (forall P) -> prf (P t)
:= P:(Term->Prop) => t:Term => p:prf (forall P) => p t.
def forall_elim: P:(Term -> Prop) -> t:Term -> prf (forall P) -> prf (P t)
:= P:(Term -> Prop) => t:Term => p:prf (forall P) => p t.

(; Existential quantificator ;)
def exists_intro: P:(Term->Prop) -> t:Term -> prf (P t) -> prf (exists P)
def exists_intro: P:(Term -> Prop) -> t:Term -> prf (P t) -> prf (exists P)
:= P:(Term -> Prop) => t:Term => p:prf (P t) =>
A:Prop => f:(x:Term -> prf (P x) -> prf A) => f t p.

def exists_elim: P:(Term->Prop) -> Q:Prop -> prf (exists P) -> prf (forall (x => imp (P x) Q)) -> prf Q
:= P:(Term->Prop) => Q:Prop => p1:prf (exists P) => p2:prf (forall (x => imp (P x) Q))
def exists_elim: P:(Term -> Prop) -> Q:Prop -> prf (exists P) -> prf (forall (x => imp (P x) Q)) -> prf Q
:= P:(Term -> Prop) => Q:Prop => p1:prf (exists P) => p2:prf (forall (x => imp (P x) Q))
=> p1 Q p2.

(; Equality ;)
Expand Down
4 changes: 2 additions & 2 deletions tests/OK/domainfree.dk
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
A:Type.
F:(A->A)->A.
def f := F (x=>x).
F:(A -> A) -> A.
def f := F (x => x).
6 changes: 3 additions & 3 deletions tests/OK/dotpat.dk
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
N: Type.
Z: N.
S: N->N.
S: N -> N.

def plus: N->N->N.
def plus: N -> N -> N.
[y] plus Z y --> y
[x,y] plus (S x) y --> S (plus x y).


V: N->Type.
V: N -> Type.
Nil: V Z.
Con: n:N -> V n -> N -> V (S n).

Expand Down
6 changes: 3 additions & 3 deletions tests/OK/emptySet.dk
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Set:Type.
Prop:Type.

def prf:Prop->Type.
def prf:Prop -> Type.

forall:(Set->Prop)->Prop.
imp:Prop->Prop->Prop.
forall:(Set -> Prop) -> Prop.
imp:Prop -> Prop -> Prop.
[f] prf (forall f) --> x:Set -> prf (f x)

[A,B] prf (imp A B) --> prf A -> prf B.
Expand Down
6 changes: 3 additions & 3 deletions tests/OK/firstOrder.dk
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ DeMorgan2 : A:Prop -> B:Prop -> prf (imp (or A B) (not (and (not A) (not B)))).

U:Type.

forall : (U->Prop) -> Prop.
forall_intro : P:(U->Prop) -> (x:U -> prf (P x)) -> prf (forall P).
forall_elim : P:(U->Prop) -> prf (forall P) -> x:U -> prf (P x).
forall : (U -> Prop) -> Prop.
forall_intro : P:(U -> Prop) -> (x:U -> prf (P x)) -> prf (forall P).
forall_elim : P:(U -> Prop) -> prf (forall P) -> x:U -> prf (P x).
12 changes: 6 additions & 6 deletions tests/OK/firstOrder_v2.dk
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ def and_elim_2 : A:Prop -> B:Prop -> prf (and A B) -> prf B
lem B B (q:prf B => q) (q:prf (not B) => false_elim B (p (x:prf A => q))).

(; Universal quantificator ;)
def forall_intro: P:(Term->Prop) -> (t:Term -> prf (P t)) -> prf (forall P)
:= P:(Term->Prop) => p:(t:Term -> prf (P t)) => p.
def forall_intro: P:(Term -> Prop) -> (t:Term -> prf (P t)) -> prf (forall P)
:= P:(Term -> Prop) => p:(t:Term -> prf (P t)) => p.

def forall_elim: P:(Term->Prop) -> t:Term -> p:prf (forall P) -> prf (P t)
:= P:(Term->Prop) => t:Term => p:prf (forall P) => p t.
def forall_elim: P:(Term -> Prop) -> t:Term -> p:prf (forall P) -> prf (P t)
:= P:(Term -> Prop) => t:Term => p:prf (forall P) => p t.

(; Existential quantificator ;)
def exists_intro: P:(Term->Prop) -> t:Term -> prf (P t) -> prf (exists P)
def exists_intro: P:(Term -> Prop) -> t:Term -> prf (P t) -> prf (exists P)
:= P:(Term -> Prop) => t:Term => p:prf (P t) => q:prf (forall (u:Term => not (P u))) => q t p.

e: (Term -> Prop) -> Term. (;Hilbert operator;)
exists_elim: P:(Term->Prop) -> prf (exists P) -> prf (P (e P)).
exists_elim: P:(Term -> Prop) -> prf (exists P) -> prf (P (e P)).

2 changes: 1 addition & 1 deletion tests/OK/nonlin.dk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ S : Nat -> Nat.
def plus : Nat -> Nat -> Nat.
[n] plus 0 n --> n
[m, n] plus (S m) n --> S (plus m n)
[n] plus n 0--> n
[n] plus n 0 --> n
[m, n] plus m (S n) --> S (plus m n).

def eq : (Nat -> Nat) -> (Nat -> Nat) -> Nat.
Expand Down
6 changes: 3 additions & 3 deletions tests/OK/surjective.dk
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
T:Type.
Pairs:Type.
def p1:Pairs->T.
def p2:Pairs->T.
def mk:T->T->Pairs.
def p1:Pairs -> T.
def p2:Pairs -> T.
def mk:T -> T -> Pairs.

[a] p1 (mk a _) --> a.
[b] p2 (mk _ b) --> b.
Expand Down
2 changes: 1 addition & 1 deletion tests/OK/tuto.dk
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def pred : Nat -> Nat.
def plus : Nat -> Nat -> Nat.
[n] plus 0 n --> n
[m, n] plus (S m) n --> S (plus m n)
[n] plus n 0--> n
[n] plus n 0 --> n
[m, n] plus m (S n) --> S (plus m n).

def plus_rec_term : Nat -> Nat -> Nat.
Expand Down
Loading