-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
froglet: error test for 'negate implies' froglet: context-sensitive join checks froglet: field lookup, stop at shadows froglet: can require from forge, but cannot use froglet: serialize funtype, fix type=? froglet: reachable, basic join checks 2+ args 1st arg object Nth arg field froglet: reachable again 3+ args: (tgt, src, acc, ...) [[ check the docs! ]] tgt must be object src must be object acc must be valid field ... for src alone? for more? froglet: checkpoint, reachable trans.closure search froglet, reachable march-forward analysis stxclass: ~literal to ~datum froglet: no obj checks for examples, insts froglet: start checking bridge_crossing froglet: loosen = typecheck, allow <: or :> froglet: add paramtypes to current env tf4: consttype parsing, ifelse delay check checkpoint froglet: upgrade pred names to formulas, when 0 args tf4: fix inst-check outline tf4: allow 'no x | x.next' etc tf4: allow bound { field is linear } froglet: stricter binary op checks tf4: progress on bridge_crossing, on to pets tf4: add a srcloc, add stx->mult tf4: basic reltype, unop #, deparsing tf4: hide froglet env to allow +2 imports tf4: +2 binop names froglet: pred, allow multiplicity on params froglet: env-fold, use helper for fn return froglet: parse fun output type froglet: lookup names in param env tf4: better ifelse checking checkpoint
- Loading branch information
Showing
26 changed files
with
946 additions
and
234 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#lang froglet | ||
option run_sterling off | ||
|
||
sig Node { | ||
next: lone Node | ||
} | ||
one sig A, B extends Node{} | ||
|
||
pred err { | ||
A not implies B else C | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#lang froglet | ||
|
||
abstract sig Position {} | ||
one sig Near extends Position {} | ||
one sig Far extends Position {} | ||
|
||
sig State { | ||
torch: one Position, | ||
spent: one Int | ||
} | ||
|
||
pred ValidState[s: State] { | ||
s.torch = 0 | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#lang froglet | ||
|
||
abstract sig Position {} | ||
one sig Near extends Position {} | ||
one sig Far extends Position {} | ||
|
||
sig State { | ||
torch: one Position, | ||
spent: one Int | ||
} | ||
|
||
pred ValidState[s: State] { | ||
s.spent = Near | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#lang froglet | ||
|
||
abstract sig Position {} | ||
one sig Near extends Position {} | ||
one sig Far extends Position {} | ||
|
||
sig State { | ||
torch: one Position, | ||
spent: one Int | ||
} | ||
|
||
pred ValidState[s: State] { | ||
s.torch <= 2 | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#lang froglet | ||
|
||
abstract sig Position {} | ||
one sig Near extends Position {} | ||
one sig Far extends Position {} | ||
|
||
sig State { | ||
torch: one Position, | ||
spent: one Int | ||
} | ||
|
||
pred ValidState[s: State] { | ||
s.spent <= Near | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#lang froglet | ||
|
||
// Student created a quantified variable that's named the same as a field, then tried to use the field. (https://edstem.org/us/courses/31922/discussion/2548781?comment=5844098). | ||
// https://edstem.org/us/courses/31922/discussion/2548781?comment=5844098 | ||
|
||
sig Person { | ||
spouse: lone Person | ||
} | ||
|
||
pred ownGrandparent { | ||
one me: Person, spouse: Person | { | ||
spouse.spouse = me | ||
} | ||
} | ||
|
||
//pred oG2 { | ||
// some me: Person, spouse: Person | { | ||
// spouse.spouse = me | ||
// } | ||
//} | ||
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#lang froglet | ||
option run_sterling off | ||
|
||
sig Node { | ||
next: lone Node | ||
} | ||
|
||
pred pp { | ||
next is linear | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#lang froglet | ||
option run_sterling off | ||
|
||
sig Node { | ||
next: lone Node | ||
} | ||
|
||
check {} for { Node is linear } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#lang froglet | ||
|
||
// no father = disallowed at toplevel | ||
|
||
sig Person { | ||
father: lone Person | ||
} | ||
one sig Tim extends Person {} | ||
|
||
pred myPred { | ||
no father | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#lang froglet -- forge | ||
|
||
abstract sig Key {} | ||
sig Pubk, Privk extends Key {} | ||
|
||
one sig Authority { | ||
pairs: func Pubk -> Privk | ||
} | ||
|
||
fun counterpart[k: one Key]: one Key { | ||
-- this produces an error, since k is known to be a Pubk | ||
/* | ||
join always results in an empty relation: | ||
Left argument of join "(Authority.pairs)" is in ((Pubk -> Privk)) | ||
Right argument of join "k" is in ((Pubk)) | ||
There is no possible join result | ||
in: "(Authority.pairs.k)" | ||
*/ | ||
Authority.pairs.k | ||
} | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#lang froglet | ||
option run_sterling off | ||
|
||
sig Node { | ||
next: lone Node | ||
} | ||
|
||
sig A { | ||
field: one Node | ||
} | ||
|
||
pred cycle { | ||
reachable[] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#lang froglet | ||
option run_sterling off | ||
|
||
sig Node { | ||
next: lone Node | ||
} | ||
|
||
sig A { | ||
field: one Node | ||
} | ||
|
||
pred cycle { | ||
all n: Node | reachable[n.next] | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#lang froglet | ||
option run_sterling off | ||
|
||
-- error: cannot reach target because types don't line up | ||
-- need NA -> NB -> NC -> NA but missing one link | ||
|
||
sig Node {} | ||
sig NA extends Node { | ||
na: lone NB | ||
} | ||
sig NB extends Node { | ||
nb: lone NC | ||
} | ||
sig NC extends Node { | ||
nc: lone NA | ||
} | ||
|
||
pred cycle { | ||
all n: NA | reachable[n, n.na, na, nb] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#lang froglet | ||
option run_sterling off | ||
|
||
-- error: useless field, cannot reach a sig that might use the field | ||
|
||
sig Node {} | ||
sig NA extends Node { | ||
na: lone NA | ||
} | ||
sig NB extends Node { | ||
nb: lone NB | ||
} | ||
|
||
pred cycle { | ||
all n: NA | reachable[n, n.na, na, nb] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,5 +11,5 @@ sig Person { | |
one sig Tim extends Person {} | ||
|
||
pred myPred { | ||
some father | ||
some father | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#lang froglet | ||
option run_sterling off | ||
|
||
sig University {} | ||
one sig BrownU extends University {} | ||
sig Person { | ||
father: lone Person, | ||
mother: lone Person, | ||
grad: lone University | ||
} | ||
one sig Tim extends Person {} | ||
|
||
pred myPred { | ||
some Tim.Tim | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#lang forge | ||
|
||
sig A {} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#lang froglet | ||
|
||
open "forge.frg" | ||
|
||
sig B { | ||
// a: lone A | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ | |
(require | ||
froglet/util) | ||
|
||
(error-print-context-length 4) | ||
|
||
;; --- | ||
|
||
(define who 'froglet) | ||
|
Oops, something went wrong.