Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
502e002
add: initial experiment with racket/typed, bugfix
tnelson Oct 22, 2025
702c1a7
working
tnelson Oct 27, 2025
d6a56a9
working...
tnelson Oct 27, 2025
c409aca
working
tnelson Oct 28, 2025
a1b052d
working
tnelson Oct 28, 2025
7c2c10b
working
tnelson Oct 28, 2025
13caced
working
tnelson Oct 29, 2025
7feaf5b
.
tnelson Oct 29, 2025
73ca897
.
tnelson Oct 29, 2025
4e6d300
working
tnelson Oct 30, 2025
c5c545d
working
tnelson Oct 30, 2025
ecfdb21
huzzah
tnelson Oct 30, 2025
21f0c5d
working
tnelson Oct 30, 2025
74c8c43
.
tnelson Oct 30, 2025
29d2c89
working
tnelson Oct 30, 2025
c4182f3
working
tnelson Oct 30, 2025
0a65b2d
progress
tnelson Oct 30, 2025
03bad71
working
tnelson Oct 30, 2025
24b2797
note
tnelson Oct 31, 2025
4f7f8fe
.
tnelson Oct 31, 2025
796ba0d
fix
tnelson Oct 31, 2025
31735a6
fix
tnelson Oct 31, 2025
3629a1e
.
tnelson Oct 31, 2025
2c5cee6
.
tnelson Oct 31, 2025
0c6e4c1
some cleanup
tnelson Oct 31, 2025
647617f
working
tnelson Oct 31, 2025
f6e8316
working
tnelson Oct 31, 2025
61515b9
fix
tnelson Nov 1, 2025
9630108
.
tnelson Nov 1, 2025
449745b
simplify breaker invocation
tnelson Nov 2, 2025
748b151
working on send-to-solver
tnelson Nov 2, 2025
2b95f66
working
tnelson Nov 2, 2025
0a4c53d
working
tnelson Nov 2, 2025
fe2c7e8
.
tnelson Nov 2, 2025
2f43b3a
.
tnelson Nov 2, 2025
2487874
.
tnelson Nov 2, 2025
1cb754e
1 fix
tnelson Nov 3, 2025
c2d2a3b
working
tnelson Nov 3, 2025
cbf5f5c
working
tnelson Nov 3, 2025
21aa41c
.
tnelson Nov 3, 2025
f13d9f8
.
tnelson Nov 3, 2025
d5f17e4
.
tnelson Nov 4, 2025
fece496
.
tnelson Nov 4, 2025
e66758b
.
tnelson Nov 4, 2025
98262dd
.
tnelson Nov 4, 2025
98cf59f
trim
tnelson Nov 4, 2025
7010f90
fix: stop loading the froglet package in CI
tnelson Nov 4, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/continuousIntegration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@v3
- name: Install Forge
run: |
raco pkg install --auto --no-docs ./forge ./froglet
raco pkg install --auto --no-docs ./forge
- name: Run tests
run: |
cd forge/
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1,141 changes: 653 additions & 488 deletions forge/breaks.rkt

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions forge/lang/ast.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,11 @@
(raise-forge-error
#:msg (format "~a quantifier cannot use the same variable name more than once; used: ~a." quantifier vars)
#:context info))
; lone and one are desugared to either more basic quantifiers or to a multiplicity.
(unless (member quantifier '(some all no))
(raise-forge-error
#:msg (format "~a quantified-formula must be desugared first to some, all, or no." quantifier)
#:context info))

(for ([e (in-list (map cdr decls))])
(unless (node/expr? e)
Expand Down
46 changes: 34 additions & 12 deletions forge/lang/bounds.rkt
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
#lang racket/base
#lang typed/racket/base

(require racket/generator (only-in forge/lang/ast relation-arity))
(require (only-in racket cartesian-product))
(provide (all-defined-out))
(require forge/types/ast-adapter)
(require forge/shared)

(provide (struct-out bound) (struct-out bounds)
make-bound make-exact-bound exact-bound? make-upper-bound
get-upper-bound bounds-variables bounds-union)

; A bound is a relation and two lists of tuples `lower` and `upper`.
(struct bound (relation lower upper) #:transparent)
(struct bound ([relation : node/expr/relation]
[lower : (Listof Tuple)]
[upper : (Listof Tuple)]) #:transparent)
; A bounds object is a universe and a collection of bound? instances.
(struct bounds (universe entries) #:transparent)
(struct bounds ([universe : (Listof FAtom)]
[entries : (Listof bound)]) #:transparent)

; Error-checking constructors for bounds
(: make-bound (-> node/expr/relation (Listof Tuple) (Listof Tuple) bound))
(define (make-bound relation lower upper)
;(printf "make-bound; upper was: ~a~n" upper)
(for ([t (in-list lower)])
Expand All @@ -21,27 +27,43 @@
(raise-arguments-error 'make-bound (format "upper bounds must contain tuples of arity ~a" (relation-arity relation)) "upper" t)))
(bound relation lower upper))

(: make-exact-bound (-> node/expr/relation (Listof Tuple) bound))
(define (make-exact-bound relation contents)
(make-bound relation contents contents))

(: exact-bound? (-> bound Boolean))
(define (exact-bound? b) (equal? (bound-lower b) (bound-upper b)))

(: make-upper-bound (-> node/expr/relation (Listof Tuple) bound))
(define (make-upper-bound relation contents)
(make-bound relation '() contents))

(define (make-product-bound relation col1 . columns)
(make-bound relation '() (apply cartesian-product col1 columns)))
; (: make-product-bound (-> node/expr/relation (Listof Tuple) (Listof Tuple) * bound))
; (define (make-product-bound relation col1 . columns)
; (define ub (apply cartesian-product col1 columns))
; (make-bound relation '() ub))

;; for/first is not supported by the typechecker??
;; but for/last is???

; Get the upper bound for a relation r in a bounds? object
(: get-upper-bound (-> bounds node/expr/relation (Option (Listof Tuple))))
(define (get-upper-bound bnds r)
(for/first ([b (in-list (bounds-entries bnds))] #:when (equal? (bound-relation b) r))
(bound-upper b)))
(for/or ([b (in-list (bounds-entries bnds))])
(if (equal? (bound-relation b) r)
(bound-upper b)
#f)))

; get a list of all relations bound by a bounds? object
(: bounds-variables (-> bounds (Listof Any)))
(define (bounds-variables bnds)
(for/list ([b (in-list (bounds-entries bnds))]) (bound-relation b)))
(for/list : (Listof Any) ([b (in-list (bounds-entries bnds))]) (bound-relation b)))

; Combine several sets of bounds, which must be mutually disjoint and share the
; same universe
(: bounds-union (-> bounds bounds))
(define (bounds-union . lbnds)
(define U (bounds-universe (car lbnds)))
(bounds U (for*/list ([bnds (in-list lbnds)][bnd (in-list (bounds-entries bnds))]) bnd)))
(bounds U (for*/list : (Listof bound) ([bnds (in-list lbnds)]
[bnd (in-list (bounds-entries bnds))]) bnd)))

18 changes: 0 additions & 18 deletions forge/lang/reader.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
racket/pretty)
(require forge/lang/alloy-syntax/parser)
(require forge/lang/alloy-syntax/tokenizer)
;(require (prefix-in log: forge/logging/2023/main))
(require forge/shared)

(do-time "forge/lang/reader")
Expand Down Expand Up @@ -113,16 +112,10 @@
path port LANG-NAME CH ACH ICH EXTRA-REQUIRES (~optional INJECTED #:defaults ([INJECTED #''()])))
(quasisyntax/loc stx
(begin
;(define-values (logging-on? project email) (plog:setup LANG-NAME port path))
(define compile-time (current-seconds))
(define injected-if-any INJECTED)
(define extra-requires EXTRA-REQUIRES)

; We no longer do in-Forge logging.
;(when logging-on?
; (uncaught-exception-handler (log:error-handler logging-on? compile-time (uncaught-exception-handler)))
; (log:register-run compile-time project LANG-NAME email path))

(define parse-tree (parse path (make-tokenizer port)))
(define ints-coerced (coerce-ints-to-atoms parse-tree))

Expand All @@ -138,10 +131,6 @@
;; Used for the evaluator
(define-namespace-anchor forge:n)
(forge:nsa forge:n)

; We no longer do in-Forge logging
;(require (prefix-in log: forge/logging/2023/main))
;(require (only-in racket printf uncaught-exception-handler))

;; Set up language-specific error messages
(require forge/choose-lang-specific
Expand All @@ -151,10 +140,6 @@
(set-inst-checker-hash! ICH)
(set-check-lang! LANG-NAME)

;; Override default exception handler
;(uncaught-exception-handler
; (log:error-handler ',logging-on? ',compile-time (uncaught-exception-handler)))

;; Add any code to inject before the model is expanded
,@injected-if-any
;; Expanded model, etc.
Expand All @@ -175,9 +160,6 @@
(module+ main
; Invoke the execs submodule
(require (submod ".." execs)))

; We no longer do in-Forge logging
;(log:flush-logs ',compile-time "no-error")
))

(define module-datum `(module forge-mod forge/lang/expander
Expand Down
Loading