Skip to content

Commit 0e6bf41

Browse files
committed
parser: allow nested quantifiers at the top level
Note: the parser is spitting out a lot of conflicts. Warning: 28 states have shift/reduce conflicts. Warning: one state has reduce/reduce conflicts. Warning: 338 shift/reduce conflicts were arbitrarily resolved. Warning: one reduce/reduce conflict was arbitrarily resolved. Warning: 232 end-of-stream conflicts were arbitrarily resolved. These are not introduced (nor fixed) by this patch.
1 parent 8e34bed commit 0e6bf41

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

src/ml/pulseparser.mly

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,10 +359,10 @@ mutOrRefQualifier:
359359
| MUT { MUT }
360360
| REF { REF }
361361

362-
typX(X,Y):
363-
| t=Y { t }
362+
typX(X):
363+
| t=X { t }
364364

365-
| q=quantifier bs=binders DOT trigger=trigger e=X
365+
| q=quantifier bs=binders DOT trigger=trigger e=typX(X)
366366
{
367367
match bs with
368368
| [] ->
@@ -373,5 +373,5 @@ typX(X,Y):
373373
}
374374

375375
pulseSLProp:
376-
| p=typX(tmEqWith(appTermNoRecordExp), tmEqWith(appTermNoRecordExp))
376+
| p=typX(tmEqWith(appTermNoRecordExp))
377377
{ p }

test/nolib/QuantifierOps.fst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
module QuantifierOps
2+
3+
#lang-pulse
4+
open Pulse.Nolib
5+
6+
let ( exists* ) : #a:Type -> (a -> slprop) -> slprop = admit()
7+
let ( forall+ ) : #a:Type -> (a -> slprop) -> slprop = admit()
8+
9+
let test =
10+
forall+ (x : int).
11+
exists* (y : int).
12+
emp
13+
14+
let test2 =
15+
exists* (y : int).
16+
forall+ (x : int).
17+
emp
18+
19+
fn def ()
20+
preserves
21+
forall+ (x : int).
22+
exists* (y : int).
23+
emp
24+
{
25+
()
26+
}

0 commit comments

Comments
 (0)