Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/refine #82

Merged
merged 69 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
7102674
feat(Handler2.AutoCompletion): add digHole
Feb 27, 2024
9832569
fix(Server.Handler2.Reload): add missing imports
Mar 1, 2024
cd2c0eb
fix(Server.Handler2): use old AutoCompletion
Mar 1, 2024
3c51d7d
fix(Server.Handler2.CustomMethod): change parse type from Request to …
Mar 1, 2024
0678493
fix to compile
B04902047 May 20, 2024
b356881
refactor server
B04902047 May 27, 2024
92f24d6
split reload from guabao to guabao/reload
B04902047 May 28, 2024
a646f27
add guabao/refine
B04902047 May 28, 2024
4bc08a3
merge with Typed.hs
B04902047 Jun 5, 2024
f3aceca
fix hover and goToDefinition
B04902047 Jun 5, 2024
07655b6
implement key function parseFragment for refine
B04902047 Jun 5, 2024
1a0d725
add helping toAbstractFragment and typeCheckFragment to guabao/refine
B04902047 Jun 5, 2024
48a1a62
refactor(Refine.hs)
B04902047 Jun 16, 2024
6ca4835
Merge branch 'master' of https://github.com/scmlab/gcl into feat/Posi…
B04902047 Jun 16, 2024
d0817ef
fix hole to compile
B04902047 Jun 18, 2024
6331967
fix refine
B04902047 Jun 19, 2024
e074ea6
add hover handler to handlers
B04902047 Jun 26, 2024
8d682cd
client to server notification define customized toJSON
B04902047 Jul 17, 2024
bc22461
add refine TODO comment
B04902047 Jul 17, 2024
3293f77
Add `TypeEnv` for `Spec` & take `TypeEnv` into account while elaborat…
AndyShiue Jul 17, 2024
a4d1e15
bind refine handler to the list of handlers
B04902047 Jul 17, 2024
8642298
Merge pull request #76 from scmlab/tmp
B04902047 Jul 24, 2024
1031dac
first commits
B04902047 Jul 24, 2024
c571909
Merge branch 'feat/PositionMapping' of https://github.com/scmlab/gcl …
B04902047 Jul 24, 2024
5a8eca6
[refactor] Changed names for data in Syntax.Typed.
scmu Jul 24, 2024
52a3500
Merge pull request #77 from scmlab/feat/TypedNameChange
B04902047 Jul 24, 2024
05f994c
first commits
B04902047 Jul 24, 2024
5e4ea27
Merge branch 'feat/PositionMapping' of https://github.com/scmlab/gcl …
B04902047 Jul 24, 2024
faf30b6
[new] Location and Operators for Syntax.Typed.
scmu Jul 24, 2024
0d3991f
[refactor] rename: GCL.WP.Type -> GCL.WP.Types
scmu Jul 26, 2024
dac8fae
[new] Render.Syntax.Typed
scmu Jul 26, 2024
8cfb254
[new] Let Pred be Syntax.Typed.Expr. Removed old Pred in some modules.
scmu Jul 26, 2024
96f2898
[new] Pretty.Typed and Syntax.Typed.Utils.
scmu Jul 26, 2024
544aa86
[new] Subst (constructor) in Syntax.Typed; typeOf in Syntax.Typed.Util.
scmu Jul 30, 2024
6e50788
[new] adapted WP.SP, Struct, Explanation, etc. to typed syntax.
scmu Aug 1, 2024
e8b41c3
[new] adapted WP.WP to typed syntax.
scmu Aug 1, 2024
5437db4
[new] GCL.WP adapted to typed syntax.
scmu Aug 1, 2024
e736353
[new] Syntax.Typed.Instances.Free
scmu Aug 1, 2024
5a26e0b
[refactor] removed SCM.
scmu Aug 1, 2024
b373452
[refactor] removed SCM
scmu Aug 1, 2024
8e199c5
[new] Variableous and Substitutable for Syntax.Typed. In progress.
scmu Aug 1, 2024
d9a71ca
[fix] import GCL.WP.Types in some files.
scmu Aug 1, 2024
8bd9694
[new] sweepFragment in Server.Handler.Gaubao.Refine now type checks a…
scmu Aug 1, 2024
b93ca2a
[fix] missing cases, import the right module, etc.
scmu Aug 1, 2024
dd847d0
fix reload and refine with new sweep on elaborated
B04902047 Aug 2, 2024
c0c00ad
fix load with question mark
B04902047 Aug 2, 2024
626e112
Merge pull request #78 from scmlab/feat/TypedWP-fix
scmu Aug 2, 2024
12f7136
[fix] sweepFragment now passes counter.
scmu Aug 2, 2024
e079bd3
Merge branch 'feat/TypedWP' of https://github.com/scmlab/gcl into fea…
B04902047 Aug 3, 2024
2e1c5a1
fixing refine
B04902047 Aug 3, 2024
cd085c7
fixing refine
B04902047 Aug 3, 2024
f0b15e2
fixing refine
B04902047 Aug 12, 2024
afee703
fixed refine: spec with multiple columns
B04902047 Aug 12, 2024
44111c2
fixing refine
B04902047 Aug 12, 2024
68750a6
Fix a bug due to abusing the state variable.
AndyShiue Aug 13, 2024
237f050
Derive `Generic` for `TypeInfo`
AndyShiue Aug 13, 2024
9a84cba
Merge pull request #79 from scmlab/for_vince
B04902047 Aug 15, 2024
4b59759
initial commits
B04902047 Aug 15, 2024
b110072
Merge branch 'feat/PositionMapping' of https://github.com/scmlab/gcl …
B04902047 Aug 15, 2024
d443b8d
initial commits
B04902047 Aug 15, 2024
67501c0
Fix the bug that decls and defns are ignored.
AndyShiue Aug 15, 2024
625354e
Merge pull request #80 from scmlab/for_vince
B04902047 Aug 15, 2024
5dfd6da
split update notification to 2 notifications: update and error
B04902047 Aug 15, 2024
00dd3e3
Merge branch 'feat/PositionMapping' of https://github.com/scmlab/gcl …
B04902047 Aug 15, 2024
92924b3
fix position encodings
B04902047 Aug 15, 2024
5fbb7ae
fixing
B04902047 Aug 21, 2024
5086c86
fixing refine
B04902047 Aug 22, 2024
d97e7f8
fixing refine a bit more
scmu Aug 22, 2024
46ef7b4
style
B04902047 Aug 22, 2024
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
9 changes: 5 additions & 4 deletions app/Main.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}

