Skip to content

Commit

Permalink
start simple inference dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Philippe Bernardy committed Oct 24, 2023
1 parent 95e40c3 commit def7f96
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,9 @@ typetopology:
-o$(TYPETOP)/json/ -i $(TYPETOP)/source/ $(TYPETOP)/source/index.lagda
zip -j data/typetopology.zip $(TYPETOP)/*.json

# +RTS -H3G -M3G -RTS \
# --no-privates \
testInfer:
cabal run agda2train -- -r -v agda2train:10 \
-oinfer-test/json/ -i infer-test/ infer-test/All.agda
3 changes: 3 additions & 0 deletions infer-test/All.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module All where
import Simple
import SimpleEnum
23 changes: 23 additions & 0 deletions infer-test/Simple.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module Simple where

open import SimpleLib

Theorem1 : Set
Theorem1 = A -> B

theorem : Theorem1
theorem = lemma1

theorem1 : A -> B
theorem1 = lemma1

Theorem2 : Set
Theorem2 = B -> A

theorem2 : B -> C
theorem2 = lemma2

theorem3 : A -> C
theorem3 x = lemma2 (lemma1 x)


14 changes: 14 additions & 0 deletions infer-test/SimpleEnum.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module SimpleEnum where

open import SimpleEnumLib

theorem : A -> B
theorem = lemma1

theorem2 : B -> C
theorem2 = lemma2

theorem3 : A -> C
theorem3 x = lemma2 (lemma1 x)


19 changes: 19 additions & 0 deletions infer-test/SimpleEnumLib.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module SimpleEnumLib where

data A : Set where
aa : A

data B : Set where
bb bb1 : B

data C : Set where
cc cc2 cc3 : C

lemma1 : A -> B
lemma1 aa = bb

lemma2 : B -> C
lemma2 bb = cc
lemma2 bb1 = cc2


25 changes: 25 additions & 0 deletions infer-test/SimpleLib.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module SimpleLib where

data A : Set where
aa : A
-- in the nominal approach (which is true to Agda), it is as if we had:

-- A : Set
-- A = <name "A">

-- aa : A
-- aa = <name "aa">

data B : Set where
bb : B

data C : Set where
cc : C

lemma1 : A -> B
lemma1 aa = bb

lemma2 : B -> C
lemma2 bb = cc


0 comments on commit def7f96

Please sign in to comment.