mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-25 02:38:55 -06:00
the NQueens algorithm written in GF
This commit is contained in:
22
examples/nqueens/Nat.gf
Normal file
22
examples/nqueens/Nat.gf
Normal file
@@ -0,0 +1,22 @@
|
||||
abstract Nat = {
|
||||
|
||||
cat Nat ;
|
||||
|
||||
data zero : Nat ;
|
||||
succ : Nat -> Nat ;
|
||||
|
||||
cat NE (i,j : Nat) ;
|
||||
cat LT (i,j : Nat) ;
|
||||
cat Plus Nat Nat Nat ;
|
||||
|
||||
data zNE : (i,j : Nat) -> NE i j -> NE (succ i) (succ j) ;
|
||||
lNE : (j : Nat) -> NE zero (succ j) ;
|
||||
rNE : (j : Nat) -> NE (succ j) zero ;
|
||||
|
||||
zLT : (n : Nat) -> LT zero (succ n) ;
|
||||
sLT : (m,n : Nat) -> LT m n -> LT (succ m) (succ n) ;
|
||||
|
||||
zP : (n : Nat) -> Plus zero n n ;
|
||||
sP : (m,n,s : Nat) -> Plus m n s -> Plus (succ m) n (succ s) ;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user