{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}

module Main where

Expand All @@ -8,18 +9,18 @@ import Pretty ()
import System.Console.GetOpt
import System.Environment
import Prelude
import Server (run)
import Server (runOnPort, runOnStdio)

main :: IO ()
main = do
(Options mode port, _) <- getArgs >>= parseOpts
case mode of
ModeHelp -> putStrLn $ usageInfo usage options
ModeLSP -> do
_ <- run False port
_ <- runOnStdio "/Users/vince/Documents/gcl-vscode/server_log.txt"
return ()
ModeDev -> do
_ <- run True port
_ <- runOnPort port
return ()

--------------------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions examples/divmod.gcl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ var q, b, r : Int
b := B
{ PowOf2 b, bnd: A - b }
do b ≤ A -> b := b * 2 od

[!

!]
{ PowOf2 b ∧ b > A }

q, r := 0, A
Expand Down
8 changes: 7 additions & 1 deletion examples/factor.gcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ var p, x, y, n : Int
var mod : Int -> Int -> Int

{: P = x * y + p = N
Q = x > 0 ∧ y > 0
Q = x > 0 ∧ y > 0 ∧ 1 > 0
:}
p := p + 1
[!

!]
[!

!]
p,x,y := N-1, 1, 1

{ P ∧ Q, bnd: p }
Expand Down
30 changes: 30 additions & 0 deletions examples/fastmul_with_holes.gcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
con A, B : Int { A ≥ 0 ∧ B ≥ 0 }
con even, odd : Int -> Bool
var r, a, b : Int

{: INV = a * b + r = A * B ∧ 0 ≤ b :}

a, b, r := A, B, 0
{ INV, bnd: b }
do b ≠ 0 ->
if even b ->
b := b / 2
| odd b ->
a := 3
a := 3
[!

!]
[!
?

!]
r := a
fi
od
{ r = A * B }





90 changes: 47 additions & 43 deletions gcl.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ library
GCL.WP.Explanation
GCL.WP.SP
GCL.WP.Struct
GCL.WP.Type
GCL.WP.Types
GCL.WP.Util
GCL.WP.WP
Pretty
Expand All @@ -45,6 +45,7 @@ library
Pretty.Concrete
Pretty.Error
Pretty.Predicate
Pretty.Typed
Pretty.Util
Pretty.Variadic
Render
Expand All @@ -54,34 +55,26 @@ library
Render.Predicate
Render.Syntax.Abstract
Render.Syntax.Common
Render.Syntax.Typed
Server
Server.CustomMethod
Server.GoToDefn
Server.Handler
Server.Handler.AutoCompletion
Server.Handler.CustomMethod
Server.Handler.Diagnostic
Server.Handler.GoToDefn
Server.Handler.GoToDefinition
Server.Handler.Guabao.Refine
Server.Handler.Guabao.Reload
Server.Handler.Hover
Server.Handler2
Server.Handler2.CustomMethod
Server.Handler2.CustomMethod.HelloWorld
Server.Handler2.CustomMethod.InsertProofTemplate
Server.Handler2.CustomMethod.Inspect
Server.Handler2.CustomMethod.Refine
Server.Handler2.CustomMethod.Reload
Server.Handler2.CustomMethod.SubstituteRedex
Server.Handler2.CustomMethod.Utils
Server.Handler2.GoToDefinition
Server.Handler2.Hover
Server.Handler2.Initialized
Server.Handler2.SemanticTokens
Server.Handler2.Utils
Server.Handler.Initialized
Server.Handler.OnDidChangeTextDocument
Server.Handler.SemanticTokens
Server.Highlighting
Server.Hover
Server.IntervalMap
Server.Load
Server.Monad
Server.Pipeline
Server.Notification.Error
Server.Notification.Update
Server.PositionMapping
Server.SrcLoc
Syntax.Abstract
Syntax.Abstract.Instances.Json
Expand All @@ -105,16 +98,24 @@ library
Syntax.Parser.Util
Syntax.Substitution
Syntax.Typed
Syntax.Typed.Instances.Free
Syntax.Typed.Instances.Located
Syntax.Typed.Instances.Substitution
Syntax.Typed.Operator
Syntax.Typed.Types
Syntax.Typed.Util
other-modules:
Paths_gcl
hs-source-dirs:
src
ghc-options: -Wall -Werror=incomplete-patterns -fno-warn-orphans
build-depends:
aeson
Diff
, aeson
, base >=4.7 && <5
, bytestring
, containers
, deepseq
, free
, hashable
, lens
Expand Down Expand Up @@ -145,10 +146,12 @@ executable gcl
app
ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -Werror=incomplete-patterns -fno-warn-orphans
build-depends:
aeson
Diff
, aeson
, base >=4.7 && <5
, bytestring
, containers
, deepseq
, free
, gcl
, hashable
Expand Down Expand Up @@ -202,7 +205,7 @@ test-suite gcl-test
GCL.WP.Explanation
GCL.WP.SP
GCL.WP.Struct
GCL.WP.Type
GCL.WP.Types
GCL.WP.Util
GCL.WP.WP
Pretty
Expand All @@ -211,6 +214,7 @@ test-suite gcl-test
Pretty.Concrete
Pretty.Error
Pretty.Predicate
Pretty.Typed
Pretty.Util
Pretty.Variadic
Render
Expand All @@ -220,34 +224,26 @@ test-suite gcl-test
Render.Predicate
Render.Syntax.Abstract
Render.Syntax.Common
Render.Syntax.Typed
Server
Server.CustomMethod
Server.GoToDefn
Server.Handler
Server.Handler.AutoCompletion
Server.Handler.CustomMethod
Server.Handler.Diagnostic
Server.Handler.GoToDefn
Server.Handler.GoToDefinition
Server.Handler.Guabao.Refine
Server.Handler.Guabao.Reload
Server.Handler.Hover
Server.Handler2
Server.Handler2.CustomMethod
Server.Handler2.CustomMethod.HelloWorld
Server.Handler2.CustomMethod.InsertProofTemplate
Server.Handler2.CustomMethod.Inspect
Server.Handler2.CustomMethod.Refine
Server.Handler2.CustomMethod.Reload
Server.Handler2.CustomMethod.SubstituteRedex
Server.Handler2.CustomMethod.Utils
Server.Handler2.GoToDefinition
Server.Handler2.Hover
Server.Handler2.Initialized
Server.Handler2.SemanticTokens
Server.Handler2.Utils
Server.Handler.Initialized
Server.Handler.OnDidChangeTextDocument
Server.Handler.SemanticTokens
Server.Highlighting
Server.Hover
Server.IntervalMap
Server.Load
Server.Monad
Server.Pipeline
Server.Notification.Error
Server.Notification.Update
Server.PositionMapping
Server.SrcLoc
Syntax.Abstract
Syntax.Abstract.Instances.Json
Expand All @@ -271,16 +267,24 @@ test-suite gcl-test
Syntax.Parser.Util
Syntax.Substitution
Syntax.Typed
Syntax.Typed.Instances.Free
Syntax.Typed.Instances.Located
Syntax.Typed.Instances.Substitution
Syntax.Typed.Operator
Syntax.Typed.Types
Syntax.Typed.Util
Paths_gcl
hs-source-dirs:
test
src
ghc-options: -Wall -Werror=incomplete-patterns -fno-warn-orphans
build-depends:
aeson
Diff
, aeson
, base >=4.7 && <5
, bytestring
, containers
, deepseq
, directory
, filepath
, free
Expand Down
22 changes: 22 additions & 0 deletions log.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
=== Log file Start ===
SInitialized is called.
STextDocumentDidOpen is called.
load start
load start
load start 2
load start 3
loaded file state
current version determined
load: source read
load: file read
load: source parsed
load: swept
load: elaborated
load: fileState created
load: fileState saved
STextDocumentDidOpen is finished.

---> Syntax Highlighting
---> Syntax Highlighting
---> Syntax Highlighting
---> Syntax Highlighting<-- Goto Definition
23 changes: 12 additions & 11 deletions package.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: gcl
version: 0.1.0.0
name: gcl
version: 0.1.0.0
#synopsis:
#description:
homepage: https://github.com/scmlab/gcl
license: BSD3
author: Author name here
maintainer: [email protected]
copyright: something
category: language
homepage: https://github.com/scmlab/gcl
license: BSD3
author: Author name here
maintainer: [email protected]
copyright: something
category: language
extra-source-files:
- README.md
- README.md

dependencies:
- base >= 4.7 && < 5
Expand All @@ -30,12 +30,14 @@ dependencies:
- regex-applicative
- random
- vector
- lsp
- lsp
- lens
- multiset
- transformers
- template-haskell
- multistate
- deepseq
- Diff

library:
source-dirs: src
Expand All @@ -60,7 +62,6 @@ executables:
- -Werror=incomplete-patterns
- -fno-warn-orphans


tests:
gcl-test:
main: Test.hs
Expand Down
Loading
Loading