diff --git a/.github/workflows/continuousIntegration.yml b/.github/workflows/continuousIntegration.yml index 0d6c2ba3f..96ab34f0c 100644 --- a/.github/workflows/continuousIntegration.yml +++ b/.github/workflows/continuousIntegration.yml @@ -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/ diff --git a/.gitignore b/.gitignore index 4c14512b6..0257b2c34 100644 --- a/.gitignore +++ b/.gitignore @@ -34,4 +34,9 @@ forge/pardinus-cli/out forge/pardinus-cli/classes *.icloud -*quotes_in_*filename.frg \ No newline at end of file +*quotes_in_*filename.frg + +# Node.js / Playwright e2e tests +forge/e2e/node_modules/ +forge/e2e/playwright-report/ +forge/e2e/test-results/ \ No newline at end of file diff --git a/forge/logging/2022/README.md b/OLD/logging/2022/README.md similarity index 100% rename from forge/logging/2022/README.md rename to OLD/logging/2022/README.md diff --git a/forge/logging/2022/index.js b/OLD/logging/2022/index.js similarity index 100% rename from forge/logging/2022/index.js rename to OLD/logging/2022/index.js diff --git a/forge/logging/2022/main.rkt b/OLD/logging/2022/main.rkt similarity index 100% rename from forge/logging/2022/main.rkt rename to OLD/logging/2022/main.rkt diff --git a/forge/logging/2022/package.js b/OLD/logging/2022/package.js similarity index 100% rename from forge/logging/2022/package.js rename to OLD/logging/2022/package.js diff --git a/forge/logging/2022/schema.sql b/OLD/logging/2022/schema.sql similarity index 100% rename from forge/logging/2022/schema.sql rename to OLD/logging/2022/schema.sql diff --git a/forge/logging/2023/README.md b/OLD/logging/2023/README.md similarity index 100% rename from forge/logging/2023/README.md rename to OLD/logging/2023/README.md diff --git a/forge/logging/2023/index.js b/OLD/logging/2023/index.js similarity index 100% rename from forge/logging/2023/index.js rename to OLD/logging/2023/index.js diff --git a/forge/logging/2023/main.rkt b/OLD/logging/2023/main.rkt similarity index 100% rename from forge/logging/2023/main.rkt rename to OLD/logging/2023/main.rkt diff --git a/forge/logging/2023/package.js b/OLD/logging/2023/package.js similarity index 100% rename from forge/logging/2023/package.js rename to OLD/logging/2023/package.js diff --git a/forge/logging/2023/schema.sql b/OLD/logging/2023/schema.sql similarity index 100% rename from forge/logging/2023/schema.sql rename to OLD/logging/2023/schema.sql diff --git a/forge/logging/check-ex-spec/README.md b/OLD/logging/check-ex-spec/README.md similarity index 100% rename from forge/logging/check-ex-spec/README.md rename to OLD/logging/check-ex-spec/README.md diff --git a/forge/logging/check-ex-spec/index.js b/OLD/logging/check-ex-spec/index.js similarity index 100% rename from forge/logging/check-ex-spec/index.js rename to OLD/logging/check-ex-spec/index.js diff --git a/forge/logging/check-ex-spec/main.rkt b/OLD/logging/check-ex-spec/main.rkt similarity index 100% rename from forge/logging/check-ex-spec/main.rkt rename to OLD/logging/check-ex-spec/main.rkt diff --git a/forge/logging/check-ex-spec/package.js b/OLD/logging/check-ex-spec/package.js similarity index 100% rename from forge/logging/check-ex-spec/package.js rename to OLD/logging/check-ex-spec/package.js diff --git a/forge/logging/check-ex-spec/schema.sql b/OLD/logging/check-ex-spec/schema.sql similarity index 100% rename from forge/logging/check-ex-spec/schema.sql rename to OLD/logging/check-ex-spec/schema.sql diff --git a/forge/logging/google-cloud-function.py b/OLD/logging/google-cloud-function.py similarity index 100% rename from forge/logging/google-cloud-function.py rename to OLD/logging/google-cloud-function.py diff --git a/forge/logging/logging.rkt b/OLD/logging/logging.rkt similarity index 100% rename from forge/logging/logging.rkt rename to OLD/logging/logging.rkt diff --git a/forge/logging/requirements.txt b/OLD/logging/requirements.txt similarity index 100% rename from forge/logging/requirements.txt rename to OLD/logging/requirements.txt diff --git a/forge/logging/schema.sql b/OLD/logging/schema.sql similarity index 100% rename from forge/logging/schema.sql rename to OLD/logging/schema.sql diff --git a/forge/logging/sigs.rkt b/OLD/logging/sigs.rkt similarity index 100% rename from forge/logging/sigs.rkt rename to OLD/logging/sigs.rkt diff --git a/README.md b/README.md index 0059b4007..53cfb9528 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Forge also uses [Sterling](https://sterling-js.github.io/), an expanded and scri ## Documentation -The [Forge documentation page](https://forge-fm.github.io/forge-documentation/home.html) is the best resource for Forge syntax, etc.; the Wiki on this repo may not be up to date. +The [Forge documentation page](https://forge-fm.github.io/forge-documentation/) is the best resource for Forge syntax, etc.; the Wiki on this repo may not be up to date. Note that the documentation is a living document and work in progress; we will be updating it live as students and other users ask questions. For broader historical context on Forge, the [Alloy documentation @@ -26,12 +26,11 @@ To contribute, fork the repository (or open a new branch if a core contributor) ## Installation from source -To install from source, use the following commands. Make sure that you have [Racket](https://racket-lang.org/) installed (any version should work, although we suggest the latest: 8.3), and the `raco` package manager is in your path. You will also need Java installed (we suggest version 11 or later). +To install from source, use the following commands. Make sure that you have [Racket](https://racket-lang.org/) installed (any version should work, although we suggest the latest: 8.3), and the `raco` package manager is in your path. You will also need Java installed (we suggest version 11 or later). Clone this repo, and then: ``` -git clone https://github.com/tnelson/Forge -cd Forge -raco pkg install ./forge ./froglet +cd Forge +raco pkg install ./forge ``` To update, `git pull` the repo and run `raco setup forge` to recompile. @@ -40,7 +39,7 @@ Running on the development branch, `dev`, requires `checkout dev` before install ## Repository Structure -- The `forge` and `froglet` subdirectories contain the `forge` and `froglet` Racket packages. +- The `forge` subdirectory contains the `forge` Racket package. - Relational Forge (`#lang forge`) is defined in the package root (`main.rkt`); - Temporal Forge (`#lang forge/temporal`) is defined in `temporal/main.rkt`. - The `forge/examples/` subdirectory contains a set of curated examples that can be run without reference to the Forge book or other resources. diff --git a/e2e/README.md b/e2e/README.md deleted file mode 100644 index 62fb58cce..000000000 --- a/e2e/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Forge models for end-to-end testing - -These models aren't meant to illustrate any particular concept, but rather are used for -end-to-end testing of the Sterling<->Forge<->Solver workflow. They may use unusual syntax, -unsafe features, etc. diff --git a/e2e/fail_assertion.frg b/e2e/fail_assertion.frg deleted file mode 100644 index 4746a801e..000000000 --- a/e2e/fail_assertion.frg +++ /dev/null @@ -1,16 +0,0 @@ -#lang forge - -option no_overflow true // disallow integer overflow - -sig Pigeon {location: one Pigeonhole} -sig Pigeonhole {} - -pred some_roommates { - some disj p1, p2: Pigeon | p1.location = p2.location -} --- This should pass; we don't expect Sterling to open at all. -assert {#Pigeon > #Pigeonhole} is sufficient for some_roommates --- This should fail; we expect Sterling to open with **only one command**, --- and for the instance to auto-load. **The evaluator should be usable**. -assert {#Pigeon >= #Pigeonhole} is sufficient for some_roommates - diff --git a/e2e/failing_decls_example.frg b/e2e/failing_decls_example.frg deleted file mode 100644 index b46455d34..000000000 --- a/e2e/failing_decls_example.frg +++ /dev/null @@ -1,21 +0,0 @@ -#lang forge - -option no_overflow true // disallow integer overflow - -sig Pigeon {location: one Pigeonhole} -sig Pigeonhole {} - -pred some_roommates { - some disj p1, p2: Pigeon | p1.location = p2.location -} - -// This fails because the instance given violates the type definitions -// The solver yields unsat, so Sterling should not open. -example threePigeons is {some_roommates} for { - Pigeon = `Pigeon0 + `Pigeon1 + `Pigeon2 - Pigeonhole = `Pigeonhole0 + `Pigeonhole1 - // This violates the type declarations: - location = `Pigeon0 -> (`Pigeonhole0 + `Pigeonhole1) + - `Pigeon1 -> `Pigeonhole0 + - `Pigeon2 -> `Pigeonhole0 -} diff --git a/e2e/failing_example.frg b/e2e/failing_example.frg deleted file mode 100644 index 15fa8c157..000000000 --- a/e2e/failing_example.frg +++ /dev/null @@ -1,19 +0,0 @@ -#lang forge - -option no_overflow true // disallow integer overflow - -sig Pigeon {location: one Pigeonhole} -sig Pigeonhole {} - -pred some_roommates { - some disj p1, p2: Pigeon | p1.location = p2.location -} - -// This fails. Since the solver has yielded unsat, Sterling shouldn't open. -example threePigeons is {not some_roommates} for { - Pigeon = `Pigeon0 + `Pigeon1 + `Pigeon2 - Pigeonhole = `Pigeonhole0 + `Pigeonhole1 - location = `Pigeon0 -> `Pigeonhole0 + - `Pigeon1 -> `Pigeonhole0 + - `Pigeon2 -> `Pigeonhole1 -} diff --git a/e2e/passing_example.frg b/e2e/passing_example.frg deleted file mode 100644 index c8f1c3d04..000000000 --- a/e2e/passing_example.frg +++ /dev/null @@ -1,18 +0,0 @@ -#lang forge - -option no_overflow true // disallow integer overflow - -sig Pigeon {location: one Pigeonhole} -sig Pigeonhole {} - -pred some_roommates { - some disj p1, p2: Pigeon | p1.location = p2.location -} - -example threePigeons is some_roommates for { - Pigeon = `Pigeon0 + `Pigeon1 + `Pigeon2 - Pigeonhole = `Pigeonhole0 + `Pigeonhole1 - location = `Pigeon0 -> `Pigeonhole0 + - `Pigeon1 -> `Pigeonhole0 + - `Pigeon2 -> `Pigeonhole1 -} diff --git a/e2e/sat_pass_unsat_pass_2_runs.frg b/e2e/sat_pass_unsat_pass_2_runs.frg deleted file mode 100644 index 9e18e9def..000000000 --- a/e2e/sat_pass_unsat_pass_2_runs.frg +++ /dev/null @@ -1,19 +0,0 @@ -#lang forge - -option no_overflow true // disallow integer overflow - -sig Pigeon {location: one Pigeonhole} -sig Pigeonhole {} - -pred some_roommates { - some disj p1, p2: Pigeon | p1.location = p2.location -} -test expect { - -- This is satisfiable, and so should appear in the run menu. - not_vacuous: {#Pigeon > #Pigeonhole} is sat - -- This is unsatisfiable, and so wouldn't be useful to visualize. - should_be_unsat: {Pigeon != Pigeon} is unsat -} - -see_principle_1: run {} for exactly 5 Pigeon, exactly 4 Pigeonhole -see_principle_2: run {} for exactly 4 Pigeon, exactly 3 Pigeonhole diff --git a/forge/breaks.rkt b/forge/breaks.rkt index 75378f6a3..9468c6d04 100644 --- a/forge/breaks.rkt +++ b/forge/breaks.rkt @@ -1,29 +1,53 @@ -#lang racket/base +#lang typed/racket/base/optional ; This module is concerned with "is linear" and other such "breaker" bind expressions. -(require forge/lang/bounds (prefix-in @ forge/lang/ast)) +(require forge/lang/bounds) ;; TYPED +(require forge/types/ast-adapter) ;; TYPED, contains needed AST functions (not macros) +(require forge/shared) + +(require/typed typed/racket + ; Missing from typed racket's definitions as of 2025-oct-31. + [set-subtract! (All (T) (-> (Setof T) (Setof T) Void))] + [set-add! (All (T) (-> (Setof T) T Void))] + [set-union! (All (T) (-> (Setof T) (Setof T) Void))] + [mutable-set (All (T) (T * -> (Setof T)))] + [set-remove! (All (T) (-> (Setof T) T Void))] + [list->mutable-set (All (T) (-> (U (Listof T) (Setof T)) (Setof T)))] + ; Present in typed racket's definitions + [hash-set! (All (K V) (-> (HashTable K V) K V Void))] + ) + (require predicates) -(require (only-in racket false true set set-union set-intersect set->list list->set set? first rest - cartesian-product empty empty? set-add! mutable-set in-set subset? - set-subtract! set-map list->mutable-set set-remove! append* set-member? - set-empty? set-union! drop-right take-right for/set for*/set filter-not - second set-add match identity) - racket/contract - racket/hash) -(require (only-in forge/shared get-verbosity VERBOSITY_HIGH)) - -(provide constrain-bounds (rename-out [break-rel break]) break-bound break-formulas) +(require (only-in typed/racket + false true set set-union set-intersect set->list list->set set? first + rest cartesian-product empty empty? in-set subset? + set-map append* set-member? + set-empty? drop-right take-right for/set for*/set filter-not + second set-add match identity)) +(require/typed forge/shared + [get-verbosity (-> Integer)] + [VERBOSITY_HIGH Integer]) + +(provide constrain-bounds break-rel break-bound break-formulas) (provide (rename-out [add-instance instance]) clear-breaker-state) (provide make-exact-sbound) (provide (struct-out sbound)) +; The `rel` parameter needs to allow for join arguments, not just relations. +(define-type StrategyFunction + (->* (Integer node/expr bound (Listof Tuple) (Listof node/expr/relation)) + ((U srcloc #f)) + breaker)) + ;;;;;;;;;;;;;; ;;;; util ;;;; ;;;;;;;;;;;;;; +(: int-add1 (-> Integer Integer)) +(define (int-add1 x) (+ x 1)) (define-syntax-rule (cons! xs x) (set! xs (cons x xs))) -(define-syntax-rule (add1! x) (begin (set! x (add1 x)) x)) +(define-syntax-rule (add1! x) (begin (set! x (int-add1 x)) x)) ;;;;;;;;;;;;;;;; ;;;; breaks ;;;; @@ -31,18 +55,30 @@ ; An "sbound" is nearly identical to the "bound" struct defined in forge/lang/bounds, ; except that it contains sets rather than lists. #f is permitted to denote a lack of value. -(struct/contract sbound ([relation any/c] - [lower (or/c #f set?)] - [upper (or/c #f set?)]) #:transparent) - -(define (make-sbound relation lower [upper false]) (sbound relation lower upper)) +; Also, it may represent a bound on a _join_, not just a relation. This is not the case for "bound". +(struct sbound + ([relation : node/expr] + [lower : (Setof Tuple)] + [upper : (Setof Tuple)]) #:transparent) + +(: make-sbound (->* (node/expr/relation (Setof Tuple)) ((Setof Tuple)) sbound)) +(define (make-sbound relation lower [upper : (Setof Tuple) (set)]) + (sbound relation lower upper)) +(: make-exact-sbound (-> node/expr/relation (Setof Tuple) sbound)) (define (make-exact-sbound relation s) (sbound relation s s)) -(struct break (sbound formulas) #:transparent) -(define (make-break sbound [formulas (set)]) (break sbound formulas)) + +;; N.B. Not to be confused with node/breaking/break +(struct break ([sbound : sbound] + [formulas : (Setof node/formula)]) + #:transparent) + +(: make-break (-> sbound (Setof node/formula) break)) +(define (make-break sbound [formulas : (Setof node/formula) (set)]) (break sbound formulas)) ; sigs :: set ; edges :: set> -(struct break-graph (sigs edges) #:transparent) +(struct break-graph ([sigs : (Setof node/expr/relation)] + [edges : (Setof (Setof node/expr/relation))]) #:transparent) ; pri :: Nat ; break-graph :: break-graph @@ -54,76 +90,111 @@ ; BEGIN INSERTED TEMPORARY FIX FOR 'FUNC (struct breaker ( ; priority level of the breaker - pri - break-graph - make-break - make-default - [use-formula #:auto #:mutable]) - #:transparent #:auto-value #f) - + [pri : Integer] + [break-graph : break-graph] + [make-break : (-> break)] + [make-default : (-> break)] + [use-formula : Boolean ]) + #:transparent #:mutable) + +(: formula-breaker (-> Integer break-graph (-> break) (-> break) breaker)) (define (formula-breaker pri break-graph make-break make-default) - (define res (breaker pri break-graph make-break make-default)) + (define res (breaker pri break-graph make-break make-default #f)) (set-breaker-use-formula! res #t) res) ; END INSERTED TEMPORARY FIX FOR 'FUNC +(: bound->sbound (-> bound sbound)) (define (bound->sbound bound) (make-sbound (bound-relation bound) (list->set (bound-lower bound)) (list->set (bound-upper bound)))) +(: sbound->bound (-> sbound bound)) (define (sbound->bound sbound) - (make-bound (sbound-relation sbound) + (if (node/expr/relation? (sbound-relation sbound)) + (make-bound (sbound-relation sbound) (set->list (sbound-lower sbound)) - (set->list (sbound-upper sbound)))) + (set->list (sbound-upper sbound))) + (raise (format "Internal error: sbound->bound called on non-relation. sbound=~a" sbound)))) + +(: bound->break (-> bound break)) (define (bound->break bound) (break (bound->sbound bound) (set))) +(: break-lower (-> break (Setof Tuple))) (define break-lower (compose sbound-lower break-sbound)) +(: break-upper (-> break (Setof Tuple))) (define break-upper (compose sbound-upper break-sbound)) +(: break-relation (-> break node/expr)) (define break-relation (compose sbound-relation break-sbound)) -(define break-bound (compose sbound->bound break-sbound)) - -(define (sbound+ . sbounds) - (make-bound (break-relation (first sbounds)) ; TODO: assert all same relations - (apply set-union (map break-lower sbounds)) - (apply set-intersect (map break-lower sbounds)))) -(define (break+ . breaks) - (make-break (apply sbound+ breaks) - (apply set-union (map break-formulas breaks)))) - -(define (make-exact-break relation contents [formulas (set)]) +(: break-bound (-> break bound)) +(define break-bound (compose sbound->bound break-sbound)) + +; (: sbound+ (-> (Listof sbound) bound)) +; (define (sbound+ sbounds) +; ; TODO: assert all same relations +; (make-bound (break-relation (first sbounds)) +; (apply set-union (map break-lower sbounds)) +; (apply set-intersect (map break-lower sbounds)))) + +; (: break+ (-> (Listof break) break)) +; (define (break+ . breaks) +; (make-break (sbound+ breaks) +; (apply set-union (map break-formulas breaks)))) + +(: make-exact-break (-> node/expr (Setof Tuple) (Setof node/formula) break)) +(define (make-exact-break relation contents [formulas : (Setof node/formula) (set)]) (break (sbound relation contents contents) formulas)) -(define (make-upper-break relation contents [formulas (set)]) + +(: make-upper-break (->* (node/expr/relation (Setof Tuple)) ((Setof node/formula)) break)) +(define (make-upper-break relation contents [formulas : (Setof node/formula) (set)]) (break (sbound relation (set) contents) formulas)) -(define (make-lower-break relation contents atom-lists [formulas (set)]) - (break (sbound relation contents (apply cartesian-product atom-lists)) formulas)) + +(: make-lower-break (-> node/expr/relation (Setof Tuple) (Listof Tuple) (Setof node/formula) break)) +(define (make-lower-break relation contents atom-lists [formulas : (Setof node/formula) (set)]) + (break (sbound relation contents (list->set (apply cartesian-product atom-lists))) formulas)) ;;;;;;;;;;;;;; ;;;; data ;;;; ;;;;;;;;;;;;;; ; symbol |-> (pri rel bound atom-lists rel-list) -> breaker +(: strategies (HashTable Symbol StrategyFunction)) (define strategies (make-hash)) + ; compos[{a₀,...,aᵢ}] = b => a₀+...+aᵢ = b +(: compos (Mutable-HashTable (Setof Symbol) Symbol)) (define compos (make-hash)) + ; a ∈ upsets[b] => a > b +(: upsets (Mutable-HashTable Symbol (Setof Symbol))) (define upsets (make-hash)) + ; a ∈ downsets[b] => a < b +(: downsets (Mutable-HashTable Symbol (Setof Symbol))) (define downsets (make-hash)) ; list of partial instance breakers +(: instances (Listof sbound)) (define instances (list)) + ; a ∈ rel-breaks[r] => "user wants to break r with a" +(: rel-breaks (Mutable-HashTable node/expr/relation (Setof node/breaking/break))) (define rel-breaks (make-hash)) + ; rel-break-pri[r][a] = i => "breaking r with a has priority i" +(: rel-break-pri (Mutable-HashTable node/expr/relation (Mutable-HashTable node/breaking/break Integer))) (define rel-break-pri (make-hash)) + ; priority counter +(: pri_c Integer) (define pri_c 0) ; clear all state +(: clear-breaker-state (-> Void)) (define (clear-breaker-state) (set! instances empty) - (set! rel-breaks (make-hash)) - (set! rel-break-pri (make-hash)) + (set! rel-breaks (ann (make-hash) (Mutable-HashTable node/expr/relation (Setof node/breaking/break)))) + (set! rel-break-pri (ann (make-hash) (Mutable-HashTable node/expr/relation (Mutable-HashTable node/breaking/break Integer)))) (set! pri_c 0)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -131,33 +202,39 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; h :: type(k) |-> set +(: hash-add! (All (K V2) (-> (HashTable K (Setof V2)) K V2 Void))) (define (hash-add! h k v) (if (hash-has-key? h k) (set-add! (hash-ref h k) v) (hash-set! h k (mutable-set v)))) ; h :: type(k1) |-> type(k2) |-> type(v) +(: hash-add-set! (All (K1 K2 V) (-> (Mutable-HashTable K1 (Mutable-HashTable K2 V)) K1 K2 V Void))) (define (hash-add-set! h k1 k2 v) - (unless (hash-has-key? h k1) (hash-set! h k1 (make-hash))) + (unless (hash-has-key? h k1) (hash-set! h k1 (ann (make-hash) (Mutable-HashTable K2 V)))) (define h_k1 (hash-ref h k1)) - (unless (hash-has-key? h_k1 k2) (hash-set! h_k1 k2 pri_c))) + ;; CHANGED pri_c to v. + ;(unless (hash-has-key? h_k1 k2) (hash-set! h_k1 k2 pri_c))) + (unless (hash-has-key? h_k1 k2) (hash-set! h_k1 k2 v))) ; strategy :: () -> breaker +(: add-strategy (-> Symbol StrategyFunction Void)) (define (add-strategy a strategy) (hash-set! strategies a strategy) (hash-add! upsets a a) ;; a > a (hash-add! downsets a a)) ;; a < a + +(: equiv (-> Symbol Symbol * Any)) (define (equiv a . bs) (hash-set! compos (apply set bs) a) (apply stricter a bs) ; TODO: if no fn defined for a, default to naively doing all bs - #|(unless (hash-has-key? strategies a) + #;(unless (hash-has-key? strategies a) (hash-set! strategies a (λ (rel atom-lists rel-list) (apply break+ (for ([b bs]) - ((hash-ref strategies b) atom-lists) - )) - )))|# + ((hash-ref strategies b) atom-lists) )) ))) ) +(: dominate (-> Symbol Symbol Void)) (define (dominate a b) (define upa (hash-ref upsets a)) (define downb (hash-ref downsets b)) @@ -172,7 +249,9 @@ (hash-set! compos (set a x) a) ;; a = a + x ) ) +(: stricter (-> Symbol Symbol * Void)) (define (stricter a . bs) (for ([b bs]) (dominate a b))) +(: weaker (-> Symbol Symbol * Void)) (define (weaker a . bs) (for ([b bs]) (dominate b a))) ; TODO: allow syntax like (declare 'a 'b > 'c 'd > 'e 'f) @@ -182,58 +261,68 @@ [(_ a < bs ...) (weaker a bs ...)] [(_ a = bs ...) (equiv a bs ...)])) +(: min-breaks! (-> (Setof node/breaking/break) (Mutable-HashTable node/breaking/break Integer) Void)) (define (min-breaks! breaks break-pris) - (define changed false) - (hash-for-each compos (λ (k v) + (define changed (ann false Boolean)) + (hash-for-each compos (λ ([k : (Setof Symbol)] [v : Symbol]) (when (subset? k breaks) (set-subtract! breaks k) (set-add! breaks v) ; new break should have priority of highest priority component - (define max-pri (apply min - (set-map k (lambda (s) (hash-ref break-pris s))))) - (hash-set! break-pris v max-pri) + (define pris (ann (set-map k (lambda ([s : Symbol]) + (hash-ref break-pris (node/breaking/break empty-nodeinfo s)))) (Listof Integer))) + (define min-pri (apply min pris)) ; was max-pri (typo?) + (hash-set! break-pris (node/breaking/break empty-nodeinfo v) min-pri) (set! changed true)) )) (when changed (min-breaks! breaks break-pris)) ) -; renamed-out to 'break for use in forge -(define/contract (break-rel rel . breaks) - (-> @node/expr? (or/c symbol? @node/breaking/break?) - void?) +(: break-rel (->* (node/expr/relation) () #:rest (U Symbol node/breaking/break) Void)) +(define (break-rel rel . breaks) (for ([break breaks]) - (define break-key - (cond [(symbol? break) break] - [(@node/breaking/break? break) (@node/breaking/break-break break)] - [else (@raise-forge-error #:msg (format "Not a valid break name: ~a~n" break) #:context #f)])) + (: break-key Symbol) + (: break-node node/breaking/break) + (define-values (break-key break-node) + (cond [(symbol? break) (values break (node/breaking/break empty-nodeinfo break))] + [(node/breaking/break? break) (values (node/breaking/break-break break) break)] + [else (raise (format "Not a value break or break name: ~a" break))])) (unless (hash-has-key? strategies break-key) (error (format "break not implemented among ~a" strategies) break-key)) - (hash-add! rel-breaks rel break) - (hash-add-set! rel-break-pri rel break (add1! pri_c)))) -(define (add-instance i) (cons! instances i)) - -(define (constrain-bounds total-bounds sigs bounds-store relations-store extensions-store) + (hash-add! rel-breaks rel break-node) + (hash-add-set! rel-break-pri rel break-node (add1! pri_c)))) + +(: add-instance (-> sbound Void)) +(define (add-instance i) (cons! instances i)) + +(: constrain-bounds (-> (Listof bound) + (Listof node/expr/relation) + (HashTable node/expr/relation (Listof FAtom)) + (HashTable node/expr/relation (Listof node/expr/relation)) + (HashTable node/expr/relation node/expr/relation) + (Values (Listof bound) (Listof node/formula)))) +(define (constrain-bounds total-bounds maybe-list-sigs bounds-store relations-store extensions-store) (define name-to-rel (make-hash)) - (hash-for-each relations-store (λ (k v) (hash-set! name-to-rel (@node/expr/relation-name k) k))) - (for ([s sigs]) (hash-set! name-to-rel (@node/expr/relation-name s) s)) + (hash-for-each relations-store (λ ([k : node/expr/relation] v) (hash-set! name-to-rel (node/expr/relation-name k) k))) + (for ([s maybe-list-sigs]) (hash-set! name-to-rel (node/expr/relation-name s) s)) ; returns (values new-total-bounds (set->list formulas)) - (define new-total-bounds (list)) - (define formulas (mutable-set)) + (define new-total-bounds (ann (list) (Listof bound))) + (define formulas (ann (mutable-set) (Setof node/formula))) ; unextended sets - (set! sigs (list->mutable-set sigs)) + (define sigs (list->mutable-set maybe-list-sigs)) ; maintain non-transitive reachability relation - (define reachable (make-hash)) + (define reachable (ann (make-hash) (Mutable-HashTable (U node/expr/relation Symbol) + (Setof (U node/expr/relation Symbol))))) (hash-set! reachable 'broken (mutable-set 'broken)) (for ([sig sigs]) (hash-set! reachable sig (mutable-set sig))) (hash-for-each extensions-store (λ (k v) (set-remove! sigs v))) - ; First add all partial instances. - (define instance-bounds (append* (for/list ([i instances]) - (if (sbound? i) (list i) (xml->breakers i name-to-rel))))) + ; First add all partial instances. + ; This is not obsolete! The breakers need to "play nicely" with user-defined `inst`s. (define defined-relations (mutable-set)) - (for ([b instance-bounds]) + (for ([b instances]) (define rel-inst (sbound-relation b)) (for ([bound total-bounds]) (define rel (bound-relation bound)) @@ -244,63 +333,76 @@ (cons! new-total-bounds (sbound->bound b)) (cons! new-total-bounds bound)) (set-add! defined-relations rel) - (define typelist ((@node/expr/relation-typelist-thunk rel))) + (define typelist ((node/expr/relation-typelist-thunk rel))) (for ([t typelist]) (when (hash-has-key? name-to-rel t) (set-remove! sigs (hash-ref name-to-rel t)))))))) ; proposed breakers from each relation - (define candidates (list)) + (define candidates (ann (list) (Listof breaker))) (for ([bound total-bounds]) ; get declared breaks for the relation associated with this bound - (define rel (bound-relation bound)) - (define breaks (hash-ref rel-breaks rel (set))) - (define break-pris (hash-ref rel-break-pri rel (make-hash))) + (define rel (bound-relation bound)) + + (define breaks (hash-ref rel-breaks rel (ann (lambda () (set)) (-> (Setof node/breaking/break)) ))) + (define backup (ann (lambda () (make-hash)) (-> (Mutable-HashTable node/breaking/break Integer)))) + (define break-pris (ann (hash-ref rel-break-pri rel backup) (Mutable-HashTable node/breaking/break Integer))) + ; compose breaks (min-breaks! breaks break-pris) - ;(printf "bound in total-bounds: ~a~n" bound) + (define defined (set-member? defined-relations rel)) (cond [(set-empty? breaks) (unless defined (cons! new-total-bounds bound)) ][else (unless (hash-has-key? relations-store rel) - (@raise-forge-error #:msg (format "Attempted to set or modify bounds of ~a, but the annotation given was of the wrong form (sig vs. field).~n" rel) - #:context #f)) - (define rel-list (hash-ref relations-store rel)) - (define atom-lists (map (λ (b) (hash-ref bounds-store b)) rel-list)) + (raise-forge-error #:msg (format "Attempted to set or modify bounds of ~a, but the annotation given was of the wrong form (sig vs. field).~n" rel) + #:context #f + #:raise? #t)) + (define rel-list (ann (hash-ref relations-store rel) (Listof node/expr/relation))) + (define atom-lists (map (λ ([b : node/expr/relation]) + (define sym-list (ann (hash-ref bounds-store b (lambda () (list))) (Listof FAtom))) + (hash-ref bounds-store b)) rel-list)) ; make all breakers - (define breakers (for/list ([break (set->list breaks)]) - (define break-sym - (cond [(symbol? break) break] - [(@node/breaking/break? break) (@node/breaking/break-break break)] - [else (@raise-forge-error #:msg (format "constrain-bounds: not a valid break name: ~a~n" break) - #:context #f)])) - (define loc (if (@node? break) - (@nodeinfo-loc (@node-info break)) + ;; break is a "break", strategy returns a "breaker" + + (define breakers (map (lambda ([b : (U node/breaking/break Symbol)]) + (define-values (break-sym break-node) + (cond [(symbol? b) (values b (node/breaking/break empty-nodeinfo b))] + [(node/breaking/break? b) (values (node/breaking/break-break b) b)] + [else (raise-forge-error #:msg (format "constrain-bounds: not a valid break name: ~a~n" break) + #:context #f + #:raise? #t)])) + (define loc (if (node? b) + (nodeinfo-loc (node-info b)) #f)) - (define strategy (hash-ref strategies break-sym)) - (define pri (hash-ref break-pris break)) - (strategy pri rel bound atom-lists rel-list loc))) - (set! breakers (sort breakers < #:key breaker-pri)) + (define strategy (ann (hash-ref strategies break-sym) StrategyFunction)) + ; What if it's a symbol instead of a break?? check dev !!!! b could be maybe + (define pri (ann (hash-ref break-pris break-node) Integer)) + (strategy pri rel bound atom-lists rel-list loc)) + (set->list breaks))) + + (set! breakers (sort breakers (lambda ([x : breaker] [y : breaker]) + (< (breaker-pri x) (breaker-pri y))))) ; propose highest pri breaker that breaks only leaf sigs ; break the rest the default way (with get-formulas) (define broken defined) - (for ([breaker breakers]) - (cond [(or broken (breaker-use-formula breaker)) - (define default ((breaker-make-default breaker))) + (for ([bkr breakers]) + (cond [(or broken (breaker-use-formula bkr)) + (define default ((breaker-make-default bkr))) (set-union! formulas (break-formulas default)) ][else - (define break-graph (breaker-break-graph breaker)) + (define break-graph (breaker-break-graph bkr)) (define broken-sigs (break-graph-sigs break-graph)) (cond [(subset? broken-sigs sigs) - (cons! candidates breaker) + (cons! candidates bkr) (set! broken #t) ][else - (define default ((breaker-make-default breaker))) + (define default ((breaker-make-default bkr))) (set-union! formulas (break-formulas default)) ]) ]) @@ -308,8 +410,7 @@ (unless (or broken defined) (cons! new-total-bounds bound)) ]) ) - ;(printf "new-total-bounds: ~a~n" new-total-bounds) - + #| Now we try to use candidate breakers, starting with highest priority. @@ -326,22 +427,25 @@ Paths between broken sigs can also break soundness. Broken sigs are given an edge to a unique 'broken "sig", so we only need to check for loops. |# - - (set! candidates (sort candidates < #:key breaker-pri)) + + (set! candidates (sort candidates (lambda ([x : breaker] [y : breaker]) + (< (breaker-pri x) (breaker-pri y))))) (for ([breaker candidates]) (define break-graph (breaker-break-graph breaker)) (define broken-sigs (break-graph-sigs break-graph)) (define broken-edges (break-graph-edges break-graph)) - (define edges (list)) + (define edges (ann (list) (Listof (U (Pairof node/expr/relation Symbol) + (Pairof node/expr/relation node/expr/relation))))) + ; reduce broken sigs to broken edges between those sigs and the auxiliary 'broken symbol ; TODO: replace 'broken with univ (for ([sig broken-sigs]) (cons! edges (cons sig 'broken))) ; get all pairs from sets - (for ([edge broken-edges]) + (for ([edge-as-set broken-edges]) ; TODO: make functional - (set! edge (set->list edge)) + (define edge (set->list edge-as-set)) (define L (length edge)) (for* ([i (in-range 0 (- L 1))] [j (in-range (+ i 1) L)]) @@ -350,28 +454,36 @@ ) ; acceptable :<-> doesn't create loops <-> no edges already exist - (define acceptable (for/and ([edge edges]) + (define acceptable (foldl (lambda ([edge : (U (Pairof node/expr/relation Symbol) + (Pairof node/expr/relation node/expr/relation))] + [res : Boolean]) (define A (car edge)) (define B (cdr edge)) - (not (set-member? (hash-ref reachable A) B)) - )) + (define Aval (ann (hash-ref reachable A) (Setof (U node/expr/relation Symbol)))) + (and res (not (set-member? Aval B)))) #t edges)) - (cond [acceptable + (cond + [acceptable ; update reachability. do all edges in parallel - (define new-reachable (make-hash)) + (define new-reachable (ann (make-hash) (Mutable-HashTable node/expr/relation + (Setof (U node/expr/relation Symbol))))) (for ([edge edges]) - (define A (car edge)) - (define B (cdr edge)) + (define A (ann (car edge) node/expr/relation)) + (define B (ann (cdr edge) (U node/expr/relation Symbol))) (when (not (hash-has-key? new-reachable A)) - (hash-set! new-reachable A (mutable-set))) + (hash-set! new-reachable A (ann (mutable-set) (Setof (U node/expr/relation Symbol))))) (when (not (hash-has-key? new-reachable B)) - (hash-set! new-reachable B (mutable-set))) + (when (node/expr/relation? B) ; narrowing + (hash-set! new-reachable B (ann (mutable-set) (Setof (U node/expr/relation Symbol)))))) (set-union! (hash-ref new-reachable A) (hash-ref reachable B)) - (set-union! (hash-ref new-reachable B) (hash-ref reachable A)) + (when (node/expr/relation? B) + (set-union! (hash-ref new-reachable B) (hash-ref reachable A))) ) - (hash-for-each new-reachable (λ (sig newset) + + (hash-for-each new-reachable (λ ([sig : node/expr/relation] + [newset : (Setof (U node/expr/relation Symbol))]) ; set new sigs reachable from sig and vice versa - (define oldset (hash-ref reachable sig)) + (define oldset (ann (hash-ref reachable sig) (Setof (U node/expr/relation Symbol)))) (set-subtract! newset oldset) (for ([sig2 newset]) (define oldset2 (hash-ref reachable sig2)) @@ -383,11 +495,11 @@ ; do break (define break ((breaker-make-break breaker))) (cons! new-total-bounds (break-bound break)) - (set-union! formulas (break-formulas break)) - ][else + (set-union! formulas (break-formulas break))] + [else ; do default break (define default ((breaker-make-default breaker))) - (cons! new-total-bounds (break-sbound default)) + (cons! new-total-bounds (sbound->bound (break-sbound default))) (set-union! formulas (break-formulas default)) ]) ) @@ -396,9 +508,7 @@ (printf "~nBreakers ran.~n New total bounds:~a~n New formulas:~a~n" new-total-bounds formulas)) - (values new-total-bounds (set->list formulas)) -) - + (values new-total-bounds (set->list formulas))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; Strategy Combinators ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -407,69 +517,80 @@ ; ex: (f:B->C) => (g:A->B->C) where f is declared 'foo ; we will declare with formulas that g[a] is 'foo for all a in A ; but we will only enforce this with bounds for a single a in A +; Note: this is needed to support `is linear` on e.g., +; `sig N { next: lone N}` because `next` is ternary. +(: variadic (-> Integer StrategyFunction StrategyFunction)) (define (variadic n f) - (λ (pri rel bound atom-lists rel-list [loc #f]) + (λ ([pri : Integer] [rel : node/expr] [bound : bound] [atom-lists : (Listof Tuple)] + [rel-list : (Listof node/expr/relation)] [loc : (U srcloc #f) #f]) + (define info (just-location-info loc)) + (cond [(= (length rel-list) n) (f pri rel bound atom-lists rel-list loc) ][else - (define prefix (drop-right rel-list n)) + (define prefix (ann (drop-right rel-list n) (Listof node/expr))) (define postfix (take-right rel-list n)) - (define prefix-lists (drop-right atom-lists n)) + (define prefix-lists (ann (drop-right atom-lists n) (Listof Tuple))) (define postfix-lists (take-right atom-lists n)) - (define vars (for/list ([p prefix]) + (define vars (for/list ([p prefix]) : (Listof node/expr/quantifier-var) (let ([symv (gensym "v")]) - (@node/expr/quantifier-var @empty-nodeinfo 1 symv symv)) + (node/expr/quantifier-var empty-nodeinfo 1 symv symv)) )) - (define new-rel (@build-box-join rel vars)) ; rel[a][b]... + (define new-rel (build-box-join rel vars)) ; rel[a][b]... (define sub-breaker (f pri new-rel bound postfix-lists postfix loc)) (define sub-break-graph (breaker-break-graph sub-breaker)) - (define sigs (break-graph-sigs sub-break-graph)) + (define sigs (ann (break-graph-sigs sub-break-graph) (Setof node/expr/relation))) (define edges (break-graph-edges sub-break-graph)) - (define new-break-graph (break-graph - sigs - (set-union edges (for/set ([sig sigs] [p prefix]) (set sig p))) - )) + (define edgesAnd (for/set : (Setof (Setof node/expr/relation)) ([sig sigs] [p prefix]) + (if (node/expr/relation? p) + (set sig p) + (raise (format "Internal error: breaks.variadic combining sigs and non-sigs"))))) + (define new-break-graph (break-graph sigs (set-union edges edgesAnd))) (breaker pri new-break-graph (λ () ; unpack results of sub-breaker (define sub-break ((breaker-make-break sub-breaker))) (define sub-sbound (break-sbound sub-break)) - (define sub-lower (sbound-lower sub-sbound)) - (define sub-upper (sbound-upper sub-sbound)) + (define sub-lower (ann (sbound-lower sub-sbound) (Setof Tuple))) + (define sub-upper (ann (sbound-upper sub-sbound) (Setof Tuple))) (cond [(set-empty? sigs) ; no sigs are broken, so use sub-bounds for ALL instances - (define cart-pref (apply cartesian-product prefix-lists)) - (define lower (for*/set ([c cart-pref] [l sub-lower]) (append c l))) - (define upper (for*/set ([c cart-pref] [u sub-upper]) (append c u))) + (define cart-pref (ann (apply cartesian-product prefix-lists) (Listof Tuple))) + (define lower (for*/set : (Setof Tuple) ([c cart-pref] [l sub-lower]) (append c l))) + (define upper (for*/set : (Setof Tuple) ([c cart-pref] [u sub-upper]) (append c u))) (define bound (sbound rel lower upper)) (define sub-formulas (break-formulas sub-break)) - (define formulas (for/set ([f sub-formulas]) - (@quantified-formula (@just-location-info loc) 'all (map cons vars prefix) f) - )) + (define formulas (for/set : (Setof node/formula) ([f sub-formulas]) + (quantified-formula info 'all + (map (ann cons (-> node/expr/quantifier-var node/expr (Pairof node/expr/quantifier-var node/expr))) + vars prefix) f) + )) ; info quantifier decls formula) (break bound formulas) ][else ; just use the sub-bounds for a single instance of prefix - (define cars (map car prefix-lists)) - (define cdrs (map cdr prefix-lists)) - (define lower (for/set ([l sub-lower]) (append cars l))) + (define cars (map (ann car (-> Tuple FAtom)) prefix-lists)) + (define cdrs (map (ann cdr (-> Tuple Tuple)) prefix-lists)) + (define lower (for/set : (Setof Tuple) ([l sub-lower]) (append cars l))) (define upper (set-union - (for/set ([u sub-upper]) (append cars u)) + (for/set : (Setof Tuple) ([u sub-upper]) (append cars u)) (list->set (apply cartesian-product (append cdrs postfix-lists))) )) (define bound (sbound rel lower upper)) ; use default formulas unless single instance - (define sub-formulas (if (> (apply * (map length prefix-lists)) 1) + (define sub-formulas (if (> (apply * (map (ann length (-> (Listof Any) Integer)) prefix-lists)) 1) (break-formulas ((breaker-make-default sub-breaker))) (break-formulas sub-break) )) ; wrap each formula in foralls for each prefix rel - (define formulas (for/set ([f sub-formulas]) - (@quantified-formula (@just-location-info loc) 'all (map cons vars prefix) f) + (define formulas (for/set : (Setof node/formula) ([f sub-formulas]) + (quantified-formula info 'all + (map (ann cons (-> node/expr/quantifier-var node/expr (Pairof node/expr/quantifier-var node/expr))) + vars prefix) f) )) (break bound formulas) @@ -478,194 +599,216 @@ (λ () (define sub-break ((breaker-make-default sub-breaker))); (define sub-formulas (break-formulas sub-break)) - (define formulas (for/set ([f sub-formulas]) - (@quantified-formula (@just-location-info loc) 'all (map cons vars prefix) f) + (define formulas (for/set : (Setof node/formula) ([f sub-formulas]) + (quantified-formula info 'all + (map (ann cons (-> node/expr/quantifier-var node/expr (Pairof node/expr/quantifier-var node/expr))) + vars prefix) f) )) - (break bound formulas) + (break (bound->sbound bound) formulas) ) + #f ) ]) ) ) -(define (co f) - (λ (pri rel bound atom-lists rel-list [loc #f]) - (define sub-breaker (f pri (@~ rel) bound (reverse atom-lists) (reverse rel-list) loc)) - (breaker pri - (breaker-break-graph sub-breaker) - (λ () - ; unpack results of sub-breaker - (define sub-break ((breaker-make-break sub-breaker))) - (define sub-formulas (break-formulas sub-break)) - (define sub-sbound (break-sbound sub-break)) - (define sub-lower (sbound-lower sub-sbound)) - (define sub-upper (sbound-upper sub-sbound)) - ; reverse all tuples in sbounds - (define lower (for/set ([l sub-lower]) (reverse l))) - (define upper (for/set ([l sub-upper]) (reverse l))) - (define bound (sbound rel lower upper)) - - (break bound sub-formulas) - ) - (λ () - ((breaker-make-default sub-breaker)) - ) - ) - ) -) +; (define (co f) +; (λ (pri rel bound atom-lists rel-list [loc #f]) +; (define sub-breaker (f pri (@~ rel) bound (reverse atom-lists) (reverse rel-list) loc)) +; (breaker pri +; (breaker-break-graph sub-breaker) +; (λ () +; ; unpack results of sub-breaker +; (define sub-break ((breaker-make-break sub-breaker))) +; (define sub-formulas (break-formulas sub-break)) +; (define sub-sbound (break-sbound sub-break)) +; (define sub-lower (sbound-lower sub-sbound)) +; (define sub-upper (sbound-upper sub-sbound)) +; ; reverse all tuples in sbounds +; (define lower (for/set ([l sub-lower]) (reverse l))) +; (define upper (for/set ([l sub-upper]) (reverse l))) +; (define bound (sbound rel lower upper)) + +; (break bound sub-formulas) +; ) +; (λ () +; ((breaker-make-default sub-breaker)) +; ) +; ) +; ) +; ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; define breaks and compositions ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; A->A Strategies ;;; -(add-strategy 'irref (λ (pri rel bound atom-lists rel-list [loc #f]) - (define atoms (first atom-lists)) - (define sig (first rel-list)) - (breaker pri - (break-graph (set) (set)) - (λ () - (make-upper-break rel - (filter-not (lambda (x) (equal? (first x) (second x))) - (apply cartesian-product atom-lists)))) - (λ () (break bound (set - (@no/info (@just-location-info loc) (@& @iden rel)) - ))) - ) -)) -(add-strategy 'ref (λ (pri rel bound atom-lists rel-list [loc #f]) - (define atoms (first atom-lists)) - (define sig (first rel-list)) - (breaker pri - (break-graph (set) (set)) - (λ () - (make-lower-break rel - (filter (lambda (x) (equal? (first x) (second x))) - (apply cartesian-product atom-lists)) - atom-lists)) - (λ () (break bound (set - (@all/info (@just-location-info loc) ([x sig]) - (@in x (@join sig rel)) - ) - ))) - ) -)) +; (add-strategy 'irref (λ (pri rel bound atom-lists rel-list [loc #f]) +; (define atoms (first atom-lists)) +; (define sig (first rel-list)) +; (breaker pri +; (break-graph (set) (set)) +; (λ () +; (make-upper-break rel +; (filter-not (lambda (x) (equal? (first x) (second x))) +; (apply cartesian-product atom-lists)))) +; (λ () (break bound (set +; (@no/info (just-location-info loc) (@& @iden rel)) +; ))) +; ) +; )) +; (add-strategy 'ref (λ (pri rel bound atom-lists rel-list [loc #f]) +; (define atoms (first atom-lists)) +; (define sig (first rel-list)) +; (breaker pri +; (break-graph (set) (set)) +; (λ () +; (make-lower-break rel +; (filter (lambda (x) (equal? (first x) (second x))) +; (apply cartesian-product atom-lists)) +; atom-lists)) +; (λ () (break bound (set +; (@all/info (just-location-info loc) ([x sig]) +; (@in x (@join sig rel)) +; ) +; ))) +; ) +; )) + + (add-strategy 'linear (λ (pri rel bound atom-lists rel-list [loc #f]) (define atoms (first atom-lists)) (define sig (first rel-list)) + (define info (just-location-info loc)) + (define init (node/expr/quantifier-var (just-location-info loc) 1 'init 'init)) + (define term (node/expr/quantifier-var (just-location-info loc) 1 'term 'term)) + (define x (node/expr/quantifier-var (just-location-info loc) 1 'x 'x)) (breaker pri (break-graph (set sig) (set)) - (λ () (make-exact-break rel (list->set (map list (drop-right atoms 1) (cdr atoms))))) - (λ () (break bound (set - (@some/info (@just-location-info loc) ([init sig]) (@&& - (@no (@join rel init)) - (@all ([x (@- sig init)]) (@one (@join rel x))) - (@= (@join init (@* rel)) sig) + (λ () (make-exact-break rel (list->set (map (ann list (-> FAtom FAtom (Listof FAtom))) + (drop-right atoms 1) (cdr atoms))) + (set))) + (λ () (break (bound->sbound bound) (set + (quantified-formula info 'some (list (cons init sig)) (&&/func #:info info + (multiplicity-formula info 'no (join/func #:info info rel init)) + (quantified-formula info 'all (list (cons x (-/func #:info info sig init))) + (multiplicity-formula info 'one (join/func #:info info rel x))) + (=/func #:info info (join/func #:info info init (*/func #:info info rel)) sig) )) - (@some/info (@just-location-info loc) ([term sig]) (@&& - (@no (@join term rel)) - (@all ([x (@- sig term)]) (@one (@join x rel))) - (@= (@join (@* rel) term) sig) - )) - ))) - ) -)) -(add-strategy 'acyclic (λ (pri rel bound atom-lists rel-list [loc #f]) - (define atoms (first atom-lists)) - (define sig (first rel-list)) - (breaker pri - (break-graph (set) (set)) - (λ () - (make-upper-break rel - (for*/list ([i (length atoms)] - [j (length atoms)] - #:when (< i j)) - (list (list-ref atoms i) (list-ref atoms j))))) - (λ () (break bound (set - (@no/info (@just-location-info loc) ([x sig]) - (@in x (@join x (@^ rel))) - ) - ))) - ) -)) -(add-strategy 'tree (λ (pri rel bound atom-lists rel-list [loc #f]) - (define atoms (first atom-lists)) - (define sig (first rel-list)) - (breaker pri - (break-graph (set) (set)) - (λ () - (make-break - (bound->sbound (make-upper-bound rel - (for*/list ([i (length atoms)] - [j (length atoms)] - #:when (< i j)) - (list (list-ref atoms i) (list-ref atoms j))))) - (set - (@some/info (@just-location-info loc) ([n sig]) - (@all ([m (@- sig n)]) - (@one (@join rel m)) - ) - ) - ))) - (λ () (break bound (set - (@some/info (@just-location-info loc) ([n sig]) (@&& - (@no (@join rel n)) - (@all ([m (@- sig n)]) - (@one (@join rel m)) - ) + + (quantified-formula info 'some (list (cons term sig)) (&&/func #:info info + (multiplicity-formula info 'no (join/func #:info info term rel)) + (quantified-formula info 'all (list (cons x (-/func #:info info sig term))) + (multiplicity-formula info 'one (join/func #:info info x rel))) + (=/func #:info info (join/func #:info info (*/func #:info info rel) term) sig) )) ))) + #f ) )) + +; (add-strategy 'acyclic (λ (pri rel bound [atom-lists : (Listof Any)] [rel-list : (Listof Any)] [loc #f]) +; (define atoms (first atom-lists)) +; (define sig (first rel-list)) +; (breaker pri +; (break-graph (set) (set)) +; (λ () +; (make-upper-break rel +; (for*/list ([i (length atoms)] +; [j (length atoms)] +; #:when (< i j)) +; (list (list-ref atoms i) (list-ref atoms j))))) +; (λ () (break bound (set +; (@no/info (just-location-info loc) ([x sig]) +; (@in x (@join x (@^ rel))) +; ) +; ))) +; ) +; )) +; (add-strategy 'tree (λ (pri rel bound atom-lists rel-list [loc #f]) +; (define atoms (first atom-lists)) +; (define sig (first rel-list)) +; (breaker pri +; (break-graph (set) (set)) +; (λ () +; (make-break +; (bound->sbound (make-upper-bound rel +; (for*/list ([i (length atoms)] +; [j (length atoms)] +; #:when (< i j)) +; (list (list-ref atoms i) (list-ref atoms j))))) +; (set +; (@some/info (just-location-info loc) ([n sig]) +; (@all ([m (@- sig n)]) +; (@one (@join rel m)) +; ) +; ) +; ))) +; (λ () (break bound (set +; (@some/info (just-location-info loc) ([n sig]) (@&& +; (@no/info (just-location-info loc) (@join rel n)) +; (@all ([m (@- sig n)]) +; (@one (@join rel m)) +; ) +; )) +; ))) +; ) +; )) (add-strategy 'plinear (λ (pri rel bound atom-lists rel-list [loc #f]) (define atoms (first atom-lists)) (define sig (first rel-list)) + (define info (just-location-info loc)) + (define init (node/expr/quantifier-var (just-location-info loc) 1 'init 'init)) + (define x (node/expr/quantifier-var (just-location-info loc) 1 'x 'x)) (breaker pri (break-graph (set sig) (set)) (λ () (break (sbound rel (set) ;(set (take atoms 2)) - (list->set (map list (drop-right atoms 1) (cdr atoms))) + (list->set (map (ann list (-> FAtom FAtom (Listof FAtom))) + (drop-right atoms 1) (cdr atoms))) ) (set - (@lone/info (@just-location-info loc) ([init sig]) (@&& - (@no (@join rel init)) - (@some (@join init rel)) - )) + (multiplicity-formula info 'lone + (set/func #:info info (list (cons init sig)) (&&/func #:info info + (multiplicity-formula info 'no (join/func #:info info rel init)) + (multiplicity-formula info 'some (join/func #:info info init rel))))) ) )) - (λ () (break bound (set - (@lone/info (@just-location-info loc) (@- (@join rel sig) (@join sig rel))) ; lone init - (@lone/info (@just-location-info loc) (@- (@join sig rel) (@join rel sig))) ; lone term - (@no/info (@just-location-info loc) (@& @iden (@^ rel))) ; acyclic - (@all/info (@just-location-info loc) ([x sig]) (@&& ; all x have - (@lone (@join x rel)) ; lone successor - (@lone (@join rel x)) ; lone predecessor + (λ () (break (bound->sbound bound) (set + (multiplicity-formula info 'lone (-/func #:info info (join/func #:info info rel sig) (join/func #:info info sig rel))) ; lone init + (multiplicity-formula info 'lone (-/func #:info info (join/func #:info info sig rel) (join/func #:info info rel sig))) ; lone term + (multiplicity-formula info 'no (&/func #:info info iden (^/func #:info info rel))) ; acyclic + (quantified-formula info 'all (list (cons x sig)) (&&/func #:info info ; all x have + (multiplicity-formula info 'lone (join/func #:info info x rel)) ; lone successor + (multiplicity-formula info 'lone (join/func #:info info rel x)) ; lone predecessor )) ))) + #f ) )) ;;; A->B Strategies ;;; -(add-strategy 'func (λ (pri rel bound atom-lists rel-list [loc #f]) - +(add-strategy 'func (λ ([pri : Integer] [rel : node/expr] [bound : bound] [atom-lists : (Listof Tuple)] [rel-list : (Listof node/expr)] [loc : (U srcloc #f) #f]) + (: funcformulajoin (-> (Listof node/expr/quantifier-var) node/expr)) (define (funcformulajoin quantvarlst) (cond - [(empty? (rest quantvarlst)) (@join (first quantvarlst) rel)] - [else (@join (first quantvarlst) (funcformulajoin (rest quantvarlst)))])) + [(empty? (rest quantvarlst)) (join/func #:info (just-location-info loc) (first quantvarlst) rel)] + [else (join/func #:info (just-location-info loc) (first quantvarlst) (funcformulajoin (rest quantvarlst)))])) - (define (funcformula rllst quantvarlst) + (: funcformula (-> (Listof node/expr) (Listof node/expr/quantifier-var) node/formula)) + (define (funcformula rllst quantvarlst) (cond [(empty? (rest (rest rllst))) - (let* ([var-id (gensym 'pfunc)] - [a (@node/expr/quantifier-var (@just-location-info loc) 1 var-id var-id)]) - (@quantified-formula (@just-location-info loc) 'all - (list (cons a (first rllst))) - (@one (funcformulajoin (cons a quantvarlst)))))] + (let* ([var-id (gensym 'func)] + [a (node/expr/quantifier-var (just-location-info loc) 1 var-id var-id)]) + (quantified-formula (just-location-info loc) 'all + (ann (list (cons a (first rllst))) (Listof (Pairof node/expr/quantifier-var node/expr))) + (one/func #:info (just-location-info loc) (funcformulajoin (cons a quantvarlst)))))] [else - (let* ([var-id (gensym 'pfunc)] - [a (@node/expr/quantifier-var (@just-location-info loc) 1 var-id var-id)]) - (@quantified-formula (@just-location-info loc) 'all + (let* ([var-id (gensym 'func)] + [a (node/expr/quantifier-var (just-location-info loc) 1 var-id var-id)]) + (quantified-formula (just-location-info loc) 'all (list (cons a (first rllst))) (funcformula (rest rllst) (cons a quantvarlst))))])) (define formulas (set (funcformula rel-list (list)))) @@ -721,32 +864,38 @@ ; (λ () (break bound formulas)) ; ) ; END INSERTED TEMPORARY FIX FOR 'FUNC - (breaker pri + (breaker pri (break-graph (set) (set)) (λ () (break (bound->sbound bound) formulas)) - (λ () (break bound formulas))) -)) - + ;; TYPES + ;(λ () (break bound formulas)) + (λ () (break (bound->sbound bound) formulas)) + #f))) (add-strategy 'pfunc (λ (pri rel bound atom-lists rel-list [loc #f]) + (define info (just-location-info loc)) + + (: pfuncformulajoin (-> (Listof node/expr/quantifier-var) node/expr)) (define (pfuncformulajoin quantvarlst) (cond ; x_n.rel - [(empty? (rest quantvarlst)) (@join (first quantvarlst) rel)] + [(empty? (rest quantvarlst)) (join/func #:info info (first quantvarlst) rel)] ; ... x_n-1.x_n.rel - [else (@join (first quantvarlst) (pfuncformulajoin (rest quantvarlst)))])) + [else (join/func #:info info (first quantvarlst) (pfuncformulajoin (rest quantvarlst)))])) + + (: pfuncformula (-> (Listof node/expr) (Listof node/expr/quantifier-var) node/formula)) (define (pfuncformula rllst quantvarlst) (cond [(empty? (rest (rest rllst))) (let* ([var-id (gensym 'pfunc)] - [a (@node/expr/quantifier-var (@just-location-info loc) 1 var-id var-id)]) - (@quantified-formula (@just-location-info loc) 'all + [a (node/expr/quantifier-var info 1 var-id var-id)]) + (quantified-formula info 'all (list (cons a (first rllst))) - (@lone (pfuncformulajoin (cons a quantvarlst)))))] + (multiplicity-formula info 'lone (pfuncformulajoin (cons a quantvarlst)))))] [else (let* ([var-id (gensym 'pfunc)] - [a (@node/expr/quantifier-var (@just-location-info loc) 1 var-id var-id)]) - (@quantified-formula (@just-location-info loc) 'all + [a (node/expr/quantifier-var info 1 var-id var-id)]) + (quantified-formula info 'all (list (cons a (first rllst))) (pfuncformula (rest rllst) (cons a quantvarlst))))])) (define pf-fmla (pfuncformula rel-list (list))) @@ -778,157 +927,172 @@ (breaker pri (break-graph (set) (set)) (λ () (break (bound->sbound bound) formulas)) - (λ () (break bound formulas)) - ) - )) - -(add-strategy 'surj (λ (pri rel bound atom-lists rel-list [loc #f]) - (define A (first rel-list)) - (define B (second rel-list)) - (define As (first atom-lists)) - (define Bs (second atom-lists)) - (define formulas (set - (@all/info (@just-location-info loc) ([a A]) (@one (@join a rel))) ; @one - (@all/info (@just-location-info loc) ([b B]) (@some (@join rel b))) ; @some - )) - (if (equal? A B) - (breaker pri ; TODO: can improve, but need better symmetry-breaking predicates - (break-graph (set) (set)) - (λ () (break (bound->sbound bound) formulas)) - (λ () (break bound formulas)) - ) - (breaker pri ; TODO: can improve, but need better symmetry-breaking predicates - (break-graph (set) (set (set A B))) ; breaks only {A,B} - (λ () - ; assume wlog f(a) = b for some a in A, b in B - (break - (sbound rel - (set (list (car As) (car Bs))) - (set-add (cartesian-product (cdr As) Bs) (list (car As) (car Bs)))) - formulas)) - (λ () (break bound formulas)) - ) - ) -)) -(add-strategy 'inj (λ (pri rel bound atom-lists rel-list [loc #f]) - (define A (first rel-list)) - (define B (second rel-list)) - (define As (first atom-lists)) - (define Bs (second atom-lists)) - (define formulas (set - (@all/info (@just-location-info loc) ([a A]) (@one (@join a rel))) ; @one - (@all/info (@just-location-info loc) ([b B]) (@lone (@join rel b))) ; @lone - )) - (if (equal? A B) - (breaker pri ; TODO: can improve, but need better symmetry-breaking predicates - (break-graph (set) (set)) (λ () (break (bound->sbound bound) formulas)) - (λ () (break bound formulas)) + #f ) - (breaker pri ; TODO: can improve, but need better symmetry-breaking predicates - (break-graph (set B) (set (set A B))) ; breaks B and {A,B} - (λ () - ; assume wlog f(a) = b for some a in A, b in B - (break - (sbound rel - (set (list (car As) (car Bs))) - (set-add (cartesian-product (cdr As) (cdr Bs)) (list (car As) (car Bs)))) - formulas)) - (λ () (break bound formulas)) - ) - ) -)) -(add-strategy 'bij (λ (pri rel bound atom-lists rel-list [loc #f]) - (define A (first rel-list)) - (define B (second rel-list)) - (define As (first atom-lists)) - (define Bs (second atom-lists)) - (define formulas (set - (@all/info (@just-location-info loc) ([a A]) (@one (@join a rel))) ; @one - (@all/info (@just-location-info loc) ([b B]) (@one (@join rel b))) ; @one )) - (if (equal? A B) - (breaker pri ; TODO: can improve, but need better symmetry-breaking predicates - (break-graph (set) (set)) - (λ () (break (bound->sbound bound) formulas)) - (λ () (break bound formulas)) - ) - (breaker pri ; TODO: can improve, but need better symmetry-breaking predicates - (break-graph (set) (set (set A B))) ; breaks only {A,B} - (λ () (make-exact-break rel (map list As Bs))) - (λ () (break bound formulas)) - ) - ) -)) -(add-strategy 'pbij (λ (pri rel bound atom-lists rel-list [loc #f]) - (define A (first rel-list)) - (define B (second rel-list)) - (define As (first atom-lists)) - (define Bs (second atom-lists)) - (define LA (length As)) - (define LB (length Bs)) - (define broken (cond [(> LA LB) (set A)] - [(< LA LB) (set B)] - [else (set)])) - ;(printf "broken : ~v~n" broken) - (define formulas (set - (@all/info (@just-location-info loc) ([a A]) (@one (@join a rel))) ; @one - (@all/info (@just-location-info loc) ([b B]) (@one (@join rel b))) ; @one - )) - (if (equal? A B) - (breaker pri ; TODO: can improve, but need better symmetry-breaking predicates - (break-graph (set) (set)) - (λ () (break (bound->sbound bound) formulas)) - (λ () (break bound formulas)) - ) - (breaker pri ; TODO: can improve, but need better symmetry-breaking predicates - (break-graph broken (set (set A B))) ; breaks only {A,B} - (λ () (make-upper-break rel (for/list ([a As][b Bs]) (list a b)) formulas)) - (λ () (break bound formulas)) - ) - ) -)) + +; ;(: surj-strategy StrategyFunction) +; (define surj-strategy (λ ([pri : Number] [rel : Any] [bound : bound] [atom-lists : (NonEmptyListOf (Listof Any))] [rel-list : (NonEmptyListOf Any)] [loc #f]) +; (define A (first rel-list)) +; (define B (second rel-list)) +; (define As (first atom-lists)) +; (define Bs (second atom-lists)) +; (define formulas (set +; (@all/info (just-location-info loc) ([a A]) (@one/info (just-location-info loc) (@join a rel))) ; @one +; (@all/info (just-location-info loc) ([b B]) (@some/info (just-location-info loc) (@join rel b))) ; @some +; )) +; (if (equal? A B) +; (breaker pri ; TODO: can improve, but need better symmetry-breaking predicates +; (break-graph (set) (set)) +; (λ () (break (bound->sbound bound) formulas)) +; (λ () (break bound formulas)) +; ) +; (breaker pri ; TODO: can improve, but need better symmetry-breaking predicates +; (break-graph (set) (set (set A B))) ; breaks only {A,B} +; (λ () +; ; assume wlog f(a) = b for some a in A, b in B +; (break +; (sbound rel +; (set (list (car As) (car Bs))) +; (set-add (cartesian-product (cdr As) Bs) (list (car As) (car Bs)))) +; formulas)) +; (λ () (break bound formulas)) +; ) +; ) +; )) +; (add-strategy 'surj surj-strategy) + +; (add-strategy 'inj (λ (pri rel bound atom-lists rel-list [loc #f]) +; (define A (first rel-list)) +; (define B (second rel-list)) +; (define As (first atom-lists)) +; (define Bs (second atom-lists)) +; (define formulas (set +; (@all/info (just-location-info loc) ([a A]) (@one/info (just-location-info loc) (@join a rel))) ; @one +; (@all/info (just-location-info loc) ([b B]) (@lone/info (just-location-info loc) (@join rel b))) ; @lone +; )) +; (if (equal? A B) +; (breaker pri ; TODO: can improve, but need better symmetry-breaking predicates +; (break-graph (set) (set)) +; (λ () (break (bound->sbound bound) formulas)) +; (λ () (break bound formulas)) +; ) +; (breaker pri ; TODO: can improve, but need better symmetry-breaking predicates +; (break-graph (set B) (set (set A B))) ; breaks B and {A,B} +; (λ () +; ; assume wlog f(a) = b for some a in A, b in B +; (break +; (sbound rel +; (set (list (car As) (car Bs))) +; (set-add (cartesian-product (cdr As) (cdr Bs)) (list (car As) (car Bs)))) +; formulas)) +; (λ () (break bound formulas)) +; ) +; ) +; )) +; (add-strategy 'bij (λ (pri rel bound atom-lists rel-list [loc #f]) +; (define A (first rel-list)) +; (define B (second rel-list)) +; (define As (first atom-lists)) +; (define Bs (second atom-lists)) +; (define formulas (set +; (@all/info (just-location-info loc) ([a A]) (@one/info (just-location-info loc) (@join a rel))) ; @one +; (@all/info (just-location-info loc) ([b B]) (@one/info (just-location-info loc) (@join rel b))) ; @one +; )) +; (if (equal? A B) +; (breaker pri ; TODO: can improve, but need better symmetry-breaking predicates +; (break-graph (set) (set)) +; (λ () (break (bound->sbound bound) formulas)) +; (λ () (break bound formulas)) +; ) +; (breaker pri ; TODO: can improve, but need better symmetry-breaking predicates +; (break-graph (set) (set (set A B))) ; breaks only {A,B} +; (λ () (make-exact-break rel (map list As Bs))) +; (λ () (break bound formulas)) +; ) +; ) +; )) +; (add-strategy 'pbij (λ (pri rel bound atom-lists rel-list [loc #f]) +; (define A (first rel-list)) +; (define B (second rel-list)) +; (define As (first atom-lists)) +; (define Bs (second atom-lists)) +; (define LA (length As)) +; (define LB (length Bs)) +; (define broken (cond [(> LA LB) (set A)] +; [(< LA LB) (set B)] +; [else (set)])) +; ;(printf "broken : ~v~n" broken) +; (define formulas (set +; (@all/info (just-location-info loc) ([a A]) (@one/info (just-location-info loc) (@join a rel))) ; @one +; (@all/info (just-location-info loc) ([b B]) (@one/info (just-location-info loc) (@join rel b))) ; @one +; )) +; (if (equal? A B) +; (breaker pri ; TODO: can improve, but need better symmetry-breaking predicates +; (break-graph (set) (set)) +; (λ () (break (bound->sbound bound) formulas)) +; (λ () (break bound formulas)) +; ) +; (breaker pri ; TODO: can improve, but need better symmetry-breaking predicates +; (break-graph broken (set (set A B))) ; breaks only {A,B} +; (λ () (make-upper-break rel (for/list ([a As][b Bs]) (list a b)) formulas)) +; (λ () (break bound formulas)) +; ) +; ) +; )) ; use to prevent breaks -(add-strategy 'default (λ (pri rel bound atom-lists rel-list [loc #f]) (breaker pri - (break-graph (set) (set)) - (λ () - (make-upper-break rel (list->set (apply cartesian-product atom-lists)))) - (λ () (break bound (set))) -))) +(: defaultStrategy StrategyFunction) +(define defaultStrategy (λ ([pri : Integer] [rel : node/expr] [bound : bound] + [atom-lists : (Listof Tuple)] + [rel-list : (Listof node/expr)] [loc : (U srcloc #f) #f]) + (if (node/expr/relation? rel) + (breaker pri + (break-graph (set) (set)) + (λ () + (make-upper-break rel (list->set (apply cartesian-product atom-lists)))) + (λ () (break (bound->sbound bound) (set))) + #f) + (raise (format "Internal error in breaks.defaultStrategy. Given: ~a; from:~a~n" rel loc))))) +(add-strategy 'default defaultStrategy) +; (add-strategy 'cotree (variadic 2 (co (hash-ref strategies 'tree)))) +; (add-strategy 'cofunc (variadic 2 (co (hash-ref strategies 'func)))) +; (add-strategy 'cosurj (variadic 2 (co (hash-ref strategies 'surj)))) +; (add-strategy 'coinj (variadic 2 (co (hash-ref strategies 'inj)))) -(add-strategy 'cotree (variadic 2 (co (hash-ref strategies 'tree)))) -(add-strategy 'cofunc (variadic 2 (co (hash-ref strategies 'func)))) -(add-strategy 'cosurj (variadic 2 (co (hash-ref strategies 'surj)))) -(add-strategy 'coinj (variadic 2 (co (hash-ref strategies 'inj)))) +; (add-strategy 'irref (variadic 2 (hash-ref strategies 'irref))) +; (add-strategy 'ref (variadic 2 (hash-ref strategies 'ref))) -(add-strategy 'irref (variadic 2 (hash-ref strategies 'irref))) -(add-strategy 'ref (variadic 2 (hash-ref strategies 'ref))) ; this one cannot afford to go to purely formula break (add-strategy 'linear (variadic 2 (hash-ref strategies 'linear))) (add-strategy 'plinear (variadic 2 (hash-ref strategies 'plinear))) -(add-strategy 'acyclic (variadic 2 (hash-ref strategies 'acyclic))) -(add-strategy 'tree (variadic 2 (hash-ref strategies 'tree))) + + + +; (add-strategy 'acyclic (variadic 2 (hash-ref strategies 'acyclic))) +; (add-strategy 'tree (variadic 2 (hash-ref strategies 'tree))) (add-strategy 'func (hash-ref strategies 'func)) (add-strategy 'pfunc (hash-ref strategies 'pfunc)) -(add-strategy 'surj (variadic 2 (hash-ref strategies 'surj))) -(add-strategy 'inj (variadic 2 (hash-ref strategies 'inj))) -(add-strategy 'bij (variadic 2 (hash-ref strategies 'bij))) -(add-strategy 'pbij (variadic 2 (hash-ref strategies 'pbij))) +; (add-strategy 'surj (variadic 2 (hash-ref strategies 'surj))) +; (add-strategy 'inj (variadic 2 (hash-ref strategies 'inj))) +; (add-strategy 'bij (variadic 2 (hash-ref strategies 'bij))) +; (add-strategy 'pbij (variadic 2 (hash-ref strategies 'pbij))) ;;; Domination Order ;;; -(declare 'linear > 'tree) -(declare 'tree > 'acyclic) -(declare 'acyclic > 'irref) -(declare 'func < 'surj 'inj 'pfunc) -(declare 'bij = 'surj 'inj) -(declare 'linear = 'tree 'cotree) -(declare 'bij = 'func 'cofunc) -(declare 'cofunc < 'cosurj 'coinj) -(declare 'bij = 'cosurj 'coinj) +; (declare 'linear > 'tree) +; (declare 'tree > 'acyclic) +; (declare 'acyclic > 'irref) +; (declare 'func < 'surj 'inj 'pfunc) +(declare 'func < 'pfunc) +; (declare 'bij = 'surj 'inj) +; (declare 'linear = 'tree 'cotree) +; (declare 'bij = 'func 'cofunc) +; (declare 'cofunc < 'cosurj 'coinj) +; (declare 'bij = 'cosurj 'coinj) (provide get-co) (define co-map (make-hash)) @@ -978,45 +1142,46 @@ TODO: |# -(require (except-in xml attribute)) -(define (xml->breakers xml name-to-rel) - (set! xml (xml->xexpr (document-element (read-xml (open-input-string xml))))) - (define (read-label info) - (define label #f) - (define builtin #f) - (for/list ([i info]) (match i - [(list 'label l) (set! label l)] - [(list 'builtin "yes") (set! builtin #t)] - [else #f] - )) - (if builtin #f (hash-ref name-to-rel label)) - ) - (define (read-atoms atoms) - (filter identity (for/list ([a atoms]) (match a - [(list atom (list (list 'label l))) (string->symbol l)] - [else #f] - ))) - ) - (define (read-tuples tuples) - (list->set (filter identity (for/list ([t tuples]) (match t - [(list 'tuple atoms ...) (read-atoms atoms)] - [else #f] - )))) - ) - (define (read-rel x) (match x - [(list 'sig info atoms ...) - (define sig (read-label info)) - (if sig (make-exact-sbound sig (map list (read-atoms atoms))) #f)] - [(list 'field info tuples ...) (make-exact-sbound (read-label info) (read-tuples tuples))] - [else #f] - )) - - (when (equal? (first xml) 'alloy) (for ([x xml]) (match x - [(list 'instance _ ...) (set! xml x)] - [else #f] - ))) - (match xml - [(list 'instance _ ...) (filter identity (for/list ([x xml]) (read-rel x)))] - [else (list (read-rel xml))] - ) -) \ No newline at end of file +; (require (except-in xml attribute)) + +; (define (xml->breakers xml name-to-rel) +; (set! xml (xml->xexpr (document-element (read-xml (open-input-string xml))))) +; (define (read-label info) +; (define label #f) +; (define builtin #f) +; (for/list ([i info]) (match i +; [(list 'label l) (set! label l)] +; [(list 'builtin "yes") (set! builtin #t)] +; [else #f] +; )) +; (if builtin #f (hash-ref name-to-rel label)) +; ) +; (define (read-atoms atoms) +; (filter identity (for/list ([a atoms]) (match a +; [(list atom (list (list 'label l))) (string->symbol l)] +; [else #f] +; ))) +; ) +; (define (read-tuples tuples) +; (list->set (filter identity (for/list ([t tuples]) (match t +; [(list 'tuple atoms ...) (read-atoms atoms)] +; [else #f] +; )))) +; ) +; (define (read-rel x) (match x +; [(list 'sig info atoms ...) +; (define sig (read-label info)) +; (if sig (make-exact-sbound sig (map list (read-atoms atoms))) #f)] +; [(list 'field info tuples ...) (make-exact-sbound (read-label info) (read-tuples tuples))] +; [else #f] +; )) + +; (when (equal? (first xml) 'alloy) (for ([x xml]) (match x +; [(list 'instance _ ...) (set! xml x)] +; [else #f] +; ))) +; (match xml +; [(list 'instance _ ...) (filter identity (for/list ([x xml]) (read-rel x)))] +; [else (list (read-rel xml))] +; ) +; ) \ No newline at end of file diff --git a/forge/e2e/README.md b/forge/e2e/README.md new file mode 100644 index 000000000..4139eec68 --- /dev/null +++ b/forge/e2e/README.md @@ -0,0 +1,39 @@ +# Forge E2E Tests + +End-to-end tests for Forge/Sterling integration using Playwright. + +## Setup + +```bash +cd e2e +npm install +npx playwright install # Install browser binaries +``` + +## Running Tests + +```bash +# Run all tests (headless) +npm test + +# Run tests with browser visible +npm run test:headed + +# Run tests in debug mode (step through) +npm run test:debug + +# Run tests with Playwright UI +npm run test:ui +``` + +## Test Structure + +- `fixtures/` - Forge files used as test inputs +- `helpers/` - Test utilities (Forge process runner, etc.) +- `tests/` - Playwright test specs + +## Notes + +- Tests run serially (single worker) to avoid port conflicts +- Each test spawns its own Forge process for isolation +- Timeout is set to 60s to allow for solver time diff --git a/forge/e2e/fixtures/multi-instance.frg b/forge/e2e/fixtures/multi-instance.frg new file mode 100644 index 000000000..ac04a9d26 --- /dev/null +++ b/forge/e2e/fixtures/multi-instance.frg @@ -0,0 +1,11 @@ +#lang forge + +-- Model that produces multiple distinct instances for testing navigation +sig Node { + edge: lone Node +} + +-- With 3 nodes and lone edge, we get many possible configurations +multiRun: run { + some edge +} for exactly 3 Node diff --git a/forge/e2e/fixtures/simple-graph.frg b/forge/e2e/fixtures/simple-graph.frg new file mode 100644 index 000000000..23dcdf98c --- /dev/null +++ b/forge/e2e/fixtures/simple-graph.frg @@ -0,0 +1,23 @@ +#lang forge + +-- Simple test model for e2e testing +sig Node { + edges: set Node +} + +pred connected { + all n1, n2: Node | n1 in n2.^edges or n2 in n1.^edges or n1 = n2 +} + +pred someEdges { + some edges +} + +simpleRun: run { + someEdges +} for exactly 3 Node + +connectedRun: run { + connected + someEdges +} for exactly 3 Node diff --git a/forge/e2e/fixtures/unsat-model.frg b/forge/e2e/fixtures/unsat-model.frg new file mode 100644 index 000000000..5e4977131 --- /dev/null +++ b/forge/e2e/fixtures/unsat-model.frg @@ -0,0 +1,12 @@ +#lang forge + +-- Model with unsatisfiable constraints for testing unsat display +sig Node { + edges: set Node +} + +-- This is unsatisfiable: can't have exactly 3 nodes where each has no edges but some edges exist +unsatRun: run { + no edges + some edges +} for exactly 3 Node diff --git a/forge/e2e/helpers/forge-runner.ts b/forge/e2e/helpers/forge-runner.ts new file mode 100644 index 000000000..5f0623ae5 --- /dev/null +++ b/forge/e2e/helpers/forge-runner.ts @@ -0,0 +1,133 @@ +import { spawn, ChildProcess } from 'child_process'; +import * as path from 'path'; + +export interface ForgeInstance { + process: ChildProcess; + sterlingUrl: string; + staticPort: number; + providerPort: number; + cleanup: () => void; +} + +import { Page, expect } from '@playwright/test'; + +/** + * Helper to select and execute a run in Sterling. + * Sterling requires selecting from dropdown AND clicking "Run" button. + */ +export async function selectAndRunCommand(page: Page, runName: string): Promise { + // Select from the combobox (first one is the run selector, not the routing dropdown) + const runSelect = page.getByRole('combobox').first(); + await expect(runSelect).toBeVisible({ timeout: 10000 }); + await runSelect.selectOption({ label: runName }); + + // Click the Run button + const runButton = page.getByRole('button', { name: 'Run', exact: true }); + await expect(runButton).toBeVisible({ timeout: 5000 }); + await runButton.click(); + + // Wait for instance to load - SVG appears in main area + await expect(page.locator('svg').first()).toBeVisible({ timeout: 20000 }); +} + +/** + * Starts a Forge file and waits for Sterling to be ready. + * Returns the Sterling URL and a cleanup function. + */ +export async function startForge( + forgeFilePath: string, + options: { timeout?: number; providerPort?: number; staticPort?: number } = {} +): Promise { + const timeout = options.timeout ?? 30000; + const providerPort = options.providerPort ?? 18000 + Math.floor(Math.random() * 1000); + const staticPort = options.staticPort ?? 19000 + Math.floor(Math.random() * 1000); + const forgePath = path.resolve(__dirname, '../../', forgeFilePath); + + return new Promise((resolve, reject) => { + // Pass options for headless mode with known ports + const proc = spawn( + 'racket', + [ + forgePath, + '-O', 'run_sterling', 'headless', + '-O', 'sterling_port', String(providerPort), + '-O', 'sterling_static_port', String(staticPort), + ], + { + cwd: path.resolve(__dirname, '../..'), + stdio: ['pipe', 'pipe', 'pipe'], + } + ); + + let stdout = ''; + let stderr = ''; + let resolved = false; + + const timeoutId = setTimeout(() => { + if (!resolved) { + resolved = true; + proc.kill(); + reject(new Error(`Timeout waiting for Sterling to start. stdout: ${stdout}, stderr: ${stderr}`)); + } + }, timeout); + + proc.stdout?.on('data', (data: Buffer) => { + const chunk = data.toString(); + stdout += chunk; + + // Look for: "Opening Forge menu in Sterling (static server port=XXXX)" + // This confirms the server is ready (we already know the port) + const serverReady = stdout.includes('static server port='); + + if (serverReady && !resolved) { + // Wait a moment for the server to be fully ready + setTimeout(() => { + if (!resolved) { + resolved = true; + clearTimeout(timeoutId); + + const sterlingUrl = `http://127.0.0.1:${staticPort}/?${providerPort}`; + + resolve({ + process: proc, + sterlingUrl, + staticPort, + providerPort, + cleanup: () => { + // Send newline to stdin to trigger Forge shutdown + proc.stdin?.write('\n'); + proc.stdin?.end(); + // Force kill after a short delay if still running + setTimeout(() => { + if (!proc.killed) { + proc.kill('SIGKILL'); + } + }, 2000); + }, + }); + } + }, 500); + } + }); + + proc.stderr?.on('data', (data: Buffer) => { + stderr += data.toString(); + }); + + proc.on('error', (err) => { + if (!resolved) { + resolved = true; + clearTimeout(timeoutId); + reject(new Error(`Failed to start Forge: ${err.message}`)); + } + }); + + proc.on('exit', (code) => { + if (!resolved) { + resolved = true; + clearTimeout(timeoutId); + reject(new Error(`Forge exited unexpectedly with code ${code}. stdout: ${stdout}, stderr: ${stderr}`)); + } + }); + }); +} diff --git a/forge/e2e/package-lock.json b/forge/e2e/package-lock.json new file mode 100644 index 000000000..7c08a611a --- /dev/null +++ b/forge/e2e/package-lock.json @@ -0,0 +1,111 @@ +{ + "name": "forge-e2e", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "forge-e2e", + "version": "1.0.0", + "devDependencies": { + "@playwright/test": "^1.40.0", + "@types/node": "^20.10.0", + "typescript": "^5.3.0" + } + }, + "node_modules/@playwright/test": { + "version": "1.57.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.57.0.tgz", + "integrity": "sha512-6TyEnHgd6SArQO8UO2OMTxshln3QMWBtPGrOCgs3wVEmQmwyuNtB10IZMfmYDE0riwNR1cu4q+pPcxMVtaG3TA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright": "1.57.0" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@types/node": { + "version": "20.19.30", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.30.tgz", + "integrity": "sha512-WJtwWJu7UdlvzEAUm484QNg5eAoq5QR08KDNx7g45Usrs2NtOPiX8ugDqmKdXkyL03rBqU5dYNYVQetEpBHq2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/playwright": { + "version": "1.57.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.57.0.tgz", + "integrity": "sha512-ilYQj1s8sr2ppEJ2YVadYBN0Mb3mdo9J0wQ+UuDhzYqURwSoW4n1Xs5vs7ORwgDGmyEh33tRMeS8KhdkMoLXQw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright-core": "1.57.0" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.57.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.57.0.tgz", + "integrity": "sha512-agTcKlMw/mjBWOnD6kFZttAAGHgi/Nw0CZ2o6JqWSbMlI219lAFLZZCyqByTsvVAJq5XA5H8cA6PrvBRpBWEuQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/forge/e2e/package.json b/forge/e2e/package.json new file mode 100644 index 000000000..027b8377d --- /dev/null +++ b/forge/e2e/package.json @@ -0,0 +1,16 @@ +{ + "name": "forge-e2e", + "version": "1.0.0", + "description": "End-to-end tests for Forge/Sterling integration", + "scripts": { + "test": "playwright test", + "test:headed": "playwright test --headed", + "test:debug": "playwright test --debug", + "test:ui": "playwright test --ui" + }, + "devDependencies": { + "@playwright/test": "^1.40.0", + "@types/node": "^20.10.0", + "typescript": "^5.3.0" + } +} diff --git a/forge/e2e/playwright.config.ts b/forge/e2e/playwright.config.ts new file mode 100644 index 000000000..6d13ecabf --- /dev/null +++ b/forge/e2e/playwright.config.ts @@ -0,0 +1,35 @@ +import { defineConfig, devices } from '@playwright/test'; + +export default defineConfig({ + testDir: './tests', + fullyParallel: false, // Run serially since each test spawns its own Forge process + forbidOnly: !!process.env.CI, + retries: process.env.CI ? 2 : 0, + workers: 1, // Single worker to avoid port conflicts + reporter: 'list', + + use: { + // Base URL will be set dynamically per test based on Forge output + trace: 'on-first-retry', + screenshot: 'only-on-failure', + }, + + // Increase timeout for tests that spawn Forge processes + timeout: 60000, + expect: { + timeout: 10000, + }, + + projects: [ + { + name: 'chromium', + use: { + ...devices['Desktop Chrome'], + headless: true, + launchOptions: { + headless: true, + }, + }, + }, + ], +}); diff --git a/forge/e2e/tests/sterling-basic.spec.ts b/forge/e2e/tests/sterling-basic.spec.ts new file mode 100644 index 000000000..a08ecf25b --- /dev/null +++ b/forge/e2e/tests/sterling-basic.spec.ts @@ -0,0 +1,74 @@ +import { test, expect, Page } from '@playwright/test'; +import { startForge, ForgeInstance, selectAndRunCommand } from '../helpers/forge-runner'; + +test.describe('Sterling Basic Functionality', () => { + let forge: ForgeInstance; + + test.afterEach(async () => { + if (forge) { + forge.cleanup(); + } + }); + + test('Sterling loads and shows run menu', async ({ page }) => { + // Start Forge with our test file + forge = await startForge('e2e/fixtures/simple-graph.frg'); + + // Navigate to Sterling + await page.goto(forge.sterlingUrl); + + // Wait for the page to load - Sterling should show a menu or graph view + await expect(page.locator('body')).toBeVisible(); + + // Check that the page has loaded something (not a blank/error page) + const content = await page.content(); + expect(content).not.toContain('Cannot GET'); + expect(content).not.toContain('404'); + + // Sterling shows runs in a combobox/select dropdown + // Look for a select element containing our run names + const runSelect = page.getByRole('combobox'); + await expect(runSelect).toBeVisible({ timeout: 10000 }); + + // Verify both runs are available as options + await expect(runSelect.locator('option', { hasText: 'simpleRun' })).toBeAttached(); + await expect(runSelect.locator('option', { hasText: 'connectedRun' })).toBeAttached(); + }); + + test('can select a run and see instance', async ({ page }) => { + forge = await startForge('e2e/fixtures/simple-graph.frg'); + await page.goto(forge.sterlingUrl); + + // Wait for Sterling to load + await page.waitForLoadState('networkidle'); + + // Select and run a command (must click Run button after selecting) + await selectAndRunCommand(page, 'simpleRun'); + + // After running, Sterling should show an instance with graph visualization + await expect(page.locator('svg').first()).toBeVisible({ timeout: 5000 }); + }); + + test('WebSocket connection is established', async ({ page }) => { + forge = await startForge('e2e/fixtures/simple-graph.frg'); + + // Set up WebSocket listener BEFORE navigating + const wsConnections: string[] = []; + page.on('websocket', (ws) => { + wsConnections.push(ws.url()); + }); + + await page.goto(forge.sterlingUrl); + + // Wait for page to establish WebSocket connection + await page.waitForLoadState('networkidle'); + + // Also wait for the combobox to appear (indicates data loaded via WebSocket) + await expect(page.getByRole('combobox')).toBeVisible({ timeout: 10000 }); + + // Verify a WebSocket connection was made to our provider + expect(wsConnections.length).toBeGreaterThan(0); + // WebSocket URL might use 127.0.0.1 or localhost + expect(wsConnections.some((url) => url.includes('127.0.0.1') || url.includes('localhost'))).toBe(true); + }); +}); diff --git a/forge/e2e/tests/sterling-evaluator.spec.ts b/forge/e2e/tests/sterling-evaluator.spec.ts new file mode 100644 index 000000000..7683e169d --- /dev/null +++ b/forge/e2e/tests/sterling-evaluator.spec.ts @@ -0,0 +1,97 @@ +import { test, expect } from '@playwright/test'; +import { startForge, ForgeInstance, selectAndRunCommand } from '../helpers/forge-runner'; + +test.describe('Sterling Evaluator', () => { + let forge: ForgeInstance; + + test.afterEach(async () => { + if (forge) { + forge.cleanup(); + } + }); + + test('can open the evaluator panel', async ({ page }) => { + forge = await startForge('e2e/fixtures/simple-graph.frg'); + await page.goto(forge.sterlingUrl); + + // Must run a command first to have an instance to evaluate + await selectAndRunCommand(page, 'simpleRun'); + + // Wait for graph layout to finish + await page.waitForTimeout(2000); + + // The Evaluator is a sidebar tab on the right - click it + // It's displayed as vertical text "Evaluator" in a tab button + const evaluatorTab = page.getByText('Evaluator', { exact: true }).first(); + await expect(evaluatorTab).toBeVisible({ timeout: 5000 }); + await evaluatorTab.click(); + + // After clicking, the EVALUATOR panel should open + await expect(page.getByPlaceholder('Enter an expression')).toBeVisible({ timeout: 5000 }); + }); + + test('can evaluate a simple expression', async ({ page }) => { + forge = await startForge('e2e/fixtures/simple-graph.frg'); + await page.goto(forge.sterlingUrl); + + // Run a command first + await selectAndRunCommand(page, 'simpleRun'); + + // Wait for graph layout to finish + await page.waitForTimeout(2000); + + // Open evaluator panel + const evaluatorTab = page.getByText('Evaluator', { exact: true }).first(); + await evaluatorTab.click(); + await expect(page.getByPlaceholder('Enter an expression')).toBeVisible({ timeout: 5000 }); + + // Find input field in evaluator - placeholder is "Enter an expression..." + const evaluatorInput = page.getByPlaceholder('Enter an expression'); + await expect(evaluatorInput).toBeVisible({ timeout: 5000 }); + + // Type a simple expression - "Node" should return all Node atoms + await evaluatorInput.fill('Node'); + await evaluatorInput.press('Enter'); + + // Wait for result + await page.waitForTimeout(2000); + + // The result should contain Node references - look for Node0, Node1, or Node2 + await expect(page.getByText(/Node[012]/).first()).toBeVisible({ timeout: 5000 }); + }); + + test('evaluator shows result for edges relation', async ({ page }) => { + forge = await startForge('e2e/fixtures/simple-graph.frg'); + await page.goto(forge.sterlingUrl); + + // Run a command first + await selectAndRunCommand(page, 'simpleRun'); + + // Wait for graph layout to finish + await page.waitForTimeout(2000); + + // Open evaluator panel + const evaluatorTab = page.getByText('Evaluator', { exact: true }).first(); + await evaluatorTab.click(); + await expect(page.getByPlaceholder('Enter an expression')).toBeVisible({ timeout: 5000 }); + + // Count how many result entries exist before evaluation + const resultsBefore = await page.locator('text=/Node\\d.*→.*Node\\d/').count(); + + // Find input field and evaluate the edges relation + const evaluatorInput = page.getByPlaceholder('Enter an expression'); + await evaluatorInput.fill('edges'); + await evaluatorInput.press('Enter'); + + // Wait for result + await page.waitForTimeout(2000); + + // The evaluator should show tuple results like "Node0 → Node1" for edges + // Since simpleRun requires "some edges", there should be at least one tuple + const resultsAfter = await page.locator('text=/Node\\d/').count(); + + // There should be more Node references after evaluation (the result tuples) + // Or at minimum, the evaluator panel should show the edges expression was processed + expect(resultsAfter).toBeGreaterThan(0); + }); +}); diff --git a/forge/e2e/tests/sterling-instance.spec.ts b/forge/e2e/tests/sterling-instance.spec.ts new file mode 100644 index 000000000..ea539a450 --- /dev/null +++ b/forge/e2e/tests/sterling-instance.spec.ts @@ -0,0 +1,55 @@ +import { test, expect } from '@playwright/test'; +import { startForge, ForgeInstance, selectAndRunCommand } from '../helpers/forge-runner'; + +test.describe('Sterling Instance Display', () => { + let forge: ForgeInstance; + + test.afterEach(async () => { + if (forge) { + forge.cleanup(); + } + }); + + test('displays atom names from the model', async ({ page }) => { + forge = await startForge('e2e/fixtures/simple-graph.frg'); + await page.goto(forge.sterlingUrl); + + // Select and run a command + await selectAndRunCommand(page, 'simpleRun'); + + // Wait for layout to finish (the "Computing layout..." message to disappear) + await page.waitForTimeout(2000); + + // The model has exactly 3 Node atoms - they should appear as Node0, Node1, Node2 + // Use getByText which works with SVG text elements + await expect(page.getByText('Node0')).toBeVisible({ timeout: 5000 }); + }); + + test('displays sig names in the interface', async ({ page }) => { + forge = await startForge('e2e/fixtures/simple-graph.frg'); + await page.goto(forge.sterlingUrl); + + await selectAndRunCommand(page, 'simpleRun'); + + // Wait for layout to finish + await page.waitForTimeout(2000); + + // The sig name "Node" appears as a label on each atom box in the graph + // Look for it in the visible text (SVG text elements) + await expect(page.getByText('Node', { exact: true }).first()).toBeVisible({ timeout: 5000 }); + }); + + test('displays edges/relations in graph view', async ({ page }) => { + forge = await startForge('e2e/fixtures/simple-graph.frg'); + await page.goto(forge.sterlingUrl); + + await selectAndRunCommand(page, 'simpleRun'); + + // Wait for layout to finish + await page.waitForTimeout(2000); + + // The simpleRun requires "some edges", so the "edges" relation label should appear + // This label is shown on the arrows connecting nodes in the graph + await expect(page.getByText('edges').first()).toBeVisible({ timeout: 5000 }); + }); +}); diff --git a/forge/e2e/tests/sterling-navigation.spec.ts b/forge/e2e/tests/sterling-navigation.spec.ts new file mode 100644 index 000000000..8aa298353 --- /dev/null +++ b/forge/e2e/tests/sterling-navigation.spec.ts @@ -0,0 +1,78 @@ +import { test, expect } from '@playwright/test'; +import { startForge, ForgeInstance, selectAndRunCommand } from '../helpers/forge-runner'; + +test.describe('Sterling Navigation', () => { + let forge: ForgeInstance; + + test.afterEach(async () => { + if (forge) { + forge.cleanup(); + } + }); + + test('can navigate to next instance', async ({ page }) => { + forge = await startForge('e2e/fixtures/multi-instance.frg'); + await page.goto(forge.sterlingUrl); + + // Select and run the command + await selectAndRunCommand(page, 'multiRun'); + + // Wait for layout to stabilize + await page.waitForTimeout(2000); + + // Verify we're on instance 1 (header shows "ID: 1 MULTIRUN") + await expect(page.getByText('ID: 1')).toBeVisible({ timeout: 5000 }); + + // Find and click the "Next" button + const nextButton = page.getByRole('button', { name: /next/i }); + await expect(nextButton).toBeVisible({ timeout: 5000 }); + await nextButton.click(); + + // Wait for the instance to update + await page.waitForTimeout(2000); + + // Verify we're now on instance 2 (header shows "ID: 2 MULTIRUN") + await expect(page.getByText('ID: 2')).toBeVisible({ timeout: 5000 }); + }); + + test('can switch between different runs', async ({ page }) => { + forge = await startForge('e2e/fixtures/simple-graph.frg'); + await page.goto(forge.sterlingUrl); + + // Run first command + await selectAndRunCommand(page, 'simpleRun'); + await page.waitForTimeout(2000); + + // Verify instance history shows the first run + await expect(page.getByText(/from: 'simpleRun'/)).toBeVisible({ timeout: 5000 }); + + // Now select and run second command (first combobox is run selector) + const runSelect = page.getByRole('combobox').first(); + await runSelect.selectOption({ label: 'connectedRun' }); + + const runButton = page.getByRole('button', { name: 'Run', exact: true }); + await runButton.click(); + + // Wait for new instance to load + await expect(page.locator('svg').first()).toBeVisible({ timeout: 20000 }); + await page.waitForTimeout(2000); + + // Verify instance history now shows the second run (instance number may vary) + await expect(page.getByText(/from: 'connectedRun'/)).toBeVisible({ timeout: 5000 }); + }); + + test('run selector shows all available runs', async ({ page }) => { + forge = await startForge('e2e/fixtures/simple-graph.frg'); + await page.goto(forge.sterlingUrl); + + const runSelect = page.getByRole('combobox').first(); + await expect(runSelect).toBeVisible({ timeout: 10000 }); + + // Get all options + const options = await runSelect.locator('option').allTextContents(); + + // Should have both runs from our fixture + expect(options).toContain('simpleRun'); + expect(options).toContain('connectedRun'); + }); +}); diff --git a/forge/e2e/tests/sterling-unsat.spec.ts b/forge/e2e/tests/sterling-unsat.spec.ts new file mode 100644 index 000000000..e686ba2de --- /dev/null +++ b/forge/e2e/tests/sterling-unsat.spec.ts @@ -0,0 +1,57 @@ +import { test, expect } from '@playwright/test'; +import { startForge, ForgeInstance } from '../helpers/forge-runner'; + +test.describe('Sterling Unsat Display', () => { + let forge: ForgeInstance; + + test.afterEach(async () => { + if (forge) { + forge.cleanup(); + } + }); + + test('displays unsat message for unsatisfiable model', async ({ page }) => { + forge = await startForge('e2e/fixtures/unsat-model.frg'); + await page.goto(forge.sterlingUrl); + + // Select the unsat run from combobox + const runSelect = page.getByRole('combobox'); + await expect(runSelect).toBeVisible({ timeout: 10000 }); + await runSelect.selectOption({ label: 'unsatRun' }); + + // Click Run button to execute + const runButton = page.getByRole('button', { name: 'Run', exact: true }); + await expect(runButton).toBeVisible({ timeout: 5000 }); + await runButton.click(); + + // Wait for Sterling to process and display result + await page.waitForTimeout(3000); + + // Should show "Unsatisfiable" text in the graph area + // This text appears inside the SVG visualization + await expect(page.getByText('Unsatisfiable')).toBeVisible({ timeout: 10000 }); + }); + + test('unsat run does not show Next button', async ({ page }) => { + forge = await startForge('e2e/fixtures/unsat-model.frg'); + await page.goto(forge.sterlingUrl); + + // Select and run the unsat command + const runSelect = page.getByRole('combobox'); + await expect(runSelect).toBeVisible({ timeout: 10000 }); + await runSelect.selectOption({ label: 'unsatRun' }); + + const runButton = page.getByRole('button', { name: 'Run', exact: true }); + await runButton.click(); + + // Wait for result and verify we got unsat + await expect(page.getByText('Unsatisfiable')).toBeVisible({ timeout: 10000 }); + + // The Next button should not be visible for unsat results + const nextButton = page.getByRole('button', { name: /next/i }); + + // Explicitly verify the Next button is NOT visible + // (as opposed to just accepting any state) + await expect(nextButton).not.toBeVisible(); + }); +}); diff --git a/forge/e2e/tests/sterling-views.spec.ts b/forge/e2e/tests/sterling-views.spec.ts new file mode 100644 index 000000000..3426de042 --- /dev/null +++ b/forge/e2e/tests/sterling-views.spec.ts @@ -0,0 +1,103 @@ +import { test, expect } from '@playwright/test'; +import { startForge, ForgeInstance, selectAndRunCommand } from '../helpers/forge-runner'; + +test.describe('Sterling Views', () => { + let forge: ForgeInstance; + + test.afterEach(async () => { + if (forge) { + forge.cleanup(); + } + }); + + test('can switch to Table view', async ({ page }) => { + forge = await startForge('e2e/fixtures/simple-graph.frg'); + await page.goto(forge.sterlingUrl); + + // Must run a command first + await selectAndRunCommand(page, 'simpleRun'); + await page.waitForTimeout(2000); + + // Find and click Table button (in top nav) + const tableButton = page.getByRole('button', { name: /table/i }); + await expect(tableButton).toBeVisible({ timeout: 5000 }); + await tableButton.click(); + + // Table view should show table-like content + await page.waitForTimeout(1000); + + // Table view shows sig/relation names as headers or in a structured format + // Look for table-specific elements or structured data display + const hasTableContent = await page.evaluate(() => { + // Check for actual table elements or grid-like structures + const tables = document.querySelectorAll('table, [role="grid"], [role="table"]'); + // Also check for structured divs that might represent table data + const headerCells = document.querySelectorAll('th, [role="columnheader"]'); + return tables.length > 0 || headerCells.length > 0; + }); + + expect(hasTableContent).toBe(true); + }); + + test('can switch to Script view', async ({ page }) => { + forge = await startForge('e2e/fixtures/simple-graph.frg'); + await page.goto(forge.sterlingUrl); + + await selectAndRunCommand(page, 'simpleRun'); + await page.waitForTimeout(2000); + + // Find and click Script button + const scriptButton = page.getByRole('button', { name: /script/i }); + await expect(scriptButton).toBeVisible({ timeout: 5000 }); + await scriptButton.click(); + + // Wait for view change + await page.waitForTimeout(1000); + + // Script view should show code editor or script-related content + const hasScriptContent = await page.evaluate(() => { + // Look for code editor elements (CodeMirror, Monaco, or plain textarea/pre) + const codeElements = document.querySelectorAll( + 'pre, code, .CodeMirror, .monaco-editor, textarea, [class*="editor"], [class*="code"]' + ); + return codeElements.length > 0; + }); + + expect(hasScriptContent).toBe(true); + }); + + test('can switch back to Graph view', async ({ page }) => { + forge = await startForge('e2e/fixtures/simple-graph.frg'); + await page.goto(forge.sterlingUrl); + + await selectAndRunCommand(page, 'simpleRun'); + + // Switch to Table + const tableButton = page.getByRole('button', { name: /table/i }); + await tableButton.click(); + await page.waitForTimeout(500); + + // Switch back to Graph + const graphButton = page.getByRole('button', { name: /graph/i }); + await expect(graphButton).toBeVisible({ timeout: 5000 }); + await graphButton.click(); + + // Should see SVG graph again + await expect(page.locator('svg').first()).toBeVisible({ timeout: 5000 }); + }); + + test('Graph view shows visualization', async ({ page }) => { + forge = await startForge('e2e/fixtures/simple-graph.frg'); + await page.goto(forge.sterlingUrl); + + await selectAndRunCommand(page, 'simpleRun'); + + // SVG should be visible with content + const svg = page.locator('svg').first(); + await expect(svg).toBeVisible(); + + // SVG should have content (not empty) + const svgContent = await svg.innerHTML(); + expect(svgContent.length).toBeGreaterThan(0); + }); +}); diff --git a/forge/e2e/tsconfig.json b/forge/e2e/tsconfig.json new file mode 100644 index 000000000..3cce7b11b --- /dev/null +++ b/forge/e2e/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "commonjs", + "moduleResolution": "node", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "outDir": "./dist", + "rootDir": ".", + "resolveJsonModule": true + }, + "include": ["**/*.ts"], + "exclude": ["node_modules", "dist"] +} diff --git a/forge/froglet/lang/bsl-lang-specific-checks.rkt b/forge/froglet/lang/bsl-lang-specific-checks.rkt index f911ab214..0b4654846 100644 --- a/forge/froglet/lang/bsl-lang-specific-checks.rkt +++ b/forge/froglet/lang/bsl-lang-specific-checks.rkt @@ -140,22 +140,22 @@ (define (check-node-expr-op-+ expr-node node-type child-types) (when (eq? (nodeinfo-lang (node-info expr-node)) LANG_ID) (define loc (nodeinfo-loc (node-info expr-node))) - (raise-bsl-relational-error "+" expr-node loc "You may have meant to use the `add` predicate instead."))) + (raise-bsl-relational-error "+" expr-node loc "The `+` operator is not used in Froglet, but is reserved for use in other Forge languages. If you meant addition, use the `add` predicate instead."))) (define (check-node-expr-op-- expr-node node-type child-types) (when (eq? (nodeinfo-lang (node-info expr-node)) LANG_ID) (define loc (nodeinfo-loc (node-info expr-node))) - (raise-bsl-relational-error "-" expr-node loc "You may have meant to use the `subtract` predicate instead."))) + (raise-bsl-relational-error "-" expr-node loc "The `-` operator is not used in Froglet, but is reserved for use in other Forge languages. If you meant subtraction, use the `subtract` predicate instead."))) (define (check-node-expr-op-& expr-node node-type child-types) (when (eq? (nodeinfo-lang (node-info expr-node)) LANG_ID) (define loc (nodeinfo-loc (node-info expr-node))) - (raise-bsl-relational-error "&" expr-node loc))) + (raise-bsl-relational-error "&" expr-node loc "The `&` operator is not used in Froglet, but is reserved for use in other Forge languages. If you meant logical-and, use `and` or `&&` instead."))) (define (check-node-expr-op--> expr-node node-type child-types) (when (eq? (nodeinfo-lang (node-info expr-node)) LANG_ID) (define loc (nodeinfo-loc (node-info expr-node))) - (raise-bsl-error "Use of -> in expressions is not allowed in forge/bsl" expr-node loc))) + (raise-bsl-error "The `->` operator is only used for field declaration in Froglet." expr-node loc))) (define (check-node-expr-op-join expr-node node-type child-types) (when (eq? (nodeinfo-lang (node-info expr-node)) LANG_ID) @@ -170,56 +170,56 @@ (define (check-node-expr-op-^ expr-node node-type child-types) (when (eq? (nodeinfo-lang (node-info expr-node)) LANG_ID) (define loc (nodeinfo-loc (node-info expr-node))) - (raise-bsl-relational-error "^" expr-node loc))) + (raise-bsl-relational-error "^" expr-node loc "The `^` operator is not used in Froglet, but is reserved for use in other Forge languages. If you meant exclusive-or, use the `xor` operator instead."))) (define (check-node-expr-op-* expr-node node-type child-types) (when (eq? (nodeinfo-lang (node-info expr-node)) LANG_ID) (define loc (nodeinfo-loc (node-info expr-node))) - (raise-bsl-relational-error "*" expr-node loc))) + (raise-bsl-relational-error "*" expr-node loc "The `*` operator is not used in Froglet, but is reserved for use in other Forge languages. If you meant multiplication, use the `multiply` predicate instead."))) (define (check-node-expr-op-~ expr-node node-type child-types) (when (eq? (nodeinfo-lang (node-info expr-node)) LANG_ID) (define loc (nodeinfo-loc (node-info expr-node))) - (raise-bsl-relational-error "~~" expr-node loc))) + (raise-bsl-relational-error "~~" expr-node loc "The `~` operator is not used in Froglet, but is reserved for use in other Forge languages. If you meant logical-negation, use `not` or '!' instead."))) (define bsl-checker-hash (make-hash)) (hash-set! bsl-checker-hash node/formula/multiplicity check-formula-mult) ;(hash-set! bsl-checker-hash node/formula/multiplicity check-node-formula-multiplicity) (hash-set! bsl-checker-hash 'empty-join err-empty-join) ;(hash-set! bsl-checker-hash 'relation-join err-relation-join) -(hash-set! bsl-checker-hash node/formula/op/in check-node-formula-op-in) -(hash-set! bsl-checker-hash node/formula/op/= check-node-formula-op-=) -(hash-set! bsl-checker-hash node/expr/op/+ check-node-expr-op-+) -(hash-set! bsl-checker-hash node/expr/op/- check-node-expr-op--) -(hash-set! bsl-checker-hash node/expr/op/& check-node-expr-op-&) -(hash-set! bsl-checker-hash node/expr/op/-> check-node-expr-op-->) -(hash-set! bsl-checker-hash node/expr/op/join check-node-expr-op-join) -(hash-set! bsl-checker-hash node/expr/op/^ check-node-expr-op-^) -(hash-set! bsl-checker-hash node/expr/op/* check-node-expr-op-*) -(hash-set! bsl-checker-hash node/expr/op/~ check-node-expr-op-~) +(hash-set! bsl-checker-hash node/formula/op-on-exprs/in check-node-formula-op-in) +(hash-set! bsl-checker-hash node/formula/op-on-exprs/= check-node-formula-op-=) +(hash-set! bsl-checker-hash node/expr/op-on-exprs/+ check-node-expr-op-+) +(hash-set! bsl-checker-hash node/expr/op-on-exprs/- check-node-expr-op--) +(hash-set! bsl-checker-hash node/expr/op-on-exprs/& check-node-expr-op-&) +(hash-set! bsl-checker-hash node/expr/op-on-exprs/-> check-node-expr-op-->) +(hash-set! bsl-checker-hash node/expr/op-on-exprs/join check-node-expr-op-join) +(hash-set! bsl-checker-hash node/expr/op-on-exprs/^ check-node-expr-op-^) +(hash-set! bsl-checker-hash node/expr/op-on-exprs/* check-node-expr-op-*) +(hash-set! bsl-checker-hash node/expr/op-on-exprs/~ check-node-expr-op-~) ;(hash-set! bsl-checker-hash node/fmla/pred-spacer check-node-fmla-pred-spacer) ;(hash-set! bsl-checker-hash node/expr/fun-spacer check-node-expr-fun-spacer) ;(hash-set! bsl-checker-hash node/formula/constant check-node-formula-constant) ;(hash-set! bsl-checker-hash node/formula/op check-node-formula-op) ;(hash-set! bsl-checker-hash node/formula/quantified check-node-formula-quantified) -;(hash-set! bsl-checker-hash node/formula/op/always check-node-formula-op-always) -;(hash-set! bsl-checker-hash node/formula/op/eventually check-node-formula-op-eventually) -;(hash-set! bsl-checker-hash node/formula/op/until check-node-formula-op-until) -;(hash-set! bsl-checker-hash node/formula/op/releases check-node-formula-op-releases) -;(hash-set! bsl-checker-hash node/formula/op/next_state check-node-formula-op-next_state) -;(hash-set! bsl-checker-hash node/formula/op/historically check-node-formula-op-historically) -;(hash-set! bsl-checker-hash node/formula/op/once check-node-formula-op-once) -;(hash-set! bsl-checker-hash node/formula/op/prev_state check-node-formula-op-prev_state) -;(hash-set! bsl-checker-hash node/formula/op/since check-node-formula-op-since) -;(hash-set! bsl-checker-hash node/formula/op/triggered check-node-formula-op-triggered) -;(hash-set! bsl-checker-hash node/formula/op/&& check-node-formula-op-&&) -;(hash-set! bsl-checker-hash node/formula/op/|| check-node-formula-op-||) -;(hash-set! bsl-checker-hash node/formula/op/=> check-node-formula-op-=>) -;(hash-set! bsl-checker-hash node/formula/op/! check-node-formula-op-!) -;(hash-set! bsl-checker-hash node/formula/op/int> check-node-formula-op-int>) -;(hash-set! bsl-checker-hash node/formula/op/int< check-node-formula-op-int<) -;(hash-set! bsl-checker-hash node/formula/op/int= check-node-formula-op-int=) +;(hash-set! bsl-checker-hash node/formula/op-on-formulas/always check-node-formula-op-always) +;(hash-set! bsl-checker-hash node/formula/op-on-formulas/eventually check-node-formula-op-eventually) +;(hash-set! bsl-checker-hash node/formula/op-on-formulas/until check-node-formula-op-until) +;(hash-set! bsl-checker-hash node/formula/op-on-formulas/releases check-node-formula-op-releases) +;(hash-set! bsl-checker-hash node/formula/op-on-formulas/next_state check-node-formula-op-next_state) +;(hash-set! bsl-checker-hash node/formula/op-on-formulas/historically check-node-formula-op-historically) +;(hash-set! bsl-checker-hash node/formula/op-on-formulas/once check-node-formula-op-once) +;(hash-set! bsl-checker-hash node/formula/op-on-formulas/prev_state check-node-formula-op-prev_state) +;(hash-set! bsl-checker-hash node/formula/op-on-formulas/since check-node-formula-op-since) +;(hash-set! bsl-checker-hash node/formula/op-on-formulas/triggered check-node-formula-op-triggered) +;(hash-set! bsl-checker-hash node/formula/op-on-formulas/&& check-node-formula-op-&&) +;(hash-set! bsl-checker-hash node/formula/op-on-formulas/|| check-node-formula-op-||) +;(hash-set! bsl-checker-hash node/formula/op-on-formulas/=> check-node-formula-op-=>) +;(hash-set! bsl-checker-hash node/formula/op-on-formulas/! check-node-formula-op-!) +;(hash-set! bsl-checker-hash node/formula/op-on-ints/int> check-node-formula-op-int>) +;(hash-set! bsl-checker-hash node/formula/op-on-ints/int< check-node-formula-op-int<) +;(hash-set! bsl-checker-hash node/formula/op-on-ints/int= check-node-formula-op-int=) ;(hash-set! bsl-checker-hash node/expr/relation check-node-expr-relation) ;(hash-set! bsl-checker-hash node/expr/atom check-node-expr-atom) ;(hash-set! bsl-checker-hash node/expr/ite check-node-expr-ite) @@ -227,8 +227,8 @@ ;(hash-set! bsl-checker-hash node/expr/op check-node-expr-op) ;(hash-set! bsl-checker-hash node/expr/quantifier-var check-node-expr-quantifier-var) ;(hash-set! bsl-checker-hash node/expr/comprehension check-node-expr-comprehension) -;(hash-set! bsl-checker-hash node/expr/op/prime check-node-expr-op-prime) -;(hash-set! bsl-checker-hash node/expr/op/sing check-node-expr-op-sing) +;(hash-set! bsl-checker-hash node/expr/op-on-exprs/prime check-node-expr-op-prime) +;(hash-set! bsl-checker-hash node/expr/op-on-ints/sing check-node-expr-op-sing) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -259,38 +259,38 @@ (define (check-args-node-expr-op--> expr-args info) (when (eq? (nodeinfo-lang info) LANG_ID) (define loc (nodeinfo-loc info)) - (raise-bsl-error-deparsed-str "Direct use of -> in a formula is not allowed in Froglet" (format "(~a->~a)" (deparse (first expr-args)) (deparse (second expr-args))) loc))) + (raise-bsl-error-deparsed-str "The `->` operator is only used for field declaration in Froglet." (format "(~a->~a)" (deparse (first expr-args)) (deparse (second expr-args))) loc))) (define (check-args-node-expr-op-+ expr-args info) (when (eq? (nodeinfo-lang info) LANG_ID) (define loc (nodeinfo-loc info)) - (raise-bsl-relational-error-expr-args "+" expr-args loc "You may have meant to use the `add` predicate instead."))) + (raise-bsl-relational-error-expr-args "+" expr-args loc "The `+` operator is not used in Froglet, but is reserved for use in other Forge languages. If you meant addition, use the `add` predicate instead."))) (define (check-args-node-expr-op-- expr-args info) (when (eq? (nodeinfo-lang info) LANG_ID) (define loc (nodeinfo-loc info)) - (raise-bsl-relational-error-expr-args "-" expr-args loc "You may have meant to use the `subtract` predicate instead."))) + (raise-bsl-relational-error-expr-args "-" expr-args loc "The `-` operator is not used in Froglet, but is reserved for use in other Forge languages. If you meant subtraction, use the `subtract` predicate instead."))) (define (check-args-node-expr-op-& expr-args info) (when (eq? (nodeinfo-lang info) LANG_ID) (define loc (nodeinfo-loc info)) - (raise-bsl-relational-error-expr-args "&" expr-args loc))) + (raise-bsl-relational-error-expr-args "&" expr-args loc "The `&` operator is not used in Froglet, but is reserved for use in other Forge languages. If you meant logical-and, use `and` or `&&` instead."))) (define (check-args-node-expr-op-^ expr-args info) (when (eq? (nodeinfo-lang info) LANG_ID) (define loc (nodeinfo-loc info)) - (raise-bsl-relational-error-expr-args "^" expr-args loc))) + (raise-bsl-relational-error-expr-args "^" expr-args loc "The `^` operator is not used in Froglet, but is reserved for use in other Forge languages. If you meant exclusive-or, use the `xor` operator instead."))) (define (check-args-node-expr-op-* expr-args info) (when (eq? (nodeinfo-lang info) LANG_ID) (define loc (nodeinfo-loc info)) - (raise-bsl-relational-error-expr-args "*" expr-args loc))) + (raise-bsl-relational-error-expr-args "*" expr-args loc "The `*` operator is not used in Froglet, but is reserved for use in other Forge languages. If you meant multiplication, use the `multiply` predicate instead."))) (define (check-args-node-expr-op-~ expr-args info) (when (eq? (nodeinfo-lang info) LANG_ID) (define loc (nodeinfo-loc info)) - (raise-bsl-relational-error-expr-args "~" expr-args loc))) + (raise-bsl-relational-error-expr-args "~" expr-args loc "The `~` operator is not used in Froglet, but is reserved for use in other Forge languages. If you meant logical-negation, use `not` or '!' instead."))) ; Prevent the forge/core arity error from appearing, since it breaks closure (define (check-args-node-formula-op-= expr-args info) @@ -319,14 +319,14 @@ (define bsl-ast-checker-hash (make-hash)) (hash-set! bsl-ast-checker-hash 'field-decl bsl-field-decl-func) -(hash-set! bsl-ast-checker-hash node/formula/op/= check-args-node-formula-op-=) -(hash-set! bsl-ast-checker-hash node/expr/op/-> check-args-node-expr-op-->) -(hash-set! bsl-ast-checker-hash node/expr/op/+ check-args-node-expr-op-+) -(hash-set! bsl-ast-checker-hash node/expr/op/- check-args-node-expr-op--) -(hash-set! bsl-ast-checker-hash node/expr/op/& check-args-node-expr-op-&) -(hash-set! bsl-ast-checker-hash node/expr/op/^ check-args-node-expr-op-^) -(hash-set! bsl-ast-checker-hash node/expr/op/* check-args-node-expr-op-*) -(hash-set! bsl-ast-checker-hash node/expr/op/~ check-args-node-expr-op-~) +(hash-set! bsl-ast-checker-hash node/formula/op-on-exprs/= check-args-node-formula-op-=) +(hash-set! bsl-ast-checker-hash node/expr/op-on-exprs/-> check-args-node-expr-op-->) +(hash-set! bsl-ast-checker-hash node/expr/op-on-exprs/+ check-args-node-expr-op-+) +(hash-set! bsl-ast-checker-hash node/expr/op-on-exprs/- check-args-node-expr-op--) +(hash-set! bsl-ast-checker-hash node/expr/op-on-exprs/& check-args-node-expr-op-&) +(hash-set! bsl-ast-checker-hash node/expr/op-on-exprs/^ check-args-node-expr-op-^) +(hash-set! bsl-ast-checker-hash node/expr/op-on-exprs/* check-args-node-expr-op-*) +(hash-set! bsl-ast-checker-hash node/expr/op-on-exprs/~ check-args-node-expr-op-~) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Partial instances and example instance blocks @@ -344,5 +344,5 @@ ; (define loc (nodeinfo-loc (node-info formula-node))) ; (raise-bsl-relational-error "\"in\"" formula-node loc))) -;(hash-set! bsl-inst-checker-hash node/formula/op/in inst-check-node-formula-op-in) +;(hash-set! bsl-inst-checker-hash node/formula/op-on-exprs/in inst-check-node-formula-op-in) (provide bsl-inst-checker-hash) diff --git a/forge/lang/alloy-syntax/parser.rkt b/forge/lang/alloy-syntax/parser.rkt index 74a56039d..0727dd5db 100644 --- a/forge/lang/alloy-syntax/parser.rkt +++ b/forge/lang/alloy-syntax/parser.rkt @@ -199,49 +199,68 @@ ExprList : NT-Expr ; binary temporal connectives which are not associative." NT-Expr : @NT-Expr1 - | LET-TOK LetDeclList BlockOrBar - | BIND-TOK LetDeclList BlockOrBar - | Quant DISJ-TOK? QuantDeclList BlockOrBar -NT-Expr1 : @NT-Expr1.5 | NT-Expr1 OR-TOK NT-Expr1.5 -NT-Expr1.5 : @NT-Expr2 | NT-Expr1.5 XOR-TOK NT-Expr2 -NT-Expr2 : @NT-Expr3 | NT-Expr2 IFF-TOK NT-Expr3 + | LET-TOK LetDeclList BlockOrBar + | BIND-TOK LetDeclList BlockOrBar + | Quant DISJ-TOK? QuantDeclList BlockOrBar +NT-Expr1 : @NT-Expr1.5 + | NT-Expr1 OR-TOK NT-Expr1.5 +NT-Expr1.5 : @NT-Expr2 + | NT-Expr1.5 XOR-TOK NT-Expr2 +NT-Expr2 : @NT-Expr3 + | NT-Expr2 IFF-TOK NT-Expr3 ;; right assoc -NT-Expr3 : @NT-Expr4 | NT-Expr4 IMP-TOK NT-Expr3 (ELSE-TOK NT-Expr3)? -NT-Expr4 : @NT-Expr4.5 | NT-Expr4 AND-TOK NT-Expr4.5 +NT-Expr3 : @NT-Expr4 + | NT-Expr4 IMP-TOK NT-Expr3 (ELSE-TOK NT-Expr3)? +;; back to left assoc +NT-Expr4 : @NT-Expr4.5 + | NT-Expr4 AND-TOK NT-Expr4.5 ; Electrum binary operators (not associative) -NT-Expr4.5 : @NT-Expr5 | NT-Expr5 UNTIL-TOK NT-Expr5 - | NT-Expr5 RELEASE-TOK NT-Expr5 - | NT-Expr5 SINCE-TOK NT-Expr5 - | NT-Expr5 TRIGGERED-TOK NT-Expr5 -NT-Expr5 : @NT-Expr6 | NEG-TOK NT-Expr5 - | ALWAYS-TOK NT-Expr5 - | EVENTUALLY-TOK NT-Expr5 - | AFTER-TOK NT-Expr5 - | BEFORE-TOK NT-Expr5 - | ONCE-TOK NT-Expr5 - | HISTORICALLY-TOK NT-Expr5 -NT-Expr6 : @NT-Expr7 | NT-Expr6 NEG-TOK? CompareOp NT-Expr7 -NT-Expr7 : @NT-Expr8 | (NO-TOK | SOME-TOK | LONE-TOK | ONE-TOK | TWO-TOK | SET-TOK) NT-Expr8 -NT-Expr8 : @NT-Expr9 | NT-Expr8 (PLUS-TOK | MINUS-TOK) NT-Expr10 -NT-Expr9 : @NT-Expr10 | CARD-TOK NT-Expr9 -NT-Expr10 : @NT-Expr11 | NT-Expr10 PPLUS-TOK NT-Expr11 -NT-Expr11 : @NT-Expr12 | NT-Expr11 AMP-TOK NT-Expr12 -NT-Expr12 : @NT-Expr13 | NT-Expr12 ArrowOp NT-Expr13 -NT-Expr13 : @NT-Expr14 | NT-Expr13 (SUBT-TOK | SUPT-TOK) NT-Expr14 -NT-Expr14 : @NT-Expr15 | NT-Expr14 LEFT-SQUARE-TOK ExprList RIGHT-SQUARE-TOK -NT-Expr15 : @NT-Expr16 | NT-Expr15 DOT-TOK NT-Expr16 - | Name LEFT-SQUARE-TOK ExprList RIGHT-SQUARE-TOK -NT-Expr16 : @NT-Expr17 | NT-Expr16 PRIME-TOK -NT-Expr17 : @NT-Expr18 | (TILDE-TOK | EXP-TOK | STAR-TOK) NT-Expr17 +NT-Expr4.5 : @NT-Expr5 + | NT-Expr5 UNTIL-TOK NT-Expr5 + | NT-Expr5 RELEASE-TOK NT-Expr5 + | NT-Expr5 SINCE-TOK NT-Expr5 + | NT-Expr5 TRIGGERED-TOK NT-Expr5 +NT-Expr5 : @NT-Expr6 + | NEG-TOK NT-Expr5 + | ALWAYS-TOK NT-Expr5 + | EVENTUALLY-TOK NT-Expr5 + | AFTER-TOK NT-Expr5 + | BEFORE-TOK NT-Expr5 + | ONCE-TOK NT-Expr5 + | HISTORICALLY-TOK NT-Expr5 +NT-Expr6 : @NT-Expr7 + | NT-Expr6 NEG-TOK? CompareOp NT-Expr7 +NT-Expr7 : @NT-Expr8 + | (NO-TOK | SOME-TOK | LONE-TOK | ONE-TOK | TWO-TOK | SET-TOK) NT-Expr8 +NT-Expr8 : @NT-Expr9 + | NT-Expr8 (PLUS-TOK | MINUS-TOK) NT-Expr10 +NT-Expr9 : @NT-Expr10 + | CARD-TOK NT-Expr9 +NT-Expr10 : @NT-Expr11 + | NT-Expr10 PPLUS-TOK NT-Expr11 +NT-Expr11 : @NT-Expr12 + | NT-Expr11 AMP-TOK NT-Expr12 +NT-Expr12 : @NT-Expr13 + | NT-Expr12 ArrowOp NT-Expr13 +NT-Expr13 : @NT-Expr14 + | NT-Expr13 (SUBT-TOK | SUPT-TOK) NT-Expr14 +NT-Expr14 : @NT-Expr15 + | NT-Expr14 LEFT-SQUARE-TOK ExprList RIGHT-SQUARE-TOK + | NT-Expr14 DOT-TOK NT-Expr15 +NT-Expr15 : @NT-Expr16 +NT-Expr16 : @NT-Expr17 + | NT-Expr16 PRIME-TOK +NT-Expr17 : @NT-Expr18 + | (TILDE-TOK | EXP-TOK | STAR-TOK) NT-Expr17 NT-Expr18 : Const - | QualName - | AT-TOK Name - | BACKQUOTE-TOK Name - | THIS-TOK - | LEFT-CURLY-TOK QuantDeclList BlockOrBar RIGHT-CURLY-TOK - | /LEFT-PAREN-TOK @NT-Expr /RIGHT-PAREN-TOK - | NT-Block - | Sexpr + | QualName + | AT-TOK Name + | BACKQUOTE-TOK Name + | THIS-TOK + | LEFT-CURLY-TOK QuantDeclList BlockOrBar RIGHT-CURLY-TOK + | /LEFT-PAREN-TOK @NT-Expr /RIGHT-PAREN-TOK + | NT-Block + | Sexpr ArrowExpr : QualName | QualName /ARROW-TOK @ArrowExpr diff --git a/forge/lang/ast.rkt b/forge/lang/ast.rkt index b491d1ae6..c8dc2ecd3 100644 --- a/forge/lang/ast.rkt +++ b/forge/lang/ast.rkt @@ -26,8 +26,8 @@ ; * node/expr (arity) -- expressions ; * node/expr/fun-spacer -- no-op spacer to record location where a fun substitution was done ; * node/expr/op (children) -- simple operators -; * node/expr/op/+ -; * node/expr/op/- +; * node/expr/op-on-exprs/+ +; * node/expr/op-on-exprs/- ; * ... ; * node/expr/comprehension (decls formula) -- set comprehension ; * node/expr/relation (name typelist-thunk parent is-variable) -- leaf relation @@ -46,7 +46,7 @@ ; * node/int -- integer expression ; * node/int/sum-quant -- sum "quantified" form ; * node/int/op (children) -; * node/int/op/add +; * node/int/op-on-ints/add ; * ... ; * node/int/constant (value) -- int constant ;; ----------------------------------------------------------------------------- @@ -130,7 +130,7 @@ ; if somehow the user has provided something ill-typed that wasn't caught elsewhere. (define (intexpr->expr/maybe a-node #:op functionname #:info info) ;(@-> (or/c node? integer?) #:op symbol? #:info nodeinfo? node/expr?) - (cond [(node/int? a-node) (node/expr/op/sing (update-annotation (node-info a-node) 'automatic-int-conversion #t) 1 (list a-node))] + (cond [(node/int? a-node) (node/expr/op-on-ints/sing (update-annotation (node-info a-node) 'automatic-int-conversion #t) 1 (list a-node))] [(integer? a-node) (intexpr->expr/maybe (int a-node) #:op functionname #:info info)] [(node/expr? a-node) a-node] [else @@ -144,7 +144,7 @@ (cond [(and (node/expr? a-node) (equal? (node/expr-arity a-node) 1)) ; If arity 1, this node/expr can be converted automatically to a node/int - (node/int/op/sum (update-annotation (node-info a-node) 'automatic-int-conversion #t) (list a-node))] + (node/int/op-on-exprs/sum (update-annotation (node-info a-node) 'automatic-int-conversion #t) (list a-node))] [(node/expr? a-node) ; Otherwise, this node/expr has the wrong arity for auto-conversion to a node/int (raise-forge-error @@ -291,7 +291,18 @@ ;; -- operators ---------------------------------------------------------------- ; Should never be directly instantiated -(struct node/expr/op node/expr (children) #:transparent) +(struct node/expr/op node/expr () #:transparent) + +; Intermediate structs grouping operators by child type (for Typed Racket support) +; Each intermediate declares children with the appropriate type constraint +(struct node/expr/op-on-exprs node/expr/op (children) #:transparent) ; children are node/expr +(struct node/expr/op-on-ints node/expr/op (children) #:transparent) ; children are node/int + +; Generic accessor for backward compatibility (returns Listof node) +(define (node/expr/op-children op) + (cond [(node/expr/op-on-exprs? op) (node/expr/op-on-exprs-children op)] + [(node/expr/op-on-ints? op) (node/expr/op-on-ints-children op)] + [else (raise-forge-error #:msg "Unknown node/expr/op subtype" #:context op)])) ;; if-then-else *expression*, which is different from an if-then-else formula ; The formula version is just sugar, the expression version is a basic expr type @@ -350,27 +361,40 @@ ; lifted operators are defaults, for when the types aren't as expected ; parent: the node struct type that is the parent of this new one ; arity: the arity of the new node, in terms of the arities of its children + +; Helper to derive the intermediate parent suffix based on child type +; Used at compile time to generate hierarchical struct names +(begin-for-syntax + (define (childtype->suffix childtype-stx) + (define ct (syntax->datum childtype-stx)) + (cond [(equal? ct 'node/expr?) "-on-exprs"] + [(equal? ct 'node/int?) "-on-ints"] + [(equal? ct 'node/formula?) "-on-formulas"] + ; For custom type predicates (e.g., breakers), use empty suffix (old behavior) + [else ""]))) + (define-syntax (define-node-op stx) (syntax-case stx () [(_ id parent arity checks ... #:lift @op #:type childtype #:elim-unary? elim-unary?) ;(printf "define-node-op defn case: ~a~n" stx) - (with-syntax ([name (format-id #'id "~a/~a" #'parent #'id)] + (with-syntax ([intermediate (format-id #'id "~a~a" #'parent (childtype->suffix #'childtype))] + [name (format-id #'id "~a~a/~a" #'parent (childtype->suffix #'childtype) #'id)] [parentname (format-id #'id "~a" #'parent)] [functionname (format-id #'id "~a/func" #'id)] [macroname/info-help (format-id #'id "~a/info-help" #'id)] [macroname/info (format-id #'id "~a/info" #'id)] [child-accessor (format-id #'id "~a-children" #'parent)] - [key (format-id #'id "~a/~a" #'parent #'id)] + [key (format-id #'id "~a~a/~a" #'parent (childtype->suffix #'childtype) #'id)] [display-id (if (equal? '|| (syntax->datum #'id)) "||" #'id)] [ellip '...]) ; otherwise ... is interpreted as belonging to the outer macro (syntax/loc stx (begin - (struct name parent () #:transparent #:reflection-name 'id + (struct name intermediate () #:transparent #:reflection-name 'id #:methods gen:equal+hash - [(define equal-proc (make-robust-node-equal-syntax parentname)) - (define hash-proc (make-robust-node-hash-syntax parentname 0)) - (define hash2-proc (make-robust-node-hash-syntax parentname 3))] + [(define equal-proc (make-robust-node-equal-syntax intermediate)) + (define hash-proc (make-robust-node-hash-syntax intermediate 0)) + (define hash2-proc (make-robust-node-hash-syntax intermediate 3))] #:methods gen:custom-write [(define (write-proc self port mode) ; all of the /op nodes have their children in a field named "children" @@ -711,7 +735,18 @@ ;; -- operators ---------------------------------------------------------------- -(struct node/int/op node/int (children) #:transparent) +(struct node/int/op node/int () #:transparent) + +; Intermediate structs grouping operators by child type (for Typed Racket support) +; Each intermediate declares children with the appropriate type constraint +(struct node/int/op-on-ints node/int/op (children) #:transparent) ; children are node/int +(struct node/int/op-on-exprs node/int/op (children) #:transparent) ; children are node/expr + +; Generic accessor for backward compatibility (returns Listof node) +(define (node/int/op-children op) + (cond [(node/int/op-on-ints? op) (node/int/op-on-ints-children op)] + [(node/int/op-on-exprs? op) (node/int/op-on-exprs-children op)] + [else (raise-forge-error #:msg "Unknown node/int/op subtype" #:context op)])) (define-node-op add node/int/op #f #:min-length 2 #:type node/int?) (define-node-op subtract node/int/op #f #:min-length 2 #:type node/int?) @@ -825,7 +860,20 @@ ;; -- operators ---------------------------------------------------------------- ; Should never be directly instantiated -(struct node/formula/op node/formula (children) #:transparent) +(struct node/formula/op node/formula () #:transparent) + +; Intermediate structs grouping operators by child type (for Typed Racket support) +; Each intermediate declares children with the appropriate type constraint +(struct node/formula/op-on-formulas node/formula/op (children) #:transparent) ; children are node/formula +(struct node/formula/op-on-exprs node/formula/op (children) #:transparent) ; children are node/expr +(struct node/formula/op-on-ints node/formula/op (children) #:transparent) ; children are node/int + +; Generic accessor for backward compatibility (returns Listof node) +(define (node/formula/op-children op) + (cond [(node/formula/op-on-formulas? op) (node/formula/op-on-formulas-children op)] + [(node/formula/op-on-exprs? op) (node/formula/op-on-exprs-children op)] + [(node/formula/op-on-ints? op) (node/formula/op-on-ints-children op)] + [else (raise-forge-error #:msg "Unknown node/formula/op subtype" #:context op)])) (define-node-op in node/formula/op #f #:same-arity? #t #:max-length 2 #:type node/expr?) @@ -874,7 +922,7 @@ (require (prefix-in @ (only-in racket ->))) (define/contract (maybe-and->list fmla) (@-> node/formula? (listof node/formula?)) - (cond [(node/formula/op/&&? fmla) + (cond [(node/formula/op-on-formulas/&&? fmla) (apply append (map maybe-and->list (node/formula/op-children fmla)))] [else (list fmla)])) @@ -898,6 +946,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) diff --git a/forge/lang/bounds.rkt b/forge/lang/bounds.rkt index 0b4a0dcb7..3a86af93d 100644 --- a/forge/lang/bounds.rkt +++ b/forge/lang/bounds.rkt @@ -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)]) @@ -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))) + diff --git a/forge/lang/deparse.rkt b/forge/lang/deparse.rkt index ea00ae46c..1cf692723 100644 --- a/forge/lang/deparse.rkt +++ b/forge/lang/deparse.rkt @@ -67,7 +67,7 @@ (define (deparse-formula-op formula parent-priority) (match formula - [(? node/formula/op/&&?) + [(? node/formula/op-on-formulas/&&?) ; Sometimes && nodes need to contain 0 or 1 arguments (cond [(equal? 0 (length (node/formula/op-children formula))) "true"] @@ -79,107 +79,107 @@ (if (@< PRIORITY-AND parent-priority) (format "(~a && ~a)" left-child right-child) (format "~a && ~a" left-child right-child)))])] - [(? node/formula/op/||?) + [(? node/formula/op-on-formulas/||?) (let ([left-child (deparse-formula (first (node/formula/op-children formula)) PRIORITY-OR)] [right-child (deparse-formula (second (node/formula/op-children formula)) PRIORITY-OR)]) (if (@< PRIORITY-OR parent-priority) (format "(~a || ~a)" left-child right-child) (format "~a || ~a" left-child right-child)))] - [(? node/formula/op/=>?) + [(? node/formula/op-on-formulas/=>?) (let ([left-child (deparse-formula (first (node/formula/op-children formula)) PRIORITY-IMPLIES)] [right-child (deparse-formula (second (node/formula/op-children formula)) PRIORITY-IMPLIES)]) (if (@< PRIORITY-IMPLIES parent-priority) (format "(~a => ~a)" left-child right-child) (format "~a => ~a" left-child right-child)))] - [(? node/formula/op/always?) + [(? node/formula/op-on-formulas/always?) (let ([child (deparse-formula (first (node/formula/op-children formula)) PRIORITY-ALWAYS)]) (if (@< PRIORITY-ALWAYS parent-priority) (format "(always ~a)" child) (format "always ~a" child)))] - [(? node/formula/op/eventually?) + [(? node/formula/op-on-formulas/eventually?) (let ([child (deparse-formula (first (node/formula/op-children formula)) PRIORITY-EVENTUALLY)]) (if (@< PRIORITY-EVENTUALLY parent-priority) (format "(eventually ~a)" child) (format "eventually ~a" child)))] - [(? node/formula/op/next_state?) + [(? node/formula/op-on-formulas/next_state?) (let ([child (deparse-formula (first (node/formula/op-children formula)) PRIORITY-AFTER)]) (if (@< PRIORITY-AFTER parent-priority) (format "(next_state ~a)" child) (format "next_state ~a" child)))] - [(? node/formula/op/historically?) + [(? node/formula/op-on-formulas/historically?) (let ([child (deparse-formula (first (node/formula/op-children formula)) PRIORITY-HISTORICALLY)]) (if (@< PRIORITY-HISTORICALLY parent-priority) (format "(historically ~a)" child) (format "historically ~a" child)))] - [(? node/formula/op/once?) + [(? node/formula/op-on-formulas/once?) (let ([child (deparse-formula (first (node/formula/op-children formula)) PRIORITY-ONCE)]) (if (@< PRIORITY-ONCE parent-priority) (format "(once ~a)" child) (format "once ~a" child)))] - [(? node/formula/op/prev_state?) + [(? node/formula/op-on-formulas/prev_state?) (let ([child (deparse-formula (first (node/formula/op-children formula)) PRIORITY-BEFORE)]) (if (@< PRIORITY-BEFORE parent-priority) (format "(prev_state ~a)" child) (format "prev_state ~a" child)))] - [(? node/formula/op/releases?) + [(? node/formula/op-on-formulas/releases?) (let ([left-child (deparse-formula (first (node/formula/op-children formula)) PRIORITY-RELEASES)] [right-child (deparse-formula (second (node/formula/op-children formula)) PRIORITY-RELEASES)]) (if (@<= PRIORITY-RELEASES parent-priority) (format "(~a releases ~a)" left-child right-child) (format "~a releases ~a" left-child right-child)))] - [(? node/formula/op/until?) + [(? node/formula/op-on-formulas/until?) (let ([left-child (deparse-formula (first (node/formula/op-children formula)) PRIORITY-UNTIL)] [right-child (deparse-formula (second (node/formula/op-children formula)) PRIORITY-UNTIL)]) (if (@<= PRIORITY-UNTIL parent-priority) (format "(~a until ~a)" left-child right-child) (format "~a until ~a" left-child right-child)))] - [(? node/formula/op/since?) + [(? node/formula/op-on-formulas/since?) (let ([left-child (deparse-formula (first (node/formula/op-children formula)) PRIORITY-SINCE)] [right-child (deparse-formula (second (node/formula/op-children formula)) PRIORITY-SINCE)]) (if (@<= PRIORITY-SINCE parent-priority) (format "(~a since ~a)" left-child right-child) (format "~a since ~a" left-child right-child)))] - [(? node/formula/op/triggered?) + [(? node/formula/op-on-formulas/triggered?) (let ([left-child (deparse-formula (first (node/formula/op-children formula)) PRIORITY-TRIGGERED)] [right-child (deparse-formula (second (node/formula/op-children formula)) PRIORITY-TRIGGERED)]) (if (@<= PRIORITY-TRIGGERED parent-priority) (format "(~a releases ~a)" left-child right-child) (format "~a releases ~a" left-child right-child)))] - [(? node/formula/op/in?) + [(? node/formula/op-on-exprs/in?) (let ([left-child (deparse-expr (first (node/formula/op-children formula)) PRIORITY-COMPAREOP)] [right-child (deparse-expr (second (node/formula/op-children formula)) PRIORITY-COMPAREOP)]) (if (@< PRIORITY-COMPAREOP parent-priority) (format "(~a in ~a)" left-child right-child) (format "~a in ~a" left-child right-child)))] - [(? node/formula/op/=?) + [(? node/formula/op-on-exprs/=?) (let ([left-child (deparse-expr (first (node/formula/op-children formula)) PRIORITY-COMPAREOP)] [right-child (deparse-expr (second (node/formula/op-children formula)) PRIORITY-COMPAREOP)]) (if (@<= PRIORITY-COMPAREOP parent-priority) (format "(~a = ~a)" left-child right-child) (format "~a = ~a" left-child right-child)))] - [(? node/formula/op/!?) + [(? node/formula/op-on-formulas/!?) (let ([child (deparse-formula (first (node/formula/op-children formula)) PRIORITY-NEG)]) (if (@< PRIORITY-NEG parent-priority) (format "(not ~a)" child) (format "not ~a" child)))] - [(? node/formula/op/int>?) + [(? node/formula/op-on-ints/int>?) (let ([left-child (deparse-int (first (node/formula/op-children formula)) PRIORITY-COMPAREOP)] [right-child (deparse-int (second (node/formula/op-children formula)) PRIORITY-COMPAREOP)]) (if (@<= PRIORITY-COMPAREOP parent-priority) (format "(~a > ~a)" left-child right-child) (format "~a > ~a" left-child right-child)))] - [(? node/formula/op/int?) + [(? node/expr/op-on-exprs/->?) (let ([left-child (deparse-expr (first (node/expr/op-children expr)) PRIORITY-CROSSPROD)] [right-child (deparse-expr (second (node/expr/op-children expr)) PRIORITY-CROSSPROD)]) (if (@<= PRIORITY-CROSSPROD parent-priority) (format "(~a->~a)" left-child right-child) (format "~a->~a" left-child right-child)))] - [(? node/expr/op/prime?) + [(? node/expr/op-on-exprs/prime?) (let ([child (deparse-expr (first (node/expr/op-children expr)) PRIORITY-PRIME)]) (if (@< PRIORITY-PRIME parent-priority) (format "(~a')" child) (format "~a'" child)))] - [(? node/expr/op/join?) + [(? node/expr/op-on-exprs/join?) (let ([left-child (deparse-expr (first (node/expr/op-children expr)) PRIORITY-JOIN)] [right-child (deparse-expr (second (node/expr/op-children expr)) PRIORITY-JOIN)]) (if (@< PRIORITY-JOIN parent-priority) (format "(~a.~a)" left-child right-child) (format "~a.~a" left-child right-child)))] - [(? node/expr/op/^?) + [(? node/expr/op-on-exprs/^?) (let ([child (deparse-expr (first (node/expr/op-children expr)) PRIORITY-EXP)]) (if (@< PRIORITY-EXP parent-priority) (format "(^~a)" child) (format "^~a" child)))] - [(? node/expr/op/*?) + [(? node/expr/op-on-exprs/*?) (let ([child (deparse-expr (first (node/expr/op-children expr)) PRIORITY-CROSSPROD)]) (if (@< PRIORITY-CROSSPROD parent-priority) (format "(*~a)" child) (format "*~a" child)))] - [(? node/expr/op/~?) + [(? node/expr/op-on-exprs/~?) (let ([child (deparse-expr (first (node/expr/op-children expr)) PRIORITY-TILDE)]) (if (@< PRIORITY-TILDE parent-priority) (format "(~a ~a)" '~~ child) (format "~a ~a" '~~ child)))] - [(? node/expr/op/sing?) + [(? node/expr/op-on-ints/sing?) (let ([child (deparse-int (first (node/expr/op-children expr)) 0)]) (format "sing[~a]" child))])) @@ -310,7 +310,7 @@ "Int"] [(node/expr/constant info arity type) (format "~a " type)] - [(node/expr/op info arity args) + [(? node/expr/op?) (deparse-expr-op expr parent-priority)] [(node/expr/quantifier-var info arity sym name) (format "~a" name)] @@ -327,7 +327,7 @@ (match expr [(node/int/constant info value) (format "~a" value)] - [(node/int/op info args) + [(? node/int/op?) (deparse-int-op expr parent-priority)] [(node/int/sum-quant info decls int-expr) (format "sum ~a | { ~a }" @@ -346,25 +346,25 @@ (define (deparse-int-op expr parent-priority) (match expr - [(node/int/op/add info args) + [(node/int/op-on-ints/add info args) (format-nary-call "add" args)] - [(node/int/op/subtract info args) + [(node/int/op-on-ints/subtract info args) (format-nary-call "subtract" args)] - [(node/int/op/multiply info args) + [(node/int/op-on-ints/multiply info args) (format-nary-call "multiply" args)] - [(node/int/op/divide info args) + [(node/int/op-on-ints/divide info args) (format-nary-call "divide" args)] - [(node/int/op/sum info args) + [(node/int/op-on-exprs/sum info args) (format "sum[~a]" (deparse-expr (first args) 0))] - [(node/int/op/card info args) + [(node/int/op-on-exprs/card info args) (format "#~a" (deparse-expr (first args) PRIORITY-CARD))] - [(node/int/op/remainder info args) + [(node/int/op-on-ints/remainder info args) (format "remainder[~a, ~a]" (deparse-int (car args) 0) (deparse-int (cdr args) 0))] - [(node/int/op/abs info args) + [(node/int/op-on-ints/abs info args) (format "abs[~a]" (deparse-int (first args) 0))] - [(node/int/op/sign info args) + [(node/int/op-on-ints/sign info args) (format "sign[~a]" (deparse-int (first args) 0))] [(node/int/sum-quant info decls int-expr) (format "sum ~a | { ~a }" diff --git a/forge/lang/expander.rkt b/forge/lang/expander.rkt index d94144e5e..c23e60be2 100644 --- a/forge/lang/expander.rkt +++ b/forge/lang/expander.rkt @@ -16,16 +16,19 @@ (require syntax/parse/define racket/stxparam (for-syntax racket/base syntax/parse racket/syntax syntax/parse/define racket/function - syntax/srcloc racket/match racket/list - (only-in racket/path file-name-from-path) - (only-in racket/string string-replace)) + syntax/srcloc racket/match racket/list + (only-in pkg/lib pkg-directory) + (only-in racket/path file-name-from-path find-relative-path normalize-path) + (only-in racket/string string-replace string-join) + (only-in forge/lang/ast raise-forge-error)) syntax/srcloc + racket/string + (only-in syntax/modresolve resolve-module-path) + (only-in forge/server/eval-model ->string) (only-in racket/list flatten) - ; Needed because the abstract-tok definition below requires phase 2 - (for-syntax (for-syntax racket/base)) - (only-in forge/server/eval-model ->string) - racket/string) + ; Needed because the abstract-tok definition below requires phase 2 + (for-syntax (for-syntax racket/base))) (require (only-in racket empty? first) (prefix-in @ (only-in racket +))) @@ -33,7 +36,6 @@ (require forge/choose-lang-specific) (require (only-in forge/lang/ast raise-forge-error)) -(provide isSeqOf seqFirst seqLast indsOf idxOf lastIdxOf elems inds isEmpty hasDups reachable) (provide #%module-begin) (provide #%top #%app #%datum #%top-interaction) @@ -521,10 +523,18 @@ (define-syntax-class QualNameClass #:attributes (name) (pattern ((~datum QualName) - (~optional "this") ; TODO, allow more complex qualnames + ;(~optional "this") ; TODO, allow more complex qualnames (~seq prefixes:id ...) raw-name:id) - #:attr name #'raw-name) + #:attr name + ; It is vital to provide #'raw-name for context in the new id, so Racket has the correct binding. + (with-syntax ([the-id (format-id #'raw-name "~a~a~a" + (string-join (map symbol->string (syntax->datum #'(prefixes ...))) "/") + (if (not (empty? (syntax->list #'(prefixes ...)))) + "/" "") + #'raw-name + #:source #'raw-name)]) + #'the-id)) (pattern ((~datum QualName) "Int") #:attr name #'(raise "Int as qualname?")) (pattern ((~datum QualName) "sum") @@ -839,12 +849,13 @@ (define-syntax (NT-AlloyModule stx) (syntax-parse stx [((~datum NT-AlloyModule) (~optional module-decl:ModuleDeclClass) - (~seq import:ImportClass ...) + ; Imports are now handled separately + ;(~seq import:ImportClass ...) (~seq paragraph:ParagraphClass ...)) (syntax/loc stx (begin (~? module-decl) - import ... + ;import ... paragraph ...))] [((~datum NT-AlloyModule) ((~datum NT-EvalDecl) "eval" expr:ExprClass)) (syntax/loc stx expr)] @@ -859,23 +870,63 @@ (~optional (~seq "[" other-names:NameListClass "]"))) (syntax/loc stx (raise "Forge does not yet support Alloy-style module naming."))])) - ; Import : OPEN-TOK QualName (LEFT-SQUARE-TOK QualNameList RIGHT-SQUARE-TOK)? (AS-TOK Name)? (define-syntax (NT-Import stx) (syntax-parse stx - [((~datum NT-Import) file-path:str - (~optional (~seq "as" as-name:NameClass))) - (syntax/loc stx (begin - (~? (require (prefix-in as-name.name file-path)) - (require file-path))))] + + ; Arbitrary relative path, usually a user-authored Forge module. Here we need to + ; take the importing module's location into account. + [((~datum NT-Import) file-path:str + (~optional (~seq "as" as-name:NameClass))) + (unless (file-exists? (build-path (current-load-relative-directory) (syntax->datum #'file-path))) + (raise-forge-error #:msg (format "File to import was not found: ~a" (syntax->datum #'file-path)) + #:context (build-source-location stx))) + (quasisyntax/loc stx + (begin + ; TODO: absolute paths should work in Windows here, but relative paths + ; not so much. + (~? (require (prefix-in as-name.name file-path)) + (require file-path))))] + + ; Path relative to the `library` subfolder of the Forge package + ; Here we can require a module path in the forge package. [((~datum NT-Import) import-name:QualNameClass - (~optional (~seq "[" other-names:QualNameListClass "]")) - (~optional (~seq "as" as-name:NameClass))) - (syntax/loc stx (begin - (raise (format "Importing packages not yet implemented: ~a." 'import-name)) - (~? (raise (format "Bracketed import not yet implemented. ~a" 'other-names))) - (~? (raise (format "Importing as not yet implemented. ~a" 'as-name)))))])) - + (~optional (~seq "[" other-names:QualNameListClass "]")) + (~optional (~seq "as" as-name:NameClass))) + + (when (syntax->datum #'(~? other-names #f)) + (raise (format "Parameterized import not yet implemented. ~a" 'other-names))) + + ; (define prefixed-file-path + ; (build-path (pkg-directory "forge") + ; "library" + ; (symbol->string (syntax->datum #'import-name.name)))) + + ; (printf "value: ~a~n" (symbol->string (syntax->datum #'import-name.name))) + ; (printf "Prefixed: ~a~n" prefixed-file-path) + ; (define actual-file-path + ; (find-relative-path + ; (current-load-relative-directory) + ; (simplify-path + ; (cond [(file-exists? (path-add-extension prefixed-file-path #".rkt")) + ; (path-add-extension prefixed-file-path #".rkt")] + ; [(file-exists? (path-add-extension prefixed-file-path #".frg")) + ; (path-add-extension prefixed-file-path #".frg")] + ; [else + ; (raise-forge-error #:msg (format "Forge library module to import did not exist: ~a" (syntax->datum #'import-name.name)) + ; #:context stx)])))) + + (define actual-module-path + (string->symbol + (format "forge/library/~a" (syntax->datum #'import-name.name)))) + + (with-syntax ([fp (datum->syntax #'import-name actual-module-path #'import-name)]) + (quasisyntax/loc stx + ; It is important that the module-path given here has the context of the Forge module. + (~? (require (prefix-in as-name.name fp)) + (require fp)) + ))])) + ; SigDecl : VAR-TOK? ABSTRACT-TOK? Mult? /SIG-TOK NameList SigExt? /LEFT-CURLY-TOK ArrowDeclList? /RIGHT-CURLY-TOK Block? (define-syntax (NT-SigDecl stx) (syntax-parse stx @@ -1572,17 +1623,17 @@ ; Annoyingly, structs aren't polymorphic in the way we need. This is not elegant, but: ; join, transpose, +, -, &, ^, *, ->, sing, ', ++ - [(node/expr/op/join? astnode) (rebuild-expr-op node/expr/op/join astnode new-info)] - [(node/expr/op/~? astnode) (rebuild-expr-op node/expr/op/~ astnode new-info)] - [(node/expr/op/+? astnode) (rebuild-expr-op node/expr/op/+ astnode new-info)] - [(node/expr/op/-? astnode) (rebuild-expr-op node/expr/op/- astnode new-info)] - [(node/expr/op/&? astnode) (rebuild-expr-op node/expr/op/& astnode new-info)] - [(node/expr/op/^? astnode) (rebuild-expr-op node/expr/op/^ astnode new-info)] - [(node/expr/op/*? astnode) (rebuild-expr-op node/expr/op/* astnode new-info)] - [(node/expr/op/->? astnode) (rebuild-expr-op node/expr/op/-> astnode new-info)] - [(node/expr/op/sing? astnode) (rebuild-expr-op node/expr/op/sing astnode new-info)] - [(node/expr/op/prime? astnode) (rebuild-expr-op node/expr/op/prime astnode new-info)] - [(node/expr/op/++? astnode) (rebuild-expr-op node/expr/op/++ astnode new-info)] + [(node/expr/op-on-exprs/join? astnode) (rebuild-expr-op node/expr/op-on-exprs/join astnode new-info)] + [(node/expr/op-on-exprs/~? astnode) (rebuild-expr-op node/expr/op-on-exprs/~ astnode new-info)] + [(node/expr/op-on-exprs/+? astnode) (rebuild-expr-op node/expr/op-on-exprs/+ astnode new-info)] + [(node/expr/op-on-exprs/-? astnode) (rebuild-expr-op node/expr/op-on-exprs/- astnode new-info)] + [(node/expr/op-on-exprs/&? astnode) (rebuild-expr-op node/expr/op-on-exprs/& astnode new-info)] + [(node/expr/op-on-exprs/^? astnode) (rebuild-expr-op node/expr/op-on-exprs/^ astnode new-info)] + [(node/expr/op-on-exprs/*? astnode) (rebuild-expr-op node/expr/op-on-exprs/* astnode new-info)] + [(node/expr/op-on-exprs/->? astnode) (rebuild-expr-op node/expr/op-on-exprs/-> astnode new-info)] + [(node/expr/op-on-ints/sing? astnode) (rebuild-expr-op node/expr/op-on-ints/sing astnode new-info)] + [(node/expr/op-on-exprs/prime? astnode) (rebuild-expr-op node/expr/op-on-exprs/prime astnode new-info)] + [(node/expr/op-on-exprs/++? astnode) (rebuild-expr-op node/expr/op-on-exprs/++ astnode new-info)] [(node/expr/ite? astnode) (node/expr/ite new-info (node/expr-arity astnode) diff --git a/forge/lang/lang-specific-checks.rkt b/forge/lang/lang-specific-checks.rkt index 312b74d25..9d9fa6120 100644 --- a/forge/lang/lang-specific-checks.rkt +++ b/forge/lang/lang-specific-checks.rkt @@ -22,25 +22,25 @@ ;; (hash-set! forge-checker-hash node/formula/op check-node-formula-op) ;; (hash-set! forge-checker-hash node/formula/multiplicity check-node-formula-multiplicity) ;; (hash-set! forge-checker-hash node/formula/quantified check-node-formula-quantified) -;; (hash-set! forge-checker-hash node/formula/op/always check-node-formula-op-always) -;; (hash-set! forge-checker-hash node/formula/op/eventually check-node-formula-op-eventually) -;; (hash-set! forge-checker-hash node/formula/op/until check-node-formula-op-until) -;; (hash-set! forge-checker-hash node/formula/op/releases check-node-formula-op-releases) -;; (hash-set! forge-checker-hash node/formula/op/next_state check-node-formula-op-next_state) -;; (hash-set! forge-checker-hash node/formula/op/historically check-node-formula-op-historically) -;; (hash-set! forge-checker-hash node/formula/op/once check-node-formula-op-once) -;; (hash-set! forge-checker-hash node/formula/op/prev_state check-node-formula-op-prev_state) -;; (hash-set! forge-checker-hash node/formula/op/since check-node-formula-op-since) -;; (hash-set! forge-checker-hash node/formula/op/triggered check-node-formula-op-triggered) -;; (hash-set! forge-checker-hash node/formula/op/&& check-node-formula-op-&&) -;; (hash-set! forge-checker-hash node/formula/op/|| check-node-formula-op-||) -;; (hash-set! forge-checker-hash node/formula/op/=> check-node-formula-op-=>) -;; (hash-set! forge-checker-hash node/formula/op/in check-node-formula-op-in) -;; (hash-set! forge-checker-hash node/formula/op/= check-node-formula-op-=) -;; (hash-set! forge-checker-hash node/formula/op/! check-node-formula-op-!) -;; (hash-set! forge-checker-hash node/formula/op/int> check-node-formula-op-int>) -;; (hash-set! forge-checker-hash node/formula/op/int< check-node-formula-op-int<) -;; (hash-set! forge-checker-hash node/formula/op/int= check-node-formula-op-int=) +;; (hash-set! forge-checker-hash node/formula/op-on-formulas/always check-node-formula-op-always) +;; (hash-set! forge-checker-hash node/formula/op-on-formulas/eventually check-node-formula-op-eventually) +;; (hash-set! forge-checker-hash node/formula/op-on-formulas/until check-node-formula-op-until) +;; (hash-set! forge-checker-hash node/formula/op-on-formulas/releases check-node-formula-op-releases) +;; (hash-set! forge-checker-hash node/formula/op-on-formulas/next_state check-node-formula-op-next_state) +;; (hash-set! forge-checker-hash node/formula/op-on-formulas/historically check-node-formula-op-historically) +;; (hash-set! forge-checker-hash node/formula/op-on-formulas/once check-node-formula-op-once) +;; (hash-set! forge-checker-hash node/formula/op-on-formulas/prev_state check-node-formula-op-prev_state) +;; (hash-set! forge-checker-hash node/formula/op-on-formulas/since check-node-formula-op-since) +;; (hash-set! forge-checker-hash node/formula/op-on-formulas/triggered check-node-formula-op-triggered) +;; (hash-set! forge-checker-hash node/formula/op-on-formulas/&& check-node-formula-op-&&) +;; (hash-set! forge-checker-hash node/formula/op-on-formulas/|| check-node-formula-op-||) +;; (hash-set! forge-checker-hash node/formula/op-on-formulas/=> check-node-formula-op-=>) +;; (hash-set! forge-checker-hash node/formula/op-on-exprs/in check-node-formula-op-in) +;; (hash-set! forge-checker-hash node/formula/op-on-exprs/= check-node-formula-op-=) +;; (hash-set! forge-checker-hash node/formula/op-on-formulas/! check-node-formula-op-!) +;; (hash-set! forge-checker-hash node/formula/op-on-ints/int> check-node-formula-op-int>) +;; (hash-set! forge-checker-hash node/formula/op-on-ints/int< check-node-formula-op-int<) +;; (hash-set! forge-checker-hash node/formula/op-on-ints/int= check-node-formula-op-int=) ;; (hash-set! forge-checker-hash node/expr/relation check-node-expr-relation) ;; (hash-set! forge-checker-hash node/expr/atom check-node-expr-atom) ;; (hash-set! forge-checker-hash node/expr/ite check-node-expr-ite) @@ -48,13 +48,13 @@ ;; (hash-set! forge-checker-hash node/expr/op check-node-expr-op) ;; (hash-set! forge-checker-hash node/expr/quantifier-var check-node-expr-quantifier-var) ;; (hash-set! forge-checker-hash node/expr/comprehension check-node-expr-comprehension) -;; (hash-set! forge-checker-hash node/expr/op/prime check-node-expr-op-prime) -;; (hash-set! forge-checker-hash node/expr/op/+ check-node-expr-op-+) -;; (hash-set! forge-checker-hash node/expr/op/- check-node-expr-op--) -;; (hash-set! forge-checker-hash node/expr/op/& check-node-expr-op-&) -;; (hash-set! forge-checker-hash node/expr/op/-> check-node-expr-op-->) -;; (hash-set! forge-checker-hash node/expr/op/join check-node-expr-op-join) -;; (hash-set! forge-checker-hash node/expr/op/^ check-node-expr-op-^) -;; (hash-set! forge-checker-hash node/expr/op/* check-node-expr-op-*) -;; (hash-set! forge-checker-hash node/expr/op/~ check-node-expr-op-~) -;; (hash-set! forge-checker-hash node/expr/op/sing check-node-expr-op-sing) +;; (hash-set! forge-checker-hash node/expr/op-on-exprs/prime check-node-expr-op-prime) +;; (hash-set! forge-checker-hash node/expr/op-on-exprs/+ check-node-expr-op-+) +;; (hash-set! forge-checker-hash node/expr/op-on-exprs/- check-node-expr-op--) +;; (hash-set! forge-checker-hash node/expr/op-on-exprs/& check-node-expr-op-&) +;; (hash-set! forge-checker-hash node/expr/op-on-exprs/-> check-node-expr-op-->) +;; (hash-set! forge-checker-hash node/expr/op-on-exprs/join check-node-expr-op-join) +;; (hash-set! forge-checker-hash node/expr/op-on-exprs/^ check-node-expr-op-^) +;; (hash-set! forge-checker-hash node/expr/op-on-exprs/* check-node-expr-op-*) +;; (hash-set! forge-checker-hash node/expr/op-on-exprs/~ check-node-expr-op-~) +;; (hash-set! forge-checker-hash node/expr/op-on-ints/sing check-node-expr-op-sing) diff --git a/forge/lang/reader.rkt b/forge/lang/reader.rkt index eb8dc5de1..4a969663b 100644 --- a/forge/lang/reader.rkt +++ b/forge/lang/reader.rkt @@ -1,6 +1,6 @@ #lang racket/base -(provide coerce-ints-to-atoms +(provide coerce-ints-to-atoms-and-preprocess read-syntax generic-forge-reader) @@ -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") @@ -19,29 +18,38 @@ ; insert automatic conversion between int-exprs and rel-exprs in ; *some* cases; the others are handled in the AST construction. +; It also separates the (leading!) imports out from the main module, +; so that the reader can lift (require ...) expressions. + ; Regarding syntax replacement, here and in the expander, ; NOTE WELL this sentence from the Racket docs on syntax/loc: ; "The source location is adjusted only if the resulting syntax object ; comes from the template itself rather than the value of a syntax pattern variable." ; (In all other cases, we apparently must use datum->syntax.) -(define (coerce-ints-to-atoms tree) +(define (coerce-ints-to-atoms-and-preprocess tree) ; AlloyModule: ModuleDecl? Import* Paragraph* (syntax-parse tree #:datum-literals (NT-AlloyModule NT-ModuleDecl NT-Import) [(NT-AlloyModule (~optional (~and module-decl - (ModuleDecl _ ...))) - (~seq (~and import - (Import _ ...)) ...) - . parags) + (NT-ModuleDecl _ ...))) + ;(~seq (~and import + ; (Import _ ...)) ...) + (~seq (~and import (NT-Import _)) ...) + . parags) #:with (paragraphs ...) (quasisyntax/loc tree #,(replace-ints-paragraph* (syntax/loc tree parags))) - ; (printf "Module-decl ~a~n~n" #'(~? module-decl "None present")) - ; (printf "Paragraphs: ~a~n~n" #'(paragraphs ...)) - (quasisyntax/loc tree + ;(printf "Module-decl ~a~n~n" #'(~? module-decl "None present")) + ;(printf "Imports: ~a~n~n" #'(import ...)) + ;(printf "Paragraphs: ~a~n~n" #'(paragraphs ...)) + (values + ; The module imports + (quasisyntax/loc tree (import ...)) + ; The module body with integers coerced and imports removed + (quasisyntax/loc tree (NT-AlloyModule (~? module-decl) - import ... - paragraphs ...))])) + ;import ... + paragraphs ...)))])) (define (replace-ints-expr expr) ;(printf "Replace-int-expr: ~a~n~n" expr) @@ -107,24 +115,21 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; NOTE: Changes to this macro may need re-compiling Forge before they are soon. + (define-syntax (generic-forge-reader stx) (syntax-parse stx [((~datum generic-forge-reader) path port LANG-NAME CH ACH ICH EXTRA-REQUIRES (~optional INJECTED #:defaults ([INJECTED #''()]))) + ; This is the Racket code for the specialized reader: (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)) + (define-values (imports ints-coerced) (coerce-ints-to-atoms-and-preprocess parse-tree)) (define final `((provide (except-out (all-defined-out) ; So other programs can require it forge:n)) ; but don't share the namespace anchor @@ -132,16 +137,14 @@ ; Racket functions are needed too. (require (only-in racket/base unless hash-empty?)) (require (only-in forge/shared do-time)) + ; Module imports (via "open") + ,@(syntax->list imports) (do-time "forge-mod toplevel") ;; 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 @@ -151,10 +154,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. @@ -175,9 +174,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 @@ -185,6 +181,7 @@ ; For debugging purposes, convert to a datum first or pretty-format will truncate. ;(printf "Ints-coerced: ~a~n" (pretty-format (syntax->datum ints-coerced))) + ;printf "Parse-tree (converted to datum:~n ~a~n" (pretty-format (syntax->datum parse-tree))) (define result (datum->syntax #f module-datum)) ;(printf "debug result of expansion: ~a~n" result) diff --git a/forge/last-checker.rkt b/forge/last-checker.rkt index 67e9f9040..d8533787a 100644 --- a/forge/last-checker.rkt +++ b/forge/last-checker.rkt @@ -120,11 +120,11 @@ (check-helper-args run-or-state 'predicate name args arg-types domain-types) (checkFormula run-or-state expanded quantvars checker-hash)] - [(node/formula/op info args) + [(? node/formula/op? op) (check-and-output formula node/formula/op checker-hash - (checkFormulaOp run-or-state formula quantvars args checker-hash))] + (checkFormulaOp run-or-state formula quantvars (node/formula/op-children op) checker-hash))] [(node/formula/multiplicity info mult expr) (define expr-type (checkExpression run-or-state expr quantvars checker-hash)) @@ -190,94 +190,94 @@ (match formula ; TEMPORAL OPERATORS - [(? node/formula/op/always?) + [(? node/formula/op-on-formulas/always?) (check-temporal-mode run-or-state formula) (check-and-output formula - node/formula/op/always + node/formula/op-on-formulas/always checker-hash (for-each (lambda (x) (checkFormula run-or-state x quantvars checker-hash)) args))] - [(? node/formula/op/eventually?) + [(? node/formula/op-on-formulas/eventually?) (check-temporal-mode run-or-state formula) (check-and-output formula - node/formula/op/eventually + node/formula/op-on-formulas/eventually checker-hash (for-each (lambda (x) (checkFormula run-or-state x quantvars checker-hash)) args))] - [(? node/formula/op/until?) + [(? node/formula/op-on-formulas/until?) (check-temporal-mode run-or-state formula) (check-and-output formula - node/formula/op/until + node/formula/op-on-formulas/until checker-hash (for-each (lambda (x) (checkFormula run-or-state x quantvars checker-hash)) args))] - [(? node/formula/op/releases?) + [(? node/formula/op-on-formulas/releases?) (check-temporal-mode run-or-state formula) (check-and-output formula - node/formula/op/releases + node/formula/op-on-formulas/releases checker-hash (for-each (lambda (x) (checkFormula run-or-state x quantvars checker-hash)) args))] - [(? node/formula/op/next_state?) + [(? node/formula/op-on-formulas/next_state?) (check-temporal-mode run-or-state formula) (check-and-output formula - node/formula/op/next_state + node/formula/op-on-formulas/next_state checker-hash (for-each (lambda (x) (checkFormula run-or-state x quantvars checker-hash)) args))] - [(? node/formula/op/historically?) + [(? node/formula/op-on-formulas/historically?) (check-temporal-mode run-or-state formula) (check-and-output formula - node/formula/op/historically + node/formula/op-on-formulas/historically checker-hash (for-each (lambda (x) (checkFormula run-or-state x quantvars checker-hash)) args))] - [(? node/formula/op/once?) + [(? node/formula/op-on-formulas/once?) (check-temporal-mode run-or-state formula) (check-and-output formula - node/formula/op/once + node/formula/op-on-formulas/once checker-hash (for-each (lambda (x) (checkFormula run-or-state x quantvars checker-hash)) args))] - [(? node/formula/op/prev_state?) + [(? node/formula/op-on-formulas/prev_state?) (check-temporal-mode run-or-state formula) (check-and-output formula - node/formula/op/prev_state + node/formula/op-on-formulas/prev_state checker-hash (for-each (lambda (x) (checkFormula run-or-state x quantvars checker-hash)) args))] - [(? node/formula/op/since?) + [(? node/formula/op-on-formulas/since?) (check-temporal-mode run-or-state formula) (check-and-output formula - node/formula/op/since + node/formula/op-on-formulas/since checker-hash (for-each (lambda (x) (checkFormula run-or-state x quantvars checker-hash)) args))] - [(? node/formula/op/triggered?) + [(? node/formula/op-on-formulas/triggered?) (check-temporal-mode run-or-state formula) (check-and-output formula - node/formula/op/triggered + node/formula/op-on-formulas/triggered checker-hash (for-each (lambda (x) (checkFormula run-or-state x quantvars checker-hash)) args))] ; AND - [(? node/formula/op/&&?) + [(? node/formula/op-on-formulas/&&?) (check-and-output formula - node/formula/op/&& + node/formula/op-on-formulas/&& checker-hash (for-each (lambda (x) (checkFormula run-or-state x quantvars checker-hash)) args))] ; OR - [(? node/formula/op/||?) + [(? node/formula/op-on-formulas/||?) (check-and-output formula - node/formula/op/|| + node/formula/op-on-formulas/|| checker-hash (for-each (lambda (x) (checkFormula run-or-state x quantvars checker-hash)) args))] ; IMPLIES - [(? node/formula/op/=>?) + [(? node/formula/op-on-formulas/=>?) (check-and-output formula - node/formula/op/=> + node/formula/op-on-formulas/=> checker-hash (for-each (lambda (x) (checkFormula run-or-state x quantvars checker-hash)) args))] ; IN (atomic fmla) - [(? node/formula/op/in?) + [(? node/formula/op-on-exprs/in?) (define child-types (map (lambda (x) (checkExpression run-or-state x quantvars checker-hash)) args)) (check-and-output formula - node/formula/op/in + node/formula/op-on-exprs/in checker-hash ;(for-each (lambda (x) (expression-type-type (checkExpression run-or-state x quantvars checker-hash))) args) (void) @@ -285,25 +285,25 @@ )] ; EQUALS - [(? node/formula/op/=?) + [(? node/formula/op-on-exprs/=?) (define child-types (map (lambda (x) (checkExpression run-or-state x quantvars checker-hash)) args)) (check-and-output formula - node/formula/op/= + node/formula/op-on-exprs/= checker-hash (void) child-types)] ; NEGATION - [(? node/formula/op/!?) + [(? node/formula/op-on-formulas/!?) (check-and-output formula - node/formula/op/! + node/formula/op-on-formulas/! checker-hash (for-each (lambda (x) (checkFormula run-or-state x quantvars checker-hash)) args))] ; INTEGER >, <, = - [(or (? node/formula/op/int>?) - (? node/formula/op/int?) + (? node/formula/op-on-ints/int (length args) 1) (expression-type-type (checkExpression run-or-state (second args) quantvars checker-hash))) (check-and-output expr - node/expr/op/- + node/expr/op-on-exprs/- checker-hash ; A-B should have only 2 children. B may be empty. (let ([a-type (first child-types)]) @@ -683,10 +683,10 @@ child-types))] ; INTERSECTION - [(? node/expr/op/&?) + [(? node/expr/op-on-exprs/&?) (define sub-results (map (lambda (x) (checkExpression run-or-state x quantvars checker-hash)) args)) (check-and-output expr - node/expr/op/& + node/expr/op-on-exprs/& checker-hash (expression-type (foldl (lambda (x acc) (keep-only (expression-type-type x) acc)) @@ -702,10 +702,10 @@ sub-results)] ; PRODUCT - [(? node/expr/op/->?) + [(? node/expr/op-on-exprs/->?) (define child-types (map (lambda (x) (checkExpression run-or-state x quantvars checker-hash)) args)) (check-and-output expr - node/expr/op/-> + node/expr/op-on-exprs/-> checker-hash (let* ([child-values (map (lambda (x) (expression-type-type x)) child-types)] [all-singleton (andmap (lambda (x) (equal? 'one (expression-type-multiplicity x))) child-types)] @@ -718,10 +718,10 @@ child-types)] ; JOIN - [(? node/expr/op/join?) + [(? node/expr/op-on-exprs/join?) (define child-types (map (lambda (x) (checkExpression run-or-state x quantvars checker-hash)) args)) (check-and-output expr - node/expr/op/join + node/expr/op-on-exprs/join checker-hash (let* ([join-result (check-join (map expression-type-type child-types))] [join-top-level (check-join (map (lambda (x) (list (expression-type-top-level-types x))) child-types))]) @@ -749,10 +749,10 @@ child-types)] ; TRANSITIVE CLOSURE - [(? node/expr/op/^?) + [(? node/expr/op-on-exprs/^?) (define child-types (map (lambda (x) (checkExpression run-or-state x quantvars checker-hash)) args)) (check-and-output expr - node/expr/op/^ + node/expr/op-on-exprs/^ checker-hash (expression-type (let* ([child-values (map (lambda (x) (expression-type-type x)) child-types)]) (check-closure (first child-values))) @@ -762,10 +762,10 @@ (get-top-levels (check-closure (first child-values)) run-or-state))))] ; REFLEXIVE-TRANSITIVE CLOSURE - [(? node/expr/op/*?) + [(? node/expr/op-on-exprs/*?) (define child-types (map (lambda (x) (checkExpression run-or-state x quantvars checker-hash)) args)) (check-and-output expr - node/expr/op/* + node/expr/op-on-exprs/* checker-hash ; includes iden, so might contain any arity-2 tuple (expression-type (let ([prims (primify run-or-state 'univ)]) @@ -777,10 +777,10 @@ child-types)] ; TRANSPOSE: ~(r); r must be arity 2. reverse all types of r - [(? node/expr/op/~?) + [(? node/expr/op-on-exprs/~?) (define child-types (map (lambda (x) (checkExpression run-or-state x quantvars checker-hash)) args)) (check-and-output expr - node/expr/op/~ + node/expr/op-on-exprs/~ checker-hash (expression-type (map reverse (expression-type-type (first child-types))) 'set ; TODO @@ -795,7 +795,7 @@ ; Need to check that the left sub-expression has arity at least 2 ; Need to check the the left and right sub-expressions have the same types ; (which is much easier thanks to the AST checking that they have the same arity) - [(? node/expr/op/++?) + [(? node/expr/op-on-exprs/++?) ;; TODO: check-and-output for this case (let ([left-arity (node/expr-arity (first args))] [left-tuples (expression-type-type (checkExpression run-or-state (first args) quantvars checker-hash))] @@ -821,11 +821,11 @@ (get-top-levels (remove-duplicates (append left-tuples right-tuples)) run-or-state))))] ; SINGLETON (typecast number to 1x1 relation with that number in it) - [(? node/expr/op/sing?) + [(? node/expr/op-on-ints/sing?) ; descend into the integer-expression within and confirm no literals are unsafe (checkInt run-or-state (first (node/expr/op-children expr)) quantvars checker-hash) (check-and-output expr - node/expr/op/sing + node/expr/op-on-ints/sing checker-hash (expression-type (list (list 'Int)) 'one (get-temporal-variance run-or-state expr quantvars args checker-hash) (list 'Int)) diff --git a/forge/library/README.md b/forge/library/README.md new file mode 100644 index 000000000..d06937b5b --- /dev/null +++ b/forge/library/README.md @@ -0,0 +1,3 @@ +Modules in this directory can be imported into Forge files via `open` without quotes. E.g., to import `./util/temporal.frg`, use `open util/temporal`. Standard libraries include: +* `util/sequences`: helpers for representing sequences of a sig `A` as relations on `Int -> A`; and +* `util/temporal`: helpers for easing temporal specification (e.g., repeating "next state" operators). diff --git a/forge/library/util/sequences.rkt b/forge/library/util/sequences.rkt new file mode 100644 index 000000000..abbb2138b --- /dev/null +++ b/forge/library/util/sequences.rkt @@ -0,0 +1,101 @@ +#lang racket/base + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;; Seq Library ;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(require (for-syntax racket/base racket/syntax syntax/srcloc syntax/parse) + (only-in forge/lang/ast raise-forge-error pretty-name-predicate + &&/info in/info ->/info univ join/info all/info + sum/info int lone/info some/info =>/info sing/info + subtract/info card/info -/info no/func nodeinfo) + (only-in forge/sigs-structs Int int>= != succ min max) + forge/lang/deparse + syntax/parse) + +; reference: +; https://github.com/AlloyTools/org.alloytools.alloy/blob/master/org.alloytools.alloy.core/src/main/resources/models/util/seqrel.als + +(provide isSeqOf seqFirst seqLast indsOf idxOf lastIdxOf elems inds isEmpty hasDups seqRest) + +(define-syntax (define-builtin stx) + (syntax-parse stx + [(define-builtin:id (opName:id locArg:id args:id ...) body:expr) + (with-syntax ([opName/func (format-id #'opName "~a/func" #'opName)] + [ellip '...]) + (syntax/loc stx (begin + (define-syntax (opName stxx) + (syntax-parse stxx + ; For use in forge/core; full s-expression expands to 0-ary procedure + ; Note use of "ellip" to denote "..." for the inner macro. + [(opName inner-args:id ellip) + (quasisyntax/loc stxx + (opName/func (nodeinfo #,(build-source-location stxx) 'checklangNoCheck #f) inner-args ellip))] + ; For use with #lang forge; identifier by itself expands to 3+-ary procedure + [opName + (quasisyntax/loc stxx + (lambda (args ...) + (opName/func (nodeinfo #,(build-source-location stxx) 'checklangNoCheck #f) args ...)))])) + + (define (opName/func locArg args ...) + body) + ))) + ])) + +(define-builtin (isSeqOf info r1 d) + (&&/info info + (in/info info r1 (->/info info Int univ)) + (in/info info (join/info info Int r1) d) + (all/info info ([i1 (join/info info r1 univ)]) + (&&/info info (int>= (sum/info info i1) (int 0)) + (lone/info info (join/info info i1 r1)))) + (all/info info ([e (join/info info Int r1)]) + (some/info info (join/info info r1 e))) + (all/info info ([i1 (join/info info r1 univ)]) + (=>/info info (!= i1 (sing/info info (int 0))) + (some/info info (join/info info + (sing/info info + (subtract/info info + (sum/info info i1) (int 1))) r1)))))) + +(define-builtin (seqFirst info r) + (join/info info + (sing/info info (int 0)) + r)) + +(define-builtin (seqLast info r) + (join/info info + (sing/info info + (subtract/info info + (card/info info r) (int 1))) + r)) + +; precondition: r isSeqOf something +(define-builtin (seqRest info r) + (-/info info + (join/info info succ r) + (->/info info (int -1) univ))) + +(define-builtin (indsOf info r e) + (join/info info r e)) + +(define-builtin (idxOf info r e) + (min (join/info info r e))) + +(define-builtin (lastIdxOf info r e) + (max (join/info info r e))) + +(define-builtin (elems info r) + (join/info info Int r)) + +(define-builtin (inds info r) + (join/info info r univ)) + +(define-builtin (isEmpty info r) + (no/func r #:info info)) + +(define-builtin (hasDups info r) + (some/info info ([e (elems/func info r)]) + (some/info info ([num1 (indsOf/func info r e)] [num2 (indsOf/func info r e)]) + (!= num1 num2)))) + diff --git a/forge/library/util/temporal.rkt b/forge/library/util/temporal.rkt new file mode 100644 index 000000000..7ab273197 --- /dev/null +++ b/forge/library/util/temporal.rkt @@ -0,0 +1,51 @@ +#lang racket/base + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Helpers for Temporal Forge +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(require (for-syntax racket/base racket/syntax syntax/srcloc) + (only-in forge/lang/ast next_state prime raise-forge-error pretty-name-predicate + node/int/constant? node/formula? node/expr? node/int/constant-value) + forge/lang/deparse) + +(provide repeat_next_state repeat_prime) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Convenience operators to apply instances of `next_state` or `prime`. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define-syntax (repeat_next_state stx) + (syntax-case stx () + [_ (quasisyntax/loc stx (build-repeater #,(build-source-location stx) + (lambda (x) (next_state x)) + 'repeat_next_state + node/formula?))])) + +(define-syntax (repeat_prime stx) + (syntax-case stx () + [_ (quasisyntax/loc stx (build-repeater #,(build-source-location stx) + (lambda (x) (prime x)) + 'repeat_prime + node/expr?))])) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Internal helpers +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (build-repeater loc construct name expected-type?) + (letrec ([builder + (lambda (n e) + (cond [(node/int/constant? n) (builder (node/int/constant-value n) e)] + [(not (integer? n)) (raise-forge-error + #:msg (format "The first argument to ~a (~a) was not an integer." name n) + #:context loc)] + [(not (expected-type? e)) (raise-forge-error + #:msg (format "The second argument to ~a (~a) was not a ~a." name (deparse e) (pretty-name-predicate expected-type?)) + #:context loc)] + [(<= n 0) e] + [(= n 1) (construct e)] + [else (builder (- n 1) (construct e))]))]) + builder)) + diff --git a/forge/pardinus-cli/server/kks.rkt b/forge/pardinus-cli/server/kks.rkt index 1c1ebfe50..c77c02016 100755 --- a/forge/pardinus-cli/server/kks.rkt +++ b/forge/pardinus-cli/server/kks.rkt @@ -11,7 +11,8 @@ (only-in racket thunk ~a)) (provide configure declare-ints print-cmd print-cmd-cont print-eoi cmd declare-univ - declare-rel declare-target read-solution solve v r x tupleset (rename-out [-> product])) + declare-rel declare-target read-solution solve v r x tupleset (rename-out [-> product]) + pardinus-port) (provide assert e f i a define-const) (provide read-evaluation read-ack) (provide clear) diff --git a/forge/run-tests.sh b/forge/run-tests.sh index 05e00bafe..31a0b1033 100755 --- a/forge/run-tests.sh +++ b/forge/run-tests.sh @@ -18,8 +18,8 @@ testDir=$1 # In "basic" regular expressions, use the backslashed versions of "(", ")", and "|" # Also, apply the pattern deeper than just one directory level (handle error/loc/*.frg) #doNotTestPattern="\(error\|srclocs\)/[^/]*\\.frg" -doNotTestPattern="\(error\|srclocs\)/.*\\.frg" -# ^ these tests get checked by tests/error/main.rkt +doNotTestPattern="\(error\|srclocs\|helpers\)/.*\\.frg" +# ^ error/srclocs: checked by tests/error/main.rkt; helpers: imported by other tests, not run directly smtTestPattern=".*/smtlibtor/.*" diff --git a/forge/send-to-solver.rkt b/forge/send-to-solver.rkt index 0c468a779..6b1052deb 100644 --- a/forge/send-to-solver.rkt +++ b/forge/send-to-solver.rkt @@ -1,29 +1,59 @@ -#lang racket/base +#lang typed/racket/base/optional +(require forge/types/ast-adapter) +(require forge/types/lazy-tree-adapter) + +;; TODO TYPES: +; Notice that we need to instantiate polymorphic functions often. E.g., +; (inst map FAtom Tuple) <-- to mean we're mapping tuples to atoms + +(define-type PiecewiseBounds (HashTable node/expr/relation PiecewiseBound)) + +(require/typed forge/last-checker + [checkFormula (-> Run-spec node/formula (Listof Any) (HashTable Any Any) Void)]) + +;; Since sigs-structs.rkt is now typed, we can import directly (require forge/sigs-structs) + (require forge/breaks) -(require forge/lang/ast) (require forge/lang/bounds) (require forge/shared - (prefix-in tree: forge/utils/lazy-tree) - forge/last-checker - forge/choose-lang-specific) -(require (prefix-in @ (only-in racket/base >= not - = and or max > < +)) + forge/last-checker) +(require (prefix-in @ (only-in racket/base max + -)) (only-in racket match first rest empty empty? set->list list->set set-intersect set-union curry range index-of pretty-print filter-map string-prefix? string-split thunk* - remove-duplicates subset? cartesian-product match-define cons? set-subtract) + remove-duplicates subset? cartesian-product match-define cons? set-subtract + build-list) racket/hash) (require (only-in syntax/srcloc build-source-location-syntax)) -; Solver-specific backend initializer functions -(require (prefix-in pardinus: (only-in forge/pardinus-cli/server/kks start-server))) -(require (prefix-in smtlib: (only-in forge/solver-specific/cvc5-server start-server))) +; Solver-specific backend initializer functions. + +(require/typed forge/solver-specific/cvc5-server + [(start-server smtlib:start-server) (-> Symbol Symbol + (Values Output-Port Input-Port Input-Port (-> Void) (-> Boolean)))]) +(require/typed forge/pardinus-cli/server/kks + [(start-server pardinus:start-server ) (-> Symbol Symbol (U False Path-String) + (Values Output-Port Input-Port Input-Port (-> Void) (-> Boolean)))]) +; (send-to-kodkod run-name run-spec bitwidth all-atoms solverspec total-bounds bound-lower +; bound-upper run-constraints stdin stdout stderr)) ; Separate solver-specific translation for each solver backend -(require (only-in forge/solver-specific/pardinus - send-to-kodkod get-next-kodkod-model)) -(require (only-in forge/solver-specific/cvc5-tor - send-to-cvc5-tor get-next-cvc5-tor-model)) +(require/typed forge/solver-specific/pardinus + [send-to-kodkod (-> Symbol Run-spec Integer (Listof FAtom) Any Any Any Any + (Listof node/formula) Output-Port Input-Port Input-Port + (Values Any Any))] + [get-next-kodkod-model (->* ((-> Boolean) Symbol Any (Listof FAtom) Any + Output-Port Input-Port Input-Port) + (String) (U Sat Unsat Unknown))]) + +(require/typed forge/solver-specific/cvc5-tor + [send-to-cvc5-tor (-> Symbol Run-spec Integer (Listof FAtom) Any Any Any Any + (Listof node/formula) Output-Port Input-Port Input-Port + (Values Any Any))] + [get-next-cvc5-tor-model (->* ((-> Boolean) Symbol Any (Listof FAtom) Any + Output-Port Input-Port Input-Port) + (String #:run-command (U False Syntax)) (U Sat Unsat Unknown))]) ; Disable DrRacket GUI extension/tool ;(require "drracket-gui.rkt") @@ -36,8 +66,10 @@ ;;;;;; Run Logic ;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Will be a Server-ports tuple if a server is active. +; Will be a Server-ports tuple if a server is active. +(: server-state (Boxof (U False Server-ports))) (define server-state (box #f)) + ; In order to prevent a bad crash, keep track of run-names used in the past, ; and throw a friendlier error if one is re-used. (define run-name-history (box (list))) @@ -46,31 +78,14 @@ ; This function is provided for scripting tests, but it is volatile; don't rely on it. (define (stop-solver-process!) - (when (unbox server-state) - ((Server-ports-shutdown (unbox server-state))) + (define unboxed (unbox server-state)) + (when unboxed + ((Server-ports-shutdown unboxed)) (set-box! server-state #f))) -; send-to-solver :: Run-spec -> Stream, List -; Given a Run-spec structure, processes the data and communicates it to KodKod-CLI; -; then produces a stream to produce instances generated by KodKod, -; along with a list of all of the atom names for sig atoms. -(define (send-to-solver run-spec run-command #:run-name [run-name (gensym)]) - (do-time "send-to-solver") - - ; In case of error, highlight an AST node if able. Otherwise, focus on the offending run command. - (define (raise-run-error message [node #f]) - (if node - (raise-forge-error #:msg message - #:context (nodeinfo-loc (node-info node))) - (raise-forge-error #:msg message - #:context run-command))) - - (when (member run-name (unbox run-name-history)) - (raise-run-error (format "Run name ~a was re-used; please use a different run name.~n" run-name))) - (set-box! run-name-history (cons run-name (unbox run-name-history))) - - ; Print version number, so students know to update - (when (and no-version-printed-yet (@>= (get-verbosity) VERBOSITY_LOW)) +; Print version number, so students know to update +(define (print-version-number) + (when (and no-version-printed-yet (>= (get-verbosity) VERBOSITY_LOW)) (set! no-version-printed-yet #f) (printf "Forge version: ~a~n" forge-version) (let* ([git-info (forge-git-info)] @@ -93,66 +108,99 @@ forge-version curr-forge-version))])))) (printf "To report issues with Forge, please visit ~a~n" - "https://report.forge-fm.org")) + "https://report.forge-fm.org"))) + + +; In case of error, highlight an AST node if able. Otherwise, focus on the offending run command. +; Never returns; we don't use the #:raise? #f option of raise-forge-error. +(: raise-run-error (->* (String Syntax) ( (U False node) ) Nothing)) +(define (raise-run-error message run-command [node #f]) + (if node + (raise-forge-error #:msg message + #:context (nodeinfo-loc (node-info node))) + (raise-forge-error #:msg message + #:context run-command))) + +; Given a Run-spec structure, processes the data and communicates it to KodKod-CLI; +; then produces a stream to produce instances generated by KodKod, +; along with a list of all of the atom names for sig atoms. +; (values results +; all-atoms +; (unbox server-state) +; (Kodkod-current (length run-constraints) 0 0) +; ; This becomes the "kodkod-bounds" field of the Run that is eventually created. + ; total-bounds) +(: send-to-solver (->* (Run-spec Syntax) (#:run-name Symbol) + (Values tree:node (Listof FAtom) Server-ports Kodkod-current (Listof bound)))) +(define (send-to-solver run-spec run-command #:run-name [run-name (gensym)]) + (do-time "send-to-solver") - ; Do relation breaks from declarations - (define relation-constraints - (apply append - (for/list ([relation (get-relations run-spec)]) - (match (Relation-breaker relation) - [#f (list)] - ['default (list)] - ['pfunc (let* ([rel relation] - [sigs (map (lambda (sig-thunk) (sig-thunk)) - (Relation-sigs-thunks relation))] - [left-sig (get-sig run-spec (first sigs))] - [sig-rel left-sig]) - (list (all ([s sig-rel]) - (lone (join s rel)))))] - [other (break relation other) - (list)])))) + (when (member run-name (unbox run-name-history)) + (raise-run-error (format "Run name ~a was re-used; please use a different run name.~n" run-name) run-command)) + (set-box! run-name-history (cons run-name (unbox run-name-history))) - (define-values (sig-to-bound relation-to-bound all-atoms) - (get-bounds run-spec raise-run-error)) + (print-version-number) - (map instance (hash-values (Bound-pbindings (Run-spec-bounds run-spec)))) + ; Set up breakers on each relation. These may arise from declaration multiplicities like "lone" + ; or from partial-instance annotations like "is linear". + ; TODO TYPES: really? what about relations declared pfunc / is linear together? + ; ** THIS MUST BE DONE BEFORE COMPUTING BOUNDS! ** + (for ([relation (get-relations run-spec)]) + ;(printf "applying constraints for ~a; ~a ~n" relation (Relation-breaker relation)) + ; Built-ins like int successor ("succ") can have #f as their break. + (define the-breaker (Relation-breaker relation)) + (when the-breaker + (break-rel relation the-breaker))) + + ; Produce bounds from scopes + (define-values (sig-to-bound relation-to-bound all-atoms) + (get-bounds run-spec run-command)) ; Get new bounds and constraints from breaks - (define-values (total-bounds break-preds) - (let* ([sig-bounds (map (compose (curry hash-ref sig-to-bound ) - Sig-name) - (get-sigs run-spec))] - [relation-bounds (map (compose (curry hash-ref relation-to-bound ) - Relation-name) - (get-relations run-spec))] + (: total-bounds (Listof bound)) + (define-values (total-bounds break-preds) + (let* ([sigs (get-sigs run-spec)] + [sig-names : (Listof Symbol) (map Sig-name sigs)] + [sig-bounds : (Listof bound) + (map (lambda ([sn : Symbol]) (hash-ref sig-to-bound sn)) + sig-names)] + [relation-bounds : (Listof bound) + (map (lambda ([rel : Relation]) (hash-ref relation-to-bound (Relation-name rel))) + (get-relations run-spec))] [total-bounds (append sig-bounds relation-bounds)] - - [sigs (get-sigs run-spec)] - [sig-rels (filter (lambda (sig) (@not (equal? (Sig-name sig) 'Int))) sigs)] - [upper-bounds (for/hash ([sig sigs]) + [sig-rels (filter (lambda ([sig : Sig]) (not (equal? (Sig-name sig) 'Int))) sigs)] + [upper-bounds (for/hash : (Immutable-HashTable Sig (Listof FAtom)) ([sig sigs]) (values sig - (map car (bound-upper (hash-ref sig-to-bound (Sig-name sig))))))] - [relations-store (for/hash ([relation (get-relations run-spec)] + ((inst map FAtom Tuple) car (bound-upper (hash-ref sig-to-bound (Sig-name sig))))))] + + [relations-store (for/hash : (Immutable-HashTable Relation (Listof Sig)) ([relation (get-relations run-spec)] #:unless (equal? (Relation-name relation) 'succ)) (values relation (get-sigs run-spec relation)))] - [extensions-store (for/hash ([sig sigs] + + [extensions-store (for/hash : (Immutable-HashTable Sig Sig) ([sig sigs] #:when (Sig-extends sig)) - (values sig (get-sig run-spec (Sig-extends sig))))]) + (define extend (Sig-extends sig)) + (define extend-sig (if extend (get-sig run-spec extend) #f)) + (if extend-sig + (values sig extend-sig) + (raise (format "Internal error building extensions-store. Sig was: ~a" sig))))]) ;(printf "args-- total-bounds : ~a~n args-- sig-rels : ~a~n args-- upper-bounds : ~a~n" total-bounds sig-rels upper-bounds ) (constrain-bounds total-bounds sig-rels upper-bounds relations-store extensions-store))) + ;(printf "after-- total-bounds : ~a~n" total-bounds) + ; Because the breaker module is stateful, we need to clear out that state for the next run. (clear-breaker-state) (define sigs-and-rels (append (State-sig-order (Run-spec-state run-spec)) (State-relation-order (Run-spec-state run-spec)))) - (set! total-bounds (map (lambda (name) - (findf (lambda (b) + (set! total-bounds (filter-map (lambda (name) + (findf (lambda ([b : bound]) (equal? name (string->symbol (relation-name (bound-relation b))))) total-bounds)) sigs-and-rels)) - (when (@>= (get-verbosity) VERBOSITY_DEBUG) + (when (>= (get-verbosity) VERBOSITY_DEBUG) (displayln "--------------------------") (printf "Original PBindings: ~n~a~n~n" (Bound-pbindings (Run-spec-bounds run-spec))) (printf "sig-to-bound: ~n~a~n~n" sig-to-bound) @@ -169,13 +217,14 @@ ; Initializing our backend process, and getting ports for communication with it. ; This was originally just Kodkod; some of that terminology remains. (define backend (get-option run-spec 'backend)) + (define unboxed (unbox server-state)) (define-values (stdin stdout stderr shutdown is-running?) (cond ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; if there is an active server state, and the server is running - [(and (unbox server-state) ((Server-ports-is-running? (unbox server-state)))) - (define sstate (unbox server-state)) - (when (@> (get-verbosity) VERBOSITY_LOW) + [(and unboxed ((Server-ports-is-running? unboxed))) + (define sstate unboxed) + (when (> (get-verbosity) VERBOSITY_LOW) (printf "~a solver process already running. Preparing to start new run with id ~a.~n" backend run-name)) (values (Server-ports-stdin sstate) (Server-ports-stdout sstate) (Server-ports-stderr sstate) (Server-ports-shutdown sstate) @@ -183,35 +232,51 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Backend=Kodkod; server isn't active/running [(equal? backend 'kodkod) - (raise "Pure Kodkod backend is no longer supported; please use `pardinus` backend instead.")] + (raise-forge-error #:msg "Pure Kodkod backend is no longer supported; please use `pardinus` backend instead." #:context run-command)] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Backend=smtlibtor; server isn't active/running [(equal? backend 'smtlibtor) (printf "Will use SMT-LIB-v2 output. This is experimental functionality. Please ensure that cvc5 is on your path.~n") - (smtlib:start-server 'stepper (get-option run-spec 'problem_type))] + (define problem-type-smt (get-option run-spec 'problem_type)) + (unless (symbol? problem-type-smt) + (raise-forge-error #:msg "problem_type option must be a symbol" #:context run-command)) + (smtlib:start-server 'stepper problem-type-smt)] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Backend=Pardinus; server isn't active/running [(equal? backend 'pardinus) - (when (@>= (get-verbosity) VERBOSITY_HIGH) + (when (>= (get-verbosity) VERBOSITY_HIGH) (printf "Starting/restarting Pardinus server (prior state=~a)...~n" (unbox server-state))) + (define problem-type-pard (get-option run-spec 'problem_type)) + (unless (symbol? problem-type-pard) + (raise-forge-error #:msg "problem_type option must be a symbol" #:context run-command)) + (define java-loc (get-option run-spec 'java_exe_location)) + (define java-exe : (U False Path-String) + (cond [(not java-loc) #f] + [(path-string? java-loc) java-loc] + [else (raise-forge-error #:msg "java_exe_location must be #f or a path" #:context run-command)])) (pardinus:start-server 'stepper ; always a stepper problem (there is a "next" button) ; 'default, 'temporal, or 'target (tells Pardinus which solver to load, ; and affects parsing so needs to be known at invocation time) - (get-option run-spec 'problem_type) + problem-type-pard ; control version of java used (by path string) - (get-option run-spec 'java_exe_location))] + java-exe)] - [else (raise (format "Invalid backend: ~a" backend))])) + [else (raise-forge-error #:msg (format "Invalid backend: ~a" backend) #:context run-command)])) ; Confirm that if the user is invoking a custom solver, that custom solver exists - (define solverspec (cond [(symbol? (get-option run-spec 'solver)) - (get-option run-spec 'solver)] - [else (string-append "\"" (get-option run-spec 'solver) "\"")])) - (unless (or (symbol? (get-option run-spec 'solver)) - (file-exists? (get-option run-spec 'solver))) - (raise-user-error (format "option solver specified custom solver (via string): ~a, but file did not exist." - (get-option run-spec 'solver)))) + (define solver-opt (get-option run-spec 'solver)) + (define solver-option : (U Symbol String) + (cond [(symbol? solver-opt) solver-opt] + [(string? solver-opt) solver-opt] + [else (raise-forge-error #:msg "solver option must be a symbol or string" #:context run-command)])) + (define solverspec (cond [(symbol? solver-option) + solver-option] + [else (string-append "\"" solver-option "\"")])) + (unless (symbol? solver-option) + (unless (file-exists? solver-option) + (raise-user-error (format "option solver specified custom solver (via string): ~a, but file did not exist." + solver-option)))) ; Print configure and declare univ size ; Note that target mode is passed separately, nearer to the (solve) invocation @@ -222,18 +287,18 @@ ;; Generate top-level constraint for this run, execute last-checker ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + (: maybe-alwaysify (-> node/formula node/formula)) (define (maybe-alwaysify fmla) (if (equal? 'temporal (get-option run-spec 'problem_type)) - (always/info (node-info fmla) fmla) + (always/func #:info (node-info fmla) fmla) fmla)) ; If in temporal mode, need to always-ify the auto-generated constraints but not the ; predicates that come from users (define raw-implicit-constraints - (append (get-sig-size-preds run-spec sig-to-bound #:error raise-run-error) + (append (get-sig-size-preds run-spec run-command sig-to-bound) (get-relation-preds run-spec) (get-extender-preds run-spec) - relation-constraints break-preds)) (define conjuncts-implicit-constraints (apply append (map maybe-and->list raw-implicit-constraints))) @@ -245,7 +310,7 @@ (append explicit-constraints implicit-constraints)) ; Run last-minute checks for errors - (for-each (lambda (c) + (for-each (lambda ([c : node/formula]) (checkFormula run-spec c '() (get-checker-hash))) run-constraints) @@ -258,50 +323,61 @@ (begin (define-values (all-rels core-map) (send-to-cvc5-tor run-name run-spec bitwidth all-atoms solverspec total-bounds bound-lower bound-upper run-constraints stdin stdout stderr)) - (lambda (mode) (get-next-cvc5-tor-model is-running? run-name all-rels all-atoms core-map stdin stdout stderr mode + (lambda ([mode : String]) (get-next-cvc5-tor-model is-running? run-name all-rels all-atoms core-map stdin stdout stderr mode #:run-command run-command)))] [(equal? backend 'pardinus) (begin (define-values (all-rels core-map) (send-to-kodkod run-name run-spec bitwidth all-atoms solverspec total-bounds bound-lower bound-upper run-constraints stdin stdout stderr)) - (lambda (mode) (get-next-kodkod-model is-running? run-name all-rels all-atoms core-map stdin stdout stderr mode)))] - [else (raise (format "Invalid backend: ~a" backend))])) + (lambda ([mode : String]) (get-next-kodkod-model is-running? run-name all-rels all-atoms core-map stdin stdout stderr mode)))] + [else (raise-forge-error #:msg (format "Invalid backend: ~a" backend) #:context run-command)])) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; DO NOT ADD MORE MESSAGES TO SOLVER AFTER THIS POINT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - + + (: next-button (-> String tree:node)) (define (next-button type) - (tree:make-node (get-next-model type) next-button)) + (tree:make-node/func get-next-model type next-button)) + (: results tree:node) (define results - (tree:make-node (get-next-model 'start) next-button)) + (tree:make-node/func get-next-model "start" next-button)) - (set-box! server-state (Server-ports stdin stdout stderr shutdown is-running?)) + (define new-server-state (Server-ports stdin stdout stderr shutdown is-running?)) + (set-box! server-state new-server-state) (values results all-atoms - (unbox server-state) + new-server-state (Kodkod-current (length run-constraints) 0 0) ; This becomes the "kodkod-bounds" field of the Run that is eventually created. total-bounds)) +(: int-range (-> Integer Integer (Listof Integer))) +(define (int-range start excluded-end) + (if (< excluded-end start) + empty + (build-list (@- excluded-end start) (lambda ([idx : Integer]) (@+ idx start))))) -(define (get-bounds run-spec raise-run-error) +(: get-bounds (-> Run-spec Syntax + (Values (HashTable Symbol bound) (HashTable Symbol bound) (Listof FAtom)))) +(define (get-bounds run-spec run-command) ; Send user defined partial bindings to breaks (map instance (hash-values (Bound-pbindings (Run-spec-bounds run-spec)))) ; Get KodKod names, min sets, and max sets of Sigs and Relations (define-values (sig-to-bound all-atoms) ; Map, List - (get-sig-bounds run-spec raise-run-error)) + (get-sig-bounds run-spec run-command)) (define relation-to-bound ; Map - (get-relation-bounds run-spec sig-to-bound raise-run-error)) + (get-relation-bounds run-spec run-command sig-to-bound)) (values sig-to-bound relation-to-bound all-atoms)) ; Produce a single AST node to blame for a given relation's bound, or #f if none available +(: get-blame-node (-> Run-spec node (U node False))) (define (get-blame-node run-spec the-rel) (cond [(or (not (node/expr/relation? the-rel)) (not (Run-spec? run-spec))) @@ -313,53 +389,86 @@ ; get-sig-bounds :: Run-spec -> Map, List ; Given a Run-spec, assigns names to each sig, assigns minimum and maximum ; sets of atoms for each, and find the total number of atoms needed (including ints). -(define (get-sig-bounds run-spec raise-run-error) +(: get-sig-bounds (-> Run-spec Syntax (Values (HashTable Symbol bound) (Listof FAtom)))) +(define (get-sig-bounds run-spec run-command) ;;;;; Helpers for extracting declared relational bounds from the run-spec (define pbindings (Bound-pbindings (Run-spec-bounds run-spec))) - (define (get-bound-lower sig) + + (: get-bound-lower (-> Sig (U (Listof FAtom) False))) + (define (get-bound-lower [sig : Sig]) + (: pbinding (U False sbound)) (define pbinding (hash-ref pbindings sig #f)) - (@and pbinding ;; !!! - (map car (set->list (sbound-lower pbinding))))) - (define (get-bound-upper sig) + (and pbinding ;; !!! + ((inst map FAtom Tuple) car (set->list (sbound-lower pbinding))))) + + (: get-bound-upper (-> Sig (U (Listof FAtom) False))) + (define (get-bound-upper [sig : Sig]) + (: pbinding (U False sbound)) (define pbinding (hash-ref pbindings sig #f)) - (@and pbinding + (and pbinding (sbound-upper pbinding) - (map car (set->list (sbound-upper pbinding))))) + ((inst map FAtom Tuple) car (set->list (sbound-upper pbinding))))) ;;;;; Helpers for extracting declared numeric scopes from the run-spec (define scopes (Run-spec-scope run-spec)) + + (: get-scope-lower (-> Sig (U False Integer))) (define (get-scope-lower sig) (define scope (hash-ref (Scope-sig-scopes scopes) (Sig-name sig) #f)) - (@and scope (Range-lower scope))) + (and scope (Range-lower scope))) + + (: get-scope-upper (-> Sig (U False Integer))) (define (get-scope-upper sig) (define scope (hash-ref (Scope-sig-scopes scopes) (Sig-name sig) #f)) - (@and scope (Range-upper scope))) + (and scope (Range-upper scope))) + + (: get-scope-lower-default (-> Sig Integer)) (define (get-scope-lower-default sig) - (let ([actual (get-scope-lower sig)]) - (or actual - (Range-lower (or (Scope-default-scope scopes) - DEFAULT-SIG-SCOPE))))) + (let* ([actual (get-scope-lower sig)] + [local-default (Scope-default-scope scopes)] + [maybe-default-global-lower (Range-lower DEFAULT-SIG-SCOPE)] + [maybe-local-default-int (if local-default (Range-lower local-default) #f)]) + (cond [actual actual] + [maybe-local-default-int maybe-local-default-int] + [maybe-default-global-lower maybe-default-global-lower] + [else (raise-run-error (format "Internal error (~a): no lower bound in DEFAULT-SIG-SCOPE" sig) + run-command + (get-blame-node run-spec sig))]))) + + (: get-scope-upper-default (-> Sig Integer)) (define (get-scope-upper-default sig) - (let ([actual (get-scope-upper sig)]) - (or actual - (Range-upper (or (Scope-default-scope scopes) - DEFAULT-SIG-SCOPE))))) + (let* ([actual (get-scope-upper sig)] + [local-default (Scope-default-scope scopes)] + [maybe-default-global-upper (Range-upper DEFAULT-SIG-SCOPE)] + [maybe-local-default-int (if local-default (Range-upper local-default) #f)]) + (cond [actual actual] + [maybe-local-default-int maybe-local-default-int] + [maybe-default-global-upper maybe-default-global-upper] + [else (raise-run-error (format "Internal error (~a): no upper bound in DEFAULT-SIG-SCOPE" sig) + run-command + (get-blame-node run-spec sig))]))) ; Map; keeps track of what the "next" generated atom ID should be + (: curr-atom-number (HashTable Symbol Integer)) (define curr-atom-number (make-hash)) - ; Sig -> Listof; the atom names declared by the user in a partial instance + ; The atom names declared by the user in a partial instance + (: all-user-atoms (Listof FAtom)) (define all-user-atoms - (apply append (for/list ([sig (get-sigs run-spec)] + (apply append (for/list : (Listof (Listof FAtom)) ([sig (get-sigs run-spec)] #:when (hash-has-key? pbindings sig)) - (define bound (hash-ref pbindings sig)) - (map car (set->list (@or (sbound-upper bound) (sbound-lower bound))))))) + (: the-bound sbound) + (define the-bound (hash-ref pbindings sig)) + (: the-set (Setof Tuple)) + (define the-set (or (sbound-upper the-bound) (sbound-lower the-bound))) + ((inst map FAtom Tuple) car (set->list the-set))))) ; Generate the "next" atom ID for a given sig, based on what's been generated/declared so far + (: get-next-name (-> Sig Symbol)) (define (get-next-name sig) - (define atom-number (add1 (hash-ref curr-atom-number (Sig-name sig) -1))) + (define atom-number (add1 (hash-ref curr-atom-number (Sig-name sig) (lambda () -1)))) (let loop ([atom-number atom-number]) (hash-set! curr-atom-number (Sig-name sig) atom-number) (define new-name (string->symbol (format "~a~a" (Sig-name sig) atom-number))) @@ -368,16 +477,20 @@ new-name))) ; Generate new names for sig + (: generate-names (-> Sig Integer (Listof Symbol))) (define (generate-names sig num) - (map (thunk* (get-next-name sig)) (range num))) + (map (lambda (_) (get-next-name sig)) (range num))) ; Overall bounds data structures, will be modified as this procedure executes + (: lower-bounds (HashTable Sig (Listof FAtom))) (define lower-bounds (make-hash)) + (: upper-bounds (HashTable Sig (Listof FAtom))) (define upper-bounds (make-hash)) ; Helper to populate a sig's lower bound based on relational bound given ; If any #:one children lack tuple-based lower bounds, there is a risk of inconsistency ; since those children must receive a fresh atom name to denote (and for #:one sigs, LB=UB) + (: fill-lower-by-bound (-> Sig (Listof FAtom))) (define (fill-lower-by-bound sig) (define children-lowers (apply append (map fill-lower-by-bound (get-children run-spec sig)))) @@ -387,15 +500,18 @@ (when (and (not curr-lower) (Sig-one sig)) ;; TODO: issue here is we would rather report the ancestor too, and ideally the stxloc for the bind (raise-run-error (format "Example or inst named members for an ancestor of 'one' sig ~a but no member name was given for ~a. This can result in inconsistency; please give bounds for ~a." (Sig-name sig) (Sig-name sig) (Sig-name sig)) + run-command (get-blame-node run-spec sig))) + (define true-lower (remove-duplicates (append children-lowers - (@or curr-lower (list))))) + (or curr-lower (list))))) (hash-set! lower-bounds sig true-lower) true-lower) ; Helper to populate a lower bound based on a numeric scope given + (: fill-lower-by-scope (-> Sig (Listof FAtom))) (define (fill-lower-by-scope sig) (define children-lowers (apply append (map fill-lower-by-scope (get-children run-spec sig)))) @@ -410,32 +526,38 @@ (hash-set! lower-bounds sig true-lower) true-lower) + (: fill-upper-with-bound (->* (Sig) ((U (Listof FAtom) False)) Void)) (define (fill-upper-with-bound sig [parent-upper #f]) (define curr-upper (get-bound-upper sig)) (if curr-upper (let () (hash-set! upper-bounds sig curr-upper) - (map (lambda (child) (fill-upper-with-bound child curr-upper)) - (get-children run-spec sig))) + (for ([child : Sig (get-children run-spec sig)]) + (fill-upper-with-bound child curr-upper))) (fill-upper-past-bound sig parent-upper))) - + + (: fill-upper-past-bound (-> Sig (U (Listof FAtom) False) Void)) (define (fill-upper-past-bound sig parent-upper) (when (get-bound-upper sig) (raise-run-error (format "Please specify an upper bound for ancestors of ~a." (Sig-name sig)) - (get-blame-node run-spec sig))) - (hash-set! upper-bounds sig parent-upper) - (map (lambda (child) (fill-upper-past-bound child parent-upper)) - (get-children run-spec sig))) + run-command (get-blame-node run-spec sig))) + (if parent-upper + (hash-set! upper-bounds sig parent-upper) + (raise (format "internal error: parent-upper for ~a was absent" sig))) + (for ([child : Sig (get-children run-spec sig)]) + (fill-upper-past-bound child parent-upper))) ; For use in situations where there is no existing upper (relational) bound + (: fill-upper-no-bound (-> Sig (Listof FAtom) Void)) (define (fill-upper-no-bound sig shared) ; If the sig has a relational upper bound, don't try to resolve the possible ; atom names etc.; ask the user to give an explicit bound on the parent, too. (when (get-bound-upper sig) (raise-run-error (format "Please specify an upper bound for ancestors of ~a." (Sig-name sig)) - (get-blame-node run-spec sig))) - (define curr-lower (hash-ref lower-bounds sig)) + run-command (get-blame-node run-spec sig))) + + (define curr-lower (ann (hash-ref lower-bounds sig) (Listof FAtom))) ; Before doing anything else, confirm that if *no* scope was given for this sig, ; that the declared scopes for its children, combined, are not bigger than the default. @@ -447,7 +569,7 @@ (@max (length curr-lower) (get-scope-upper-default sig))) (define child-upper-declared-total - (foldl (lambda (curr acc) + (foldl (lambda ([curr : Sig] [acc : Integer]) (@+ acc (or (get-scope-upper curr) 0))) 0 (get-children run-spec sig))) @@ -457,19 +579,22 @@ However, the total of declared and inferred child-sig scopes was ~a. \ Please declare a sufficient scope for ~a." (Sig-name sig) upper-budget child-upper-declared-total (Sig-name sig)) + run-command (get-blame-node run-spec sig)))) ; If the upper-bound's scope is bigger than the lower bound's current contents ; (which should include child sigs' lower bounds), make room using atoms from parent. ; Otherwise, upper = lower, since there is no excess capacity. - (if (@> (get-scope-upper-default sig) (length curr-lower)) + (if (> (get-scope-upper-default sig) (length curr-lower)) (hash-set! upper-bounds sig (append curr-lower shared)) (hash-set! upper-bounds sig curr-lower)) ; Recur on children - (map (lambda (child) (fill-upper-no-bound child (append curr-lower shared))) + (for-each (lambda ([child : Sig]) + (fill-upper-no-bound child (append curr-lower shared))) (get-children run-spec sig))) ; List of all atoms that come from sigs, except Int. Will change as this procedure runs. + (: sig-atoms (Listof FAtom)) (define sig-atoms (list)) ; Start with each top-level sig @@ -493,6 +618,7 @@ Please declare a sufficient scope for ~a." ; root (get-scope-upper root) (get-scope-upper-default root)) ; Generate new names + (: shared (Listof Symbol)) (define shared (generate-names root (@- upper-size lower-size))) ; This function is also responsible for validating totals (we didn't go over budget) (fill-upper-no-bound root shared))) @@ -500,12 +626,17 @@ Please declare a sufficient scope for ~a." (set! sig-atoms (append sig-atoms (hash-ref upper-bounds root)))) ; Set the bounds for the Int built-in sig + (: int-atoms (Listof FAtom)) (define int-atoms (let* ([bitwidth (get-bitwidth run-spec)] - [max-int (expt 2 (sub1 bitwidth))]) - (range (@- max-int) max-int))) - (hash-set! lower-bounds (get-sig run-spec Int) int-atoms) - (hash-set! upper-bounds (get-sig run-spec Int) int-atoms) + [max-int (floor (expt 2 (sub1 bitwidth)))]) + (int-range (@- max-int) max-int))) + + ; We have access to Int, but be cautious + (define int-sig (get-sig run-spec Int)) + (when int-sig + (hash-set! lower-bounds int-sig int-atoms) + (hash-set! upper-bounds int-sig int-atoms)) ; Special case: allow sigs to extend Int. (define int-extenders (get-children run-spec Int)) @@ -516,19 +647,22 @@ Please declare a sufficient scope for ~a." (define all-atoms (append int-atoms sig-atoms)) ; for ease of understanding, just sort by first atom + (: tuple Tuple Tuple Boolean)) (define (tuple (define bounds-hash - (for/hash ([sig (get-sigs run-spec)]) + (for/hash : (HashTable Symbol bound) ([sig (get-sigs run-spec)]) (let* ([name (Sig-name sig)] [rel sig] - [lower (map list (hash-ref lower-bounds sig))] + [lower (map (inst list FAtom) (hash-ref lower-bounds sig))] ; Override generated upper bounds for #:one sigs, unless they extend Int ; (In this case, we cannot generate an arbitrary atom for them, since Int atoms ; have semantic value -- i.e., they are not isomorphic.) @@ -536,10 +670,11 @@ Please declare a sufficient scope for ~a." (cond [(and (Sig-one sig) (not (member sig int-extenders))) lower] [else - (map list (hash-ref upper-bounds sig))])]) + (map (inst list FAtom) (hash-ref upper-bounds sig))])]) ;(printf "bounds-hash at ~a; lower = ~a; upper = ~a; non-one upper = ~a~n" rel lower upper (hash-ref upper-bounds sig)) (unless (subset? (list->set lower) (list->set upper)) (raise-run-error (format "Bounds inconsistency detected for sig ~a: lower bound was ~a, which is not a subset of upper bound ~a." (Sig-name sig) lower upper) + run-command (get-blame-node run-spec sig))) (values name (bound rel (sort (remove-duplicates lower) tuple Run-spec Syntax (HashTable Symbol bound) (HashTable Symbol bound))) +(define (get-relation-bounds run-spec run-command sig-to-bound) + (: pbindings (HashTable node/expr/relation sbound)) (define pbindings (Bound-pbindings (Run-spec-bounds run-spec))) + (: piecewise PiecewiseBounds) (define piecewise (Bound-piecewise (Run-spec-bounds run-spec))) + (: get-bound-lower (-> node/expr/relation (U False (Setof Tuple)))) (define (get-bound-lower rel) (define pbinding (hash-ref pbindings rel #f)) - (@and pbinding + (and pbinding (sbound-lower pbinding))) + + (: get-bound-upper (-> node/expr/relation (U False (Setof Tuple)))) (define (get-bound-upper rel) - (define pbinding (hash-ref pbindings rel #f)) - (@and pbinding - (sbound-upper pbinding) + (define pbinding (ann (hash-ref pbindings rel #f) (U False sbound))) + (and pbinding + (sbound-upper pbinding) ;; TODO why duplicate? (sbound-upper pbinding))) + (: get-bound-piecewise (-> node/expr/relation (U False PiecewiseBound))) (define (get-bound-piecewise rel) (hash-ref piecewise rel #f)) (define without-succ - (for/hash ([relation (get-relations run-spec)] + (for/hash : (HashTable Symbol bound) ([relation (get-relations run-spec)] #:unless (equal? (Relation-name relation) 'succ)) + (: sigs (Listof Sig)) (define sigs (get-sigs run-spec relation)) - (define sig-atoms (map (compose (curry map car ) - bound-upper - (curry hash-ref sig-to-bound ) - Sig-name) + ; Types: compose is supposed to be varargs! + ; (define sig-atoms (map (compose (curry map car) + ; bound-upper + ; (curry hash-ref sig-to-bound) + ; Sig-name) + ; sigs)) + + (define sig-atoms (map (lambda ([a-sig : Sig]) + (define sig-name (Sig-name a-sig)) + (: upper-tups (Listof Tuple)) + (define upper-tups (bound-upper (hash-ref sig-to-bound sig-name))) + (map (lambda ([tup : Tuple]) (car tup)) + upper-tups)) sigs)) ;(printf "~a: sig-atoms : ~a~n" relation sig-atoms) ;(printf "~a: raw upper : ~a~n" relation (get-bound-upper relation)) ;(printf "~a: raw lower : ~a~n" relation (get-bound-lower relation)) - + (: upper (Listof Tuple)) (define upper - (let ([bound-upper (get-bound-upper relation)] - [bound-piecewise (get-bound-piecewise relation)]) + (let ([upper-bound-value (get-bound-upper relation)] + [piecewise-bound-value (get-bound-piecewise relation)]) (cond - [(and bound-piecewise bound-upper) + [(and piecewise-bound-value upper-bound-value) ; Error condition -- should never have both complete and piecewise on the same relation (raise-run-error (format "~a upper-bound had both complete and piecewise components, could not resolve them." - relation) + relation) run-command (get-blame-node run-spec relation))] - [bound-piecewise + [piecewise-bound-value ;(printf "upper; bound-piecewise tuples: ~a~n" (PiecewiseBound-tuples bound-piecewise)) ; for each admissible atom (taken from first component of the relation's declaration): ; Where a piecewise entry exists: intersect with cartesian product of restricted universe. ; otherwise: include the full cartesian-product for the restriction outside of that domain - (define pw-domain (PiecewiseBound-atoms bound-piecewise)) + (define pw-domain (PiecewiseBound-atoms piecewise-bound-value)) ;(printf "upper; sig-atoms[domain]: ~a~n" (first sig-atoms)) ;(printf "upper; pw-domain: ~a~n" pw-domain) ; ISSUE: this is pre-eval :/ store post-eval? @@ -608,24 +760,25 @@ Please declare a sufficient scope for ~a." (define undeclared (set->list (set-subtract (list->set pw-domain) (list->set (first sig-atoms))))) (raise-run-error (format "Field ~a was bounded for atom(s): ~a, but the corresponding sig ~a contained only ~a. This might be caused by an inst or example not providing a value or bound for the sig; recall the default scope of ~a through ~a atoms will apply if no scope or bound is given." (Relation-name relation) undeclared (first sigs) (first sig-atoms) (Range-lower DEFAULT-SIG-SCOPE) (Range-upper DEFAULT-SIG-SCOPE)) - (get-blame-node run-spec relation))) + run-command (get-blame-node run-spec relation))) ; TODO: that only helps with the domain, not the range - (define in-domain (set-intersect (list->set (PiecewiseBound-tuples bound-piecewise)) + (define in-domain (set-intersect (list->set (PiecewiseBound-tuples piecewise-bound-value)) (list->set (apply cartesian-product sig-atoms)))) ;(printf "upper; sig-atoms product was: ~a~n" (apply cartesian-product sig-atoms)) ;(printf "upper; in-domain: ~a~n" in-domain) (define out-of-domain (list->set - (filter (lambda (tup) + (filter (lambda ([tup : Tuple] + ) (not (member (first tup) pw-domain))) (apply cartesian-product sig-atoms)))) ;(printf "upper; out-of-domain: ~a~n" out-of-domain) (set->list (set-union in-domain out-of-domain))] - [bound-upper + [upper-bound-value ; complete upper bound exists; intersect with the cartesian product of universe ; restricted to the sig-sequence in relation's declaration - (set->list (set-intersect bound-upper + (set->list (set-intersect upper-bound-value (list->set (apply cartesian-product sig-atoms))))] [else ; no upper-bound given, default to cartesian product of universe, restricted @@ -633,39 +786,47 @@ Please declare a sufficient scope for ~a." (apply cartesian-product sig-atoms)]))) ;(define upper (set->list (set-intersect (get-bound-upper relation) (list->set (apply cartesian-product sig-atoms))))) - ;(printf "~a: refined upper : ~a~n" relation upper) ; Piecewise lower bounds were handled in sigs-functional, before send-to-solver is called. (define lower (let ([bound-lower (get-bound-lower relation)]) (if bound-lower (set->list (set-union bound-lower (list->set empty))) - (list->set empty)))) + empty))) ;(define lower (set->list (set-union (get-bound-lower relation) (list->set empty)))) + ;(printf "~a:~nrefined upper: ~a~nrefined lower: ~a~n" relation upper lower) (unless (subset? (list->set lower) (list->set upper)) (raise-run-error (format "Bounds inconsistency detected for field ~a: lower bound was ~a, which is not a subset of upper bound ~a." (Relation-name relation) lower upper) + run-command (get-blame-node run-spec relation))) (values (Relation-name relation) (bound relation lower upper)))) - (define ints (map car (bound-upper (hash-ref sig-to-bound 'Int)))) - (define succ-tuples (map list (reverse (rest (reverse ints))) (rest ints))) + (: upper-on-int (Listof Tuple)) + (define upper-on-int (bound-upper (hash-ref sig-to-bound 'Int))) + (: ints (Listof FAtom)) + (define ints (map (ann car (-> Tuple FAtom)) upper-on-int)) + (: succ-tuples (Listof (Listof FAtom))) + ;; Int tuples are sorted numerically by tuple List ; Creates assertions for each Sig to restrict ; it to the correct lower/upper bound. -(define (get-sig-size-preds run-spec sig-to-bound #:error raise-run-error) +(: get-sig-size-preds (-> Run-spec Syntax (HashTable Symbol bound) (Listof node/formula))) +(define (get-sig-size-preds run-spec run-command sig-to-bound) (define max-int (expt 2 (sub1 (get-bitwidth run-spec)))) - (apply append - (for/list ([sig (get-sigs run-spec)] + (define lists (for/list : (Listof (Listof node/formula)) ([sig (get-sigs run-spec)] #:unless (equal? (Sig-name sig) 'Int)) (match-define (bound rel bound-lower bound-upper) (hash-ref sig-to-bound (Sig-name sig))) (define-values (bound-lower-size bound-upper-size) (values (length bound-lower) (length bound-upper))) (match-define (Range int-lower int-upper) - (hash-ref (Scope-sig-scopes (Run-spec-scope run-spec)) (Sig-name sig) (Range #f #f))) + (hash-ref (Scope-sig-scopes (Run-spec-scope run-spec)) (Sig-name sig) (lambda () (Range #f #f)))) ; Sub-optimal, because it points to the sig definition (define info (nodeinfo (nodeinfo-loc (node-info sig)) 'checklangNoCheck #f)) @@ -675,28 +836,31 @@ Please declare a sufficient scope for ~a." ; in how bounds should be resolved. e.g., sig A {} sig B extends A {} ; run {} for 4 A, 3 B. (append - (if (@and int-lower (@> int-lower bound-lower-size)) + (if (and int-lower (> int-lower bound-lower-size)) (let () - (unless (@< int-lower max-int) + (unless (< int-lower max-int) (raise-run-error (format (string-append "Lower bound too large for given BitWidth; " "Sig: ~a, Lower-bound: ~a, Max-int: ~a") sig int-lower (sub1 max-int)) + run-command (get-blame-node run-spec sig))) - (list (||/info info - (int Run-spec (Listof node/formula))) (define (get-extender-preds run-spec) - (define sig-constraints (for/list ([sig (get-sigs run-spec)]) + (: sig-constraints (Listof (Listof node/formula))) + (define sig-constraints (for/list : (Listof (Listof node/formula)) ([sig (get-sigs run-spec)]) ; get children information + (: children-rels (Listof Sig)) (define children-rels (get-children run-spec sig)) - ; abstract and sig1, ... extend => (= sig (+ sig1 ...)) ; not abstract and sig is parent of sig1 => (in sig1 sig) ; TODO: optimize by identifying abstract sigs as sum of children + (: abstract (-> Sig (Listof Sig) node/formula)) (define (abstract sig extenders) ; TODO : location not correct - (let ([loc (nodeinfo-loc (node-info sig))]) - (if (@= (length extenders) 1) - (=/info (nodeinfo loc 'checklangNoCheck #f) sig (car extenders)) - (=/info (nodeinfo loc 'checklangNoCheck #f) sig (+ extenders))))) + (let* ([loc (nodeinfo-loc (node-info sig))] + [info (nodeinfo loc 'checklangNoCheck #f)]) + + (if (equal? (length extenders) 1) + (=/func #:info info sig (car extenders)) + (=/func #:info info sig (app-e +/func info extenders))))) + + (: parent (-> Sig Sig node/formula)) (define (parent sig1 sig2) ; loc of sig2? (let ([loc (nodeinfo-loc (node-info sig2))]) - (in/info (nodeinfo loc 'checklangNoCheck #f) sig2 sig1))) + (in/func #:info (nodeinfo loc 'checklangNoCheck #f) sig2 sig1))) + (: extends-constraints (Listof node/formula)) (define extends-constraints (if (and (Sig-abstract sig) (cons? (get-children run-spec sig))) (list (abstract sig children-rels)) @@ -737,20 +909,25 @@ Please declare a sufficient scope for ~a." ; sig1 and sig2 extend sig => (no (& sig1 sig2)) ; (unless both are #:one, in which case exact-bounds should enforce this constraint) + (: disjoin-pair (-> Sig Sig node/formula)) (define (disjoin-pair sig1 sig2) (let* ([loc (nodeinfo-loc (node-info sig2))] [info (nodeinfo loc 'checklangNoCheck #f)]) - (cond [(and (Sig-one sig1) (Sig-one sig2)) true] - [else (no/info info (&/info info sig1 sig2))]))) + (cond [(and (Sig-one sig1) (Sig-one sig2)) true-formula] + [else (no/func #:info info (&/func #:info info sig1 sig2))]))) + + (: disjoin-list (-> Sig (Listof Sig) (Listof node/formula))) (define (disjoin-list a-sig a-list) (map (curry disjoin-pair a-sig) a-list)) + + (: disjoin (-> (Listof Sig) (Listof node/formula))) (define (disjoin a-list) (if (empty? a-list) empty (append (disjoin-list (first a-list) (rest a-list)) (disjoin (rest a-list))))) + (: disjoint-constraints (Listof node/formula)) (define disjoint-constraints (disjoin children-rels)) - (append extends-constraints disjoint-constraints))) ; combine all constraints together @@ -759,11 +936,12 @@ Please declare a sufficient scope for ~a." ; get-relation-preds :: Run-spec -> List ; Creates assertions for each Relation to ensure that it does not ; contain any atoms which don't populate their Sig. +(: get-relation-preds (-> Run-spec (Listof node/formula))) (define (get-relation-preds run-spec) - (for/list ([relation (get-relations run-spec)]) + (for/list : (Listof node/formula) ([relation (get-relations run-spec)]) (define sig-rels (get-sigs run-spec relation)) (define info (nodeinfo (nodeinfo-loc (node-info relation)) 'checklangNoCheck #f)) - (in/info info relation (->/info info sig-rels)))) + (in/func #:info info relation (app-e ->/func info sig-rels)))) #| diff --git a/forge/server/eval-model.rkt b/forge/server/eval-model.rkt index a8f7fcac6..7b8cee09b 100644 --- a/forge/server/eval-model.rkt +++ b/forge/server/eval-model.rkt @@ -94,30 +94,30 @@ (printf "evaluating expr : ~v~n" exp)) (define result (match exp ; Conversion from int values - [(ast:node/expr/op/sing _ _ `(,ix1)) + [(ast:node/expr/op-on-ints/sing _ _ `(,ix1)) (int-atom (eval-int-expr ix1 bind bitwidth))] ; Binary set operations ; Union should support n-ary - [(ast:node/expr/op/+ _ _ (list exp1 exps ...)) + [(ast:node/expr/op-on-exprs/+ _ _ (list exp1 exps ...)) (apply append (map (lambda (exp) (eval-exp exp bind bitwidth safe)) (cons exp1 exps)))] - [(ast:node/expr/op/- _ _ `(,exp-1 ,exp-2)) + [(ast:node/expr/op-on-exprs/- _ _ `(,exp-1 ,exp-2)) (set->list (set-subtract (list->set (eval-exp exp-1 bind bitwidth safe)) (list->set (eval-exp exp-2 bind bitwidth safe))))] - [(ast:node/expr/op/& _ _ `(,exp-1 ,exp-2)) + [(ast:node/expr/op-on-exprs/& _ _ `(,exp-1 ,exp-2)) (set->list (set-intersect (list->set (eval-exp exp-1 bind bitwidth safe)) (list->set (eval-exp exp-2 bind bitwidth safe))))] - [(ast:node/expr/op/-> _ _ `(,exp-1 ,exp-2)) + [(ast:node/expr/op-on-exprs/-> _ _ `(,exp-1 ,exp-2)) (map flatten (foldl append '() (map (lambda (x) (map (lambda (y) `(,x ,y)) (eval-exp exp-2 bind bitwidth safe))) (eval-exp exp-1 bind bitwidth safe))))] - [(ast:node/expr/op/++ _ _ `(,exp-1 ,exp-2)) + [(ast:node/expr/op-on-exprs/++ _ _ `(,exp-1 ,exp-2)) (let* ([right-tuples (eval-exp exp-2 bind bitwidth safe)] [to-override (map (lambda (t) (first t)) right-tuples)] [left-tuples (eval-exp exp-1 bind bitwidth safe)] @@ -125,7 +125,7 @@ (filter (lambda (t) (not (member (first t) right-tuples))) left-tuples)]) (append left-after-removal right-tuples))] - [(ast:node/expr/op/join _ _ `(,exp-1 ,exp-2)) + [(ast:node/expr/op-on-exprs/join _ _ `(,exp-1 ,exp-2)) (foldl append '() (map (lambda (x) @@ -135,11 +135,11 @@ (eval-exp exp-2 bind bitwidth safe)))) (eval-exp exp-1 bind bitwidth safe)))] ; Unary set operations - [(ast:node/expr/op/^ _ _ `(,child-exp)) + [(ast:node/expr/op-on-exprs/^ _ _ `(,child-exp)) (tc (eval-exp child-exp bind bitwidth safe))] - [(ast:node/expr/op/* _ _ `(,child-exp)) + [(ast:node/expr/op-on-exprs/* _ _ `(,child-exp)) (append (build-iden bind) (tc (eval-exp child-exp bind bitwidth safe)))] - [(ast:node/expr/op/~ _ _ `(,child-exp)) + [(ast:node/expr/op-on-exprs/~ _ _ `(,child-exp)) (map reverse (eval-exp child-exp bind bitwidth safe))] ; Set comprehension - TODO (do we need this? Thomas says no) #;[`(set ,var ,lst ,form) (filter (lambda (x) (eval-form form (hash-set bind var (list x)) bitwidth)) @@ -311,30 +311,36 @@ (foldl (λ (x res) (+ res (eval-int-expr ie (hash-set bind var (list x)) bitwidth))) 0 (eval-exp lst bind bitwidth))] - [(ast:node/int/op/sum _ `(,child-exp)) + [(ast:node/int/op-on-exprs/sum _ `(,child-exp)) (wraparound (let ([expr-val (eval-exp child-exp bind bitwidth)]) (foldl (λ (x ret) (if (and (= (length x) 1) (int-atom? (first x))) (+ ret (int-atom-n (first x))) ret)) 0 expr-val)) bitwidth)] - [(ast:node/int/op/card _ `(,child-exp)) + [(ast:node/int/op-on-exprs/card _ `(,child-exp)) (wraparound (length (eval-exp child-exp bind bitwidth)) bitwidth)] - [(ast:node/int/op/add _ `(,ix1 ,ix2)) + [(ast:node/int/op-on-ints/add _ `(,ix1 ,ix2)) (wraparound (+ (eval-int-expr ix1 bind bitwidth) (eval-int-expr ix2 bind bitwidth)) bitwidth)] - [(ast:node/int/op/subtract _ `(,ix1 ,ix2)) + [(ast:node/int/op-on-ints/subtract _ `(,ix1 ,ix2)) (wraparound (- (eval-int-expr ix1 bind bitwidth) (eval-int-expr ix2 bind bitwidth)) bitwidth)] - [(ast:node/int/op/multiply _ `(,ix1 ,ix2)) + [(ast:node/int/op-on-ints/multiply _ `(,ix1 ,ix2)) (wraparound (* (eval-int-expr ix1 bind bitwidth) (eval-int-expr ix2 bind bitwidth)) bitwidth)] - [(ast:node/int/op/divide _ `(,ix1 ,ix2)) - (wraparound (quotient (eval-int-expr ix1 bind bitwidth) (eval-int-expr ix2 bind bitwidth)) bitwidth)] - [(ast:node/int/op/remainder _ `(,ix1 ,ix2)) - (wraparound (remainder (eval-int-expr ix1 bind bitwidth) (eval-int-expr ix2 bind bitwidth)) bitwidth)] - [(ast:node/int/op/abs _ `(,ix1)) + [(and div-node (ast:node/int/op-on-ints/divide _ `(,ix1 ,ix2))) + (let ([divisor (eval-int-expr ix2 bind bitwidth)]) + (when (= divisor 0) + (ast:raise-forge-error #:msg "division by zero" #:context div-node)) + (wraparound (quotient (eval-int-expr ix1 bind bitwidth) divisor) bitwidth))] + [(and rem-node (ast:node/int/op-on-ints/remainder _ `(,ix1 ,ix2))) + (let ([divisor (eval-int-expr ix2 bind bitwidth)]) + (when (= divisor 0) + (ast:raise-forge-error #:msg "remainder by zero" #:context rem-node)) + (wraparound (remainder (eval-int-expr ix1 bind bitwidth) divisor) bitwidth))] + [(ast:node/int/op-on-ints/abs _ `(,ix1)) (let ([ix1-val (eval-int-expr ix1 bind bitwidth)]) (wraparound (racket-abs ix1-val) bitwidth))] - [(ast:node/int/op/sign _ `(,ix1)) + [(ast:node/int/op-on-ints/sign _ `(,ix1)) (let ([ix1-val (eval-int-expr ix1 bind bitwidth)]) (wraparound (cond [(> ix1-val 0) 1] [(= ix1-val 0) 0] diff --git a/forge/server/forgeserver.rkt b/forge/server/forgeserver.rkt index 569a746e5..6bc8343e0 100644 --- a/forge/server/forgeserver.rkt +++ b/forge/server/forgeserver.rkt @@ -14,7 +14,7 @@ ; should be called for any context where a menu of commands doesn't fit (such as a ; failing test, perhaps). -(require (only-in forge/lang/ast relation-name raise-forge-error) +(require (only-in forge/lang/ast relation-name raise-forge-error deparse node?) forge/server/modelToXML forge/evaluator xml @@ -49,11 +49,47 @@ (define/contract (get-from-json json-m path) (-> (and/c jsexpr? hash?) (listof symbol?) jsexpr?) (cond [(empty? path) json-m] - [else + [else (unless (hash-has-key? json-m (first path)) (error (format "get-from-json expected JSON dictionary with ~a field, got: ~a~n" (first path) json-m))) (get-from-json (hash-ref json-m (first path)) (rest path))])) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Shared helpers for Sterling communication +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; Send a message to Sterling over a WebSocket connection +(define (send-to-sterling m #:connection connection) + (when (@>= (get-verbosity) VERBOSITY_STERLING) + (printf "Sending message to Sterling: ~a~n" m)) + (ws-send! connection m)) + +; Start a WebSocket server for Sterling communication. +; Returns (values stop-service port) where port may be a string on failure. +; handler-proc: (-> connection message void) - handles non-ping messages +; port-option: the port number to listen on (0 for ephemeral) +(define (start-websocket-server port-option handler-proc) + (define chan (make-async-channel)) + (define stop-service + (ws-serve + (λ (connection _) + (let loop () + (define m (ws-recv connection)) + (unless (eof-object? m) + (when (@>= (get-verbosity) VERBOSITY_STERLING) + (printf "Message received from Sterling: ~a~n" m)) + (cond [(equal? m "ping") + (send-to-sterling "pong" #:connection connection)] + [else (handler-proc connection m)]) + (loop)))) + #:port port-option #:confirmation-channel chan)) + (define port (async-channel-get chan)) + (when (string? port) + (printf "NO PORTS AVAILABLE. Could not start provider server.~n")) + (values stop-service port)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; name is the name of the model ; get-next-instance returns the next instance each time it is called, or #f. (define (display-model @@ -63,11 +99,16 @@ (define state-for-run (Run-spec-state (Run-run-spec the-run))) - (define current-tree orig-lazy-tree) - (define curr-datum-id 1) ; nonzero - (define id-to-instance-map (make-hash)) ; mutable hash - - (define (get-current-instance) + ;; Skip starting WebSocket server if Sterling is disabled + (when (member (get-option the-run 'run_sterling) (list 'off "off" #f)) + (printf "Sterling is disabled (run_sterling = off). Skipping visualization.~n")) + + (unless (member (get-option the-run 'run_sterling) (list 'off "off" #f)) + (define current-tree orig-lazy-tree) + (define curr-datum-id 1) ; nonzero + (define id-to-instance-map (make-hash)) ; mutable hash + + (define (get-current-instance) (define returned-instance (tree:get-value current-tree)) (set-box! (Run-last-sterling-instance the-run) returned-instance) returned-instance) @@ -81,12 +122,7 @@ (values curr-datum-id (get-current-instance))) (define command-string (format "~a" (syntax->datum command))) - - (define (send-to-sterling m #:connection connection) - (when (@>= (get-verbosity) VERBOSITY_STERLING) - (printf "Sending message to Sterling: ~a~n" m)) - (ws-send! connection m)) - + (define (get-xml soln) ;(define tuple-annotations (if (and (Sat? model) (equal? 'on (get-option the-run 'local_necessity))) ; (build-tuple-annotations-for-ln model) @@ -130,7 +166,7 @@ [else (printf "Sterling: unexpected 'next' request type: ~a~n" json-m)])) (define xml (get-xml inst)) - (define response (make-sterling-data xml datum-id name temporal? (Sat? inst) old-datum-id)) + (define response (make-sterling-data xml datum-id name temporal? inst old-datum-id)) (send-to-sterling response #:connection connection)] [else (printf "Sterling: unexpected onClick: ~a~n" json-m)]) @@ -143,7 +179,7 @@ (define inst (get-current-instance)) (define id curr-datum-id) (define xml (get-xml inst)) - (define response (make-sterling-data xml id name temporal? (Sat? inst))) + (define response (make-sterling-data xml id name temporal? inst)) (send-to-sterling response #:connection connection) ] [(equal? (hash-ref json-m 'type) "eval") @@ -169,37 +205,39 @@ (send-to-sterling "BAD REQUEST" #:connection connection) (printf "Sterling message contained unexpected type field: ~a~n" json-m)])) - (define chan (make-async-channel)) - - ; After this is defined, the service is active and should be listening - (define stop-service - (ws-serve - ; This is the connection handler function, it has total control over the connection - ; from the time that conn-headers finishes responding to the connection request, to the time - ; the connection closes. The server generates a new handler thread for this function - ; every time a connection is initiated. - (λ (connection _) - (let loop () - (define m (ws-recv connection)) - (unless (eof-object? m) - (when (@>= (get-verbosity) VERBOSITY_STERLING) - (printf "Message received from Sterling: ~a~n" m)) - (cond [(equal? m "ping") - (send-to-sterling "pong" #:connection connection)] - [else (handle-json connection m)]) - (loop)))) - ; default #:port 0 will assign an ephemeral port - #:port (get-option the-run 'sterling_port) #:confirmation-channel chan)) - - (define port (async-channel-get chan)) - (when (string? port) - (printf "NO PORTS AVAILABLE. Could not start provider server.~n")) - - ; Now, serve the static sterling website files (this will be a different server/port). - (unless (equal? 'off (get-option state-for-run 'run_sterling)) - (serve-sterling-static #:provider-port port))) - -(define (make-sterling-data xml id run-name temporal? not-done? [old-id #f]) + (define-values (stop-service port) + (start-websocket-server (get-option the-run 'sterling_port) handle-json)) + + ; Now, serve the static sterling website files (this will be a different server/port). + (define run-sterling-mode (get-option state-for-run 'run_sterling)) + (cond [(member run-sterling-mode (list 'off "off")) + (void)] ; do nothing + [(member run-sterling-mode (list 'serve "serve")) + (serve-no-sterling #:provider-port port)] + [(member run-sterling-mode (list 'headless "headless")) + (serve-sterling-static #:provider-port port + #:static-port (get-option state-for-run 'sterling_static_port) + #:open-browser #f)] + [else + (serve-sterling-static #:provider-port port + #:static-port (get-option state-for-run 'sterling_static_port))]))) ; closes outer unless + +(define (make-status-value inst) + (cond [(Sat? inst) "sat"] + [(Unsat? inst) "unsat"] + [(Unknown? inst) "unknown"] + [else "error"])) +(define (make-core-value inst) + (if (and (Unsat? inst) (Unsat-core inst)) + (map (lambda (cr) (cond [(node? cr) (deparse cr)] + [(string? cr) cr] + [else (raise-forge-error #:msg (format "Unexpected core value sending to Sterling: ~a" cr) + #:context #f)])) + (Unsat-core inst)) + #f)) + +(define (make-sterling-data xml id run-name temporal? inst [old-id #f]) + (define not-done? (Sat? inst)) (jsexpr->string (hash 'type "data" @@ -210,6 +248,8 @@ 'generatorName (->string run-name) 'format "alloy" 'data xml + 'status (make-status-value inst) + 'core (make-core-value inst) 'buttons (cond [(not not-done?) (list)] [temporal? (list (hash 'text "Next Trace" @@ -252,8 +292,11 @@ ;; The namespace is passed to aid evaluation ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define (start-sterling-menu curr-state nsa) - ; The runs defined in the state at this point, which should be after all declarations. - (define runmap (State-runmap curr-state)) + ;; Early exit if Sterling is disabled - avoid starting WebSocket server + (unless (member (get-option curr-state 'run_sterling) (list 'off "off" #f)) + + ; The runs defined in the state at this point, which should be after all declarations. + (define runmap (State-runmap curr-state)) (define defined-run-names (hash-keys runmap)) ; Filter out runs that are not useful to visualize, like tests that failed due to unsat. @@ -278,11 +321,6 @@ (when (> (get-verbosity) VERBOSITY_LOW) (printf "Starting Sterling in command-selection mode...~n") (printf "Available commands: ~a~n" useful-run-names)) - - (define (send-to-sterling m #:connection connection) - (when (@>= (get-verbosity) VERBOSITY_STERLING) - (printf "Sending message to Sterling: ~a~n" m)) - (ws-send! connection m)) (define curr-datum-id 0) ; nonzero (define id-to-instance-map (make-hash)) ; mutable hash @@ -321,8 +359,8 @@ (define payload (hash-ref json-m 'payload)) (define onClick (hash-ref payload 'onClick)) - (define context (hash-ref payload 'context)) - (define generatorName (string->symbol (hash-ref context 'generatorName))) + (define contextPayload (hash-ref payload 'context)) + (define generatorName (string->symbol (hash-ref contextPayload 'generatorName))) (define next? (equal? "next" (substring onClick 0 4))) (unless (hash-has-key? runmap generatorName) (raise-forge-error @@ -403,11 +441,12 @@ #:msg (format "Error: Sterling sent unexpected 'next' request type: ~a~n" json-m) #:context context)])) (define xml (get-xml inst)) + ; is-running? is about the _solver process itself_. ; is-run-closed? is about whether this specific run has been terminated ; Sat? is about whether the solution we have is Sat. (define response (make-sterling-data xml datum-id name temporal? - (and (is-running? the-run) (not (is-run-closed? the-run)) (Sat? inst)) + (and (is-running? the-run) (not (is-run-closed? the-run)) inst) old-datum-id)) (send-to-sterling response #:connection connection)] [else @@ -487,37 +526,22 @@ #:msg (format "Sterling message contained unexpected type field: ~a~n" json-m) #:context context)])) - (define chan (make-async-channel)) - - ; After this is defined, the service is active and should be listening - (define stop-service - (ws-serve - ; This is the connection handler function, it has total control over the connection - ; from the time that conn-headers finishes responding to the connection request, to the time - ; the connection closes. The server generates a new handler thread for this function - ; every time a connection is initiated. - (λ (connection _) - (let loop () - (define m (ws-recv connection)) - (unless (eof-object? m) - (when (@>= (get-verbosity) VERBOSITY_STERLING) - (printf "Message received from Sterling: ~a~n" m)) - (cond [(equal? m "ping") - (send-to-sterling "pong" #:connection connection)] - [else (handle-json connection m)]) - (loop)))) - ; default #:port 0 will assign an ephemeral port - #:port (get-option curr-state 'sterling_port) #:confirmation-channel chan)) - (define port (async-channel-get chan)) - (when (string? port) - (printf "NO PORTS AVAILABLE. Could not start provider server.~n")) - - ; Now, serve the static sterling website files (this will be a different server/port). - ; Switch Sterling off for the "off" string too, because users may neglect the \' - ; if providing an override at the command line. This means that one cannot provide - ; a script in a file named "off". - (unless (or (member (get-option curr-state 'run_sterling) (list 'off "off" #f)) - (empty? useful-run-names)) - (serve-sterling-static #:provider-port port)) - (when (empty? useful-run-names) - (printf "There was nothing useful to visualize: all commands were already executed and produced no instances.~n"))) \ No newline at end of file + (define-values (stop-service port) + (start-websocket-server (get-option curr-state 'sterling_port) handle-json)) + + ; Now, serve the static sterling website files (this will be a different server/port). + ; Switch Sterling off for the "off" string too, because users may neglect the \' + ; if providing an override at the command line. This means that one cannot provide + ; a script in a file named "off". + + (cond [(empty? useful-run-names) + (printf "There was nothing useful to visualize: all commands were already executed and produced no instances.~n")] + [(member (get-option curr-state 'run_sterling) (list 'serve "serve")) + (serve-no-sterling #:provider-port port)] + [(member (get-option curr-state 'run_sterling) (list 'headless "headless")) + (serve-sterling-static #:provider-port port + #:static-port (get-option curr-state 'sterling_static_port) + #:open-browser #f)] + [else + (serve-sterling-static #:provider-port port + #:static-port (get-option curr-state 'sterling_static_port))]))) ; closes unless \ No newline at end of file diff --git a/forge/server/modelToXML.rkt b/forge/server/modelToXML.rkt index 6d08d5f62..ceb41fce7 100644 --- a/forge/server/modelToXML.rkt +++ b/forge/server/modelToXML.rkt @@ -85,7 +85,7 @@ ; Possibly annotate the XML with instructions on where to find visualization info. ; The option supports a _list_ of files, so Racket needs to disambiguate. (define (sterling-viz-to-xml run-options) - (define rs-opt (Options-run_sterling run-options)) + (define rs-opt (hash-ref run-options 'run_sterling)) (define (single-path-to-xml p) (cond [(and (string? p) (file-exists? p)) ; the forge expander makes this an absolute path (see OptionDecl) @@ -110,12 +110,16 @@ [(list? rs-opt) (apply string-append (map single-path-to-xml rs-opt))] [else ""])) -(define (clean str) - (string-replace - (string-replace - (string-replace +(define (clean ele) + (cond + [(string? ele) (string-replace - (string-replace str "\"" """) ">" ">") "<" "<") "&" "&") "\n" " ")) + (string-replace + (string-replace + (string-replace + (string-replace ele "\"" """) ">" ">") "<" "<") "&" "&") "\n" " ")] + [(node? ele) (deparse ele)] + [else ele])) (define (agg-lines lines) (if (empty? lines) @@ -221,11 +225,11 @@ here-string-delimiter "" "\n" "\n\n" - (if data - (string-append "\n") "") + "lines (open-input-file filepath))))) + "\">\n" "")] ; ** Special display for "out of instances" vs. "unsat" ** diff --git a/forge/server/serve-sterling-static.rkt b/forge/server/serve-sterling-static.rkt index 891d886fe..9cdb5ba7f 100644 --- a/forge/server/serve-sterling-static.rkt +++ b/forge/server/serve-sterling-static.rkt @@ -15,7 +15,7 @@ racket/runtime-path racket/async-channel forge/shared) -(provide serve-sterling-static) +(provide serve-sterling-static serve-no-sterling) (define-runtime-path sterling-path "../sterling/build/") (define sterling-index (build-path sterling-path "index.html")) @@ -32,13 +32,15 @@ [else bytes-read])) -(define (serve-sterling-static #:provider-port [provider-port 0]) +(define (serve-sterling-static #:provider-port [provider-port 0] + #:static-port [static-port 0] + #:open-browser [open-browser #t]) (define confirm-chan (make-async-channel)) (define stop-static-server (serve #:dispatch (files:make #:url->path (make-url->path sterling-path)) - #:port 0 + #:port static-port #:confirmation-channel confirm-chan)) (define port (async-channel-get confirm-chan)) @@ -46,17 +48,19 @@ (printf "NO PORTS AVAILABLE. Unable to serve Sterling static files. You may be able to manually load Sterling's index.html here:~n~a~n" (string-append (path->string sterling-index) "?" (number->string provider-port)))] [else - ; Attempt to open a browser to the Sterling index.html, with the proper port - ; If this cannot be opened for whatever reason, keep the server open but print - ; a warning, allowing the user a workaround. - ; (We no longer use send-url/file, which is for file:// URLs) (define sterling-url (format "http://127.0.0.1:~a/?~a" port provider-port)) - (with-handlers ([exn? - (lambda (e) (printf "Racket could not open a browser on your system; you may be able manually navigate to this address, which is where Forge expects Sterling to load:~n ~a~nContext: ~a~n" - sterling-url - e))]) - (send-url sterling-url)) - + ; In headless mode, skip opening the browser + (when open-browser + ; Attempt to open a browser to the Sterling index.html, with the proper port + ; If this cannot be opened for whatever reason, keep the server open but print + ; a warning, allowing the user a workaround. + ; (We no longer use send-url/file, which is for file:// URLs) + (with-handlers ([exn? + (lambda (e) (printf "Racket could not open a browser on your system; you may be able manually navigate to this address, which is where Forge expects Sterling to load:~n ~a~nContext: ~a~n" + sterling-url + e))]) + (send-url sterling-url))) + (printf "Opening Forge menu in Sterling (static server port=~a). Press enter to stop Forge (or click 'Stop' in VSCode).~n" port) (flush-output) @@ -73,4 +77,17 @@ (void (read-char))]) ; Once a character is read, stop the server - (stop-static-server)])) \ No newline at end of file + (stop-static-server)])) + + +(define (serve-no-sterling #:provider-port provider-port) + (define provider-url (format "http://127.0.0.1/~a" provider-port)) + (printf "Forge running without Sterling; provider at: ~a.~n Press enter to stop Forge (or click 'Stop' in VSCode).~n" provider-url) + (flush-output) + + ; See serve-sterling-static for rationale of splitting windows/non-windows. + (cond + [(equal? (system-type) 'windows) + (void (windows-read-char-patch))] + [else + (void (read-char))])) \ No newline at end of file diff --git a/forge/shared.rkt b/forge/shared.rkt index aea305749..89f29a869 100644 --- a/forge/shared.rkt +++ b/forge/shared.rkt @@ -1,26 +1,49 @@ -#lang racket/base +#lang typed/racket/base/optional -(require racket/runtime-path racket/file) -(require (only-in racket/draw color%) - (only-in racket make-object) - (only-in racket/system system*) - (only-in racket/string string-trim) +(require racket/runtime-path racket/file racket/match) +(require (only-in racket/system system*) + (only-in racket/string string-trim string-replace) (only-in racket/port call-with-output-string) (only-in pkg/lib pkg-directory)) -(require racket/stream) -(require net/http-easy - json - base64) +(require typed/net/base64) +(require (only-in typed/net/url URL)) + +(define-type FAtom (U Symbol Integer)) +(define-type Tuple (Listof FAtom)) +(provide FAtom Tuple) + +(require/typed json + [#:opaque JSExpr jsexpr?] + [string->jsexpr (-> String JSExpr)] + [jsexpr->string (-> JSExpr String)]) + +(require/typed pkg/lib + [pkg-directory (->* (String) (#:cache (U False (HashTable Any Any))) (U Path-String False))]) + +(require/typed net/http-easy + [#:opaque Response response?] + [response-body (-> Response Bytes)] + [response-status-code (-> Response Integer)] + [get (->* ( (U Bytes String URL) ) + ( #:close? Boolean + #:stream? Boolean + #:headers (HashTable Symbol (U Bytes String)) + #:params (Listof (Pairof Symbol (U False String))) + #:auth (U False Procedure) ;; more specific in reality + #:data Any + #:form Any + #:json Any + #:timeouts Any + #:max-attempts Any + #:max-redirects Any + #:user-agent Any) + Response)]) (provide get-verbosity set-verbosity VERBOSITY_LOW VERBOSITY_STERLING VERBOSITY_HIGH VERBOSITY_DEBUG VERBOSITY_LASTCHECK get-temp-dir) -(provide forge-version forge-git-info instance-diff CORE-HIGHLIGHT-COLOR curr-forge-version) -(provide stream-map/once port-echo java>=1.9? do-time) - -(module+ test (require rackunit)) - -(define CORE-HIGHLIGHT-COLOR (make-object color% 230 150 150)) +(provide forge-version forge-git-info instance-diff curr-forge-version remove-newlines) +(provide port-echo java>=1.9? do-time) ; Level of output when running specs (define VERBOSITY_SCRIPT 0) ; for test scripts @@ -33,29 +56,45 @@ (define VERBOSITY_LASTCHECK 1) (define verbosityoption VERBOSITY_LOW) + ; for accessing verbosity in other modules +(: get-verbosity (-> Integer)) (define (get-verbosity) verbosityoption) +(: set-verbosity (-> Integer Void)) (define (set-verbosity x) (set! verbosityoption x)) (define-runtime-path info-path "info.rkt") +(: forge-version String) (define forge-version "x.x.x") + (with-handlers ([exn:fail? (λ (exn) (println exn))]) (define info-str (file->string info-path)) + ; A strange type, but cadr/second will pull out the appropriate string + (: parts (U (Pairof String (Listof (U False String))) False)) (define parts (regexp-match #px"define\\s+version\\s+\"(\\S+)\"" info-str)) - (set! forge-version (cadr parts)) -) + ; Typed Racket had trouble with doing this narrowing with one cond. + (cond [(not parts) (set! forge-version "UNKNOWN")] + [else + (define the-str (cadr parts)) + (if the-str + (set! forge-version the-str) + (set! forge-version "UNKNOWN"))])) (define (forge-git-info) (with-handlers ([exn:fail? void]) (define windows? (eq? (system-type) 'windows)) + (: git-exe (U False Path)) (define git-exe (find-executable-path (if windows? "git.exe" "git"))) - (parameterize ([current-directory (pkg-directory "forge")]) - (map - string-trim - (list - (shell git-exe '("rev-parse" "--abbrev-ref" "HEAD")) - (shell git-exe '("rev-parse" "--short" "HEAD")) - (shell git-exe '("log" "-1" "--format=%cd"))))))) + (define forge-dir (pkg-directory "forge")) + (if (or (not forge-dir) (not git-exe)) + (raise "Could not find Forge package installed on the system.") + (parameterize ([current-directory forge-dir]) + (map + string-trim + (list + (shell git-exe '("rev-parse" "--abbrev-ref" "HEAD")) + (shell git-exe '("rev-parse" "--short" "HEAD")) + (shell git-exe '("log" "-1" "--format=%cd")))))))) ; Returns temp directory for files (define (get-temp-dir) @@ -71,28 +110,32 @@ "tnelson" "Forge" "forge/info.rkt")) - (define response (get URL)) (if (= (response-status-code response) 200) (let* ([body (response-body response)] - [json-data (string->jsexpr (bytes->string/utf-8 body))] - [content (hash-ref json-data 'content)] - [decoded-content (bytes->string/utf-8 (base64-decode (string->bytes/utf-8 content)))] - [version (regexp-match #px"\\(define version \"([0-9]+[.0-9]+)\"\\)" decoded-content)]) - (car (cdr version))) + [json-data (string->jsexpr (bytes->string/utf-8 body))]) + (define content (if (hash? json-data) (hash-ref json-data 'content) #f)) + (define decoded-content (bytes->string/utf-8 (base64-decode (string->bytes/utf-8 + (if (string? content) content ""))))) + (define version (regexp-match #px"\\(define version \"([0-9]+[.0-9]+)\"\\)" decoded-content)) + (if (list? version) + (car (cdr version)) + void)) void))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(define-type InstanceHash (HashTable Symbol (Listof Tuple))) ; Returns the difference of two instances (> and < separately) +(: instance-diff (-> InstanceHash InstanceHash (List Symbol (Listof Any) (Listof Any)))) (define (instance-diff i1 i2) (if (equal? (hash-keys i1) (hash-keys i2)) (list 'same-signature - (hash-map i1 (lambda (k v) + (hash-map i1 (lambda ([k : Symbol] [v : (Listof Tuple)]) (list k (filter (lambda (ele) (not (member ele (hash-ref i2 k)))) v)))) - (hash-map i2 (lambda (k v) + (hash-map i2 (lambda ([k : Symbol] [v : (Listof Tuple)]) (list k (filter (lambda (ele) (not (member ele (hash-ref i1 k)))) v))))) (list @@ -100,45 +143,53 @@ (filter (lambda (k) (not (member k (hash-keys i2)))) (hash-keys i1)) (filter (lambda (k) (not (member k (hash-keys i1)))) (hash-keys i2))))) -(define (stream-map/once func strm) - (stream-cons (func (stream-first strm)) - (stream-map/once func (stream-rest strm)))) - +(: port-echo (->* (Input-Port Output-Port) (#:title String) Void)) (define (port-echo in-port out-port #:title [title #f]) (when title (fprintf out-port "~a logs:~n" title)) (for ([ln (in-lines in-port)]) (displayln ln out-port))) +(: java>=1.9? (-> Path-String Boolean)) (define (java>=1.9? java-exe) (define version-str (shell java-exe "-version")) (java-version>=1.9? version-str java-exe)) +(: java-version>=1.9? (-> String (U False Path-String) Boolean)) (define (java-version>=1.9? version-str java-exe) + (: m0 (U False (Pairof String (Listof (U False String))))) + (define m0 (regexp-match #rx"(java|openjdk) version \"([^\"]+)\"" version-str)) + + ; Needed to do this step-by-step; (and ...) wasn't working to narrow. + (define maybe-vstr (if m0 (caddr m0) "")) + (define vstr (if maybe-vstr maybe-vstr "")) + (define m1 (or (regexp-match #rx"^([0-9]+)(\\.[0-9]+\\.)?" vstr) + (raise-arguments-error 'forge/shared + "Error checking Java version" + "java exe" java-exe + "version string" version-str))) + (define major (cadr m1)) + (define minor (caddr m1)) + + (: major-nums (List (U Number False) (U Number False))) (define major-nums - (let* ([m0 (regexp-match #rx"(java|openjdk) version \"([^\"]+)\"" version-str)] - [vstr (if m0 (caddr m0) "")] - [m1 (or - (regexp-match #rx"^([0-9]+)(\\.[0-9]+\\.)?" vstr) - (raise-arguments-error 'forge/shared - "Error checking Java version" - "java exe" java-exe - "version string" version-str))] - [major (cadr m1)] - [minor (caddr m1)]) - (list (string->number major) - (if minor (string->number (substring minor 1 (sub1 (string-length minor)))) 0)))) - (or (and (= 1 (car major-nums)) - (<= 9 (cadr major-nums))) - (<= 9 (car major-nums)))) - -(module+ test + (list (if major (string->number major) #f) + (if minor (string->number (substring minor 1 (sub1 (string-length minor)))) 0))) + ; Note on types: <= requires a *Real* number, not just a Number. + (or (and (number? (car major-nums)) (= 1 (car major-nums)) + (real? (cadr major-nums)) (<= 9 (cadr major-nums))) + (and (real? (car major-nums)) (<= 9 (car major-nums))))) + +(module+ test (require typed/rackunit)) +(module+ test (test-case "java-version" (check-true (java-version>=1.9? "openjdk version \"17\" 2021-09-14" #f)) (check-false (java-version>=1.9? "openjdk version \"1.8.0_242\"\nOpenJDK Runtime Environment (build 1.8.0_242-b08)" #f)) (check-false (java-version>=1.9? "java version \"1.8.0_65\"\nJava(TM) SE Runtime Environment" #f)))) +(: shell (-> Path-String (U (Listof String) String) String)) (define (shell exe pre-cmd) + (: success? (Boxof Boolean)) (define success? (box #f)) (define cmd* (if (string? pre-cmd) (list pre-cmd) pre-cmd)) (define str @@ -151,42 +202,112 @@ str (raise-user-error 'shell "failed to apply '~a' to arguments '~a': got ~a" exe cmd* (unbox success?)))) +(: remove-newlines (-> String String)) +(define (remove-newlines str) + (string-replace (string-replace str "\n" "") "\r" "")) + ;; --- timing (define-logger forge-timing) (define do-time (let () + (: last-time (Option Integer)) (define last-time #f) + (: initial-time (Option Integer)) (define initial-time #f) + (: gc-time (Option Integer)) (define gc-time #f) + (: set!-initial-time (-> Integer Void)) (define (set!-initial-time t) (set! initial-time t)) + (: set!-last-time (-> Integer Void)) (define (set!-last-time t) (set! last-time t)) + (: set!-gc-time (-> Integer Void)) (define (set!-gc-time t) (set! gc-time t)) (define pad-len 40) + + (: pad (-> String Char String)) (define (pad str pad-char) (define l (string-length str)) (if (>= l pad-len) str (string-append str (make-string (- pad-len l) pad-char)))) + (define (start-timing msg) (when last-time (error 'start-timing "Timing already started")) (set!-last-time (current-process-milliseconds)) - (set!-initial-time last-time) + (set!-initial-time (current-process-milliseconds)) (set!-gc-time (current-gc-milliseconds)) (log-forge-timing-debug "~a at ~a" (pad "Starting" #\space) initial-time)) - (lambda (msg) + + (lambda ([msg : String]) (unless last-time (start-timing msg)) - (log-forge-timing-debug - (let* ([t (current-process-milliseconds)] - [gc (current-gc-milliseconds)] - [old last-time] - [diff (- t old)] - [gc-diff (- gc gc-time)] - [new-msg (pad msg #\space)]) - (set!-last-time t) - (set!-gc-time gc) + (define t (current-process-milliseconds)) + (define gc (current-gc-milliseconds)) + (define old last-time) + (define diff (if old (- t old) #f)) + (define new-msg (pad msg #\space)) + ;; TODO TYPES why did I need the (runtime checked) assertions? + (define gc-diff (if (exact-integer? gc-time) (- gc (assert gc-time exact-integer?)) #f)) + (define init-diff (if (exact-integer? initial-time) (- t (assert initial-time exact-integer?)) #f)) + (set!-last-time t) + (set!-gc-time gc) + (log-forge-timing-debug (format "~a at ~a\tlast step: ~a\tgc: ~a\ttotal: ~a" - new-msg t diff gc-diff (- t initial-time))))))) + new-msg t diff gc-diff init-diff))))) + + + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; Infrastructure for logging to files ;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(provide log-forge-event setup-logfile! log-to-file-enabled?) +(define-logger forge-logger) + +(: logfile-name (Boxof (U False Path-String))) +(define logfile-name (box #f)) +(: logger-port (Boxof (U False Output-Port))) +(define logger-port (box #f)) + +(: log-to-file-enabled? (-> Boolean)) +(define (log-to-file-enabled?) + (if (and (unbox logger-port) (unbox logfile-name)) #t #f)) + +(: setup-logfile! (-> Path-String Void)) +(define (setup-logfile! fp) + (set-box! logfile-name fp) + (when fp + (define receiver (make-log-receiver forge-logger-logger 'debug)) + (define logger-port-temp (open-output-file fp #:exists 'replace)) + (set-box! logger-port logger-port-temp) + + (when logger-port-temp + ; Set up the receiver to write to the file + (define forge-log-receiver-thread + (thread + (lambda () + (let loop () + (match (sync receiver) + [(vector level msg data event-name) + ;(printf "Log received: ~a~n" data) + (fprintf logger-port-temp "[~a] ~a: ~a\n" level event-name data) + (flush-output logger-port-temp)]) + (loop))))) + ; Be prepared to gracefully close the logger file, if any + (exit-handler + (let ([old-exit (exit-handler)]) + (lambda (v) + (close-output-port logger-port-temp) + (old-exit v))))))) + + +(: log-forge-event (-> Log-Level Symbol String Any Void)) +(define (log-forge-event level topic message datum) + (when (log-to-file-enabled?) + ;(printf "Log sending: ~a~n" datum) + ; logger level topic message data prefix-message + (log-message forge-logger-logger level topic message datum #t))) \ No newline at end of file diff --git a/forge/sigs-functional.rkt b/forge/sigs-functional.rkt index 7ac14f287..796383d29 100644 --- a/forge/sigs-functional.rkt +++ b/forge/sigs-functional.rkt @@ -44,11 +44,13 @@ make-check test-from-state make-test - display) + display + state-set-option) (provide Int succ) (provide (prefix-out forge: make-model-generator)) (provide solution-diff) -(provide reset-run-name-history! stop-solver-process!) +(provide ;reset-run-name-history! + stop-solver-process!) ; ; Instance analysis functions ; (provide is-sat? is-unsat?) @@ -70,7 +72,6 @@ (prefix-out forge: (struct-out Range)) (prefix-out forge: (struct-out Scope)) (prefix-out forge: (struct-out Bound)) - (prefix-out forge: (struct-out Options)) (prefix-out forge: (struct-out State)) (prefix-out forge: (struct-out Run-spec)) (prefix-out forge: (struct-out Run)) @@ -309,23 +310,23 @@ ; no rel, one rel, two rel, lone rel [(node/formula/multiplicity info mult rel) ; is it safe to use the info from above here? - (let ([rel-card (node/int/op/card info (list rel))]) + (let ([rel-card (node/int/op-on-exprs/card info (list rel))]) (do-bind (match mult - ['no (node/formula/op/= info (list rel none))] - ['one (node/formula/op/int= info (list rel-card 1))] - ['two (node/formula/op/int= info (list rel-card 2))] + ['no (node/formula/op-on-exprs/= info (list rel none))] + ['one (node/formula/op-on-ints/int= info (list rel-card 1))] + ['two (node/formula/op-on-ints/int= info (list rel-card 2))] ['lone - (node/formula/op/|| info - (list (node/formula/op/int< info (list rel-card 1)) - (node/formula/op/int= info (list rel-card 1))))]) + (node/formula/op-on-formulas/|| info + (list (node/formula/op-on-ints/int< info (list rel-card 1)) + (node/formula/op-on-ints/int= info (list rel-card 1))))]) scope bound))] ; (= (card rel) n) - [(node/formula/op/int= eq-info (list left right)) + [(node/formula/op-on-ints/int= eq-info (list left right)) (match left - [(node/int/op/card c-info (list left-rel)) + [(node/int/op-on-exprs/card c-info (list left-rel)) (let* ([exact (safe-fast-eval-int-expr right (Bound-tbindings bound) SUFFICIENT-INT-BOUND)] [new-scope (if (equal? (relation-name left-rel) "Int") (update-bitwidth scope exact) @@ -334,26 +335,26 @@ [_ (fail "int=")])] ; (<= (card rel) upper) - [(node/formula/op/|| or-info - (list (node/formula/op/int< lt-info (list lt-left lt-right)) - (node/formula/op/int= eq-info (list eq-left eq-right)))) + [(node/formula/op-on-formulas/|| or-info + (list (node/formula/op-on-ints/int< lt-info (list lt-left lt-right)) + (node/formula/op-on-ints/int= eq-info (list eq-left eq-right)))) (unless (and (equal? lt-left eq-left) (equal? lt-right eq-right)) (fail "int<=")) (match lt-left - [(node/int/op/card c-info (list left-rel)) + [(node/int/op-on-exprs/card c-info (list left-rel)) (let* ([upper-val (safe-fast-eval-int-expr lt-right (Bound-tbindings bound) SUFFICIENT-INT-BOUND)] [new-scope (update-int-bound scope left-rel (Range 0 upper-val))]) (values new-scope bound))] [_ (fail "int<=")])] ; (<= lower (card-rel)) - [(node/formula/op/|| or-info - (list (node/formula/op/int< lt-info (list lt-left lt-right)) - (node/formula/op/int= eq-info (list eq-left eq-right)))) + [(node/formula/op-on-formulas/|| or-info + (list (node/formula/op-on-ints/int< lt-info (list lt-left lt-right)) + (node/formula/op-on-ints/int= eq-info (list eq-left eq-right)))) (unless (and (equal? lt-left eq-left) (equal? lt-right eq-right)) (fail "int>=")) (match lt-right - [(node/int/op/card c-info (list right-rel)) + [(node/int/op-on-exprs/card c-info (list right-rel)) (let* ([lower-val (safe-fast-eval-int-expr lt-left (Bound-tbindings bound) SUFFICIENT-INT-BOUND)] [new-scope (update-int-bound scope right-rel (Range lower-val 0))]) (values new-scope bound))] @@ -366,9 +367,9 @@ [(node/breaking/break _ breaker) breaker] [_ (fail "is")])) (match left - [(? node/expr/relation?) (break left right)] - [(node/expr/op/~ info arity (list left-rel)) - (break left-rel (get-co right))] + [(? node/expr/relation?) (break-rel left right)] + [(node/expr/op-on-exprs/~ info arity (list left-rel)) + (break-rel left-rel (get-co right))] [_ (fail "is")]) (values scope bound)] @@ -377,14 +378,14 @@ ; rel = expr [absolute bound] ; (atom . rel) = expr [partial bound, indexed by atom] - [(node/formula/op/= info (list left right)) - (inst-check bind node/formula/op/=) + [(node/formula/op-on-exprs/= info (list left right)) + (inst-check bind node/formula/op-on-exprs/=) (cond [(node/expr/relation? left) (let ([tups (safe-fast-eval-exp right (Bound-tbindings bound) SUFFICIENT-INT-BOUND)]) (define new-scope scope) (define new-bound (update-bindings bound left tups tups #:node bind)) (values new-scope new-bound))] - [(and (node/expr/op/join? left) + [(and (node/expr/op-on-exprs/join? left) (list? (node/expr/op-children left)) (equal? 2 (length (node/expr/op-children left))) (node/expr/atom? (first (node/expr/op-children left))) @@ -401,8 +402,8 @@ ; expr in rel ; (atom . rel) in/ni expr [partial bound, indexed by atom] ; note: "ni" is handled by desugaring to "in" with reversed arguments. - [(node/formula/op/in info (list left right)) - (inst-check bind node/formula/op/in) + [(node/formula/op-on-exprs/in info (list left right)) + (inst-check bind node/formula/op-on-exprs/in) (cond ; rel in expr [(node/expr/relation? left) @@ -410,7 +411,7 @@ (define new-bound (update-bindings bound left (@set) tups #:node bind)) (values scope new-bound))] ; atom.rel in expr - [(and (node/expr/op/join? left) + [(and (node/expr/op-on-exprs/join? left) (list? (node/expr/op-children left)) (equal? 2 (length (node/expr/op-children left))) (node/expr/atom? (first (node/expr/op-children left))) @@ -426,7 +427,7 @@ (define new-bound (update-bindings bound right tups #:node bind)) (values scope new-bound))] ; atom.rel ni expr - [(and (node/expr/op/join? right) + [(and (node/expr/op-on-exprs/join? right) (list? (node/expr/op-children right)) (equal? 2 (length (node/expr/op-children right))) (node/expr/atom? (first (node/expr/op-children right))) @@ -450,6 +451,7 @@ (define-values (new-scope new-bound) (for/fold ([scope scope] [bound bound]) ([bind binds]) + ;(printf "*** In inst-func do-bind ~a~n" bind) (do-bind bind scope bound))) (values new-scope new-bound)) @@ -481,7 +483,7 @@ (->* () (#:sigs (listof Sig?) #:relations (listof Relation?) - #:options (or/c Options? #f)) + #:options (or/c (hash/c symbol? any/c) #f)) State?) (define sigs-with-Int (append sigs-input (list Int))) @@ -700,7 +702,7 @@ #:target (or/c Target? #f) #:sigs (listof Sig?) #:relations (listof Relation?) - #:options (or/c Options? #f)) + #:options (or/c (hash/c symbol? any/c) #f)) Run?) (define state (make-state-for-run #:sigs sigs-input @@ -768,7 +770,7 @@ #:target (or/c Target? #f) #:sigs (listof Sig?) #:relations (listof Relation?) - #:options (or/c Options? #f)) + #:options (or/c (hash/c symbol? any/c) #f)) Run?) (let ([state (make-state-for-run #:sigs sigs-input #:relations relations-input @@ -860,8 +862,8 @@ #:bounds (or/c Inst? (listof (or/c Inst? node/formula))) #:target (or/c Target? #f) #:sigs (listof Sig?) - #:relations (listof Relation?) - #:options (or/c Options? #f)) + #:relations (listof Relation?) + #:options (or/c (hash/c symbol? any/c) #f)) void?) (let ([state (make-state-for-run #:sigs sigs-input #:relations relations-input @@ -1067,62 +1069,53 @@ ; state-set-option :: State, Symbol, Symbol -> State ; Sets option to value for state. -(define (state-set-option state option value) +(define/contract (state-set-option state option value #:original-path [original-path #f]) + (->* (State? symbol? any/c) + (#:original-path (or/c path-string? #f)) + State?) (define options (State-options state)) + (unless (hash-ref option-types option #f) + (raise-user-error (format "No such option: ~a" option))) (unless ((hash-ref option-types option) value) (raise-user-error (format "Setting option ~a requires ~a; received ~a" - option (hash-ref option-types option) value))) + option (hash-ref option-types-names option) value))) - (define new-options + (define (translate-single-path p) + (path->string (build-path original-path (string->path p)))) + + (define/contract new-options (hash/c symbol? any/c) (cond + [(equal? option 'eval-language) + (unless (or (equal? value 'surface) (equal? value 'core)) + (raise-user-error (format "Invalid evaluator language ~a; must be surface or core.~n" + value))) + (hash-set options option value)] [(equal? option 'solver) - (struct-copy Options options - [solver value])] - [(equal? option 'backend) - (struct-copy Options options - [backend value])] - [(equal? option 'sb) - (struct-copy Options options - [sb value])] - [(equal? option 'coregranularity) - (struct-copy Options options - [coregranularity value])] - [(equal? option 'logtranslation) - (struct-copy Options options - [logtranslation value])] - [(equal? option 'local_necessity) - (struct-copy Options options - [local_necessity value])] + (hash-set options 'solver (if (and (string? value) original-path) + (path->string (build-path original-path (string->path value))) + value))] [(equal? option 'min_tracelength) (let ([max-trace-length (get-option state 'max_tracelength)]) (if (> value max-trace-length) (raise-user-error (format "Cannot set min_tracelength to ~a because min_tracelength cannot be greater than max_tracelength. Current max_tracelength is ~a." value max-trace-length)) - (struct-copy Options options - [min_tracelength value])))] + (hash-set options option value)))] [(equal? option 'max_tracelength) (let ([min-trace-length (get-option state 'min_tracelength)]) (if (< value min-trace-length) (raise-user-error (format "Cannot set max_tracelength to ~a because max_tracelength cannot be less than min_tracelength. Current min_tracelength is ~a." value min-trace-length)) - (struct-copy Options options - [max_tracelength value])))] - [(equal? option 'problem_type) - (struct-copy Options options - [problem_type value])] - [(equal? option 'target_mode) - (struct-copy Options options - [target_mode value])] - [(equal? option 'core_minimization) - (struct-copy Options options - [core_minimization value])] - [(equal? option 'skolem_depth) - (struct-copy Options options - [skolem_depth value])] + (hash-set options option value)))] [(equal? option 'run_sterling) - (struct-copy Options options - [run_sterling value])])) + (hash-set options 'run_sterling (cond + [(and (string? value) original-path) + (translate-single-path value)] + [(and (list? value) original-path) + (map translate-single-path value)] + [else value]))] + [else + (hash-set options option value)])) (struct-copy State state - [options new-options])) + [options new-options])) \ No newline at end of file diff --git a/forge/sigs-structs.rkt b/forge/sigs-structs.rkt index 80751a89f..551ca30c9 100644 --- a/forge/sigs-structs.rkt +++ b/forge/sigs-structs.rkt @@ -1,24 +1,34 @@ -#lang racket/base +#lang typed/racket/base/optional ; Structures and helper functions for running Forge, along with some constants and ; configuration code (e.g., most options). -(require (except-in forge/lang/ast -> set) +(require forge/types/ast-adapter forge/lang/bounds forge/breaks - (only-in forge/shared get-verbosity VERBOSITY_HIGH)) -(require (prefix-in @ (only-in racket hash not +)) - (only-in racket nonnegative-integer? thunk curry) + forge/shared + ; Import AST constructors needed for macros and helpers + (only-in forge/lang/ast + &&/info ||/info =>/info !/info =/info in/info &/info ->/info + int>/info |int Any String)] + [deparse (-> Any String)]) +(require (prefix-in @ (only-in racket hash not +)) + (only-in racket thunk curry) (prefix-in @ racket/set)) -(require racket/contract - racket/match +(require racket/match racket/set racket/list) (require (for-syntax racket/base racket/syntax syntax/srcloc syntax/parse)) -(require (prefix-in tree: forge/utils/lazy-tree)) +(require forge/types/lazy-tree-adapter) (require syntax/srcloc) -(require (prefix-in pardinus: (only-in forge/pardinus-cli/server/kks clear cmd))) -(require (prefix-in cvc5: (only-in forge/solver-specific/smtlib-shared smtlib-display))) +; Typed imports for solver-specific functions +(require/typed forge/pardinus-cli/server/kks + [pardinus-port (Parameterof Output-Port)] + [(clear pardinus-clear) (-> Symbol Void)]) +(require/typed forge/solver-specific/smtlib-shared + [(smtlib-display cvc5-smtlib-display) (-> Output-Port String Void)]) (provide (all-defined-out)) @@ -31,23 +41,26 @@ ; Results from solver ; For a non-temporal result, just take the first element of instances -(struct/contract Sat ( - [instances any/c] ; list of hashes - [stats any/c] ; association list - [metadata any/c] ; association list +(struct Sat ( + [instances : Any] ; list of hashes + [stats : Any] ; association list + [metadata : Any] ; association list ) #:transparent) -(struct/contract Unsat ( - [core (or/c #f (listof any/c))]; list-of-Formula-string-or-formulaID)] - [stats any/c] ; association list - [kind symbol?] ; symbol +(struct Unsat ( + ; If there's a core, there are two cases per component: + ; (1) a node: a known formula + ; (2) a string: an unknown formula (Kodkod couldn't map back this part of the core) + [core : (U False (Listof (U node String)))] + [stats : Any] ; association list + [kind : Symbol] ; symbol ) #:transparent) ; For SMT backends only, may yield "unknown" -(struct/contract Unknown ( - [stats any/c] ; data on performance, translation, etc. - [metadata any/c] ; any solver-specific data provided about the unknown result - )#:transparent) +(struct Unknown ( + [stats : Any] ; data on performance, translation, etc. + [metadata : Any] ; any solver-specific data provided about the unknown result + ) #:transparent) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Sigs and Relations enrich the "relation" AST node with @@ -56,26 +69,20 @@ ; DO NOT EXTEND THIS STRUCT (struct Sig node/expr/relation ( - name ; symbol? - one ; boolean? - lone ; boolean? - abstract ; boolean? - extends ; (or/c Sig? #f) - ) #:transparent - #:methods gen:custom-write - [(define (write-proc self port mode) - (fprintf port "(Sig ~a)" (Sig-name self)))]) + [name : Symbol] + [one : Boolean] + [lone : Boolean] + [abstract : Boolean] + [extends : (U Sig False)] + ) #:transparent) ; DO NOT EXTEND THIS STRUCT ; TODO: really this should be called "Field", since it represents that at the surface/core level. (struct Relation node/expr/relation ( - name ; symbol? - sigs-thunks ; (listof (-> Sig?)) - breaker ; (or/c node/breaking/break? #f) - ) #:transparent - #:methods gen:custom-write - [(define (write-proc self port mode) - (fprintf port "(Relation ~a)" (Relation-name self)))]) + [name : Symbol] + [sigs-thunks : (Listof (-> Sig))] + [breaker : (U node/breaking/break False)] + ) #:transparent) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -102,18 +109,18 @@ ; the Bounds struct defined here. At some point, we can perhaps condense these into a single IR. ; A Range contains the minimum and maximum scope for a relation. -(struct/contract Range ( - [lower (or/c nonnegative-integer? #f)] - [upper (or/c nonnegative-integer? #f)] +(struct Range ( + [lower : (U Nonnegative-Integer False)] + [upper : (U Nonnegative-Integer False)] ) #:transparent) ; A Scope represents the numeric size limitations on sigs in a run. ; This includes the range of possible bitwidths, and a default range ; to use for sigs whose scope is undefined. -(struct/contract Scope ( - [default-scope (or/c Range? #f)] - [bitwidth (or/c nonnegative-integer? #f)] - [sig-scopes (hash/c symbol? Range?)] +(struct Scope ( + [default-scope : (U Range False)] + [bitwidth : (U Nonnegative-Integer False)] + [sig-scopes : (HashTable Symbol Range)] ) #:transparent) ; A PiecewiseBound represents an atom-indexed, incomplete partial bound. E.g., one might write: @@ -121,132 +128,117 @@ ; `Bob.father in `Charlie + `David ; Note that a piecewise bound is not the same as a "partial" bound; a partial bound is complete, ; in the sense that only one bind declaration is possible for that relation. -(struct/contract PiecewiseBound ( - [tuples (listof any/c)] ; first element is the indexed atom in the original piecewise bounds - [atoms (listof any/c)] ; which atoms have been bound? (distinguish "given none" from "none given") - [operator (one-of/c '= 'in 'ni)] ; which operator mode? +(struct PiecewiseBound ( + [tuples : (Listof Tuple)] ; first element is the indexed atom in the original piecewise bounds + [atoms : (Listof FAtom)] ; which atoms have been bound? (distinguish "given none" from "none given") + [operator : (U '= 'in 'ni)] ; which operator mode? ) #:transparent) -(define PiecewiseBounds/c (hash/c node/expr/relation? PiecewiseBound?)) +(define-type PiecewiseBounds (HashTable node/expr/relation PiecewiseBound)) + +; Type for arguments to helper predicates and functions: expressions, int-expressions, or Racket integers +(define-type HelperArg (U Integer node/expr node/int)) +; Type for a helper predicate: either a procedure (n-arg, or 0-arg before use) or a node/formula (0-arg after use) +(define-type HelperPred (U (->* () (#:info (U nodeinfo False)) #:rest HelperArg node/formula) node/formula)) +; Type for a helper function: always a procedure returning node/expr +(define-type HelperFun (->* () (#:info (U nodeinfo False)) #:rest HelperArg node/expr)) ; A Bound represents the set-based size limitations on sigs and relations in a run. ; Information from Scope(s) and Bounds(s) will be combined only once a run executes. -(struct/contract Bound ( +(struct Bound ( ; pbindings: partial (but complete) bindings for a given relation - [pbindings (hash/c node/expr/relation? sbound?)] + [pbindings : (HashTable node/expr/relation sbound)] ; tbindings: total (and complete) bindings for a given relation; also known as an exact bound. - [tbindings (hash/c node/expr/relation? any/c)] + [tbindings : (HashTable node/expr/relation Any)] ; incomplete bindings for a given relation, indexed by first column - [piecewise PiecewiseBounds/c] + [piecewise : PiecewiseBounds] ; original AST nodes, for improving errors, indexed by relation - [orig-nodes (hash/c node/expr/relation? (listof node?))] + [orig-nodes : (HashTable node/expr/relation (Listof node))] ) #:transparent) - + ; An Inst function is an accumulator of bounds information. It doesn't (necessarily) ; contain the full information about a run's scope, bounds, etc. Rather, it allows for ; the aggregation of this info across multiple `inst` declarations. -(struct/contract Inst ( - [func (Scope? Bound? . -> . (values Scope? Bound?))] +(struct Inst ( + [func : (-> Scope Bound (Values Scope Bound))] ) #:transparent) ; A Target describes the goal of a target-oriented model-finding run. -(struct/contract Target ( - [target (or/c - ; Original forge/core partial-instance notation - (hash/c symbol? (listof (listof (or/c number? symbol?)))) - ; `inst` notation from #lang forge - Inst?)] +(define-type TargetMode (U 'close_noretarget 'far_noretarget 'close_retarget 'far_retarget 'hamming_cover)) +(struct Target ( + [target : (U (HashTable Symbol (Listof (Listof (U Number Symbol)))) Inst)] ; This is not the same as option target_mode, which provides a global default. ; Rather, this is per target. - [distance (or/c 'close_noretarget 'far_noretarget 'close_retarget 'far_retarget 'hamming_cover)] + [distance : TargetMode] ) #:transparent) -(struct/contract expression-type ( - [type (listof (listof symbol?))] - [multiplicity (or/c 'set 'lone 'one 'no 'func 'pfunc)] - [temporal-variance (or/c boolean? string?)] - [top-level-types (listof (or/c 'Int 'univ))] +(define-type Multiplicity (U 'set 'lone 'one 'no 'func 'pfunc)) +(struct expression-type ( + [type : (Listof (Listof Symbol))] + [multiplicity : Multiplicity] + [temporal-variance : (U Boolean String)] + [top-level-types : (Listof (U 'Int 'univ))] ) #:transparent) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; If adding new option fields, remember to update all of: ; -- DEFAULT_OPTIONS -; -- symbol->proc ; -- option-types ; -- option-types-names -; -- state-set-option (in sigs.rkt) -(struct/contract Options ( - [eval-language symbol?] - [solver (or/c string? symbol?)] - [backend symbol?] - [sb nonnegative-integer?] - [coregranularity nonnegative-integer?] - [logtranslation nonnegative-integer?] - [min_tracelength nonnegative-integer?] - [max_tracelength nonnegative-integer?] - [problem_type symbol?] - [target_mode symbol?] - [core_minimization symbol?] - [skolem_depth integer?] ; allow -1 (disable Skolemization entirely) - [local_necessity symbol?] - [run_sterling (or/c string? symbol? (listof string?))] - [sterling_port nonnegative-integer?] - [engine_verbosity nonnegative-integer?] - [test_keep symbol?] - [no_overflow symbol?] - [java_exe_location (or/c false/c string?)] +; -- state-set-option (in sigs.rkt or sigs-functional.rkt) +; Options are stored as a hash for flexibility; type safety is provided +; via case-> typing on get-option for known option keys. + +(struct State ( + [sigs : (HashTable Symbol Sig)] + [sig-order : (Listof Symbol)] + [relations : (HashTable Symbol Relation)] + [relation-order : (Listof Symbol)] + [pred-map : (HashTable Symbol HelperPred)] + [fun-map : (HashTable Symbol HelperFun)] + [const-map : (HashTable Symbol node)] + [inst-map : (HashTable Symbol Inst)] + [options : (HashTable Symbol Any)] ; hash-based options with case-> typed accessor + [runmap : (HashTable Symbol Any)] ; TODO: Any -> Run ) #:transparent) -(struct/contract State ( - [sigs (hash/c symbol? Sig?)] - [sig-order (listof symbol?)] - [relations (hash/c symbol? Relation?)] - [relation-order (listof symbol?)] - [pred-map (hash/c symbol? (or/c (unconstrained-domain-> node/formula?) - node/formula?))] - [fun-map (hash/c symbol? (unconstrained-domain-> node?))] - [const-map (hash/c symbol? node?)] - [inst-map (hash/c symbol? Inst?)] - [options Options?] - [runmap (hash/c symbol? any/c)] ; TODO: any/c -> Run? +(struct Run-spec ( + [state : State] ; Model state at the point of this run + [preds : (Listof node/formula)] ; predicates to run, conjoined + [scope : Scope] ; Numeric scope(s) + [bounds : Bound] ; set-based upper and lower bounds + [target : (U Target False)] ; target-oriented model finding ) #:transparent) -(struct/contract Run-spec ( - [state State?] ; Model state at the point of this run - [preds (listof node/formula?)] ; predicates to run, conjoined - [scope Scope?] ; Numeric scope(s) - [bounds Bound?] ; set-based upper and lower bounds - [target (or/c Target? #f)] ; target-oriented model finding +(struct Server-ports ( + [stdin : Output-Port] + [stdout : Input-Port] + [stderr : Input-Port] + [shutdown : (-> Void)] + [is-running? : (-> Boolean)] ) #:transparent) -(struct Server-ports ( - stdin - stdout - stderr - shutdown - is-running?) #:transparent) - -(struct/contract Kodkod-current ( - [[formula #:mutable] nonnegative-integer?] - [[expression #:mutable] nonnegative-integer?] - [[int #:mutable] nonnegative-integer?])) - -(struct/contract Run ( - [name symbol?] - [command syntax?] - [run-spec Run-spec?] +(struct Kodkod-current ( + [formula : Nonnegative-Integer] + [expression : Nonnegative-Integer] + [int : Nonnegative-Integer]) #:mutable) + +(struct Run ( + [name : Symbol] + [command : Syntax] + [run-spec : Run-spec] ; This is the *start* of the exploration tree. - [result tree:node?] - [server-ports Server-ports?] - [atoms (listof (or/c symbol? number?))] - [kodkod-currents Kodkod-current?] - [kodkod-bounds (listof any/c)] + [result : tree:node] + [server-ports : Server-ports] + [atoms : (Listof FAtom)] + [kodkod-currents : Kodkod-current] + [kodkod-bounds : (Listof Any)] ; This is Sterling's current cursor into the exploration tree. ; It is mutated whenever Sterling asks for a new instance. We keep this ; separately, since there may be multiple cursors into the lazy tree if ; the run is also being processed in a script, but the programmatic cursor - ; and the Sterling cursor should not interfere. - [last-sterling-instance (box/c (or/c Sat? Unsat? Unknown? false/c))] + ; and the Sterling cursor should not interfere. + [last-sterling-instance : (Boxof (U Sat Unsat Unknown False))] ) #:transparent) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -255,51 +247,58 @@ (define DEFAULT-BITWIDTH 4) (define DEFAULT-SIG-SCOPE (Range 0 4)) + ; an engine_verbosity of 1 logs SEVERE level in the Java engine; ; this will send back info about crashes, but shouldn't spam (and possibly overfill) stderr. -(define DEFAULT-OPTIONS (Options 'surface 'SAT4J 'pardinus 20 0 0 1 5 'default - 'close_noretarget 'fast 0 'off 'on 0 1 'first 'false #f)) +(define DEFAULT-OPTIONS : (HashTable Symbol Any) + (hash 'eval-language 'surface + 'solver 'SAT4J + 'backend 'pardinus + 'sb 20 + 'coregranularity 0 + 'logtranslation 0 + 'min_tracelength 1 + 'max_tracelength 5 + 'problem_type 'default + 'target_mode 'close_noretarget + 'core_minimization 'fast + 'skolem_depth 0 + 'local_necessity 'off + 'run_sterling 'on + 'sterling_port 0 + 'sterling_static_port 0 + 'engine_verbosity 1 + 'test_keep 'first + 'no_overflow 'false + 'java_exe_location #f)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;; Constants ;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(define-syntax Int (lambda (stx) (syntax-case stx () - [val (identifier? (syntax val)) (quasisyntax/loc stx (Sig (nodeinfo #,(build-source-location stx) 'checklangplaceholder #f) 1 "Int" (thunk '("Int")) "univ" #f 'Int #f #f #f #f))]))) -(define-syntax succ (lambda (stx) (syntax-case stx () - [val (identifier? (syntax val)) (quasisyntax/loc stx (Relation (nodeinfo #,(build-source-location stx) 'checklangplaceholder #f) 2 "succ" (thunk '("Int" "Int")) "Int" #f 'succ (list (thunk Int) (thunk Int)) #f))]))) +; Built-in Int sig and succ relation - defined as values with empty nodeinfo +; (source location tracking not needed for built-in constants) +(define Int : Sig (Sig empty-nodeinfo 1 "Int" (thunk '("Int")) "univ" #f 'Int #f #f #f #f)) +(define succ : Relation (Relation empty-nodeinfo 2 "succ" (thunk '("Int" "Int")) "Int" #f 'succ (list (thunk Int) (thunk Int)) #f)) +; These use the typed AST functional interface +(: max (-> node/expr node/int)) (define (max s-int) - (sum (- s-int (join (^ succ) s-int)))) + (sum/func (-/func s-int (join/func (^/func succ) s-int)))) +(: min (-> node/expr node/int)) (define (min s-int) - (sum (- s-int (join s-int (^ succ))))) - -(define symbol->proc - (hash 'eval-language Options-eval-language - 'solver Options-solver - 'backend Options-backend - 'sb Options-sb - 'coregranularity Options-coregranularity - 'logtranslation Options-logtranslation - 'min_tracelength Options-min_tracelength - 'max_tracelength Options-max_tracelength - 'problem_type Options-problem_type - 'target_mode Options-target_mode - 'core_minimization Options-core_minimization - 'skolem_depth Options-skolem_depth - 'local_necessity Options-local_necessity - 'run_sterling Options-run_sterling - 'sterling_port Options-sterling_port - 'engine_verbosity Options-engine_verbosity - 'test_keep Options-test_keep - 'no_overflow Options-no_overflow - 'java_exe_location Options-java_exe_location)) + (sum/func (-/func s-int (join/func s-int (^/func succ))))) +; Helper for option type checking - returns a predicate that checks membership +(: oneof-pred (-> (Listof Symbol) (-> Any Boolean))) (define (oneof-pred lst) - (lambda (x) (member x lst))) + (lambda ([x : Any]) (if (member x lst) #t #f))) + +(define VALID_BUILTIN_SOLVERS '(SAT4J Glucose MiniSat MiniSatProver PMaxSAT4J)) (define option-types (hash 'eval-language symbol? - 'solver (lambda (x) (or (symbol? x) (string? x))) ; allow for custom solver path + ; allow for custom solver path given as a string + 'solver (lambda ([x : Any]) (or (member x VALID_BUILTIN_SOLVERS) (string? x))) 'backend symbol? ; 'verbosity exact-nonnegative-integer? 'sb exact-nonnegative-integer? @@ -317,6 +316,7 @@ (and (list? x) (andmap (lambda (ele) (string? ele)) x)))) 'sterling_port exact-nonnegative-integer? + 'sterling_static_port exact-nonnegative-integer? 'engine_verbosity exact-nonnegative-integer? 'test_keep (oneof-pred '(first last)) 'no_overflow (oneof-pred '(false true)) @@ -324,7 +324,7 @@ (define option-types-names (hash 'eval-language "symbol" - 'solver "symbol or string" + 'solver (format "one of ~a or a path string" VALID_BUILTIN_SOLVERS) 'backend "symbol" 'sb "non-negative integer" 'coregranularity "non-negative integer" @@ -338,6 +338,7 @@ 'local_necessity "symbol" 'run_sterling "symbol, string, or sequence of strings" 'sterling_port "non-negative integer" + 'sterling_static_port "non-negative integer" 'engine_verbosity "non-negative integer" 'test_keep "one of: first or last" 'no_overflow "one of: false or true" @@ -352,11 +353,11 @@ (define init-sig-order (list 'Int)) (define init-relations (hash 'succ succ)) (define init-relation-order (list 'succ)) -(define init-pred-map (@hash)) -(define init-fun-map (@hash)) -(define init-const-map (@hash)) -(define init-inst-map (@hash)) -(define init-runmap (@hash)) +(define init-pred-map : (HashTable Symbol HelperPred) (@hash)) +(define init-fun-map : (HashTable Symbol HelperFun) (@hash)) +(define init-const-map : (HashTable Symbol node) (@hash)) +(define init-inst-map : (HashTable Symbol Inst) (@hash)) +(define init-runmap : (HashTable Symbol Any) (@hash)) (define init-options DEFAULT-OPTIONS) (define init-state (State init-sigs init-sig-order init-relations init-relation-order @@ -404,9 +405,13 @@ is-unsat? :: Run -> boolean Returns whether the given run resulted in sat or unsat, respectively. |# +; Type alias for common parameter type +(define-type Run-or-State (U Run Run-spec State)) + ; get-state :: Run-or-State -> State ; If run-or-state is a State, returns it; ; if it is a Run-spec or a Run, then returns its state. +(: get-state (-> Run-or-State State)) (define (get-state run-or-state) (cond [(Run? run-or-state) (Run-spec-state (Run-run-spec run-or-state))] @@ -416,6 +421,7 @@ Returns whether the given run resulted in sat or unsat, respectively. run-or-state])) ; get-run-spec :: Run-or-State -> Run-spec +(: get-run-spec (-> (U Run Run-spec) Run-spec)) (define (get-run-spec run-or-state) (cond [(Run? run-or-state) (Run-run-spec run-or-state)] @@ -424,8 +430,9 @@ Returns whether the given run resulted in sat or unsat, respectively. ; get-sig :: Run-or-State (|| Symbol Sig*) -> Sig ; Returns the Sig of a given name/ast-relation from a run/state. +(: get-sig (-> Run-or-State (U Symbol node/expr/relation) (U Sig False))) (define (get-sig run-or-state sig-name-or-rel) - (define sig-name + (define sig-name : Symbol (cond [(symbol? sig-name-or-rel) sig-name-or-rel] [(Sig? sig-name-or-rel) (Sig-name sig-name-or-rel)] @@ -440,112 +447,128 @@ Returns whether the given run resulted in sat or unsat, respectively. ; get-sigs :: Run-or-State, Relation*? -> List ; If a relation is provided, returns the column sigs; ; otherwise, returns the Sigs of the given relation in a run/state. +(: get-sigs (->* (Run-or-State) ((U False node/expr/relation)) (Listof Sig))) (define (get-sigs run-or-state [relation #f]) (define state (get-state run-or-state)) (if relation - (map (compose (curry get-sig state) (lambda (sig-thunk) (sig-thunk))) - (Relation-sigs-thunks (get-relation state relation))) - (map (curry hash-ref (State-sigs state)) + (map (lambda ([sig-thunk : (-> Sig)]) (assert (get-sig state (sig-thunk)) Sig?)) + (Relation-sigs-thunks (assert (get-relation state relation) Relation?))) + (map (lambda ([s : Symbol]) (hash-ref (State-sigs state) s)) (State-sig-order state)))) ; get-top-level-sigs :: Run-or-State -> List ; Returns the Sigs in a run/state that do not extend another Sig. +(: get-top-level-sigs (-> Run-or-State (Listof Sig))) (define (get-top-level-sigs run-or-state) - (filter (compose @not Sig-extends) (get-sigs run-or-state))) + (filter (lambda ([s : Sig]) (@not (Sig-extends s))) (get-sigs run-or-state))) ; get-fields :: Run-or-State Sig* -> List ; Returns the relations whose first sig is the given sig. +(: get-fields (-> Run-or-State (U Sig node/expr/relation) (Listof Relation))) (define (get-fields run-or-state sig-or-rel) (define state (get-state run-or-state)) (define sig (get-sig state sig-or-rel)) (define relations (get-relations state)) - (for/list ([relation relations] + (for/list ([relation : Relation relations] #:when (equal? (first (get-sigs state relation)) sig)) relation)) ; get-relation :: Run-or-State, (|| Symbol Relation*) -> Relation ; Returns the Relation of a given name/ast-relation from a run/state. +(: get-relation (-> Run-or-State (U Symbol node/expr/relation) (U Relation False))) (define (get-relation run-or-state relation-name-or-rel) - (define name + (define name : Symbol (cond [(symbol? relation-name-or-rel) relation-name-or-rel] [(node/expr/relation? relation-name-or-rel) (string->symbol (relation-name relation-name-or-rel))] [(Relation? relation-name-or-rel) - (Relation-name relation-name-or-rel)])) + (Relation-name relation-name-or-rel)] + [else (error "get-relation: unexpected input")])) (cond [(hash-has-key? (State-relations (get-state run-or-state)) name) (hash-ref (State-relations (get-state run-or-state)) name)] [else #f])) ; get-relations :: Run-or-State -> List ; Returns the Relations in a run/state. +(: get-relations (-> Run-or-State (Listof Relation))) (define (get-relations run-or-state) (define state (get-state run-or-state)) - (map (curry hash-ref (State-relations state) ) + (map (lambda ([s : Symbol]) (hash-ref (State-relations state) s)) (State-relation-order state))) -; get-pred :: Run-or-State, Symbol -> Predicate -; Gets a predicate by name from a given state +; get-pred :: Run-or-State, Symbol -> HelperPred or #f +; Gets a predicate by name from a given state, or #f if not found. ; Note that this will return the procedure, not the macro (no stx loc capture) +(: get-pred (-> Run-or-State Symbol (U HelperPred False))) (define (get-pred run-or-state name) (define state (get-state run-or-state)) - (hash-ref (State-pred-map state) name)) + (hash-ref (State-pred-map state) name #f)) -; get-fun :: Run-or-State, Symbol -> Function -; Gets a function by name from a given state +; get-fun :: Run-or-State, Symbol -> HelperFun or #f +; Gets a function by name from a given state, or #f if not found. ; Note that this will return the procedure, not the macro (no stx loc capture) +(: get-fun (-> Run-or-State Symbol (U HelperFun False))) (define (get-fun run-or-state name) (define state (get-state run-or-state)) - (hash-ref (State-fun-map state) name)) + (hash-ref (State-fun-map state) name #f)) -; get-const :: Run-or-State, Symbol -> Constant -; Gets a constant by name from a given state +; get-const :: Run-or-State, Symbol -> Constant or #f +; Gets a constant by name from a given state, or #f if not found. +(: get-const (-> Run-or-State Symbol (U node False))) (define (get-const run-or-state name) (define state (get-state run-or-state)) - (hash-ref (State-const-map state) name)) + (hash-ref (State-const-map state) name #f)) -; get-inst :: Run-or-State, Symbol -> Inst -; Gets a inst by name from a given state +; get-inst :: Run-or-State, Symbol -> Inst or #f +; Gets an inst by name from a given state, or #f if not found. +(: get-inst (-> Run-or-State Symbol (U Inst False))) (define (get-inst run-or-state name) (define state (get-state run-or-state)) - (hash-ref (State-inst-map state) name)) + (hash-ref (State-inst-map state) name #f)) ; get-children :: Run-or-State, Sig* -> List ; Returns the children Sigs of a Sig. +(: get-children (-> Run-or-State (U Symbol Sig node/expr/relation) (Listof Sig))) (define (get-children run-or-state sig-or-rel) (define sigs (get-sigs run-or-state)) (define parent (get-sig run-or-state sig-or-rel)) - (filter (lambda (sig) (equal? (Sig-extends sig) parent)) sigs)) + (filter (lambda ([sig : Sig]) (equal? (Sig-extends sig) parent)) sigs)) ; get-result :: Run -> Stream ; Returns a stream of instances for the given run. +(: get-result (-> Run tree:node)) (define (get-result run) (Run-result run)) ; get-pbinding :: Run-spec, Sig -> (|| List> #f) ; Returns the partial binding in a given Run-spec ; for a given Sig, returning #f if none present. +(: get-sig-pbinding (-> Run-spec Sig Any)) (define (get-sig-pbinding run-spec sig) - (hash-ref (Bound-pbindings (Run-spec-bounds run-spec)) (Sig-name sig) #f)) + (hash-ref (Bound-pbindings (Run-spec-bounds run-spec)) sig #f)) ; get-pbinding :: Run-spec, Sig -> (|| List> #f) ; Returns the total binding in a given Run-spec ; for a given Sig, returning #f if none present. +(: get-sig-tbinding (-> Run-spec Sig Any)) (define (get-sig-tbinding run-spec sig) - (hash-ref (Bound-tbindings (Run-spec-bounds run-spec)) (Sig-name sig) #f)) + (hash-ref (Bound-tbindings (Run-spec-bounds run-spec)) sig #f)) ; get-pbinding :: Run-spec, Relation -> (|| List> #f) ; Returns the partial binding in a given Run-spec ; for a given Relation, returning #f if none present. +(: get-relation-pbinding (-> Run-spec Relation Any)) (define (get-relation-pbinding run-spec rel) - (hash-ref (Bound-pbindings (Run-spec-bounds run-spec)) (Relation-name rel) #f)) + (hash-ref (Bound-pbindings (Run-spec-bounds run-spec)) rel #f)) ; get-tbinding :: Run-spec, Relation -> (|| List> #f) ; Returns the total binding in a given Run-spec ; for a given Relation, returning #f if none present. +(: get-relation-tbinding (-> Run-spec Relation Any)) (define (get-relation-tbinding run-spec rel) - (hash-ref (Bound-tbindings (Run-spec-bounds run-spec)) (Relation-name rel) #f)) + (hash-ref (Bound-tbindings (Run-spec-bounds run-spec)) rel #f)) ; get-scope :: (|| Run-spec Scope), (|| Sig Symbol) -> Range ; Returns the run bound of a Sig, in order: @@ -553,14 +576,15 @@ Returns whether the given run resulted in sat or unsat, respectively. ; - if an explicit bound is given, returns it; ; - if a default bound is given; returns it; ; - return DEFAULT-SIG-BOUND +(: get-scope (-> (U Run-spec Scope) (U Sig Symbol) Range)) (define (get-scope run-spec-or-scope sig-or-name) - (define scope + (define scope : Scope (cond [(Scope? run-spec-or-scope) run-spec-or-scope] [(Run-spec? run-spec-or-scope) (Run-spec-scope run-spec-or-scope)])) - (define sig-name + (define sig-name : Symbol (cond [(Sig? sig-or-name) (Sig-name sig-or-name)] [(symbol? sig-or-name) @@ -568,18 +592,19 @@ Returns whether the given run resulted in sat or unsat, respectively. (if (equal? sig-name 'Int) (let* ([bitwidth (get-bitwidth scope)] - [num-ints (expt 2 bitwidth)]) + [num-ints (assert (expt 2 bitwidth) exact-nonnegative-integer?)]) (Range num-ints num-ints)) (let* ([scope-map (Scope-sig-scopes scope)] - [default-scope (or (Scope-default-scope scope) + [default-scope (or (Scope-default-scope scope) DEFAULT-SIG-SCOPE)]) - (hash-ref scope-map sig-name default-scope)))) + (hash-ref scope-map sig-name (lambda () default-scope))))) ; get-bitwidth :: (|| Run-spec Scope) -> int ; Returns the bitwidth for a run/scope, returning the ; DEFAULT-BITWIDTH if none is provided. +(: get-bitwidth (-> (U Run-spec Scope) Integer)) (define (get-bitwidth run-spec-or-scope) - (define scope + (define scope : Scope (cond [(Run-spec? run-spec-or-scope) (Run-spec-scope run-spec-or-scope)] [(Scope? run-spec-or-scope) @@ -591,11 +616,12 @@ Returns whether the given run resulted in sat or unsat, respectively. ; Returns a list of all sigs, then all relations, as ; their rels in the order they were defined; if given a Run, ; includes all of the additional relations used for individual -; atom access by the evaluator. +; atom access by the evaluator. ; Used for translate to kodkod-cli. +(: get-all-rels (-> (U Run Run-spec) (Listof node/expr/relation))) (define (get-all-rels run-or-spec) (cond [(Run-spec? run-or-spec) - + (let ([run-spec run-or-spec]) (append (get-sigs run-spec) @@ -609,46 +635,56 @@ Returns whether the given run resulted in sat or unsat, respectively. ; get-relation-map :: (|| Run Run-spec) -> Map ; Returns a map from names to AST-Relations. +(: get-relation-map (-> (U Run Run-spec) (HashTable String node/expr/relation))) (define (get-relation-map run-or-spec) - (for/hash ([rel (get-all-rels run-or-spec)]) + (for/hash : (HashTable String node/expr/relation) ([rel (get-all-rels run-or-spec)]) (values (relation-name rel) rel))) ; get-option :: Run-or-state Symbol -> Any +; Returns the value of an option from the state's options hash. +; Note: callers needing specific types should cast the result. +(: get-option (-> Run-or-State Symbol Any)) (define (get-option run-or-state option) (define state (get-state run-or-state)) - ((hash-ref symbol->proc option) (State-options state))) + (hash-ref (State-options state) option #f)) ; is-sat? :: Run -> boolean ; Checks if a given run result is 'sat +(: is-sat? (-> Run Boolean)) (define (is-sat? run) (define first-instance (tree:get-value (Run-result run))) (Sat? first-instance)) ; is-unsat? :: Run -> boolean ; Checks if a given run result is 'unsat +(: is-unsat? (-> Run Boolean)) (define (is-unsat? run) (define first-instance (tree:get-value (Run-result run))) (Unsat? first-instance)) ; is-unknown? :: Run -> boolean ; Checks if a given run result is 'unknown. This kind of result won't be given -; by all kinds of solver backends, but some do produce it. +; by all kinds of solver backends, but some do produce it. +(: is-unknown? (-> Run Boolean)) (define (is-unknown? run) (define first-instance (tree:get-value (Run-result run))) (Unknown? first-instance)) ; get-stdin :: Run -> input-port? +(: get-stdin (-> Run Output-Port)) (define (get-stdin run) (assert-is-running run) (Server-ports-stdin (Run-server-ports run))) ; get-stdout :: Run -> output-port? +(: get-stdout (-> Run Input-Port)) (define (get-stdout run) (assert-is-running run) (Server-ports-stdout (Run-server-ports run))) ; get-stderr :: Run -> output-port? +(: get-stderr (-> Run Input-Port)) (define (get-stderr run) (assert-is-running run) (Server-ports-stderr (Run-server-ports run))) @@ -657,20 +693,24 @@ Returns whether the given run resulted in sat or unsat, respectively. ; Per-run closed status ; Keep track of which runs have been closed via close-run +(: closed-run-names (Boxof (Listof Symbol))) (define closed-run-names (box (list))) ; Allows other modules to let this layer know a run is closed; this box ; is referenced by the instance generator for each run. +(: add-closed-run-name! (-> Symbol Void)) (define (add-closed-run-name! name) (set-box! closed-run-names (cons name (unbox closed-run-names)))) +(: is-run-closed? (-> (U Symbol Run) Boolean)) (define (is-run-closed? name-or-run) - (define (truthify x) (if x #t #f)) + (define (truthify [x : Any]) : Boolean (if x #t #f)) (truthify - (cond [(Run? name-or-run) + (cond [(Run? name-or-run) (member (Run-name name-or-run) (unbox closed-run-names))] [else (member name-or-run (unbox closed-run-names))]))) ; close-run :: Run -> void +(: close-run (-> Run Void)) (define (close-run run) (assert-is-running run) (when (>= (get-verbosity) VERBOSITY_HIGH) @@ -678,15 +718,17 @@ Returns whether the given run resulted in sat or unsat, respectively. ; Cut off this Run's ability to query the solver, since it's about to be closed ; This state is referenced in the instance-generator thunk (add-closed-run-name! (Run-name run)) - + ; Since we're using a single process now, send it instructions to clear this run ; Different backends will be cleared in different ways. (define backend (get-option (Run-run-spec run) 'backend)) (match backend ['pardinus - (pardinus:cmd [(get-stdin run)] (pardinus:clear (Run-name run)))] + (parameterize ([pardinus-port (get-stdin run)]) + (pardinus-clear (Run-name run)) + (flush-output (get-stdin run)))] ['smtlibtor - (cvc5:smtlib-display (get-stdin run) "(reset)")] + (cvc5-smtlib-display (get-stdin run) "(reset)")] [else (raise-forge-error #:msg (format "Unsupported backend when closing solver run: ~a" backend) #:context #f)])) @@ -694,9 +736,11 @@ Returns whether the given run resulted in sat or unsat, respectively. ; is-running :: Run -> Boolean ; This reports whether the _solver server_ is running; ; *NOT* whether an individual run is still open. +(: is-running? (-> Run Boolean)) (define (is-running? run) ((Server-ports-is-running? (Run-server-ports run)))) +(: assert-is-running (-> Run Void)) (define (assert-is-running run) (unless (is-running? run) (raise-user-error "Solver process is not running."))) @@ -749,24 +793,39 @@ Returns whether the given run resulted in sat or unsat, respectively. (=>/info (nodeinfo #,(build-source-location stx) 'checklangNoCheck #f) a b) (=>/info (nodeinfo #,(build-source-location stx) 'checklangNoCheck #f) b a)))])) +; Helper to convert int expressions to node/expr for ite +(: ensure-expr (-> Any nodeinfo node/expr)) +(define (ensure-expr x info) + (cond [(node/expr? x) (assert x node/expr?)] + [(node/int? x) (sing/func (assert x node/int?) #:info info)] + [(exact-integer? x) (sing/func (int/func x #:info info) #:info info)] + [else (raise-forge-error #:msg (format "Expected expression, got ~a" (pretty-type-of x)) + #:context info)])) + ; for ifte, use struct type to decide whether this is a formula (sugar) ; or expression form (which has its own AST node). Avoid exponential ; blowup from chained IFTEs by expanding to a chain of function calls. +; Uses typed AST functions for proper type safety. +(: ifte-disambiguator (-> nodeinfo Any Any Any (U node/formula node/expr))) (define (ifte-disambiguator info a b c) (unless (node/formula? a) (raise-forge-error - #:msg ("If-then-else needed a boolean-valued formula for its first argument; got ~a." (pretty-type-of a)) + #:msg (format "If-then-else needed a boolean-valued formula for its first argument; got ~a." (pretty-type-of a)) #:context a)) + ; Type narrowing: after the check above, a is known to be node/formula + (define a-fmla : node/formula (assert a node/formula?)) (cond - ; It's a formula if-then-else + ; It's a formula if-then-else: (a => b) && (!a => c) = (!a || b) && (a || c) [(and (node/formula? b) (node/formula? c)) - (&&/info info - (=>/info info a b) - (=>/info info (!/info info a) c))] + (define b-fmla : node/formula (assert b node/formula?)) + (define c-fmla : node/formula (assert c node/formula?)) + (&&/func (||/func (!/func a-fmla #:info info) b-fmla #:info info) + (||/func a-fmla c-fmla #:info info) + #:info info)] ; It's an expression if-then-else (note: mixing int-expr and rel-expr is OK) [(and (or (node/expr? b) (node/int? b) (integer? b)) (or (node/expr? c) (node/int? c) (integer? c))) - (ite/info info a b c)] + (ite/func info a-fmla (ensure-expr b info) (ensure-expr c info))] ; It's an error [else (raise-forge-error #:msg (format "If-then-else needed consistent types (either both formulas or both expressions) for its true and false branches, but got (~a) and (~a)." @@ -815,91 +874,93 @@ Returns whether the given run resulted in sat or unsat, respectively. (<:helper a b (nodeinfo #,(build-source-location stx) check-lang #f)))])) ; TODO: this only functions for binary relations +(: <:helper (-> node/expr node/expr nodeinfo node/expr)) (define (<:helper a b info) (domain-check<: a b (nodeinfo-loc info)) - (&/info info - b - (->/info info a univ))) + (&/func b (->/func a univ #:info info) #:info info)) -(define-syntax (:> stx) - (syntax-case stx () - [(_ a b) - (quasisyntax/loc stx +(define-syntax (:> stx) + (syntax-case stx () + [(_ a b) + (quasisyntax/loc stx (:>helper a b (nodeinfo #,(build-source-location stx) 'checklangNoCheck #f)))] - [(_ (#:lang check-lang) a b) - (quasisyntax/loc stx + [(_ (#:lang check-lang) a b) + (quasisyntax/loc stx (:>helper a b (nodeinfo #,(build-source-location stx) check-lang #f)))])) ; TODO: this only functions for binary relations +(: :>helper (-> node/expr node/expr nodeinfo node/expr)) (define (:>helper a b info) (domain-check:> a b (nodeinfo-loc info)) - (&/info info - a - (->/info info univ b))) + (&/func a (->/func univ b #:info info) #:info info)) -(define (domain-check<: a b loc) +(: domain-check<: (-> node/expr node/expr Any Void)) +(define (domain-check<: a b loc) (unless (equal? (node/expr-arity b) - (@+ 1 (node/expr-arity a))) + (@+ 1 (node/expr-arity a))) (raise-forge-error - #:msg (format "<: argument has incorrect arity (~a vs. ~a) in ~a <: ~a" + #:msg (format "<: argument has incorrect arity (~a vs. ~a) in ~a <: ~a" (node/expr-arity a) (node/expr-arity b) (deparse a) (deparse b)) #:context loc))) -(define (domain-check:> a b loc) +(: domain-check:> (-> node/expr node/expr Any Void)) +(define (domain-check:> a b loc) (unless (equal? (node/expr-arity a) - (@+ 1 (node/expr-arity b))) + (@+ 1 (node/expr-arity b))) (raise-forge-error - #:msg (format ":> argument has incorrect arity (~a vs. ~a) in ~a :> ~a" + #:msg (format ":> argument has incorrect arity (~a vs. ~a) in ~a :> ~a" (node/expr-arity a) (node/expr-arity b) (deparse a) (deparse b)) #:context loc))) -; A Field relation is functional if it has a functional breaker assigned. +; A Field relation is functional if it has a functional breaker assigned. +(: Relation-is-functional? (-> Any Boolean)) (define (Relation-is-functional? r) - (or (Relation-is? r '(pfunc func)))) + (if (Relation-is? r '(pfunc func)) #t #f)) +(: Relation-is? (-> Any (Listof Symbol) Boolean)) (define (Relation-is? r sym-list) (and (Relation? r) (node/breaking/break? (Relation-breaker r)) - (member (node/breaking/break-break (Relation-breaker r)) sym-list))) + (if (member (node/breaking/break-break (Relation-breaker r)) sym-list) #t #f))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; "Primification"-related utilities ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Do not check integer literals with respect to bitwidth for these backends -(define UNBOUNDED_INT_BACKENDS '(smtlibtor)) +(define UNBOUNDED_INT_BACKENDS : (Listof Symbol) '(smtlibtor)) ; Turn signame into list of all primsigs it contains ; Note we use Alloy-style "_remainder" names here; these aren't necessarily embodied in Forge -(define/contract (primify run-or-state raw-signame) - (-> (or/c Run? State? Run-spec?) (or/c symbol? string?) (listof symbol?)) - (let ([signame (cond [(string? raw-signame) (string->symbol raw-signame)] - [(Sig? raw-signame) (Sig-name raw-signame)] - [else raw-signame])]) - (cond [(equal? 'Int signame) +(: primify (-> (U Run Run-spec State) (U Symbol String) (Listof Symbol))) +(define (primify run-or-state raw-signame) + (let ([signame : Symbol (cond [(string? raw-signame) (string->symbol raw-signame)] + [(Sig? raw-signame) (Sig-name raw-signame)] + [else raw-signame])]) + (cond [(equal? 'Int signame) '(Int)] [(equal? 'univ signame) - (if (member (get-option (get-run-spec run-or-state) 'backend) UNBOUNDED_INT_BACKENDS) - (remove-duplicates (flatten (map (lambda (n) (primify run-or-state n)) (remove 'Int (map Sig-name (get-sigs run-or-state)))))) - (remove-duplicates (flatten (map (lambda (n) (primify run-or-state n)) (cons 'Int (map Sig-name (get-sigs run-or-state)))))))] + (if (member (get-option (get-run-spec (assert run-or-state (lambda (x) (or (Run? x) (Run-spec? x))))) 'backend) UNBOUNDED_INT_BACKENDS) + (remove-duplicates (append* (map (lambda ([n : Symbol]) (primify run-or-state n)) (remove 'Int (map Sig-name (get-sigs run-or-state)))))) + (remove-duplicates (append* (map (lambda ([n : Symbol]) (primify run-or-state n)) (cons 'Int (map Sig-name (get-sigs run-or-state)))))))] [else (define the-sig (get-sig run-or-state signame)) - - (define all-primitive-descendants + + (define all-primitive-descendants : (Listof Symbol) (remove-duplicates - (flatten - (map (lambda (n) (primify run-or-state n)) + (append* + (map (lambda ([n : Sig]) (primify run-or-state (Sig-name n))) (get-children run-or-state signame))))) (cond - [(Sig-abstract the-sig) - + [(and the-sig (Sig-abstract the-sig)) + (if (empty? (get-children run-or-state signame)) (raise-forge-error #:msg (format "The abstract sig ~a is not extended by any children" (symbol->string signame)) #:context the-sig) all-primitive-descendants)] - [else (cons - (string->symbol (string-append (symbol->string signame) + [else (cons + (string->symbol (string-append (symbol->string signame) (if (empty? (get-children run-or-state signame)) "" "_remainder"))) @@ -912,8 +973,8 @@ Returns whether the given run resulted in sat or unsat, respectively. ; We assume that the list of sigs given is already primified; i.e., there are no non-primitive ; sig names (X_remainder counts as a primitive sig) being passed to this function. ; This version works only for lists of primified sig symbols, e.g. (A B C D_remainder) -(define/contract (deprimify run-or-state primsigs) - (-> (or/c Run? State? Run-spec?) (non-empty-listof symbol?) (non-empty-listof symbol?)) +(: deprimify (-> Run-or-State (Listof Symbol) (Listof Symbol))) +(define (deprimify run-or-state primsigs) (let ([all-sigs (map Sig-name (get-sigs run-or-state))]) (cond ; In case this is a singleton list, we can't improve anything @@ -921,13 +982,13 @@ Returns whether the given run resulted in sat or unsat, respectively. primsigs] ; In case all sigs are represented here, it's univ [(equal? (list->set primsigs) - (list->set (remove-duplicates (flatten (map (lambda (n) (primify run-or-state n)) (cons 'Int all-sigs)))))) + (list->set (remove-duplicates (flatten (map (lambda ([n : Symbol]) (primify run-or-state n)) (cons 'Int all-sigs)))))) '(univ)] ; Otherwise, compress as much as possible ; Use primify to handle the X_remainder cases. [else (define top-level (get-top-level-sigs run-or-state)) - (define pseudo-fold-lambda (lambda (sig acc) - (if (or (subset? (primify run-or-state (Sig-name sig)) (flatten primsigs)) + (define pseudo-fold-lambda (lambda ([sig : Sig] [acc : (Listof Symbol)]) + (if (or (subset? (list->set (primify run-or-state (Sig-name sig))) (list->set (flatten primsigs))) (equal? (list (car (primify run-or-state (Sig-name sig)))) (flatten primsigs))) ; the above check is added for when you have the parent sig, but are expecting the child (values (append acc (list (Sig-name sig))) #t) ; replace cons with values @@ -938,8 +999,9 @@ Returns whether the given run resulted in sat or unsat, respectively. ; Runs a DFS over the sigs tree, starting from sigs in . ; On each visited sig, is called to obtain a new accumulated value ; and whether the search should continue to that sig's children. +(: dfs-sigs (All (A) (-> Run-or-State (-> Sig A (Values A Boolean)) (Listof Sig) A A))) (define (dfs-sigs run-or-state func sigs init-acc) - (define (dfs-sigs-helper todo acc) + (define (dfs-sigs-helper [todo : (Listof Sig)] [acc : A]) : A (cond [(equal? (length todo) 0) acc] [else (define next (first todo)) (define-values (new-acc stop) @@ -952,6 +1014,7 @@ Returns whether the given run resulted in sat or unsat, respectively. (dfs-sigs-helper sigs init-acc)) ; maybe take in initial accumulator as well for more flexibility ; Be robust to callers who pass quantifier-vars as either (var . domain) or as '(var domain). +(: second/safe (-> (U (Listof Any) (Pairof Any Any)) Any)) (define (second/safe list-or-pair) (cond [(list? list-or-pair) (second list-or-pair)] [else (cdr list-or-pair)])) diff --git a/forge/sigs.rkt b/forge/sigs.rkt index b9b55c300..20c124ac5 100644 --- a/forge/sigs.rkt +++ b/forge/sigs.rkt @@ -41,14 +41,14 @@ make-check test-from-state make-test - reset-run-name-history! + state-set-option stop-solver-process!)) (require forge/choose-lang-specific) ; Commands (provide sig relation fun const pred inst with) (provide run check test example display execute start-sterling-menu) -(provide instance-diff solution-diff evaluate) +(provide solution-diff evaluate) ; Instance analysis functions (provide is-unsat? is-sat? is-unknown?) @@ -72,7 +72,6 @@ (prefix-out forge: (struct-out Range)) (prefix-out forge: (struct-out Scope)) (prefix-out forge: (struct-out Bound)) - (prefix-out forge: (struct-out Options)) (prefix-out forge: (struct-out State)) (prefix-out forge: (struct-out Run-spec)) (prefix-out forge: (struct-out Run)) @@ -108,7 +107,8 @@ (provide (prefix-out forge: relation-name)) (provide (prefix-out forge: curr-state) - (prefix-out forge: update-state!)) + (prefix-out forge: update-state!) + (prefix-out forge: current-options)) (provide (struct-out Sat) (struct-out Unsat)) @@ -197,105 +197,11 @@ [(or (equal? option 'verbosity) (equal? option 'verbose)) (set-verbosity value)] [else - (update-state! (state-set-option curr-state option value #:original-path original-path))])) + (define new-state (state-set-option curr-state option value #:original-path original-path)) + (update-state! new-state) + ; Also update the current-options parameter so tests can snapshot it + (current-options (State-options new-state))])) -; state-set-option :: State, Symbol, Symbol -> State -; Sets option to value for state. -(define (state-set-option state option value #:original-path [original-path #f]) - (define options (State-options state)) - - (unless (hash-ref option-types option #f) - (raise-user-error (format "No such option: ~a" option))) - (unless ((hash-ref option-types option) value) - (raise-user-error (format "Setting option ~a requires ~a; received ~a" - option (hash-ref option-types-names option) value))) - - (define (translate-single-path p) - (path->string (build-path original-path (string->path p)))) - - (define new-options - (cond - [(equal? option 'eval-language) - (unless (or (equal? value 'surface) (equal? value 'core)) - (raise-user-error (format "Invalid evaluator language ~a; must be surface or core.~n" - value))) - (struct-copy Options options - [eval-language value])] - [(equal? option 'solver) - (struct-copy Options options - [solver - (if (and (string? value) original-path) - (path->string (build-path original-path (string->path value))) - value)])] - [(equal? option 'backend) - (struct-copy Options options - [backend value])] - [(equal? option 'sb) - (struct-copy Options options - [sb value])] - [(equal? option 'coregranularity) - (struct-copy Options options - [coregranularity value])] - [(equal? option 'logtranslation) - (struct-copy Options options - [logtranslation value])] - [(equal? option 'local_necessity) - (struct-copy Options options - [local_necessity value])] - [(equal? option 'min_tracelength) - (let ([max-trace-length (get-option state 'max_tracelength)]) - (if (> value max-trace-length) - (raise-user-error (format "Cannot set min_tracelength to ~a because min_tracelength cannot be greater than max_tracelength. Current max_tracelength is ~a." - value max-trace-length)) - (struct-copy Options options - [min_tracelength value])))] - [(equal? option 'max_tracelength) - (let ([min-trace-length (get-option state 'min_tracelength)]) - (if (< value min-trace-length) - (raise-user-error (format "Cannot set max_tracelength to ~a because max_tracelength cannot be less than min_tracelength. Current min_tracelength is ~a." - value min-trace-length)) - (struct-copy Options options - [max_tracelength value])))] - [(equal? option 'problem_type) - (struct-copy Options options - [problem_type value])] - [(equal? option 'target_mode) - (struct-copy Options options - [target_mode value])] - [(equal? option 'core_minimization) - (struct-copy Options options - [core_minimization value])] - [(equal? option 'skolem_depth) - (struct-copy Options options - [skolem_depth value])] - [(equal? option 'run_sterling) - (struct-copy Options options - [run_sterling - (cond - [(and (string? value) original-path) - (translate-single-path value)] - [(and (list? value) original-path) - (map translate-single-path value)] - [else value])])] - [(equal? option 'sterling_port) - (struct-copy Options options - [sterling_port value])] - [(equal? option 'engine_verbosity) - (struct-copy Options options - [engine_verbosity value])] - [(equal? option 'test_keep) - (struct-copy Options options - [test_keep value])] - [(equal? option 'no_overflow) - (struct-copy Options options - [no_overflow value])] - [(equal? option 'java_exe_location) - (struct-copy Options options - [java_exe_location value])] - )) - - (struct-copy State state - [options new-options])) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -307,6 +213,10 @@ (define (update-state! new-state) (set! curr-state new-state)) +; Parameter for snapshotting options at test definition time. +; Tests capture this value when defined, then parameterize with it when executed. +(define current-options (make-parameter (State-options init-state))) + ; check-temporal-for-var :: Boolean String -> void ; raises an error if is-var is true and the problem_type option is 'temporal ; uses the given name in the error message @@ -595,7 +505,7 @@ ; maintain the invariant that helper functions are always rel-expression valued (define safe-result (cond [(node/int? result-once) - (node/expr/op/sing (node-info result-once) 1 (list result-once))] + (node/expr/op-on-ints/sing (node-info result-once) 1 (list result-once))] [else result-once])) ; - "fun spacer" added to record use of function along with original argument declarations etc. (node/expr/fun-spacer @@ -697,9 +607,9 @@ (~? 'target-distance 'close_noretarget)) #f)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;; TODO: this _really_ ought to be a box. If the above calls update-state!, - ;; this is no longer aliased. - (define run-state curr-state) + ;; Use current-options parameter so tests can snapshot options at definition time. + ;; The state gets current sigs/preds/etc, but options from the parameter. + (define run-state (struct-copy State curr-state [options (current-options)])) (define run-command #'#,command) (define name (run-from-state run-state @@ -728,12 +638,29 @@ [(test name args ... #:expect expected) (syntax/loc stx (test name args ... #:expect expected #:expect-details #f))] [(test name args ... #:expect expected #:expect-details expected-details) - (add-to-execs - (with-syntax ([loc (build-source-location stx)] - [run-stx (syntax/loc stx (run name args ...))] - [check-stx (syntax/loc stx (check name args ...))]) - (quasisyntax/loc stx - (cond + ; Snapshot options at definition time, then parameterize at execution time + (with-syntax ([snapshot-id (generate-temporary 'options-snapshot)] + [loc (build-source-location stx)] + [run-stx (syntax/loc stx (run name args ...))] + [check-stx (syntax/loc stx (check name args ...))]) + (if (equal? (syntax-local-context) 'module) + ; At module level: capture options now, defer test with parameterize + (quasisyntax/loc stx + (begin + (define snapshot-id (current-options)) + (module+ execs + (parameterize ([current-options snapshot-id]) + #,(quasisyntax/loc stx (test-body name loc run-stx check-stx expected expected-details)))))) + ; Not at module level: just run directly + (quasisyntax/loc stx + (test-body name loc run-stx check-stx expected expected-details))))])) + +; Helper macro for test body - factored out to avoid duplication +(define-syntax (test-body stx) + (syntax-case stx () + [(test-body name loc run-stx check-stx expected expected-details) + (quasisyntax/loc stx + (cond ; TODO: isn't this known at expansion time? We'll have the value of . [(equal? 'expected 'forge_error) ; Expecting an error. If we receive one, do nothing. @@ -822,55 +749,97 @@ (raise-forge-error #:msg "The syntax 'is theorem' is deprecated and will be re-enabled in a future version for complete solver backends only; use 'is checked' instead." #:context loc)] - [else (raise-forge-error + [else (raise-forge-error #:msg (format "Illegal argument to test. Received ~a, expected sat, unsat, checked, or forge_error." 'expected) - #:context loc)]))))])) + #:context loc)]))])) -(define-syntax (example stx) +(define-syntax (example stx) (syntax-parse stx [(_ name:id pred bounds ...) - (add-to-execs - (with-syntax* ([double-check-name (format-id #'name "double-check_~a_~a" #'name (gensym))] - [run-stx (syntax/loc stx (run name #:preds [pred] #:bounds [bounds ...]))] - [double-check-run-stx (syntax/loc stx (run double-check-name #:preds [] #:bounds [bounds ...]))]) - (quasisyntax/loc stx (begin - (when (eq? 'temporal (get-option curr-state 'problem_type)) - (raise-forge-error - #:msg (format "example ~a: Can't have examples when problem_type option is temporal" 'name) - #:context #,(build-source-location stx))) - run-stx - (define first-instance (tree:get-value (Run-result name))) - (cond - [(Unsat? first-instance) - ; Run a second check to see if {} would have also failed, meaning this example - ; violates the sig/field declarations. - double-check-run-stx - (define double-check-instance (tree:get-value (Run-result double-check-name))) - (close-run double-check-name) ;; always close the double-check run immediately - - (cond - [(Sat? double-check-instance) - (report-test-failure #:name 'name #:msg (format "Invalid example '~a'; the instance specified does not satisfy the given predicate." 'name) - #:context #,(build-source-location stx) - #:instance first-instance - #:run name)] - [(Unsat? double-check-instance) - (report-test-failure #:name 'name #:msg (format (string-append "Invalid example '~a'; the instance specified is impossible. " - "This means that the specified bounds conflict with each other " - "or with the sig/field definitions.") - 'name) - #:context #,(build-source-location stx) - #:instance first-instance - #:run name)] - [(Unknown? double-check-instance) - (report-test-failure #:name 'name #:msg (format "Invalid example '~a'. Unable to determine if the instance given satisfies the sig/field definitions or specified bounds." 'name) - #:context #,(build-source-location stx) - #:instance first-instance - #:run name)])] - [else - (report-passing-test #:name 'name) - (close-run name)])))))])) + ; Snapshot options at definition time, then parameterize at execution time + (with-syntax* ([snapshot-id (generate-temporary 'options-snapshot)] + [double-check-name (format-id #'name "double-check_~a_~a" #'name (gensym))] + [run-stx (syntax/loc stx (run name #:preds [pred] #:bounds [bounds ...]))] + [double-check-run-stx (syntax/loc stx (run double-check-name #:preds [] #:bounds [bounds ...]))]) + (if (equal? (syntax-local-context) 'module) + (quasisyntax/loc stx + (begin + (define snapshot-id (current-options)) + (module+ execs + (parameterize ([current-options snapshot-id]) + (when (eq? 'temporal (get-option curr-state 'problem_type)) + (raise-forge-error + #:msg (format "example ~a: Can't have examples when problem_type option is temporal" 'name) + #:context #,(build-source-location stx))) + run-stx + (define first-instance (tree:get-value (Run-result name))) + (cond + [(Unsat? first-instance) + ; Run a second check to see if {} would have also failed, meaning this example + ; violates the sig/field declarations. + double-check-run-stx + (define double-check-instance (tree:get-value (Run-result double-check-name))) + (close-run double-check-name) ;; always close the double-check run immediately + + (cond + [(Sat? double-check-instance) + (report-test-failure #:name 'name #:msg (format "Invalid example '~a'; the instance specified does not satisfy the given predicate." 'name) + #:context #,(build-source-location stx) + #:instance first-instance + #:run name)] + [(Unsat? double-check-instance) + (report-test-failure #:name 'name #:msg (format (string-append "Invalid example '~a'; the instance specified is impossible. " + "This means that the specified bounds conflict with each other " + "or with the sig/field definitions.") + 'name) + #:context #,(build-source-location stx) + #:instance first-instance + #:run name)] + [(Unknown? double-check-instance) + (report-test-failure #:name 'name #:msg (format "Invalid example '~a'. Unable to determine if the instance given satisfies the sig/field definitions or specified bounds." 'name) + #:context #,(build-source-location stx) + #:instance first-instance + #:run name)])] + [else + (report-passing-test #:name 'name) + (close-run name)]))))) + ; Not at module level: just run directly (original behavior) + (quasisyntax/loc stx + (begin + (when (eq? 'temporal (get-option curr-state 'problem_type)) + (raise-forge-error + #:msg (format "example ~a: Can't have examples when problem_type option is temporal" 'name) + #:context #,(build-source-location stx))) + run-stx + (define first-instance (tree:get-value (Run-result name))) + (cond + [(Unsat? first-instance) + double-check-run-stx + (define double-check-instance (tree:get-value (Run-result double-check-name))) + (close-run double-check-name) + (cond + [(Sat? double-check-instance) + (report-test-failure #:name 'name #:msg (format "Invalid example '~a'; the instance specified does not satisfy the given predicate." 'name) + #:context #,(build-source-location stx) + #:instance first-instance + #:run name)] + [(Unsat? double-check-instance) + (report-test-failure #:name 'name #:msg (format (string-append "Invalid example '~a'; the instance specified is impossible. " + "This means that the specified bounds conflict with each other " + "or with the sig/field definitions.") + 'name) + #:context #,(build-source-location stx) + #:instance first-instance + #:run name)] + [(Unknown? double-check-instance) + (report-test-failure #:name 'name #:msg (format "Invalid example '~a'. Unable to determine if the instance given satisfies the sig/field definitions or specified bounds." 'name) + #:context #,(build-source-location stx) + #:instance first-instance + #:run name)])] + [else + (report-passing-test #:name 'name) + (close-run name)])))))])) ; Checks that some predicates are always true. (define-syntax (check stx) @@ -1040,99 +1009,6 @@ (define (solution-diff s1 s2) (map instance-diff (Sat-instances s1) (Sat-instances s2))) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;;;;;;; Seq Library ;;;;;;;; -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -; reference: -; https://github.com/AlloyTools/org.alloytools.alloy/blob/master/org.alloytools.alloy.core/src/main/resources/models/util/seqrel.als - -; need to provide through expander - -(provide isSeqOf seqFirst seqLast indsOf idxOf lastIdxOf elems inds isEmpty hasDups seqRest) - -(define-syntax (define-builtin stx) - (syntax-parse stx - [(define-builtin:id (opName:id locArg:id args:id ...) body:expr) - (with-syntax ([opName/func (format-id #'opName "~a/func" #'opName)] - [ellip '...]) - (syntax/loc stx (begin - (define-syntax (opName stxx) - (syntax-parse stxx - ; For use in forge/core; full s-expression expands to 0-ary procedure - ; Note use of "ellip" to denote "..." for the inner macro. - [(opName inner-args:id ellip) - (quasisyntax/loc stxx - (opName/func (nodeinfo #,(build-source-location stxx) 'checklangNoCheck #f) inner-args ellip))] - ; For use with #lang forge; identifier by itself expands to 3+-ary procedure - [opName - (quasisyntax/loc stxx - (lambda (args ...) - (opName/func (nodeinfo #,(build-source-location stxx) 'checklangNoCheck #f) args ...)))])) - - (define (opName/func locArg args ...) - body) - ))) - ])) - -(define-builtin (isSeqOf info r1 d) - (&&/info info - (in/info info r1 (->/info info Int univ)) - (in/info info (join/info info Int r1) d) - (all/info info ([i1 (join/info info r1 univ)]) - (&&/info info (int>= (sum/info info i1) (int 0)) - (lone/info info (join/info info i1 r1)))) - (all/info info ([e (join/info info Int r1)]) - (some/info info (join/info info r1 e))) - (all/info info ([i1 (join/info info r1 univ)]) - (=>/info info (!= i1 (sing/info info (int 0))) - (some/info info (join/info info - (sing/info info - (subtract/info info - (sum/info info i1) (int 1))) r1)))))) - -(define-builtin (seqFirst info r) - (join/info info - (sing/info info (int 0)) - r)) - -(define-builtin (seqLast info r) - (join/info info - (sing/info info - (subtract/info info - (card/info info r) (int 1))) - r)) - -; precondition: r isSeqOf something -(define-builtin (seqRest info r) - (-/info info - (join/info info succ r) - (->/info info (int -1) univ))) - -(define-builtin (indsOf info r e) - (join/info info r e)) - -(define-builtin (idxOf info r e) - (min (join/info info r e))) - -(define-builtin (lastIdxOf info r e) - (max (join/info info r e))) - -(define-builtin (elems info r) - (join/info info Int r)) - -(define-builtin (inds info r) - (join/info info r univ)) - -(define-builtin (isEmpty info r) - (no/func r #:info info)) - -(define-builtin (hasDups info r) - (some ([e (elems/func info r)]) - (some ([num1 (indsOf/func info r e)] [num2 (indsOf/func info r e)]) - (!= num1 num2)))) - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;; Reachability Library ;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -1332,7 +1208,7 @@ #:multi [("-o" "--option") OPTION-NAME OPTION-VALUE "Option set" - (begin + (begin (printf "Setting ~a = ~a~n" (string->symbol OPTION-NAME) OPTION-VALUE) (set-option! (string->symbol OPTION-NAME) (string->option-type OPTION-NAME OPTION-VALUE)))] @@ -1345,6 +1221,9 @@ (string->option-type OPTION-NAME OPTION-VALUE)) ; Don't allow the Forge file to reset this option. (set-box! option-overrides (cons (string->symbol OPTION-NAME) (unbox option-overrides))))] + [("-L" "--logfile") LOGFILE-PATH + "Log filename" + (setup-logfile! LOGFILE-PATH)] [("-N" "--notests") "Disable tests for this model execution (NOT YET SUPPORTED)" (begin @@ -1352,4 +1231,4 @@ (set-box! disable-tests #t))] - #:args remaining-args remaining-args)) \ No newline at end of file + #:args remaining-args remaining-args)) diff --git a/forge/solver-specific/pardinus-cores.rkt b/forge/solver-specific/pardinus-cores.rkt new file mode 100644 index 000000000..1dd72bd61 --- /dev/null +++ b/forge/solver-specific/pardinus-cores.rkt @@ -0,0 +1,91 @@ +#lang racket/base + +(require forge/lang/ast) +(require racket/string + (only-in racket first empty? rest) + (except-in racket/contract ->) + (prefix-in @ (only-in racket/contract ->)) + + (prefix-in @ (only-in racket +)) + (only-in forge/shared get-verbosity VERBOSITY_HIGH)) +(provide pretty-print-core-formula process-core-formula pretty-format-core-formula) + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ; Note on cores: if core granularity is high, Kodkod may return a formula we do not have an ID for. + ; In these cases, the engine should be passing something like "f:0,0" which indexes _child_ formulas. + ; (In *very* rare cases, Kodkod may not be able to blame a subformula, and just give us a string.) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + (define (traverse-path-list path core-map [fmla #f]) + ;; Cannot use for/fold or fold here, because we need to _not_ move down the list for + ;; a node/fmla/pred-spacer node (and any other node that is invisible to Pardinus). + (cond + ; Base case: no more indexes to process + [(empty? path) fmla] + ; We have an index, descend as appropriate + [else + (define idx-str (first path)) + (define idx (string->number idx-str)) + (cond [(not fmla) + (traverse-path-list (rest path) + core-map + (hash-ref core-map idx))] + [(node/formula/quantified? fmla) + ; Quantified: decls formulas first, then sub-formula last + (cond [(>= idx (length (node/formula/quantified-decls fmla))) + (traverse-path-list (rest path) + core-map + (node/formula/quantified-formula fmla))] + [else + (define decl (list-ref (node/formula/quantified-decls fmla) idx)) + (traverse-path-list (rest path) + core-map + (car decl))])] + [(node/formula/op? fmla) + ; Operator formula: sub-formulas in order. Note that this layer isn't shown + ; to Pardinus, so we cannot move down the path index list for this. + (traverse-path-list (rest path) + core-map + (list-ref (node/formula/op-children fmla) idx))] + [(node/fmla/pred-spacer? fmla) + ; Predicate spacer, just use internal formula, and don't move forward in the path + (traverse-path-list path + core-map + (node/fmla/pred-spacer-expanded fmla))] + [else + (raise-user-error (format "Unsupported formula type in core: ~a" fmla))])])) + +(define (find-core-formula id core-map) + (unless (string-prefix? id "f:") + (raise-user-error (format "Unexpected error: invalid formula path ID: ~a" id))) + (define path (string-split (first (string-split id "f:")) ",")) + (when (>= (get-verbosity) VERBOSITY_HIGH) + (printf "core path: ~a~n" path)) + (unless (and (> (length path) 0) (member (string->number (first path)) (hash-keys core-map))) + (raise-user-error (format "Unexpected error: solver path ID prefix was invalid: ~a; valid prefixes: ~a" id (hash-keys core-map)))) + (traverse-path-list path core-map #f)) + +; A processed core formula will hopefully be a node, but it might also be a string +; describing a formula that Kodkod couldn't map back. (This happens sometimes when using +; temporal operators, but it's rare.) +(define/contract (process-core-formula fmla-or-id core-map) + (@-> (or/c node? string?) hash? (or/c string? node?)) + ; (printf "***~n*** process-core-formula ~a ~a~n" fmla-or-id core-map) + ;(define fmla-num (if (string-prefix? id "f:") (string->number (substring id 2)) #f)] + (cond [(and (string? fmla-or-id) (string-prefix? fmla-or-id "f:")) + (find-core-formula fmla-or-id core-map)] + ; Otherwise, it might be a node already, or else a string with a formula + ; Kodkod couldn't find a blame path for. + [else fmla-or-id])) + +(define (pretty-format-core-formula idx max fmla-or-id core-map) + (define fmla-or-string (process-core-formula fmla-or-id core-map)) + (cond [(node? fmla-or-string) + (format "Core(part ~a/~a): [~a] ~a~n" (@+ idx 1) max + (pretty-loc fmla-or-string) (deparse fmla-or-string))] + [else + (format "Core(part ~a/~a): [UNKNOWN] ~a~n" (@+ idx 1) max + fmla-or-string)])) + +(define (pretty-print-core-formula idx max fmla-or-id core-map) + (fprintf (current-error-port) (pretty-format-core-formula idx max fmla-or-id core-map))) + \ No newline at end of file diff --git a/forge/solver-specific/pardinus.rkt b/forge/solver-specific/pardinus.rkt index f1d059c07..0301f1c6e 100644 --- a/forge/solver-specific/pardinus.rkt +++ b/forge/solver-specific/pardinus.rkt @@ -33,6 +33,8 @@ remove-duplicates subset? cartesian-product match-define cons? set-subtract) racket/hash) +(require forge/solver-specific/pardinus-cores) + (provide send-to-kodkod get-next-kodkod-model) (define (send-to-kodkod run-name run-spec bitwidth all-atoms solverspec total-bounds bound-lower bound-upper run-constraints stdin stdout stderr) @@ -181,68 +183,8 @@ 'run (pardinus:read-solution stdout stderr) all-rels - all-atoms)) - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ; Note on cores: if core granularity is high, Kodkod may return a formula we do not have an ID for. - ; In these cases, the engine should be passing something like "f:0,0" which indexes _child_ formulas. - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - (define (traverse-path-list path [fmla #f]) - ;; Cannot use for/fold or fold here, because we need to _not_ move down the list for - ;; a node/fmla/pred-spacer node (and any other node that is invisible to Pardinus). - (cond - ; Base case: no more indexes to process - [(empty? path) fmla] - ; We have an index, descend as appropriate - [else - (define idx-str (first path)) - (define idx (string->number idx-str)) - (cond [(not fmla) - (traverse-path-list (rest path) - (hash-ref core-map idx))] - [(node/formula/quantified? fmla) - ; Quantified: decls formulas first, then sub-formula last - (cond [(>= idx (length (node/formula/quantified-decls fmla))) - (traverse-path-list (rest path) - (node/formula/quantified-formula fmla))] - [else - (define decl (list-ref (node/formula/quantified-decls fmla) idx)) - (traverse-path-list (rest path) - (car decl))])] - [(node/formula/op? fmla) - ; Operator formula: sub-formulas in order. Note that this layer isn't shown - ; to Pardinus, so we cannot move down the path index list for this. - (traverse-path-list (rest path) - (list-ref (node/formula/op-children fmla) idx))] - [(node/fmla/pred-spacer? fmla) - ; Predicate spacer, just use internal formula, and don't move forward in the path - (traverse-path-list path - (node/fmla/pred-spacer-expanded fmla))] - [else - (raise-user-error (format "Unsupported formula type in core: ~a" fmla))])])) - - (define (find-core-formula id) - (unless (string-prefix? id "f:") - (raise-user-error (format "Unexpected error: invalid formula path ID: ~a" id))) - (define path (string-split (first (string-split id "f:")) ",")) - (printf "core path: ~a~n" path) - (unless (and (> (length path) 0) (member (string->number (first path)) (hash-keys core-map))) - (raise-user-error (format "Unexpected error: solver path ID prefix was invalid: ~a; valid prefixes: ~a" id (hash-keys core-map)))) - (traverse-path-list path #f)) - - (define (pretty-core idx max known? fmla-or-id) - (cond [known? - (define fmla fmla-or-id) - (fprintf (current-error-port) "Core(part ~a/~a): [~a] ~a~n" (@+ idx 1) max - (pretty-loc fmla) (deparse fmla))] - [(string-prefix? fmla-or-id "f:") - (define fmla (find-core-formula fmla-or-id)) - (fprintf (current-error-port) "Core(part ~a/~a): [~a] ~a~n" (@+ idx 1) max - (pretty-loc fmla) (deparse fmla))] - [else - (fprintf (current-error-port) "Core(part ~a/~a): [UNKNOWN] ~a~n" (@+ idx 1) max - fmla-or-id)])) - + all-atoms + core-map)) (when (and (Unsat? result) (Unsat-core result)) ; if we have a core (when (@>= (get-verbosity) VERBOSITY_DEBUG) @@ -252,13 +194,7 @@ (printf "Unsat core available (~a formulas):~n" (length (Unsat-core result)))) (for ([id (Unsat-core result)] [idx (range (length (Unsat-core result)))]) - (let ([fmla-num (if (string-prefix? id "f:") (string->number (substring id 2)) #f)]) - (cond [(member fmla-num (hash-keys core-map)) - ; This is a formula ID and we know it immediately; it's a top-level constraint - (pretty-core idx (length (Unsat-core result)) fmla-num (hash-ref core-map fmla-num))] - [else - ; This is NOT a known top-level constraint, but it's part of the core - (pretty-core idx (length (Unsat-core result)) #f id)])))) + (pretty-print-core-formula idx (length (Unsat-core result)) id core-map))) (when (@>= (get-verbosity) VERBOSITY_LOW) (displayln (format-statistics (if (Sat? result) (Sat-stats result) (Unsat-stats result))))) diff --git a/forge/solver-specific/to-smtlib-tor.rkt b/forge/solver-specific/to-smtlib-tor.rkt index ab69dd41c..2ff862aac 100644 --- a/forge/solver-specific/to-smtlib-tor.rkt +++ b/forge/solver-specific/to-smtlib-tor.rkt @@ -52,8 +52,8 @@ (if type 'true 'false)] [(node/fmla/pred-spacer info name args expanded) (convert-formula run-or-state expanded relations atom-names quantvars quantvar-types bounds)] - [(node/formula/op info args) - (convert-formula-op run-or-state formula relations atom-names quantvars quantvar-types args bounds)] + [(? node/formula/op? op) + (convert-formula-op run-or-state formula relations atom-names quantvars quantvar-types (node/formula/op-children op) bounds)] [(node/formula/multiplicity info mult expr) (let ([processed-expr (convert-expr run-or-state expr relations atom-names quantvars quantvar-types bounds)]) (match mult @@ -179,60 +179,60 @@ (when (@>= (get-verbosity) VERBOSITY_HIGH) (printf "to-smtlib-tor: convert-formula-op: ~a~n" formula)) (match formula - [(node/formula/op/&& info children) + [(node/formula/op-on-formulas/&& info children) `(and ,@(process-children-formula run-or-state children relations atom-names quantvars quantvar-types bounds))] - [(node/formula/op/|| info children) + [(node/formula/op-on-formulas/|| info children) `(or ,@(process-children-formula run-or-state children relations atom-names quantvars quantvar-types bounds))] - [(node/formula/op/=> info children) + [(node/formula/op-on-formulas/=> info children) `(=> ,@(process-children-formula run-or-state children relations atom-names quantvars quantvar-types bounds))] - [(node/formula/op/always info children) + [(node/formula/op-on-formulas/always info children) (raise-forge-error #:msg "Temporal operators are unsupported by SMT backend." #:context formula)] - [(node/formula/op/eventually info children) + [(node/formula/op-on-formulas/eventually info children) (raise-forge-error #:msg "Temporal operators are unsupported by SMT backend." #:context formula)] - [(node/formula/op/next_state info children) + [(node/formula/op-on-formulas/next_state info children) (raise-forge-error #:msg "Temporal operators are unsupported by SMT backend." #:context formula)] - [(node/formula/op/releases info children) + [(node/formula/op-on-formulas/releases info children) (raise-forge-error #:msg "Temporal operators are unsupported by SMT backend." #:context formula)] - [(node/formula/op/until info children) + [(node/formula/op-on-formulas/until info children) (raise-forge-error #:msg "Temporal operators are unsupported by SMT backend." #:context formula)] - [(node/formula/op/historically info children) + [(node/formula/op-on-formulas/historically info children) (raise-forge-error #:msg "Temporal operators are unsupported by SMT backend." #:context formula)] - [(node/formula/op/once info children) + [(node/formula/op-on-formulas/once info children) (raise-forge-error #:msg "Temporal operators are unsupported by SMT backend." #:context formula)] - [(node/formula/op/prev_state info children) + [(node/formula/op-on-formulas/prev_state info children) (raise-forge-error #:msg "Temporal operators are unsupported by SMT backend." #:context formula)] - [(node/formula/op/since info children) + [(node/formula/op-on-formulas/since info children) (raise-forge-error #:msg "Temporal operators are unsupported by SMT backend." #:context formula)] - [(node/formula/op/triggered info children) + [(node/formula/op-on-formulas/triggered info children) (raise-forge-error #:msg "Temporal operators are unsupported by SMT backend." #:context formula)] - [(node/formula/op/in info children) + [(node/formula/op-on-exprs/in info children) `(set.subset ,@(process-children-expr run-or-state args relations atom-names quantvars quantvar-types bounds))] - [(node/formula/op/= info children) - (if (for/or ([child children]) (if (node/int/op/card? child) #t #f)) + [(node/formula/op-on-exprs/= info children) + (if (for/or ([child children]) (if (node/int/op-on-exprs/card? child) #t #f)) (form-cardinality run-or-state formula relations atom-names quantvars quantvar-types children "=" bounds) `(= ,@(process-children-ambiguous run-or-state args relations atom-names quantvars quantvar-types bounds)))] - [(node/formula/op/! info children) + [(node/formula/op-on-formulas/! info children) `(not ,@(process-children-formula run-or-state args relations atom-names quantvars quantvar-types bounds))] - [(node/formula/op/int> info children) - (if (for/or ([child children]) (if (node/int/op/card? child) #t #f)) + [(node/formula/op-on-ints/int> info children) + (if (for/or ([child children]) (if (node/int/op-on-exprs/card? child) #t #f)) (form-cardinality run-or-state formula relations atom-names quantvars quantvar-types children ">" bounds) `(> ,@(process-children-ambiguous run-or-state args relations atom-names quantvars quantvar-types bounds #t)))] - [(node/formula/op/int< info children) - (if (for/or ([child children]) (if (node/int/op/card? child) #t #f)) + [(node/formula/op-on-ints/int< info children) + (if (for/or ([child children]) (if (node/int/op-on-exprs/card? child) #t #f)) (form-cardinality run-or-state formula relations atom-names quantvars quantvar-types children "<" bounds) `(< ,@(process-children-ambiguous run-or-state args relations atom-names quantvars quantvar-types bounds #t)))] - [(node/formula/op/int= info children) - (if (for/or ([child children]) (if (node/int/op/card? child) #t #f)) + [(node/formula/op-on-ints/int= info children) + (if (for/or ([child children]) (if (node/int/op-on-exprs/card? child) #t #f)) (form-cardinality run-or-state formula relations atom-names quantvars quantvar-types children "=" bounds) `(= ,@(process-children-ambiguous run-or-state args relations atom-names quantvars quantvar-types bounds #t)))])) @@ -346,8 +346,8 @@ (define (form-cardinality run-or-state formula relations atom-names quantvars quantvar-types children op bounds) ; Ensure that the child that is not a cardinality operator is an int constant. - (define int-expr (for/or ([child children] #:when (not (node/int/op/card? child))) child)) - (define card-expr (for/or ([child children] #:when (node/int/op/card? child)) (car (node/int/op-children child)))) + (define int-expr (for/or ([child children] #:when (not (node/int/op-on-exprs/card? child))) child)) + (define card-expr (for/or ([child children] #:when (node/int/op-on-exprs/card? child)) (car (node/int/op-children child)))) (define card-expr-type (expression-type-top-level-types (checkExpression run-or-state card-expr quantvar-types (make-hash)))) (define processed-card-expr (convert-expr run-or-state card-expr relations atom-names quantvars quantvar-types bounds)) (define value 0) @@ -468,8 +468,8 @@ [(node/expr/constant info arity type) (raise-forge-error #:msg (format "Unexpected node reached by to-smtlib-tor: node/expr/constant with type " type) #:context info)] - [(node/expr/op info arity args) - (convert-expr-op run-or-state expr relations atom-names quantvars quantvar-types args bounds)] + [(? node/expr/op? op) + (convert-expr-op run-or-state expr relations atom-names quantvars quantvar-types (node/expr/op-children op) bounds)] [(node/expr/quantifier-var info arity sym name) ; If this is an integer-unwrapping quantifier variable, it will be declared of sort Int, ; and should not be wrapped to make it a singleton-set-of-tuples. Otherwise, it must be @@ -489,32 +489,32 @@ (when (@>= (get-verbosity) VERBOSITY_HIGH) (printf "to-smtlib-tor: convert-expr-op: ~a~n" expr)) (match expr - [(node/expr/op/+ info arity children) + [(node/expr/op-on-exprs/+ info arity children) `(set.union ,@(process-children-expr run-or-state args relations atom-names quantvars quantvar-types bounds))] - [(node/expr/op/- info arity children) + [(node/expr/op-on-exprs/- info arity children) `(set.minus ,@(process-children-expr run-or-state args relations atom-names quantvars quantvar-types bounds))] - [(node/expr/op/& info arity children) + [(node/expr/op-on-exprs/& info arity children) `(set.inter ,@(process-children-expr run-or-state args relations atom-names quantvars quantvar-types bounds))] - [(node/expr/op/-> info arity children) + [(node/expr/op-on-exprs/-> info arity children) ; rel.product in CVC5 is _binary_, not nary, so need to chain this. (define child-strings (process-children-expr run-or-state args relations atom-names quantvars quantvar-types bounds)) (define rest-string (for/fold ([acc (second child-strings)]) ([str (rest (rest child-strings))]) `(rel.product ,acc ,str))) `(rel.product ,(first child-strings) ,rest-string)] - [(node/expr/op/prime info arity children) + [(node/expr/op-on-exprs/prime info arity children) (raise-forge-error #:msg "Temporal operators are unsupported by SMT backend." #:context expr)] - [(node/expr/op/join info arity children) + [(node/expr/op-on-exprs/join info arity children) `(rel.join ,@(process-children-expr run-or-state args relations atom-names quantvars quantvar-types bounds))] - [(node/expr/op/^ info arity children) + [(node/expr/op-on-exprs/^ info arity children) `(rel.tclosure ,@(process-children-expr run-or-state args relations atom-names quantvars quantvar-types bounds))] - [(node/expr/op/* info arity children) + [(node/expr/op-on-exprs/* info arity children) `(set.union (rel.tclosure ,@(process-children-expr run-or-state args relations atom-names quantvars quantvar-types bounds)) (rel.iden (as set.universe (Relation Atom))))] - [(node/expr/op/~ info arity children) + [(node/expr/op-on-exprs/~ info arity children) `(rel.transpose ,@(process-children-expr run-or-state args relations atom-names quantvars quantvar-types bounds))] - [(node/expr/op/++ info arity children) + [(node/expr/op-on-exprs/++ info arity children) ; The relational-override expression R ++ (key -> B) is equivalent to: ; R - (key -> univ) + (key -> B) ; Note that `B` may be of arity > 1, it must be of arity 1 less than R. @@ -527,7 +527,7 @@ (define converted-RHS (convert-expr run-or-state RHS relations atom-names quantvars quantvar-types bounds)) `(set.union (set.minus ,converted-R ,converted-to-remove) ,converted-RHS)] - [(node/expr/op/sing info arity children) + [(node/expr/op-on-ints/sing info arity children) (let ([processed-form (process-children-int run-or-state children relations atom-names quantvars quantvar-types bounds #t)]) (form-int-op-comp run-or-state expr relations atom-names quantvars quantvar-types processed-form bounds))])) @@ -551,8 +551,8 @@ (define new-constraint `(assert (= (IntAtom-to-Int ,const-name) ,value))) (set-box! new-top-level-strings (append (list new-decl new-constraint) (get-new-top-level-strings))) (string->symbol (format "~a" const-name))])] - [(node/int/op info args) - (convert-int-op run-or-state expr relations atom-names quantvars quantvar-types args bounds)] + [(? node/int/op? op) + (convert-int-op run-or-state expr relations atom-names quantvars quantvar-types (node/int/op-children op) bounds)] [(node/int/sum-quant info decls int-expr) (define new-vs-decls (for/fold ([vs-decls (list quantvars '())]) @@ -574,15 +574,15 @@ (when (@>= (get-verbosity) VERBOSITY_HIGH) (printf "to-smtlib-tor: convert-int-op: ~a~n" expr)) (match expr - [(node/int/op/add info children) + [(node/int/op-on-ints/add info children) `(+ ,@(process-children-ambiguous run-or-state args relations atom-names quantvars quantvar-types bounds #t))] - [(node/int/op/subtract info children) + [(node/int/op-on-ints/subtract info children) `(- ,@(process-children-ambiguous run-or-state args relations atom-names quantvars quantvar-types bounds #t))] - [(node/int/op/multiply info children) + [(node/int/op-on-ints/multiply info children) `(* ,@(process-children-ambiguous run-or-state args relations atom-names quantvars quantvar-types bounds #t))] - [(node/int/op/divide info children) + [(node/int/op-on-ints/divide info children) `(div ,@(process-children-ambiguous run-or-state args relations atom-names quantvars quantvar-types bounds #t))] - [(node/int/op/sum info children) + [(node/int/op-on-exprs/sum info children) ; Since we are following the CRS/cvc4 work for integer-handling, the child must always be a singleton. ; This holds whether or not the "sum" was added automatically, but manual/auto affects the nature of the error. ;(printf "qv-types: ~a; qvs: ~a~n" quantvar-types quantvars) @@ -595,15 +595,15 @@ (raise-forge-error #:msg "SMT backend requires that this expression evaluates to a singleton integer, but could not infer this." #:context expr) (raise-forge-error #:msg "SMT backend does not currently support `sum` over multiple integer values, but could not infer safety." #:context expr))) `(IntAtom-to-Int (reconcile-int_atom ,@(process-children-ambiguous run-or-state args relations atom-names quantvars quantvar-types bounds)))] - [(node/int/op/card info children) + [(node/int/op-on-exprs/card info children) (let ([processed-form (string->symbol (string-join (process-children-ambiguous run-or-state args relations atom-names quantvars quantvar-types bounds) " "))]) processed-form)] - [(node/int/op/remainder info children) + [(node/int/op-on-ints/remainder info children) ; TODO: do we need int-ctxt, or can it be inferred? `(mod ,@(process-children-ambiguous run-or-state args relations atom-names quantvars quantvar-types bounds #t))] - [(node/int/op/abs info children) + [(node/int/op-on-ints/abs info children) `(abs ,@(process-children-ambiguous run-or-state args relations atom-names quantvars quantvar-types bounds))] - [(node/int/op/sign info children) + [(node/int/op-on-ints/sign info children) ; The Forge->SMT-LIB generator preamble defines a function "sign" `(sign ,@(process-children-ambiguous run-or-state args relations atom-names quantvars quantvar-types bounds))] [(node/int/sum-quant info decls int-expr) @@ -618,7 +618,7 @@ (match expr [(node/expr/relation info arity name typelist-thunk parent is-var) (list expr)] - [(node/expr/op/join info 2 children) + [(node/expr/op-on-exprs/join info 2 children) (cons (first children) (join->list/right (second children)))] [else (raise-forge-error #:msg (format "join->list/right expected relation or right-chain of binary joins, got ~a" expr) #:context expr)])) \ No newline at end of file diff --git a/forge/solver-specific/translate-from-kodkod-cli.rkt b/forge/solver-specific/translate-from-kodkod-cli.rkt index 91ac74eae..115a22afc 100644 --- a/forge/solver-specific/translate-from-kodkod-cli.rkt +++ b/forge/solver-specific/translate-from-kodkod-cli.rkt @@ -4,6 +4,7 @@ (only-in forge/lang/ast univ)) (require forge/sigs-structs) (require (only-in racket curry first second third fourth fifth match-define)) +(require (only-in forge/solver-specific/pardinus-cores process-core-formula)) (provide translate-from-kodkod-cli translate-evaluation-from-kodkod-cli ) @@ -55,6 +56,9 @@ Note: sometimes the engine manufactures NEW atoms, as Pardinus does in temporal (define indices (make-hash))) |# +(define (process-core core-map data) + (map (lambda (core-fmla) (process-core-formula core-fmla core-map)) data)) + #| model is in the form (cons sym data). sym is either 'sat, 'unsat, or 'no-more-sat. If sym is 'sat, data is the relation list. If 'unsat, data is either a core or #f. If 'no-more-sat, data is #f. @@ -65,7 +69,7 @@ So, the proper name of atom 0 is the value of (list-ref univ 0). relation-names is the same, a list of all relation names ordered as they are in the model. This function just recreates the model, but using names instead of numbers. |# -(define (translate-from-kodkod-cli runtype model relations inty-univ) +(define (translate-from-kodkod-cli runtype model relations inty-univ core-map) ; (flag run-name data stats [metadata]) where metadata is for sat only (define flag (first model)) (define run-name (second model)) @@ -75,11 +79,11 @@ This function just recreates the model, but using names instead of numbers. ; TODO: add run-name to struct for error checking / context (cond [(and (equal? 'unsat flag) (equal? runtype 'run) data) - (Unsat data stats 'unsat)] + (Unsat (process-core core-map data) stats 'unsat)] [(and (equal? 'unsat flag) (equal? runtype 'run) (not data)) (Unsat #f stats 'unsat)] [(and (equal? 'unsat flag) (equal? runtype 'check) data) - (Unsat data stats 'no-counterexample)] + (Unsat (process-core core-map data) stats 'no-counterexample)] [(and (equal? 'unsat flag) (equal? runtype 'check) (not data)) (Unsat #f stats 'no-counterexample)] [(equal? 'no-more-instances flag) diff --git a/forge/solver-specific/translate-to-kodkod-cli.rkt b/forge/solver-specific/translate-to-kodkod-cli.rkt index 9f7a6733b..3756231a8 100644 --- a/forge/solver-specific/translate-to-kodkod-cli.rkt +++ b/forge/solver-specific/translate-to-kodkod-cli.rkt @@ -36,8 +36,8 @@ ( print-cmd-cont (format "~a " type))] [(node/fmla/pred-spacer info name args expanded) (interpret-formula run-or-state expanded relations atom-names quantvars)] - [(node/formula/op info args) - (interpret-formula-op run-or-state formula relations atom-names quantvars args)] + [(? node/formula/op? op) + (interpret-formula-op run-or-state formula relations atom-names quantvars (node/formula/op-children op))] [(node/formula/multiplicity info mult expr) ( print-cmd-cont (format "(~a " mult )) (interpret-expr run-or-state expr relations atom-names quantvars) @@ -71,85 +71,85 @@ (define (interpret-formula-op run-or-state formula relations atom-names quantvars args) (match formula - [(? node/formula/op/&&?) + [(? node/formula/op-on-formulas/&&?) ( print-cmd-cont "(&& ") (map (lambda (x) (interpret-formula run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/formula/op/||?) + [(? node/formula/op-on-formulas/||?) ( print-cmd-cont "(|| ") (map (lambda (x) (interpret-formula run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/formula/op/=>?) + [(? node/formula/op-on-formulas/=>?) ( print-cmd-cont "(=> ") (map (lambda (x) (interpret-formula run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/formula/op/always?) + [(? node/formula/op-on-formulas/always?) ( print-cmd-cont "(always ") (map (lambda (x) (interpret-formula run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/formula/op/eventually?) + [(? node/formula/op-on-formulas/eventually?) ( print-cmd-cont "(eventually ") (map (lambda (x) (interpret-formula run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/formula/op/next_state?) + [(? node/formula/op-on-formulas/next_state?) ( print-cmd-cont "(after ") ; note name change (map (lambda (x) (interpret-formula run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/formula/op/releases?) + [(? node/formula/op-on-formulas/releases?) ( print-cmd-cont "(releases ") (map (lambda (x) (interpret-formula run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/formula/op/until?) + [(? node/formula/op-on-formulas/until?) ( print-cmd-cont "(until ") (map (lambda (x) (interpret-formula run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/formula/op/historically?) + [(? node/formula/op-on-formulas/historically?) ( print-cmd-cont "(historically ") (map (lambda (x) (interpret-formula run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/formula/op/once?) + [(? node/formula/op-on-formulas/once?) ( print-cmd-cont "(once ") (map (lambda (x) (interpret-formula run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/formula/op/prev_state?) + [(? node/formula/op-on-formulas/prev_state?) ( print-cmd-cont "(before ") ; note name change (map (lambda (x) (interpret-formula run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/formula/op/since?) + [(? node/formula/op-on-formulas/since?) ( print-cmd-cont "(since ") (map (lambda (x) (interpret-formula run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/formula/op/triggered?) + [(? node/formula/op-on-formulas/triggered?) ( print-cmd-cont "(triggered ") (map (lambda (x) (interpret-formula run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/formula/op/in?) + [(? node/formula/op-on-exprs/in?) (print-cmd-cont "(in ") (map (lambda (x) (interpret-expr run-or-state x relations atom-names quantvars)) args) (print-cmd-cont ")")] - [(? node/formula/op/=?) + [(? node/formula/op-on-exprs/=?) (print-cmd-cont "(= ") (map (lambda (x) (interpret-expr run-or-state x relations atom-names quantvars)) args) (print-cmd-cont ")")] - [(? node/formula/op/!?) + [(? node/formula/op-on-formulas/!?) (print-cmd-cont "(! ") (map (lambda (x) (interpret-formula run-or-state x relations atom-names quantvars)) args) (print-cmd-cont ")")] - [(? node/formula/op/int>?) + [(? node/formula/op-on-ints/int>?) ( print-cmd-cont "(> ") (map (lambda (x) (interpret-int run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/formula/op/intstring (v sym))) (print-cmd-cont (symbol->string (v (get-sym expr)))) @@ -218,37 +218,37 @@ (define (interpret-expr-op run-or-state expr relations atom-names quantvars args) (match expr - [(? node/expr/op/+?) + [(? node/expr/op-on-exprs/+?) ( print-cmd-cont "(+ ") (map (lambda (x) (interpret-expr run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/expr/op/-?) + [(? node/expr/op-on-exprs/-?) ( print-cmd-cont "(- ") (map (lambda (x) (interpret-expr run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/expr/op/&?) + [(? node/expr/op-on-exprs/&?) ( print-cmd-cont "(& ") (map (lambda (x) (interpret-expr run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/expr/op/->?) + [(? node/expr/op-on-exprs/->?) ( print-cmd-cont "(-> ") (map (lambda (x) (interpret-expr run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/expr/op/prime?) + [(? node/expr/op-on-exprs/prime?) ( print-cmd-cont "(prime ") (map (lambda (x) (interpret-expr run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/expr/op/join?) + [(? node/expr/op-on-exprs/join?) ( print-cmd-cont "(. ") (map (lambda (x) (interpret-expr run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/expr/op/^?) + [(? node/expr/op-on-exprs/^?) ( print-cmd-cont "(^ ") (map (lambda (x) (interpret-expr run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/expr/op/*?) + [(? node/expr/op-on-exprs/*?) ; Since * involves iden, we need to intercede so univ is restricted to actual *used* universe (print-cmd-cont (format "(+ (& iden (-> ~a ~a)) (^ " @@ -256,15 +256,15 @@ (build-univ-string run-or-state))) (map (lambda (x) (interpret-expr run-or-state x relations atom-names quantvars)) args) (print-cmd-cont "))")] - [(? node/expr/op/~?) + [(? node/expr/op-on-exprs/~?) (print-cmd-cont "(~a " '~) ; Likely '~ added this way because ~ would need to be escaped (map (lambda (x) (interpret-expr run-or-state x relations atom-names quantvars)) args) (print-cmd-cont ")")] - [(? node/expr/op/++?) + [(? node/expr/op-on-exprs/++?) (print-cmd-cont "(++ ") (map (lambda (x) (interpret-expr run-or-state x relations atom-names quantvars)) args) (print-cmd-cont ")")] - [(? node/expr/op/sing?) + [(? node/expr/op-on-ints/sing?) (print-cmd-cont "(lone ") (map (lambda (x) (interpret-int run-or-state x relations atom-names quantvars)) args) (print-cmd-cont ")") @@ -274,8 +274,8 @@ (match expr [(node/int/constant info value) (print-cmd-cont (format "~a " value))] - [(node/int/op info args) - (interpret-int-op run-or-state expr relations atom-names quantvars args)] + [(? node/int/op? op) + (interpret-int-op run-or-state expr relations atom-names quantvars (node/int/op-children op))] [(node/int/sum-quant info decls int-expr) (define var (car (car decls))) (let ([quantvars (cons var quantvars)]) @@ -289,39 +289,39 @@ (define (interpret-int-op run-or-state expr relations atom-names quantvars args) (match expr - [(? node/int/op/add?) + [(? node/int/op-on-ints/add?) ( print-cmd-cont "(+ ") (map (lambda (x) (interpret-int run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/int/op/subtract?) + [(? node/int/op-on-ints/subtract?) ( print-cmd-cont "(- ") (map (lambda (x) (interpret-int run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/int/op/multiply?) + [(? node/int/op-on-ints/multiply?) ( print-cmd-cont "(* ") (map (lambda (x) (interpret-int run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/int/op/divide?) + [(? node/int/op-on-ints/divide?) ( print-cmd-cont "(/ ") (map (lambda (x) (interpret-int run-or-state x relations atom-names quantvars )) args) ( print-cmd-cont ")")] - [(? node/int/op/sum?) + [(? node/int/op-on-exprs/sum?) ( print-cmd-cont "(sum ") (map (lambda (x) (interpret-expr run-or-state x relations atom-names quantvars )) args) ( print-cmd-cont ")")] - [(? node/int/op/card?) + [(? node/int/op-on-exprs/card?) ( print-cmd-cont "(# ") (map (lambda (x) (interpret-expr run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/int/op/remainder?) + [(? node/int/op-on-ints/remainder?) ( print-cmd-cont "(% ") (map (lambda (x) (interpret-int run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/int/op/abs?) + [(? node/int/op-on-ints/abs?) ( print-cmd-cont "(abs ") (map (lambda (x) (interpret-int run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] - [(? node/int/op/sign?) + [(? node/int/op-on-ints/sign?) ( print-cmd-cont "(sgn ") (map (lambda (x) (interpret-int run-or-state x relations atom-names quantvars)) args) ( print-cmd-cont ")")] diff --git a/forge/sterling/build/1065.bundle.js b/forge/sterling/build/1065.bundle.js index b94bc4358..2050e9360 100644 --- a/forge/sterling/build/1065.bundle.js +++ b/forge/sterling/build/1065.bundle.js @@ -1,2 +1,2 @@ /*! For license information please see 1065.bundle.js.LICENSE.txt */ -"use strict";(self.webpackChunksterling_ts=self.webpackChunksterling_ts||[]).push([[1065],{71065:(e,n,s)=>{s.r(n),s.d(n,{conf:()=>i,language:()=>t});var i={brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">",notIn:["string"]}],surroundingPairs:[{open:"(",close:")"},{open:"[",close:"]"},{open:"`",close:"`"}],folding:{markers:{start:new RegExp("^\\s*\x3c!--\\s*#?region\\b.*--\x3e"),end:new RegExp("^\\s*\x3c!--\\s*#?endregion\\b.*--\x3e")}}},t={defaultToken:"",tokenPostfix:".rst",control:/[\\`*_\[\]{}()#+\-\.!]/,escapes:/\\(?:@control)/,empty:["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param"],alphanumerics:/[A-Za-z0-9]/,simpleRefNameWithoutBq:/(?:@alphanumerics[-_+:.]*@alphanumerics)+|(?:@alphanumerics+)/,simpleRefName:/(?:`@phrase`|@simpleRefNameWithoutBq)/,phrase:/@simpleRefNameWithoutBq(?:\s@simpleRefNameWithoutBq)*/,citationName:/[A-Za-z][A-Za-z0-9-_.]*/,blockLiteralStart:/(?:[!"#$%&'()*+,-./:;<=>?@\[\]^_`{|}~]|[\s])/,precedingChars:/(?:[ -:/'"<([{])/,followingChars:/(?:[ -.,:;!?/'")\]}>]|$)/,punctuation:/(=|-|~|`|#|"|\^|\+|\*|:|\.|'|_|\+)/,tokenizer:{root:[[/^(@punctuation{3,}$){1,1}?/,"keyword"],[/^\s*([\*\-+‣•]|[a-zA-Z0-9]+\.|\([a-zA-Z0-9]+\)|[a-zA-Z0-9]+\))\s/,"keyword"],[/([ ]::)\s*$/,"keyword","@blankLineOfLiteralBlocks"],[/(::)\s*$/,"keyword","@blankLineOfLiteralBlocks"],{include:"@tables"},{include:"@explicitMarkupBlocks"},{include:"@inlineMarkup"}],explicitMarkupBlocks:[{include:"@citations"},{include:"@footnotes"},[/^(\.\.\s)(@simpleRefName)(::\s)(.*)$/,[{token:"",next:"subsequentLines"},"keyword","",""]],[/^(\.\.)(\s+)(_)(@simpleRefName)(:)(\s+)(.*)/,[{token:"",next:"hyperlinks"},"","","string.link","","","string.link"]],[/^((?:(?:\.\.)(?:\s+))?)(__)(:)(\s+)(.*)/,[{token:"",next:"subsequentLines"},"","","","string.link"]],[/^(__\s+)(.+)/,["","string.link"]],[/^(\.\.)( \|)([^| ]+[^|]*[^| ]*)(\| )(@simpleRefName)(:: .*)/,[{token:"",next:"subsequentLines"},"","string.link","","keyword",""],"@rawBlocks"],[/(\|)([^| ]+[^|]*[^| ]*)(\|_{0,2})/,["","string.link",""]],[/^(\.\.)([ ].*)$/,[{token:"",next:"@comments"},"comment"]]],inlineMarkup:[{include:"@citationsReference"},{include:"@footnotesReference"},[/(@simpleRefName)(_{1,2})/,["string.link",""]],[/(`)([^<`]+\s+)(<)(.*)(>)(`)(_)/,["","string.link","","string.link","","",""]],[/\*\*([^\\*]|\*(?!\*))+\*\*/,"strong"],[/\*[^*]+\*/,"emphasis"],[/(``)((?:[^`]|\`(?!`))+)(``)/,["","keyword",""]],[/(__\s+)(.+)/,["","keyword"]],[/(:)((?:@simpleRefNameWithoutBq)?)(:`)([^`]+)(`)/,["","keyword","","",""]],[/(`)([^`]+)(`:)((?:@simpleRefNameWithoutBq)?)(:)/,["","","","keyword",""]],[/(`)([^`]+)(`)/,""],[/(_`)(@phrase)(`)/,["","string.link",""]]],citations:[[/^(\.\.\s+\[)((?:@citationName))(\]\s+)(.*)/,[{token:"",next:"@subsequentLines"},"string.link","",""]]],citationsReference:[[/(\[)(@citationName)(\]_)/,["","string.link",""]]],footnotes:[[/^(\.\.\s+\[)((?:[0-9]+))(\]\s+.*)/,[{token:"",next:"@subsequentLines"},"string.link",""]],[/^(\.\.\s+\[)((?:#@simpleRefName?))(\]\s+)(.*)/,[{token:"",next:"@subsequentLines"},"string.link","",""]],[/^(\.\.\s+\[)((?:\*))(\]\s+)(.*)/,[{token:"",next:"@subsequentLines"},"string.link","",""]]],footnotesReference:[[/(\[)([0-9]+)(\])(_)/,["","string.link","",""]],[/(\[)(#@simpleRefName?)(\])(_)/,["","string.link","",""]],[/(\[)(\*)(\])(_)/,["","string.link","",""]]],blankLineOfLiteralBlocks:[[/^$/,"","@subsequentLinesOfLiteralBlocks"],[/^.*$/,"","@pop"]],subsequentLinesOfLiteralBlocks:[[/(@blockLiteralStart+)(.*)/,["keyword",""]],[/^(?!blockLiteralStart)/,"","@popall"]],subsequentLines:[[/^[\s]+.*/,""],[/^(?!\s)/,"","@pop"]],hyperlinks:[[/^[\s]+.*/,"string.link"],[/^(?!\s)/,"","@pop"]],comments:[[/^[\s]+.*/,"comment"],[/^(?!\s)/,"","@pop"]],tables:[[/\+-[+-]+/,"keyword"],[/\+=[+=]+/,"keyword"]]}}}}]); \ No newline at end of file +"use strict";(self.webpackChunksterling_layout=self.webpackChunksterling_layout||[]).push([[1065],{71065:(e,n,s)=>{s.r(n),s.d(n,{conf:()=>i,language:()=>t});var i={brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">",notIn:["string"]}],surroundingPairs:[{open:"(",close:")"},{open:"[",close:"]"},{open:"`",close:"`"}],folding:{markers:{start:new RegExp("^\\s*\x3c!--\\s*#?region\\b.*--\x3e"),end:new RegExp("^\\s*\x3c!--\\s*#?endregion\\b.*--\x3e")}}},t={defaultToken:"",tokenPostfix:".rst",control:/[\\`*_\[\]{}()#+\-\.!]/,escapes:/\\(?:@control)/,empty:["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param"],alphanumerics:/[A-Za-z0-9]/,simpleRefNameWithoutBq:/(?:@alphanumerics[-_+:.]*@alphanumerics)+|(?:@alphanumerics+)/,simpleRefName:/(?:`@phrase`|@simpleRefNameWithoutBq)/,phrase:/@simpleRefNameWithoutBq(?:\s@simpleRefNameWithoutBq)*/,citationName:/[A-Za-z][A-Za-z0-9-_.]*/,blockLiteralStart:/(?:[!"#$%&'()*+,-./:;<=>?@\[\]^_`{|}~]|[\s])/,precedingChars:/(?:[ -:/'"<([{])/,followingChars:/(?:[ -.,:;!?/'")\]}>]|$)/,punctuation:/(=|-|~|`|#|"|\^|\+|\*|:|\.|'|_|\+)/,tokenizer:{root:[[/^(@punctuation{3,}$){1,1}?/,"keyword"],[/^\s*([\*\-+‣•]|[a-zA-Z0-9]+\.|\([a-zA-Z0-9]+\)|[a-zA-Z0-9]+\))\s/,"keyword"],[/([ ]::)\s*$/,"keyword","@blankLineOfLiteralBlocks"],[/(::)\s*$/,"keyword","@blankLineOfLiteralBlocks"],{include:"@tables"},{include:"@explicitMarkupBlocks"},{include:"@inlineMarkup"}],explicitMarkupBlocks:[{include:"@citations"},{include:"@footnotes"},[/^(\.\.\s)(@simpleRefName)(::\s)(.*)$/,[{token:"",next:"subsequentLines"},"keyword","",""]],[/^(\.\.)(\s+)(_)(@simpleRefName)(:)(\s+)(.*)/,[{token:"",next:"hyperlinks"},"","","string.link","","","string.link"]],[/^((?:(?:\.\.)(?:\s+))?)(__)(:)(\s+)(.*)/,[{token:"",next:"subsequentLines"},"","","","string.link"]],[/^(__\s+)(.+)/,["","string.link"]],[/^(\.\.)( \|)([^| ]+[^|]*[^| ]*)(\| )(@simpleRefName)(:: .*)/,[{token:"",next:"subsequentLines"},"","string.link","","keyword",""],"@rawBlocks"],[/(\|)([^| ]+[^|]*[^| ]*)(\|_{0,2})/,["","string.link",""]],[/^(\.\.)([ ].*)$/,[{token:"",next:"@comments"},"comment"]]],inlineMarkup:[{include:"@citationsReference"},{include:"@footnotesReference"},[/(@simpleRefName)(_{1,2})/,["string.link",""]],[/(`)([^<`]+\s+)(<)(.*)(>)(`)(_)/,["","string.link","","string.link","","",""]],[/\*\*([^\\*]|\*(?!\*))+\*\*/,"strong"],[/\*[^*]+\*/,"emphasis"],[/(``)((?:[^`]|\`(?!`))+)(``)/,["","keyword",""]],[/(__\s+)(.+)/,["","keyword"]],[/(:)((?:@simpleRefNameWithoutBq)?)(:`)([^`]+)(`)/,["","keyword","","",""]],[/(`)([^`]+)(`:)((?:@simpleRefNameWithoutBq)?)(:)/,["","","","keyword",""]],[/(`)([^`]+)(`)/,""],[/(_`)(@phrase)(`)/,["","string.link",""]]],citations:[[/^(\.\.\s+\[)((?:@citationName))(\]\s+)(.*)/,[{token:"",next:"@subsequentLines"},"string.link","",""]]],citationsReference:[[/(\[)(@citationName)(\]_)/,["","string.link",""]]],footnotes:[[/^(\.\.\s+\[)((?:[0-9]+))(\]\s+.*)/,[{token:"",next:"@subsequentLines"},"string.link",""]],[/^(\.\.\s+\[)((?:#@simpleRefName?))(\]\s+)(.*)/,[{token:"",next:"@subsequentLines"},"string.link","",""]],[/^(\.\.\s+\[)((?:\*))(\]\s+)(.*)/,[{token:"",next:"@subsequentLines"},"string.link","",""]]],footnotesReference:[[/(\[)([0-9]+)(\])(_)/,["","string.link","",""]],[/(\[)(#@simpleRefName?)(\])(_)/,["","string.link","",""]],[/(\[)(\*)(\])(_)/,["","string.link","",""]]],blankLineOfLiteralBlocks:[[/^$/,"","@subsequentLinesOfLiteralBlocks"],[/^.*$/,"","@pop"]],subsequentLinesOfLiteralBlocks:[[/(@blockLiteralStart+)(.*)/,["keyword",""]],[/^(?!blockLiteralStart)/,"","@popall"]],subsequentLines:[[/^[\s]+.*/,""],[/^(?!\s)/,"","@pop"]],hyperlinks:[[/^[\s]+.*/,"string.link"],[/^(?!\s)/,"","@pop"]],comments:[[/^[\s]+.*/,"comment"],[/^(?!\s)/,"","@pop"]],tables:[[/\+-[+-]+/,"keyword"],[/\+=[+=]+/,"keyword"]]}}}}]); \ No newline at end of file diff --git a/forge/sterling/build/1134.bundle.js b/forge/sterling/build/1134.bundle.js index 76ff05501..0b97f8c74 100644 --- a/forge/sterling/build/1134.bundle.js +++ b/forge/sterling/build/1134.bundle.js @@ -1,2 +1,2 @@ /*! For license information please see 1134.bundle.js.LICENSE.txt */ -"use strict";(self.webpackChunksterling_ts=self.webpackChunksterling_ts||[]).push([[1134,6717],{41134:(e,t,n)=>{n.r(t),n.d(t,{conf:()=>r,language:()=>s});var o=n(96717),r=o.conf,s={defaultToken:"invalid",tokenPostfix:".js",keywords:["break","case","catch","class","continue","const","constructor","debugger","default","delete","do","else","export","extends","false","finally","for","from","function","get","if","import","in","instanceof","let","new","null","return","set","super","switch","symbol","this","throw","true","try","typeof","undefined","var","void","while","with","yield","async","await","of"],typeKeywords:[],operators:o.language.operators,symbols:o.language.symbols,escapes:o.language.escapes,digits:o.language.digits,octaldigits:o.language.octaldigits,binarydigits:o.language.binarydigits,hexdigits:o.language.hexdigits,regexpctl:o.language.regexpctl,regexpesc:o.language.regexpesc,tokenizer:o.language.tokenizer}},96717:(e,t,n)=>{n.r(t),n.d(t,{conf:()=>g,language:()=>l});var o=n(1593),r=Object.defineProperty,s=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,c={};r(c,"__esModule",{value:!0}),((e,t,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of i(t))a.call(e,o)||"default"===o||r(e,o,{get:()=>t[o],enumerable:!(n=s(t,o))||n.enumerable})})(c,o);var g={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],onEnterRules:[{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,afterText:/^\s*\*\/$/,action:{indentAction:c.languages.IndentAction.IndentOutdent,appendText:" * "}},{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,action:{indentAction:c.languages.IndentAction.None,appendText:" * "}},{beforeText:/^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/,action:{indentAction:c.languages.IndentAction.None,appendText:"* "}},{beforeText:/^(\t|(\ \ ))*\ \*\/\s*$/,action:{indentAction:c.languages.IndentAction.None,removeText:1}}],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]},{open:"`",close:"`",notIn:["string","comment"]},{open:"/**",close:" */",notIn:["string"]}],folding:{markers:{start:new RegExp("^\\s*//\\s*#?region\\b"),end:new RegExp("^\\s*//\\s*#?endregion\\b")}}},l={defaultToken:"invalid",tokenPostfix:".ts",keywords:["abstract","any","as","asserts","bigint","boolean","break","case","catch","class","continue","const","constructor","debugger","declare","default","delete","do","else","enum","export","extends","false","finally","for","from","function","get","if","implements","import","in","infer","instanceof","interface","is","keyof","let","module","namespace","never","new","null","number","object","package","private","protected","public","override","readonly","require","global","return","set","static","string","super","switch","symbol","this","throw","true","try","type","typeof","undefined","unique","unknown","var","void","while","with","yield","async","await","of"],operators:["<=",">=","==","!=","===","!==","=>","+","-","**","*","/","%","++","--","<<",">",">>>","&","|","^","!","~","&&","||","??","?",":","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=","@"],symbols:/[=>](?!@symbols)/,"@brackets"],[/!(?=([^=]|$))/,"delimiter"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/,"number.float"],[/0[xX](@hexdigits)n?/,"number.hex"],[/0[oO]?(@octaldigits)n?/,"number.octal"],[/0[bB](@binarydigits)n?/,"number.binary"],[/(@digits)n?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string_double"],[/'/,"string","@string_single"],[/`/,"string","@string_backtick"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@jsdoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],jsdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/,["regexp.escape.control","regexp.escape.control"]],[/[()]/,"regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],[/(\/)([dgimsuy]*)/,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,{token:"regexp.escape.control",next:"@pop",bracket:"@close"}]],string_double:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],string_single:[[/[^\\']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"]],string_backtick:[[/\$\{/,{token:"delimiter.bracket",next:"@bracketCounting"}],[/[^\\`$]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/`/,"string","@pop"]],bracketCounting:[[/\{/,"delimiter.bracket","@bracketCounting"],[/\}/,"delimiter.bracket","@pop"],{include:"common"}]}}}}]); \ No newline at end of file +"use strict";(self.webpackChunksterling_layout=self.webpackChunksterling_layout||[]).push([[1134,6717],{41134:(e,t,n)=>{n.r(t),n.d(t,{conf:()=>r,language:()=>i});var o=n(96717),r=o.conf,i={defaultToken:"invalid",tokenPostfix:".js",keywords:["break","case","catch","class","continue","const","constructor","debugger","default","delete","do","else","export","extends","false","finally","for","from","function","get","if","import","in","instanceof","let","new","null","return","set","super","switch","symbol","this","throw","true","try","typeof","undefined","var","void","while","with","yield","async","await","of"],typeKeywords:[],operators:o.language.operators,symbols:o.language.symbols,escapes:o.language.escapes,digits:o.language.digits,octaldigits:o.language.octaldigits,binarydigits:o.language.binarydigits,hexdigits:o.language.hexdigits,regexpctl:o.language.regexpctl,regexpesc:o.language.regexpesc,tokenizer:o.language.tokenizer}},96717:(e,t,n)=>{n.r(t),n.d(t,{conf:()=>g,language:()=>l});var o=n(1593),r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,c={};r(c,"__esModule",{value:!0}),((e,t,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of s(t))a.call(e,o)||"default"===o||r(e,o,{get:()=>t[o],enumerable:!(n=i(t,o))||n.enumerable})})(c,o);var g={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],onEnterRules:[{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,afterText:/^\s*\*\/$/,action:{indentAction:c.languages.IndentAction.IndentOutdent,appendText:" * "}},{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,action:{indentAction:c.languages.IndentAction.None,appendText:" * "}},{beforeText:/^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/,action:{indentAction:c.languages.IndentAction.None,appendText:"* "}},{beforeText:/^(\t|(\ \ ))*\ \*\/\s*$/,action:{indentAction:c.languages.IndentAction.None,removeText:1}}],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]},{open:"`",close:"`",notIn:["string","comment"]},{open:"/**",close:" */",notIn:["string"]}],folding:{markers:{start:new RegExp("^\\s*//\\s*#?region\\b"),end:new RegExp("^\\s*//\\s*#?endregion\\b")}}},l={defaultToken:"invalid",tokenPostfix:".ts",keywords:["abstract","any","as","asserts","bigint","boolean","break","case","catch","class","continue","const","constructor","debugger","declare","default","delete","do","else","enum","export","extends","false","finally","for","from","function","get","if","implements","import","in","infer","instanceof","interface","is","keyof","let","module","namespace","never","new","null","number","object","package","private","protected","public","override","readonly","require","global","return","set","static","string","super","switch","symbol","this","throw","true","try","type","typeof","undefined","unique","unknown","var","void","while","with","yield","async","await","of"],operators:["<=",">=","==","!=","===","!==","=>","+","-","**","*","/","%","++","--","<<",">",">>>","&","|","^","!","~","&&","||","??","?",":","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=","@"],symbols:/[=>](?!@symbols)/,"@brackets"],[/!(?=([^=]|$))/,"delimiter"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/,"number.float"],[/0[xX](@hexdigits)n?/,"number.hex"],[/0[oO]?(@octaldigits)n?/,"number.octal"],[/0[bB](@binarydigits)n?/,"number.binary"],[/(@digits)n?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string_double"],[/'/,"string","@string_single"],[/`/,"string","@string_backtick"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@jsdoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],jsdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/,["regexp.escape.control","regexp.escape.control"]],[/[()]/,"regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\\./,"regexp.invalid"],[/(\/)([dgimsuy]*)/,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,{token:"regexp.escape.control",next:"@pop",bracket:"@close"}]],string_double:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],string_single:[[/[^\\']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"]],string_backtick:[[/\$\{/,{token:"delimiter.bracket",next:"@bracketCounting"}],[/[^\\`$]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/`/,"string","@pop"]],bracketCounting:[[/\{/,"delimiter.bracket","@bracketCounting"],[/\}/,"delimiter.bracket","@pop"],{include:"common"}]}}}}]); \ No newline at end of file diff --git a/forge/sterling/build/1147.bundle.js b/forge/sterling/build/1147.bundle.js index 2bd24deba..e3ecbee38 100644 --- a/forge/sterling/build/1147.bundle.js +++ b/forge/sterling/build/1147.bundle.js @@ -1,2 +1,2 @@ /*! For license information please see 1147.bundle.js.LICENSE.txt */ -"use strict";(self.webpackChunksterling_ts=self.webpackChunksterling_ts||[]).push([[1147],{21147:(e,r,t)=>{t.r(r),t.d(r,{conf:()=>n,language:()=>s});var n={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{blockComment:["###","###"],lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},s={defaultToken:"",ignoreCase:!0,tokenPostfix:".coffee",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],regEx:/\/(?!\/\/)(?:[^\/\\]|\\.)*\/[igm]*/,keywords:["and","or","is","isnt","not","on","yes","@","no","off","true","false","null","this","new","delete","typeof","in","instanceof","return","throw","break","continue","debugger","if","else","switch","for","while","do","try","catch","finally","class","extends","super","undefined","then","unless","until","loop","of","by","when"],symbols:/[=>{t.r(r),t.d(r,{conf:()=>n,language:()=>s});var n={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{blockComment:["###","###"],lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},s={defaultToken:"",ignoreCase:!0,tokenPostfix:".coffee",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],regEx:/\/(?!\/\/)(?:[^\/\\]|\\.)*\/[igm]*/,keywords:["and","or","is","isnt","not","on","yes","@","no","off","true","false","null","this","new","delete","typeof","in","instanceof","return","throw","break","continue","debugger","if","else","switch","for","while","do","try","catch","finally","class","extends","super","undefined","then","unless","until","loop","of","by","when"],symbols:/[=>{i.r(e),i.d(e,{conf:()=>d,language:()=>f});var d={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"],["<",">"]],autoClosingPairs:[{open:'"',close:'"',notIn:["string","comment"]},{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]}]},f={defaultToken:"",tokenPostfix:".sol",brackets:[{token:"delimiter.curly",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"},{token:"delimiter.angle",open:"<",close:">"}],keywords:["pragma","solidity","contract","library","using","struct","function","modifier","constructor","address","string","bool","Int","Uint","Byte","Fixed","Ufixed","int","int8","int16","int24","int32","int40","int48","int56","int64","int72","int80","int88","int96","int104","int112","int120","int128","int136","int144","int152","int160","int168","int176","int184","int192","int200","int208","int216","int224","int232","int240","int248","int256","uint","uint8","uint16","uint24","uint32","uint40","uint48","uint56","uint64","uint72","uint80","uint88","uint96","uint104","uint112","uint120","uint128","uint136","uint144","uint152","uint160","uint168","uint176","uint184","uint192","uint200","uint208","uint216","uint224","uint232","uint240","uint248","uint256","byte","bytes","bytes1","bytes2","bytes3","bytes4","bytes5","bytes6","bytes7","bytes8","bytes9","bytes10","bytes11","bytes12","bytes13","bytes14","bytes15","bytes16","bytes17","bytes18","bytes19","bytes20","bytes21","bytes22","bytes23","bytes24","bytes25","bytes26","bytes27","bytes28","bytes29","bytes30","bytes31","bytes32","fixed","fixed0x8","fixed0x16","fixed0x24","fixed0x32","fixed0x40","fixed0x48","fixed0x56","fixed0x64","fixed0x72","fixed0x80","fixed0x88","fixed0x96","fixed0x104","fixed0x112","fixed0x120","fixed0x128","fixed0x136","fixed0x144","fixed0x152","fixed0x160","fixed0x168","fixed0x176","fixed0x184","fixed0x192","fixed0x200","fixed0x208","fixed0x216","fixed0x224","fixed0x232","fixed0x240","fixed0x248","fixed0x256","fixed8x8","fixed8x16","fixed8x24","fixed8x32","fixed8x40","fixed8x48","fixed8x56","fixed8x64","fixed8x72","fixed8x80","fixed8x88","fixed8x96","fixed8x104","fixed8x112","fixed8x120","fixed8x128","fixed8x136","fixed8x144","fixed8x152","fixed8x160","fixed8x168","fixed8x176","fixed8x184","fixed8x192","fixed8x200","fixed8x208","fixed8x216","fixed8x224","fixed8x232","fixed8x240","fixed8x248","fixed16x8","fixed16x16","fixed16x24","fixed16x32","fixed16x40","fixed16x48","fixed16x56","fixed16x64","fixed16x72","fixed16x80","fixed16x88","fixed16x96","fixed16x104","fixed16x112","fixed16x120","fixed16x128","fixed16x136","fixed16x144","fixed16x152","fixed16x160","fixed16x168","fixed16x176","fixed16x184","fixed16x192","fixed16x200","fixed16x208","fixed16x216","fixed16x224","fixed16x232","fixed16x240","fixed24x8","fixed24x16","fixed24x24","fixed24x32","fixed24x40","fixed24x48","fixed24x56","fixed24x64","fixed24x72","fixed24x80","fixed24x88","fixed24x96","fixed24x104","fixed24x112","fixed24x120","fixed24x128","fixed24x136","fixed24x144","fixed24x152","fixed24x160","fixed24x168","fixed24x176","fixed24x184","fixed24x192","fixed24x200","fixed24x208","fixed24x216","fixed24x224","fixed24x232","fixed32x8","fixed32x16","fixed32x24","fixed32x32","fixed32x40","fixed32x48","fixed32x56","fixed32x64","fixed32x72","fixed32x80","fixed32x88","fixed32x96","fixed32x104","fixed32x112","fixed32x120","fixed32x128","fixed32x136","fixed32x144","fixed32x152","fixed32x160","fixed32x168","fixed32x176","fixed32x184","fixed32x192","fixed32x200","fixed32x208","fixed32x216","fixed32x224","fixed40x8","fixed40x16","fixed40x24","fixed40x32","fixed40x40","fixed40x48","fixed40x56","fixed40x64","fixed40x72","fixed40x80","fixed40x88","fixed40x96","fixed40x104","fixed40x112","fixed40x120","fixed40x128","fixed40x136","fixed40x144","fixed40x152","fixed40x160","fixed40x168","fixed40x176","fixed40x184","fixed40x192","fixed40x200","fixed40x208","fixed40x216","fixed48x8","fixed48x16","fixed48x24","fixed48x32","fixed48x40","fixed48x48","fixed48x56","fixed48x64","fixed48x72","fixed48x80","fixed48x88","fixed48x96","fixed48x104","fixed48x112","fixed48x120","fixed48x128","fixed48x136","fixed48x144","fixed48x152","fixed48x160","fixed48x168","fixed48x176","fixed48x184","fixed48x192","fixed48x200","fixed48x208","fixed56x8","fixed56x16","fixed56x24","fixed56x32","fixed56x40","fixed56x48","fixed56x56","fixed56x64","fixed56x72","fixed56x80","fixed56x88","fixed56x96","fixed56x104","fixed56x112","fixed56x120","fixed56x128","fixed56x136","fixed56x144","fixed56x152","fixed56x160","fixed56x168","fixed56x176","fixed56x184","fixed56x192","fixed56x200","fixed64x8","fixed64x16","fixed64x24","fixed64x32","fixed64x40","fixed64x48","fixed64x56","fixed64x64","fixed64x72","fixed64x80","fixed64x88","fixed64x96","fixed64x104","fixed64x112","fixed64x120","fixed64x128","fixed64x136","fixed64x144","fixed64x152","fixed64x160","fixed64x168","fixed64x176","fixed64x184","fixed64x192","fixed72x8","fixed72x16","fixed72x24","fixed72x32","fixed72x40","fixed72x48","fixed72x56","fixed72x64","fixed72x72","fixed72x80","fixed72x88","fixed72x96","fixed72x104","fixed72x112","fixed72x120","fixed72x128","fixed72x136","fixed72x144","fixed72x152","fixed72x160","fixed72x168","fixed72x176","fixed72x184","fixed80x8","fixed80x16","fixed80x24","fixed80x32","fixed80x40","fixed80x48","fixed80x56","fixed80x64","fixed80x72","fixed80x80","fixed80x88","fixed80x96","fixed80x104","fixed80x112","fixed80x120","fixed80x128","fixed80x136","fixed80x144","fixed80x152","fixed80x160","fixed80x168","fixed80x176","fixed88x8","fixed88x16","fixed88x24","fixed88x32","fixed88x40","fixed88x48","fixed88x56","fixed88x64","fixed88x72","fixed88x80","fixed88x88","fixed88x96","fixed88x104","fixed88x112","fixed88x120","fixed88x128","fixed88x136","fixed88x144","fixed88x152","fixed88x160","fixed88x168","fixed96x8","fixed96x16","fixed96x24","fixed96x32","fixed96x40","fixed96x48","fixed96x56","fixed96x64","fixed96x72","fixed96x80","fixed96x88","fixed96x96","fixed96x104","fixed96x112","fixed96x120","fixed96x128","fixed96x136","fixed96x144","fixed96x152","fixed96x160","fixed104x8","fixed104x16","fixed104x24","fixed104x32","fixed104x40","fixed104x48","fixed104x56","fixed104x64","fixed104x72","fixed104x80","fixed104x88","fixed104x96","fixed104x104","fixed104x112","fixed104x120","fixed104x128","fixed104x136","fixed104x144","fixed104x152","fixed112x8","fixed112x16","fixed112x24","fixed112x32","fixed112x40","fixed112x48","fixed112x56","fixed112x64","fixed112x72","fixed112x80","fixed112x88","fixed112x96","fixed112x104","fixed112x112","fixed112x120","fixed112x128","fixed112x136","fixed112x144","fixed120x8","fixed120x16","fixed120x24","fixed120x32","fixed120x40","fixed120x48","fixed120x56","fixed120x64","fixed120x72","fixed120x80","fixed120x88","fixed120x96","fixed120x104","fixed120x112","fixed120x120","fixed120x128","fixed120x136","fixed128x8","fixed128x16","fixed128x24","fixed128x32","fixed128x40","fixed128x48","fixed128x56","fixed128x64","fixed128x72","fixed128x80","fixed128x88","fixed128x96","fixed128x104","fixed128x112","fixed128x120","fixed128x128","fixed136x8","fixed136x16","fixed136x24","fixed136x32","fixed136x40","fixed136x48","fixed136x56","fixed136x64","fixed136x72","fixed136x80","fixed136x88","fixed136x96","fixed136x104","fixed136x112","fixed136x120","fixed144x8","fixed144x16","fixed144x24","fixed144x32","fixed144x40","fixed144x48","fixed144x56","fixed144x64","fixed144x72","fixed144x80","fixed144x88","fixed144x96","fixed144x104","fixed144x112","fixed152x8","fixed152x16","fixed152x24","fixed152x32","fixed152x40","fixed152x48","fixed152x56","fixed152x64","fixed152x72","fixed152x80","fixed152x88","fixed152x96","fixed152x104","fixed160x8","fixed160x16","fixed160x24","fixed160x32","fixed160x40","fixed160x48","fixed160x56","fixed160x64","fixed160x72","fixed160x80","fixed160x88","fixed160x96","fixed168x8","fixed168x16","fixed168x24","fixed168x32","fixed168x40","fixed168x48","fixed168x56","fixed168x64","fixed168x72","fixed168x80","fixed168x88","fixed176x8","fixed176x16","fixed176x24","fixed176x32","fixed176x40","fixed176x48","fixed176x56","fixed176x64","fixed176x72","fixed176x80","fixed184x8","fixed184x16","fixed184x24","fixed184x32","fixed184x40","fixed184x48","fixed184x56","fixed184x64","fixed184x72","fixed192x8","fixed192x16","fixed192x24","fixed192x32","fixed192x40","fixed192x48","fixed192x56","fixed192x64","fixed200x8","fixed200x16","fixed200x24","fixed200x32","fixed200x40","fixed200x48","fixed200x56","fixed208x8","fixed208x16","fixed208x24","fixed208x32","fixed208x40","fixed208x48","fixed216x8","fixed216x16","fixed216x24","fixed216x32","fixed216x40","fixed224x8","fixed224x16","fixed224x24","fixed224x32","fixed232x8","fixed232x16","fixed232x24","fixed240x8","fixed240x16","fixed248x8","ufixed","ufixed0x8","ufixed0x16","ufixed0x24","ufixed0x32","ufixed0x40","ufixed0x48","ufixed0x56","ufixed0x64","ufixed0x72","ufixed0x80","ufixed0x88","ufixed0x96","ufixed0x104","ufixed0x112","ufixed0x120","ufixed0x128","ufixed0x136","ufixed0x144","ufixed0x152","ufixed0x160","ufixed0x168","ufixed0x176","ufixed0x184","ufixed0x192","ufixed0x200","ufixed0x208","ufixed0x216","ufixed0x224","ufixed0x232","ufixed0x240","ufixed0x248","ufixed0x256","ufixed8x8","ufixed8x16","ufixed8x24","ufixed8x32","ufixed8x40","ufixed8x48","ufixed8x56","ufixed8x64","ufixed8x72","ufixed8x80","ufixed8x88","ufixed8x96","ufixed8x104","ufixed8x112","ufixed8x120","ufixed8x128","ufixed8x136","ufixed8x144","ufixed8x152","ufixed8x160","ufixed8x168","ufixed8x176","ufixed8x184","ufixed8x192","ufixed8x200","ufixed8x208","ufixed8x216","ufixed8x224","ufixed8x232","ufixed8x240","ufixed8x248","ufixed16x8","ufixed16x16","ufixed16x24","ufixed16x32","ufixed16x40","ufixed16x48","ufixed16x56","ufixed16x64","ufixed16x72","ufixed16x80","ufixed16x88","ufixed16x96","ufixed16x104","ufixed16x112","ufixed16x120","ufixed16x128","ufixed16x136","ufixed16x144","ufixed16x152","ufixed16x160","ufixed16x168","ufixed16x176","ufixed16x184","ufixed16x192","ufixed16x200","ufixed16x208","ufixed16x216","ufixed16x224","ufixed16x232","ufixed16x240","ufixed24x8","ufixed24x16","ufixed24x24","ufixed24x32","ufixed24x40","ufixed24x48","ufixed24x56","ufixed24x64","ufixed24x72","ufixed24x80","ufixed24x88","ufixed24x96","ufixed24x104","ufixed24x112","ufixed24x120","ufixed24x128","ufixed24x136","ufixed24x144","ufixed24x152","ufixed24x160","ufixed24x168","ufixed24x176","ufixed24x184","ufixed24x192","ufixed24x200","ufixed24x208","ufixed24x216","ufixed24x224","ufixed24x232","ufixed32x8","ufixed32x16","ufixed32x24","ufixed32x32","ufixed32x40","ufixed32x48","ufixed32x56","ufixed32x64","ufixed32x72","ufixed32x80","ufixed32x88","ufixed32x96","ufixed32x104","ufixed32x112","ufixed32x120","ufixed32x128","ufixed32x136","ufixed32x144","ufixed32x152","ufixed32x160","ufixed32x168","ufixed32x176","ufixed32x184","ufixed32x192","ufixed32x200","ufixed32x208","ufixed32x216","ufixed32x224","ufixed40x8","ufixed40x16","ufixed40x24","ufixed40x32","ufixed40x40","ufixed40x48","ufixed40x56","ufixed40x64","ufixed40x72","ufixed40x80","ufixed40x88","ufixed40x96","ufixed40x104","ufixed40x112","ufixed40x120","ufixed40x128","ufixed40x136","ufixed40x144","ufixed40x152","ufixed40x160","ufixed40x168","ufixed40x176","ufixed40x184","ufixed40x192","ufixed40x200","ufixed40x208","ufixed40x216","ufixed48x8","ufixed48x16","ufixed48x24","ufixed48x32","ufixed48x40","ufixed48x48","ufixed48x56","ufixed48x64","ufixed48x72","ufixed48x80","ufixed48x88","ufixed48x96","ufixed48x104","ufixed48x112","ufixed48x120","ufixed48x128","ufixed48x136","ufixed48x144","ufixed48x152","ufixed48x160","ufixed48x168","ufixed48x176","ufixed48x184","ufixed48x192","ufixed48x200","ufixed48x208","ufixed56x8","ufixed56x16","ufixed56x24","ufixed56x32","ufixed56x40","ufixed56x48","ufixed56x56","ufixed56x64","ufixed56x72","ufixed56x80","ufixed56x88","ufixed56x96","ufixed56x104","ufixed56x112","ufixed56x120","ufixed56x128","ufixed56x136","ufixed56x144","ufixed56x152","ufixed56x160","ufixed56x168","ufixed56x176","ufixed56x184","ufixed56x192","ufixed56x200","ufixed64x8","ufixed64x16","ufixed64x24","ufixed64x32","ufixed64x40","ufixed64x48","ufixed64x56","ufixed64x64","ufixed64x72","ufixed64x80","ufixed64x88","ufixed64x96","ufixed64x104","ufixed64x112","ufixed64x120","ufixed64x128","ufixed64x136","ufixed64x144","ufixed64x152","ufixed64x160","ufixed64x168","ufixed64x176","ufixed64x184","ufixed64x192","ufixed72x8","ufixed72x16","ufixed72x24","ufixed72x32","ufixed72x40","ufixed72x48","ufixed72x56","ufixed72x64","ufixed72x72","ufixed72x80","ufixed72x88","ufixed72x96","ufixed72x104","ufixed72x112","ufixed72x120","ufixed72x128","ufixed72x136","ufixed72x144","ufixed72x152","ufixed72x160","ufixed72x168","ufixed72x176","ufixed72x184","ufixed80x8","ufixed80x16","ufixed80x24","ufixed80x32","ufixed80x40","ufixed80x48","ufixed80x56","ufixed80x64","ufixed80x72","ufixed80x80","ufixed80x88","ufixed80x96","ufixed80x104","ufixed80x112","ufixed80x120","ufixed80x128","ufixed80x136","ufixed80x144","ufixed80x152","ufixed80x160","ufixed80x168","ufixed80x176","ufixed88x8","ufixed88x16","ufixed88x24","ufixed88x32","ufixed88x40","ufixed88x48","ufixed88x56","ufixed88x64","ufixed88x72","ufixed88x80","ufixed88x88","ufixed88x96","ufixed88x104","ufixed88x112","ufixed88x120","ufixed88x128","ufixed88x136","ufixed88x144","ufixed88x152","ufixed88x160","ufixed88x168","ufixed96x8","ufixed96x16","ufixed96x24","ufixed96x32","ufixed96x40","ufixed96x48","ufixed96x56","ufixed96x64","ufixed96x72","ufixed96x80","ufixed96x88","ufixed96x96","ufixed96x104","ufixed96x112","ufixed96x120","ufixed96x128","ufixed96x136","ufixed96x144","ufixed96x152","ufixed96x160","ufixed104x8","ufixed104x16","ufixed104x24","ufixed104x32","ufixed104x40","ufixed104x48","ufixed104x56","ufixed104x64","ufixed104x72","ufixed104x80","ufixed104x88","ufixed104x96","ufixed104x104","ufixed104x112","ufixed104x120","ufixed104x128","ufixed104x136","ufixed104x144","ufixed104x152","ufixed112x8","ufixed112x16","ufixed112x24","ufixed112x32","ufixed112x40","ufixed112x48","ufixed112x56","ufixed112x64","ufixed112x72","ufixed112x80","ufixed112x88","ufixed112x96","ufixed112x104","ufixed112x112","ufixed112x120","ufixed112x128","ufixed112x136","ufixed112x144","ufixed120x8","ufixed120x16","ufixed120x24","ufixed120x32","ufixed120x40","ufixed120x48","ufixed120x56","ufixed120x64","ufixed120x72","ufixed120x80","ufixed120x88","ufixed120x96","ufixed120x104","ufixed120x112","ufixed120x120","ufixed120x128","ufixed120x136","ufixed128x8","ufixed128x16","ufixed128x24","ufixed128x32","ufixed128x40","ufixed128x48","ufixed128x56","ufixed128x64","ufixed128x72","ufixed128x80","ufixed128x88","ufixed128x96","ufixed128x104","ufixed128x112","ufixed128x120","ufixed128x128","ufixed136x8","ufixed136x16","ufixed136x24","ufixed136x32","ufixed136x40","ufixed136x48","ufixed136x56","ufixed136x64","ufixed136x72","ufixed136x80","ufixed136x88","ufixed136x96","ufixed136x104","ufixed136x112","ufixed136x120","ufixed144x8","ufixed144x16","ufixed144x24","ufixed144x32","ufixed144x40","ufixed144x48","ufixed144x56","ufixed144x64","ufixed144x72","ufixed144x80","ufixed144x88","ufixed144x96","ufixed144x104","ufixed144x112","ufixed152x8","ufixed152x16","ufixed152x24","ufixed152x32","ufixed152x40","ufixed152x48","ufixed152x56","ufixed152x64","ufixed152x72","ufixed152x80","ufixed152x88","ufixed152x96","ufixed152x104","ufixed160x8","ufixed160x16","ufixed160x24","ufixed160x32","ufixed160x40","ufixed160x48","ufixed160x56","ufixed160x64","ufixed160x72","ufixed160x80","ufixed160x88","ufixed160x96","ufixed168x8","ufixed168x16","ufixed168x24","ufixed168x32","ufixed168x40","ufixed168x48","ufixed168x56","ufixed168x64","ufixed168x72","ufixed168x80","ufixed168x88","ufixed176x8","ufixed176x16","ufixed176x24","ufixed176x32","ufixed176x40","ufixed176x48","ufixed176x56","ufixed176x64","ufixed176x72","ufixed176x80","ufixed184x8","ufixed184x16","ufixed184x24","ufixed184x32","ufixed184x40","ufixed184x48","ufixed184x56","ufixed184x64","ufixed184x72","ufixed192x8","ufixed192x16","ufixed192x24","ufixed192x32","ufixed192x40","ufixed192x48","ufixed192x56","ufixed192x64","ufixed200x8","ufixed200x16","ufixed200x24","ufixed200x32","ufixed200x40","ufixed200x48","ufixed200x56","ufixed208x8","ufixed208x16","ufixed208x24","ufixed208x32","ufixed208x40","ufixed208x48","ufixed216x8","ufixed216x16","ufixed216x24","ufixed216x32","ufixed216x40","ufixed224x8","ufixed224x16","ufixed224x24","ufixed224x32","ufixed232x8","ufixed232x16","ufixed232x24","ufixed240x8","ufixed240x16","ufixed248x8","event","enum","let","mapping","private","public","external","inherited","payable","true","false","var","import","constant","if","else","for","else","for","while","do","break","continue","throw","returns","return","suicide","new","is","this","super"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/,"number.float"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/,"number.hex"],[/0[0-7']*[0-7](@integersuffix)/,"number.octal"],[/0[bB][0-1']*[0-1](@integersuffix)/,"number.binary"],[/\d[\d']*\d(@integersuffix)/,"number"],[/\d(@integersuffix)/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doccomment"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],doccomment:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]]}}}}]); \ No newline at end of file +"use strict";(self.webpackChunksterling_layout=self.webpackChunksterling_layout||[]).push([[1156],{1156:(x,e,i)=>{i.r(e),i.d(e,{conf:()=>d,language:()=>f});var d={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"],["<",">"]],autoClosingPairs:[{open:'"',close:'"',notIn:["string","comment"]},{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]}]},f={defaultToken:"",tokenPostfix:".sol",brackets:[{token:"delimiter.curly",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"},{token:"delimiter.angle",open:"<",close:">"}],keywords:["pragma","solidity","contract","library","using","struct","function","modifier","constructor","address","string","bool","Int","Uint","Byte","Fixed","Ufixed","int","int8","int16","int24","int32","int40","int48","int56","int64","int72","int80","int88","int96","int104","int112","int120","int128","int136","int144","int152","int160","int168","int176","int184","int192","int200","int208","int216","int224","int232","int240","int248","int256","uint","uint8","uint16","uint24","uint32","uint40","uint48","uint56","uint64","uint72","uint80","uint88","uint96","uint104","uint112","uint120","uint128","uint136","uint144","uint152","uint160","uint168","uint176","uint184","uint192","uint200","uint208","uint216","uint224","uint232","uint240","uint248","uint256","byte","bytes","bytes1","bytes2","bytes3","bytes4","bytes5","bytes6","bytes7","bytes8","bytes9","bytes10","bytes11","bytes12","bytes13","bytes14","bytes15","bytes16","bytes17","bytes18","bytes19","bytes20","bytes21","bytes22","bytes23","bytes24","bytes25","bytes26","bytes27","bytes28","bytes29","bytes30","bytes31","bytes32","fixed","fixed0x8","fixed0x16","fixed0x24","fixed0x32","fixed0x40","fixed0x48","fixed0x56","fixed0x64","fixed0x72","fixed0x80","fixed0x88","fixed0x96","fixed0x104","fixed0x112","fixed0x120","fixed0x128","fixed0x136","fixed0x144","fixed0x152","fixed0x160","fixed0x168","fixed0x176","fixed0x184","fixed0x192","fixed0x200","fixed0x208","fixed0x216","fixed0x224","fixed0x232","fixed0x240","fixed0x248","fixed0x256","fixed8x8","fixed8x16","fixed8x24","fixed8x32","fixed8x40","fixed8x48","fixed8x56","fixed8x64","fixed8x72","fixed8x80","fixed8x88","fixed8x96","fixed8x104","fixed8x112","fixed8x120","fixed8x128","fixed8x136","fixed8x144","fixed8x152","fixed8x160","fixed8x168","fixed8x176","fixed8x184","fixed8x192","fixed8x200","fixed8x208","fixed8x216","fixed8x224","fixed8x232","fixed8x240","fixed8x248","fixed16x8","fixed16x16","fixed16x24","fixed16x32","fixed16x40","fixed16x48","fixed16x56","fixed16x64","fixed16x72","fixed16x80","fixed16x88","fixed16x96","fixed16x104","fixed16x112","fixed16x120","fixed16x128","fixed16x136","fixed16x144","fixed16x152","fixed16x160","fixed16x168","fixed16x176","fixed16x184","fixed16x192","fixed16x200","fixed16x208","fixed16x216","fixed16x224","fixed16x232","fixed16x240","fixed24x8","fixed24x16","fixed24x24","fixed24x32","fixed24x40","fixed24x48","fixed24x56","fixed24x64","fixed24x72","fixed24x80","fixed24x88","fixed24x96","fixed24x104","fixed24x112","fixed24x120","fixed24x128","fixed24x136","fixed24x144","fixed24x152","fixed24x160","fixed24x168","fixed24x176","fixed24x184","fixed24x192","fixed24x200","fixed24x208","fixed24x216","fixed24x224","fixed24x232","fixed32x8","fixed32x16","fixed32x24","fixed32x32","fixed32x40","fixed32x48","fixed32x56","fixed32x64","fixed32x72","fixed32x80","fixed32x88","fixed32x96","fixed32x104","fixed32x112","fixed32x120","fixed32x128","fixed32x136","fixed32x144","fixed32x152","fixed32x160","fixed32x168","fixed32x176","fixed32x184","fixed32x192","fixed32x200","fixed32x208","fixed32x216","fixed32x224","fixed40x8","fixed40x16","fixed40x24","fixed40x32","fixed40x40","fixed40x48","fixed40x56","fixed40x64","fixed40x72","fixed40x80","fixed40x88","fixed40x96","fixed40x104","fixed40x112","fixed40x120","fixed40x128","fixed40x136","fixed40x144","fixed40x152","fixed40x160","fixed40x168","fixed40x176","fixed40x184","fixed40x192","fixed40x200","fixed40x208","fixed40x216","fixed48x8","fixed48x16","fixed48x24","fixed48x32","fixed48x40","fixed48x48","fixed48x56","fixed48x64","fixed48x72","fixed48x80","fixed48x88","fixed48x96","fixed48x104","fixed48x112","fixed48x120","fixed48x128","fixed48x136","fixed48x144","fixed48x152","fixed48x160","fixed48x168","fixed48x176","fixed48x184","fixed48x192","fixed48x200","fixed48x208","fixed56x8","fixed56x16","fixed56x24","fixed56x32","fixed56x40","fixed56x48","fixed56x56","fixed56x64","fixed56x72","fixed56x80","fixed56x88","fixed56x96","fixed56x104","fixed56x112","fixed56x120","fixed56x128","fixed56x136","fixed56x144","fixed56x152","fixed56x160","fixed56x168","fixed56x176","fixed56x184","fixed56x192","fixed56x200","fixed64x8","fixed64x16","fixed64x24","fixed64x32","fixed64x40","fixed64x48","fixed64x56","fixed64x64","fixed64x72","fixed64x80","fixed64x88","fixed64x96","fixed64x104","fixed64x112","fixed64x120","fixed64x128","fixed64x136","fixed64x144","fixed64x152","fixed64x160","fixed64x168","fixed64x176","fixed64x184","fixed64x192","fixed72x8","fixed72x16","fixed72x24","fixed72x32","fixed72x40","fixed72x48","fixed72x56","fixed72x64","fixed72x72","fixed72x80","fixed72x88","fixed72x96","fixed72x104","fixed72x112","fixed72x120","fixed72x128","fixed72x136","fixed72x144","fixed72x152","fixed72x160","fixed72x168","fixed72x176","fixed72x184","fixed80x8","fixed80x16","fixed80x24","fixed80x32","fixed80x40","fixed80x48","fixed80x56","fixed80x64","fixed80x72","fixed80x80","fixed80x88","fixed80x96","fixed80x104","fixed80x112","fixed80x120","fixed80x128","fixed80x136","fixed80x144","fixed80x152","fixed80x160","fixed80x168","fixed80x176","fixed88x8","fixed88x16","fixed88x24","fixed88x32","fixed88x40","fixed88x48","fixed88x56","fixed88x64","fixed88x72","fixed88x80","fixed88x88","fixed88x96","fixed88x104","fixed88x112","fixed88x120","fixed88x128","fixed88x136","fixed88x144","fixed88x152","fixed88x160","fixed88x168","fixed96x8","fixed96x16","fixed96x24","fixed96x32","fixed96x40","fixed96x48","fixed96x56","fixed96x64","fixed96x72","fixed96x80","fixed96x88","fixed96x96","fixed96x104","fixed96x112","fixed96x120","fixed96x128","fixed96x136","fixed96x144","fixed96x152","fixed96x160","fixed104x8","fixed104x16","fixed104x24","fixed104x32","fixed104x40","fixed104x48","fixed104x56","fixed104x64","fixed104x72","fixed104x80","fixed104x88","fixed104x96","fixed104x104","fixed104x112","fixed104x120","fixed104x128","fixed104x136","fixed104x144","fixed104x152","fixed112x8","fixed112x16","fixed112x24","fixed112x32","fixed112x40","fixed112x48","fixed112x56","fixed112x64","fixed112x72","fixed112x80","fixed112x88","fixed112x96","fixed112x104","fixed112x112","fixed112x120","fixed112x128","fixed112x136","fixed112x144","fixed120x8","fixed120x16","fixed120x24","fixed120x32","fixed120x40","fixed120x48","fixed120x56","fixed120x64","fixed120x72","fixed120x80","fixed120x88","fixed120x96","fixed120x104","fixed120x112","fixed120x120","fixed120x128","fixed120x136","fixed128x8","fixed128x16","fixed128x24","fixed128x32","fixed128x40","fixed128x48","fixed128x56","fixed128x64","fixed128x72","fixed128x80","fixed128x88","fixed128x96","fixed128x104","fixed128x112","fixed128x120","fixed128x128","fixed136x8","fixed136x16","fixed136x24","fixed136x32","fixed136x40","fixed136x48","fixed136x56","fixed136x64","fixed136x72","fixed136x80","fixed136x88","fixed136x96","fixed136x104","fixed136x112","fixed136x120","fixed144x8","fixed144x16","fixed144x24","fixed144x32","fixed144x40","fixed144x48","fixed144x56","fixed144x64","fixed144x72","fixed144x80","fixed144x88","fixed144x96","fixed144x104","fixed144x112","fixed152x8","fixed152x16","fixed152x24","fixed152x32","fixed152x40","fixed152x48","fixed152x56","fixed152x64","fixed152x72","fixed152x80","fixed152x88","fixed152x96","fixed152x104","fixed160x8","fixed160x16","fixed160x24","fixed160x32","fixed160x40","fixed160x48","fixed160x56","fixed160x64","fixed160x72","fixed160x80","fixed160x88","fixed160x96","fixed168x8","fixed168x16","fixed168x24","fixed168x32","fixed168x40","fixed168x48","fixed168x56","fixed168x64","fixed168x72","fixed168x80","fixed168x88","fixed176x8","fixed176x16","fixed176x24","fixed176x32","fixed176x40","fixed176x48","fixed176x56","fixed176x64","fixed176x72","fixed176x80","fixed184x8","fixed184x16","fixed184x24","fixed184x32","fixed184x40","fixed184x48","fixed184x56","fixed184x64","fixed184x72","fixed192x8","fixed192x16","fixed192x24","fixed192x32","fixed192x40","fixed192x48","fixed192x56","fixed192x64","fixed200x8","fixed200x16","fixed200x24","fixed200x32","fixed200x40","fixed200x48","fixed200x56","fixed208x8","fixed208x16","fixed208x24","fixed208x32","fixed208x40","fixed208x48","fixed216x8","fixed216x16","fixed216x24","fixed216x32","fixed216x40","fixed224x8","fixed224x16","fixed224x24","fixed224x32","fixed232x8","fixed232x16","fixed232x24","fixed240x8","fixed240x16","fixed248x8","ufixed","ufixed0x8","ufixed0x16","ufixed0x24","ufixed0x32","ufixed0x40","ufixed0x48","ufixed0x56","ufixed0x64","ufixed0x72","ufixed0x80","ufixed0x88","ufixed0x96","ufixed0x104","ufixed0x112","ufixed0x120","ufixed0x128","ufixed0x136","ufixed0x144","ufixed0x152","ufixed0x160","ufixed0x168","ufixed0x176","ufixed0x184","ufixed0x192","ufixed0x200","ufixed0x208","ufixed0x216","ufixed0x224","ufixed0x232","ufixed0x240","ufixed0x248","ufixed0x256","ufixed8x8","ufixed8x16","ufixed8x24","ufixed8x32","ufixed8x40","ufixed8x48","ufixed8x56","ufixed8x64","ufixed8x72","ufixed8x80","ufixed8x88","ufixed8x96","ufixed8x104","ufixed8x112","ufixed8x120","ufixed8x128","ufixed8x136","ufixed8x144","ufixed8x152","ufixed8x160","ufixed8x168","ufixed8x176","ufixed8x184","ufixed8x192","ufixed8x200","ufixed8x208","ufixed8x216","ufixed8x224","ufixed8x232","ufixed8x240","ufixed8x248","ufixed16x8","ufixed16x16","ufixed16x24","ufixed16x32","ufixed16x40","ufixed16x48","ufixed16x56","ufixed16x64","ufixed16x72","ufixed16x80","ufixed16x88","ufixed16x96","ufixed16x104","ufixed16x112","ufixed16x120","ufixed16x128","ufixed16x136","ufixed16x144","ufixed16x152","ufixed16x160","ufixed16x168","ufixed16x176","ufixed16x184","ufixed16x192","ufixed16x200","ufixed16x208","ufixed16x216","ufixed16x224","ufixed16x232","ufixed16x240","ufixed24x8","ufixed24x16","ufixed24x24","ufixed24x32","ufixed24x40","ufixed24x48","ufixed24x56","ufixed24x64","ufixed24x72","ufixed24x80","ufixed24x88","ufixed24x96","ufixed24x104","ufixed24x112","ufixed24x120","ufixed24x128","ufixed24x136","ufixed24x144","ufixed24x152","ufixed24x160","ufixed24x168","ufixed24x176","ufixed24x184","ufixed24x192","ufixed24x200","ufixed24x208","ufixed24x216","ufixed24x224","ufixed24x232","ufixed32x8","ufixed32x16","ufixed32x24","ufixed32x32","ufixed32x40","ufixed32x48","ufixed32x56","ufixed32x64","ufixed32x72","ufixed32x80","ufixed32x88","ufixed32x96","ufixed32x104","ufixed32x112","ufixed32x120","ufixed32x128","ufixed32x136","ufixed32x144","ufixed32x152","ufixed32x160","ufixed32x168","ufixed32x176","ufixed32x184","ufixed32x192","ufixed32x200","ufixed32x208","ufixed32x216","ufixed32x224","ufixed40x8","ufixed40x16","ufixed40x24","ufixed40x32","ufixed40x40","ufixed40x48","ufixed40x56","ufixed40x64","ufixed40x72","ufixed40x80","ufixed40x88","ufixed40x96","ufixed40x104","ufixed40x112","ufixed40x120","ufixed40x128","ufixed40x136","ufixed40x144","ufixed40x152","ufixed40x160","ufixed40x168","ufixed40x176","ufixed40x184","ufixed40x192","ufixed40x200","ufixed40x208","ufixed40x216","ufixed48x8","ufixed48x16","ufixed48x24","ufixed48x32","ufixed48x40","ufixed48x48","ufixed48x56","ufixed48x64","ufixed48x72","ufixed48x80","ufixed48x88","ufixed48x96","ufixed48x104","ufixed48x112","ufixed48x120","ufixed48x128","ufixed48x136","ufixed48x144","ufixed48x152","ufixed48x160","ufixed48x168","ufixed48x176","ufixed48x184","ufixed48x192","ufixed48x200","ufixed48x208","ufixed56x8","ufixed56x16","ufixed56x24","ufixed56x32","ufixed56x40","ufixed56x48","ufixed56x56","ufixed56x64","ufixed56x72","ufixed56x80","ufixed56x88","ufixed56x96","ufixed56x104","ufixed56x112","ufixed56x120","ufixed56x128","ufixed56x136","ufixed56x144","ufixed56x152","ufixed56x160","ufixed56x168","ufixed56x176","ufixed56x184","ufixed56x192","ufixed56x200","ufixed64x8","ufixed64x16","ufixed64x24","ufixed64x32","ufixed64x40","ufixed64x48","ufixed64x56","ufixed64x64","ufixed64x72","ufixed64x80","ufixed64x88","ufixed64x96","ufixed64x104","ufixed64x112","ufixed64x120","ufixed64x128","ufixed64x136","ufixed64x144","ufixed64x152","ufixed64x160","ufixed64x168","ufixed64x176","ufixed64x184","ufixed64x192","ufixed72x8","ufixed72x16","ufixed72x24","ufixed72x32","ufixed72x40","ufixed72x48","ufixed72x56","ufixed72x64","ufixed72x72","ufixed72x80","ufixed72x88","ufixed72x96","ufixed72x104","ufixed72x112","ufixed72x120","ufixed72x128","ufixed72x136","ufixed72x144","ufixed72x152","ufixed72x160","ufixed72x168","ufixed72x176","ufixed72x184","ufixed80x8","ufixed80x16","ufixed80x24","ufixed80x32","ufixed80x40","ufixed80x48","ufixed80x56","ufixed80x64","ufixed80x72","ufixed80x80","ufixed80x88","ufixed80x96","ufixed80x104","ufixed80x112","ufixed80x120","ufixed80x128","ufixed80x136","ufixed80x144","ufixed80x152","ufixed80x160","ufixed80x168","ufixed80x176","ufixed88x8","ufixed88x16","ufixed88x24","ufixed88x32","ufixed88x40","ufixed88x48","ufixed88x56","ufixed88x64","ufixed88x72","ufixed88x80","ufixed88x88","ufixed88x96","ufixed88x104","ufixed88x112","ufixed88x120","ufixed88x128","ufixed88x136","ufixed88x144","ufixed88x152","ufixed88x160","ufixed88x168","ufixed96x8","ufixed96x16","ufixed96x24","ufixed96x32","ufixed96x40","ufixed96x48","ufixed96x56","ufixed96x64","ufixed96x72","ufixed96x80","ufixed96x88","ufixed96x96","ufixed96x104","ufixed96x112","ufixed96x120","ufixed96x128","ufixed96x136","ufixed96x144","ufixed96x152","ufixed96x160","ufixed104x8","ufixed104x16","ufixed104x24","ufixed104x32","ufixed104x40","ufixed104x48","ufixed104x56","ufixed104x64","ufixed104x72","ufixed104x80","ufixed104x88","ufixed104x96","ufixed104x104","ufixed104x112","ufixed104x120","ufixed104x128","ufixed104x136","ufixed104x144","ufixed104x152","ufixed112x8","ufixed112x16","ufixed112x24","ufixed112x32","ufixed112x40","ufixed112x48","ufixed112x56","ufixed112x64","ufixed112x72","ufixed112x80","ufixed112x88","ufixed112x96","ufixed112x104","ufixed112x112","ufixed112x120","ufixed112x128","ufixed112x136","ufixed112x144","ufixed120x8","ufixed120x16","ufixed120x24","ufixed120x32","ufixed120x40","ufixed120x48","ufixed120x56","ufixed120x64","ufixed120x72","ufixed120x80","ufixed120x88","ufixed120x96","ufixed120x104","ufixed120x112","ufixed120x120","ufixed120x128","ufixed120x136","ufixed128x8","ufixed128x16","ufixed128x24","ufixed128x32","ufixed128x40","ufixed128x48","ufixed128x56","ufixed128x64","ufixed128x72","ufixed128x80","ufixed128x88","ufixed128x96","ufixed128x104","ufixed128x112","ufixed128x120","ufixed128x128","ufixed136x8","ufixed136x16","ufixed136x24","ufixed136x32","ufixed136x40","ufixed136x48","ufixed136x56","ufixed136x64","ufixed136x72","ufixed136x80","ufixed136x88","ufixed136x96","ufixed136x104","ufixed136x112","ufixed136x120","ufixed144x8","ufixed144x16","ufixed144x24","ufixed144x32","ufixed144x40","ufixed144x48","ufixed144x56","ufixed144x64","ufixed144x72","ufixed144x80","ufixed144x88","ufixed144x96","ufixed144x104","ufixed144x112","ufixed152x8","ufixed152x16","ufixed152x24","ufixed152x32","ufixed152x40","ufixed152x48","ufixed152x56","ufixed152x64","ufixed152x72","ufixed152x80","ufixed152x88","ufixed152x96","ufixed152x104","ufixed160x8","ufixed160x16","ufixed160x24","ufixed160x32","ufixed160x40","ufixed160x48","ufixed160x56","ufixed160x64","ufixed160x72","ufixed160x80","ufixed160x88","ufixed160x96","ufixed168x8","ufixed168x16","ufixed168x24","ufixed168x32","ufixed168x40","ufixed168x48","ufixed168x56","ufixed168x64","ufixed168x72","ufixed168x80","ufixed168x88","ufixed176x8","ufixed176x16","ufixed176x24","ufixed176x32","ufixed176x40","ufixed176x48","ufixed176x56","ufixed176x64","ufixed176x72","ufixed176x80","ufixed184x8","ufixed184x16","ufixed184x24","ufixed184x32","ufixed184x40","ufixed184x48","ufixed184x56","ufixed184x64","ufixed184x72","ufixed192x8","ufixed192x16","ufixed192x24","ufixed192x32","ufixed192x40","ufixed192x48","ufixed192x56","ufixed192x64","ufixed200x8","ufixed200x16","ufixed200x24","ufixed200x32","ufixed200x40","ufixed200x48","ufixed200x56","ufixed208x8","ufixed208x16","ufixed208x24","ufixed208x32","ufixed208x40","ufixed208x48","ufixed216x8","ufixed216x16","ufixed216x24","ufixed216x32","ufixed216x40","ufixed224x8","ufixed224x16","ufixed224x24","ufixed224x32","ufixed232x8","ufixed232x16","ufixed232x24","ufixed240x8","ufixed240x16","ufixed248x8","event","enum","let","mapping","private","public","external","inherited","payable","true","false","var","import","constant","if","else","for","else","for","while","do","break","continue","throw","returns","return","suicide","new","is","this","super"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/,"number.float"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/,"number.hex"],[/0[0-7']*[0-7](@integersuffix)/,"number.octal"],[/0[bB][0-1']*[0-1](@integersuffix)/,"number.binary"],[/\d[\d']*\d(@integersuffix)/,"number"],[/\d(@integersuffix)/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doccomment"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],doccomment:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]]}}}}]); \ No newline at end of file diff --git a/forge/sterling/build/1259.bundle.js b/forge/sterling/build/1259.bundle.js index c20e05c8e..9d7ed2375 100644 --- a/forge/sterling/build/1259.bundle.js +++ b/forge/sterling/build/1259.bundle.js @@ -1,2 +1,2 @@ /*! For license information please see 1259.bundle.js.LICENSE.txt */ -"use strict";(self.webpackChunksterling_ts=self.webpackChunksterling_ts||[]).push([[1259],{91259:(E,S,e)=>{e.r(S),e.d(S,{conf:()=>T,language:()=>R});var T={brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},R={defaultToken:"",tokenPostfix:".redis",ignoreCase:!0,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:["APPEND","AUTH","BGREWRITEAOF","BGSAVE","BITCOUNT","BITFIELD","BITOP","BITPOS","BLPOP","BRPOP","BRPOPLPUSH","CLIENT","KILL","LIST","GETNAME","PAUSE","REPLY","SETNAME","CLUSTER","ADDSLOTS","COUNT-FAILURE-REPORTS","COUNTKEYSINSLOT","DELSLOTS","FAILOVER","FORGET","GETKEYSINSLOT","INFO","KEYSLOT","MEET","NODES","REPLICATE","RESET","SAVECONFIG","SET-CONFIG-EPOCH","SETSLOT","SLAVES","SLOTS","COMMAND","COUNT","GETKEYS","CONFIG","GET","REWRITE","SET","RESETSTAT","DBSIZE","DEBUG","OBJECT","SEGFAULT","DECR","DECRBY","DEL","DISCARD","DUMP","ECHO","EVAL","EVALSHA","EXEC","EXISTS","EXPIRE","EXPIREAT","FLUSHALL","FLUSHDB","GEOADD","GEOHASH","GEOPOS","GEODIST","GEORADIUS","GEORADIUSBYMEMBER","GETBIT","GETRANGE","GETSET","HDEL","HEXISTS","HGET","HGETALL","HINCRBY","HINCRBYFLOAT","HKEYS","HLEN","HMGET","HMSET","HSET","HSETNX","HSTRLEN","HVALS","INCR","INCRBY","INCRBYFLOAT","KEYS","LASTSAVE","LINDEX","LINSERT","LLEN","LPOP","LPUSH","LPUSHX","LRANGE","LREM","LSET","LTRIM","MGET","MIGRATE","MONITOR","MOVE","MSET","MSETNX","MULTI","PERSIST","PEXPIRE","PEXPIREAT","PFADD","PFCOUNT","PFMERGE","PING","PSETEX","PSUBSCRIBE","PUBSUB","PTTL","PUBLISH","PUNSUBSCRIBE","QUIT","RANDOMKEY","READONLY","READWRITE","RENAME","RENAMENX","RESTORE","ROLE","RPOP","RPOPLPUSH","RPUSH","RPUSHX","SADD","SAVE","SCARD","SCRIPT","FLUSH","LOAD","SDIFF","SDIFFSTORE","SELECT","SETBIT","SETEX","SETNX","SETRANGE","SHUTDOWN","SINTER","SINTERSTORE","SISMEMBER","SLAVEOF","SLOWLOG","SMEMBERS","SMOVE","SORT","SPOP","SRANDMEMBER","SREM","STRLEN","SUBSCRIBE","SUNION","SUNIONSTORE","SWAPDB","SYNC","TIME","TOUCH","TTL","TYPE","UNSUBSCRIBE","UNLINK","UNWATCH","WAIT","WATCH","ZADD","ZCARD","ZCOUNT","ZINCRBY","ZINTERSTORE","ZLEXCOUNT","ZRANGE","ZRANGEBYLEX","ZREVRANGEBYLEX","ZRANGEBYSCORE","ZRANK","ZREM","ZREMRANGEBYLEX","ZREMRANGEBYRANK","ZREMRANGEBYSCORE","ZREVRANGE","ZREVRANGEBYSCORE","ZREVRANK","ZSCORE","ZUNIONSTORE","SCAN","SSCAN","HSCAN","ZSCAN"],operators:[],builtinFunctions:[],builtinVariables:[],pseudoColumns:[],tokenizer:{root:[{include:"@whitespace"},{include:"@pseudoColumns"},{include:"@numbers"},{include:"@strings"},{include:"@scopes"},[/[;,.]/,"delimiter"],[/[()]/,"@brackets"],[/[\w@#$]+/,{cases:{"@keywords":"keyword","@operators":"operator","@builtinVariables":"predefined","@builtinFunctions":"predefined","@default":"identifier"}}],[/[<>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],pseudoColumns:[[/[$][A-Za-z_][\w@#$]*/,{cases:{"@pseudoColumns":"predefined","@default":"identifier"}}]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/'/,{token:"string",next:"@string"}],[/"/,{token:"string.double",next:"@stringDouble"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],stringDouble:[[/[^"]+/,"string.double"],[/""/,"string.double"],[/"/,{token:"string.double",next:"@pop"}]],scopes:[]}}}}]); \ No newline at end of file +"use strict";(self.webpackChunksterling_layout=self.webpackChunksterling_layout||[]).push([[1259],{91259:(E,S,e)=>{e.r(S),e.d(S,{conf:()=>T,language:()=>R});var T={brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},R={defaultToken:"",tokenPostfix:".redis",ignoreCase:!0,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:["APPEND","AUTH","BGREWRITEAOF","BGSAVE","BITCOUNT","BITFIELD","BITOP","BITPOS","BLPOP","BRPOP","BRPOPLPUSH","CLIENT","KILL","LIST","GETNAME","PAUSE","REPLY","SETNAME","CLUSTER","ADDSLOTS","COUNT-FAILURE-REPORTS","COUNTKEYSINSLOT","DELSLOTS","FAILOVER","FORGET","GETKEYSINSLOT","INFO","KEYSLOT","MEET","NODES","REPLICATE","RESET","SAVECONFIG","SET-CONFIG-EPOCH","SETSLOT","SLAVES","SLOTS","COMMAND","COUNT","GETKEYS","CONFIG","GET","REWRITE","SET","RESETSTAT","DBSIZE","DEBUG","OBJECT","SEGFAULT","DECR","DECRBY","DEL","DISCARD","DUMP","ECHO","EVAL","EVALSHA","EXEC","EXISTS","EXPIRE","EXPIREAT","FLUSHALL","FLUSHDB","GEOADD","GEOHASH","GEOPOS","GEODIST","GEORADIUS","GEORADIUSBYMEMBER","GETBIT","GETRANGE","GETSET","HDEL","HEXISTS","HGET","HGETALL","HINCRBY","HINCRBYFLOAT","HKEYS","HLEN","HMGET","HMSET","HSET","HSETNX","HSTRLEN","HVALS","INCR","INCRBY","INCRBYFLOAT","KEYS","LASTSAVE","LINDEX","LINSERT","LLEN","LPOP","LPUSH","LPUSHX","LRANGE","LREM","LSET","LTRIM","MGET","MIGRATE","MONITOR","MOVE","MSET","MSETNX","MULTI","PERSIST","PEXPIRE","PEXPIREAT","PFADD","PFCOUNT","PFMERGE","PING","PSETEX","PSUBSCRIBE","PUBSUB","PTTL","PUBLISH","PUNSUBSCRIBE","QUIT","RANDOMKEY","READONLY","READWRITE","RENAME","RENAMENX","RESTORE","ROLE","RPOP","RPOPLPUSH","RPUSH","RPUSHX","SADD","SAVE","SCARD","SCRIPT","FLUSH","LOAD","SDIFF","SDIFFSTORE","SELECT","SETBIT","SETEX","SETNX","SETRANGE","SHUTDOWN","SINTER","SINTERSTORE","SISMEMBER","SLAVEOF","SLOWLOG","SMEMBERS","SMOVE","SORT","SPOP","SRANDMEMBER","SREM","STRLEN","SUBSCRIBE","SUNION","SUNIONSTORE","SWAPDB","SYNC","TIME","TOUCH","TTL","TYPE","UNSUBSCRIBE","UNLINK","UNWATCH","WAIT","WATCH","ZADD","ZCARD","ZCOUNT","ZINCRBY","ZINTERSTORE","ZLEXCOUNT","ZRANGE","ZRANGEBYLEX","ZREVRANGEBYLEX","ZRANGEBYSCORE","ZRANK","ZREM","ZREMRANGEBYLEX","ZREMRANGEBYRANK","ZREMRANGEBYSCORE","ZREVRANGE","ZREVRANGEBYSCORE","ZREVRANK","ZSCORE","ZUNIONSTORE","SCAN","SSCAN","HSCAN","ZSCAN"],operators:[],builtinFunctions:[],builtinVariables:[],pseudoColumns:[],tokenizer:{root:[{include:"@whitespace"},{include:"@pseudoColumns"},{include:"@numbers"},{include:"@strings"},{include:"@scopes"},[/[;,.]/,"delimiter"],[/[()]/,"@brackets"],[/[\w@#$]+/,{cases:{"@keywords":"keyword","@operators":"operator","@builtinVariables":"predefined","@builtinFunctions":"predefined","@default":"identifier"}}],[/[<>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],pseudoColumns:[[/[$][A-Za-z_][\w@#$]*/,{cases:{"@pseudoColumns":"predefined","@default":"identifier"}}]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/'/,{token:"string",next:"@string"}],[/"/,{token:"string.double",next:"@stringDouble"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],stringDouble:[[/[^"]+/,"string.double"],[/""/,"string.double"],[/"/,{token:"string.double",next:"@pop"}]],scopes:[]}}}}]); \ No newline at end of file diff --git a/forge/sterling/build/1448.bundle.js b/forge/sterling/build/1448.bundle.js index 9983cf60b..35c7a5e11 100644 --- a/forge/sterling/build/1448.bundle.js +++ b/forge/sterling/build/1448.bundle.js @@ -1,2 +1,2 @@ /*! For license information please see 1448.bundle.js.LICENSE.txt */ -"use strict";(self.webpackChunksterling_ts=self.webpackChunksterling_ts||[]).push([[1448],{11448:(e,o,t)=>{t.r(o),t.d(o,{conf:()=>n,language:()=>s});var n={comments:{lineComment:"//",blockComment:["(*","*)"]},brackets:[["{","}"],["[","]"],["(",")"],["<",">"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'},{open:"(*",close:"*)"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'},{open:"(*",close:"*)"}]},s={defaultToken:"",tokenPostfix:".cameligo",ignoreCase:!0,brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],keywords:["abs","assert","block","Bytes","case","Crypto","Current","else","failwith","false","for","fun","if","in","let","let%entry","let%init","List","list","Map","map","match","match%nat","mod","not","operation","Operation","of","record","Set","set","sender","skip","source","String","then","to","true","type","with"],typeKeywords:["int","unit","string","tz","nat","bool"],operators:["=",">","<","<=",">=","<>",":",":=","and","mod","or","+","-","*","/","@","&","^","%","->","<-","&&","||"],symbols:/[=><:@\^&|+\-*\/\^%]+/,tokenizer:{root:[[/[a-zA-Z_][\w]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/\$[0-9a-fA-F]{1,16}/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'/,"string","@string"],[/'[^\\']'/,"string"],[/'/,"string.invalid"],[/\#\d+/,"string"]],comment:[[/[^\(\*]+/,"comment"],[/\*\)/,"comment","@pop"],[/\(\*/,"comment"]],string:[[/[^\\']+/,"string"],[/\\./,"string.escape.invalid"],[/'/,{token:"string.quote",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,"white"],[/\(\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}}}}]); \ No newline at end of file +"use strict";(self.webpackChunksterling_layout=self.webpackChunksterling_layout||[]).push([[1448],{11448:(e,o,t)=>{t.r(o),t.d(o,{conf:()=>n,language:()=>s});var n={comments:{lineComment:"//",blockComment:["(*","*)"]},brackets:[["{","}"],["[","]"],["(",")"],["<",">"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'},{open:"(*",close:"*)"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'},{open:"(*",close:"*)"}]},s={defaultToken:"",tokenPostfix:".cameligo",ignoreCase:!0,brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],keywords:["abs","assert","block","Bytes","case","Crypto","Current","else","failwith","false","for","fun","if","in","let","let%entry","let%init","List","list","Map","map","match","match%nat","mod","not","operation","Operation","of","record","Set","set","sender","skip","source","String","then","to","true","type","with"],typeKeywords:["int","unit","string","tz","nat","bool"],operators:["=",">","<","<=",">=","<>",":",":=","and","mod","or","+","-","*","/","@","&","^","%","->","<-","&&","||"],symbols:/[=><:@\^&|+\-*\/\^%]+/,tokenizer:{root:[[/[a-zA-Z_][\w]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/\$[0-9a-fA-F]{1,16}/,"number.hex"],[/\d+/,"number"],[/[;,.]/,"delimiter"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'/,"string","@string"],[/'[^\\']'/,"string"],[/'/,"string.invalid"],[/\#\d+/,"string"]],comment:[[/[^\(\*]+/,"comment"],[/\*\)/,"comment","@pop"],[/\(\*/,"comment"]],string:[[/[^\\']+/,"string"],[/\\./,"string.escape.invalid"],[/'/,{token:"string.quote",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,"white"],[/\(\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}}}}]); \ No newline at end of file diff --git a/forge/sterling/build/1471.bundle.js b/forge/sterling/build/1471.bundle.js index e1ba47d98..9fa6d7f12 100644 --- a/forge/sterling/build/1471.bundle.js +++ b/forge/sterling/build/1471.bundle.js @@ -1,2 +1,2 @@ /*! For license information please see 1471.bundle.js.LICENSE.txt */ -"use strict";(self.webpackChunksterling_ts=self.webpackChunksterling_ts||[]).push([[1471],{31471:(e,t,n)=>{n.r(t),n.d(t,{conf:()=>s,language:()=>o});var s={comments:{lineComment:"#"}},o={defaultToken:"keyword",ignoreCase:!0,tokenPostfix:".azcli",str:/[^#\s]/,tokenizer:{root:[{include:"@comment"},[/\s-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}],[/^-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}]],type:[{include:"@comment"},[/-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":"key.identifier"}}],[/@str+\s*/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}]],comment:[[/#.*$/,{cases:{"@eos":{token:"comment",next:"@popall"}}}]]}}}}]); \ No newline at end of file +"use strict";(self.webpackChunksterling_layout=self.webpackChunksterling_layout||[]).push([[1471],{31471:(e,t,n)=>{n.r(t),n.d(t,{conf:()=>s,language:()=>o});var s={comments:{lineComment:"#"}},o={defaultToken:"keyword",ignoreCase:!0,tokenPostfix:".azcli",str:/[^#\s]/,tokenizer:{root:[{include:"@comment"},[/\s-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}],[/^-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}]],type:[{include:"@comment"},[/-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":"key.identifier"}}],[/@str+\s*/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}]],comment:[[/#.*$/,{cases:{"@eos":{token:"comment",next:"@popall"}}}]]}}}}]); \ No newline at end of file diff --git a/forge/sterling/build/180.bundle.js b/forge/sterling/build/180.bundle.js index d84448b81..ab9bb359c 100644 --- a/forge/sterling/build/180.bundle.js +++ b/forge/sterling/build/180.bundle.js @@ -1,2 +1,2 @@ /*! For license information please see 180.bundle.js.LICENSE.txt */ -"use strict";(self.webpackChunksterling_ts=self.webpackChunksterling_ts||[]).push([[180],{90180:(e,t,o)=>{o.r(t),o.d(t,{conf:()=>r,language:()=>n});var r={wordPattern:/(unary_[@~!#%^&*()\-=+\\|:<>\/?]+)|([a-zA-Z_$][\w$]*?_=)|(`[^`]+`)|([a-zA-Z_$][\w$]*)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:))")}}},n={tokenPostfix:".scala",keywords:["asInstanceOf","catch","class","classOf","def","do","else","extends","finally","for","foreach","forSome","if","import","isInstanceOf","macro","match","new","object","package","return","throw","trait","try","type","until","val","var","while","with","yield","given","enum","then"],softKeywords:["as","export","extension","end","derives","on"],constants:["true","false","null","this","super"],modifiers:["abstract","final","implicit","lazy","override","private","protected","sealed"],softModifiers:["inline","opaque","open","transparent","using"],name:/(?:[a-z_$][\w$]*|`[^`]+`)/,type:/(?:[A-Z][\w$]*)/,symbols:/[=>))/,["@brackets","white","variable"]],[/@name/,{cases:{"@keywords":"keyword","@softKeywords":"keyword","@modifiers":"keyword.modifier","@softModifiers":"keyword.modifier","@constants":{token:"constant",next:"@allowMethod"},"@default":{token:"identifier",next:"@allowMethod"}}}],[/@type/,"type","@allowMethod"],{include:"@whitespace"},[/@[a-zA-Z_$][\w$]*(?:\.[a-zA-Z_$][\w$]*)*/,"annotation"],[/[{(]/,"@brackets"],[/[})]/,"@brackets","@allowMethod"],[/\[/,"operator.square"],[/](?!\s*(?:va[rl]|def|type)\b)/,"operator.square","@allowMethod"],[/]/,"operator.square"],[/([=-]>|<-|>:|<:|:>|<%)(?=[\s\w()[\]{},\."'`])/,"keyword"],[/@symbols/,"operator"],[/[;,\.]/,"delimiter"],[/'[a-zA-Z$][\w$]*(?!')/,"attribute.name"],[/'[^\\']'/,"string","@allowMethod"],[/(')(@escapes)(')/,["string","string.escape",{token:"string",next:"@allowMethod"}]],[/'/,"string.invalid"]],import:[[/;/,"delimiter","@pop"],[/^|$/,"","@pop"],[/[ \t]+/,"white"],[/[\n\r]+/,"white","@pop"],[/\/\*/,"comment","@comment"],[/@name|@type/,"type"],[/[(){}]/,"@brackets"],[/[[\]]/,"operator.square"],[/[\.,]/,"delimiter"]],allowMethod:[[/^|$/,"","@pop"],[/[ \t]+/,"white"],[/[\n\r]+/,"white","@pop"],[/\/\*/,"comment","@comment"],[/(?==>[\s\w([{])/,"keyword","@pop"],[/(@name|@symbols)(?=[ \t]*[[({"'`]|[ \t]+(?:[+-]?\.?\d|\w))/,{cases:{"@keywords":{token:"keyword",next:"@pop"},"->|<-|>:|<:|<%":{token:"keyword",next:"@pop"},"@default":{token:"@rematch",next:"@pop"}}}],["","","@pop"]],comment:[[/[^\/*]+/,"comment"],[/\/\*/,"comment","@push"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],case:[[/\b_\*/,"key"],[/\b(_|true|false|null|this|super)\b/,"keyword","@allowMethod"],[/\bif\b|=>/,"keyword","@pop"],[/`[^`]+`/,"identifier","@allowMethod"],[/@name/,"variable","@allowMethod"],[/:::?|\||@(?![a-z_$])/,"keyword"],{include:"@root"}],vardef:[[/\b_\*/,"key"],[/\b(_|true|false|null|this|super)\b/,"keyword"],[/@name/,"variable"],[/:::?|\||@(?![a-z_$])/,"keyword"],[/=|:(?!:)/,"operator","@pop"],[/$/,"white","@pop"],{include:"@root"}],string:[[/[^\\"\n\r]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}]],stringt:[[/[^\\"\n\r]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/"/,"string"]],fstring:[[/@escapes/,"string.escape"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/%%/,"string"],[/(%)([\-#+ 0,(])(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","keyword.modifier","number","metatag"]],[/(%)(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","number","metatag"]],[/(%)([\-#+ 0,(])(@fstring_conv)/,["metatag","keyword.modifier","metatag"]],[/(%)(@fstring_conv)/,["metatag","metatag"]],[/./,"string"]],fstringt:[[/@escapes/,"string.escape"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/%%/,"string"],[/(%)([\-#+ 0,(])(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","keyword.modifier","number","metatag"]],[/(%)(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","number","metatag"]],[/(%)([\-#+ 0,(])(@fstring_conv)/,["metatag","keyword.modifier","metatag"]],[/(%)(@fstring_conv)/,["metatag","metatag"]],[/./,"string"]],sstring:[[/@escapes/,"string.escape"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/./,"string"]],sstringt:[[/@escapes/,"string.escape"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/./,"string"]],interp:[[/{/,"operator","@push"],[/}/,"operator","@pop"],{include:"@root"}],rawstring:[[/[^"]/,"string"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}]],rawstringt:[[/[^"]/,"string"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/"/,"string"]],whitespace:[[/[ \t\r\n]+/,"white"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}}}}]); \ No newline at end of file +"use strict";(self.webpackChunksterling_layout=self.webpackChunksterling_layout||[]).push([[180],{90180:(e,t,o)=>{o.r(t),o.d(t,{conf:()=>r,language:()=>n});var r={wordPattern:/(unary_[@~!#%^&*()\-=+\\|:<>\/?]+)|([a-zA-Z_$][\w$]*?_=)|(`[^`]+`)|([a-zA-Z_$][\w$]*)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:))")}}},n={tokenPostfix:".scala",keywords:["asInstanceOf","catch","class","classOf","def","do","else","extends","finally","for","foreach","forSome","if","import","isInstanceOf","macro","match","new","object","package","return","throw","trait","try","type","until","val","var","while","with","yield","given","enum","then"],softKeywords:["as","export","extension","end","derives","on"],constants:["true","false","null","this","super"],modifiers:["abstract","final","implicit","lazy","override","private","protected","sealed"],softModifiers:["inline","opaque","open","transparent","using"],name:/(?:[a-z_$][\w$]*|`[^`]+`)/,type:/(?:[A-Z][\w$]*)/,symbols:/[=>))/,["@brackets","white","variable"]],[/@name/,{cases:{"@keywords":"keyword","@softKeywords":"keyword","@modifiers":"keyword.modifier","@softModifiers":"keyword.modifier","@constants":{token:"constant",next:"@allowMethod"},"@default":{token:"identifier",next:"@allowMethod"}}}],[/@type/,"type","@allowMethod"],{include:"@whitespace"},[/@[a-zA-Z_$][\w$]*(?:\.[a-zA-Z_$][\w$]*)*/,"annotation"],[/[{(]/,"@brackets"],[/[})]/,"@brackets","@allowMethod"],[/\[/,"operator.square"],[/](?!\s*(?:va[rl]|def|type)\b)/,"operator.square","@allowMethod"],[/]/,"operator.square"],[/([=-]>|<-|>:|<:|:>|<%)(?=[\s\w()[\]{},\."'`])/,"keyword"],[/@symbols/,"operator"],[/[;,\.]/,"delimiter"],[/'[a-zA-Z$][\w$]*(?!')/,"attribute.name"],[/'[^\\']'/,"string","@allowMethod"],[/(')(@escapes)(')/,["string","string.escape",{token:"string",next:"@allowMethod"}]],[/'/,"string.invalid"]],import:[[/;/,"delimiter","@pop"],[/^|$/,"","@pop"],[/[ \t]+/,"white"],[/[\n\r]+/,"white","@pop"],[/\/\*/,"comment","@comment"],[/@name|@type/,"type"],[/[(){}]/,"@brackets"],[/[[\]]/,"operator.square"],[/[\.,]/,"delimiter"]],allowMethod:[[/^|$/,"","@pop"],[/[ \t]+/,"white"],[/[\n\r]+/,"white","@pop"],[/\/\*/,"comment","@comment"],[/(?==>[\s\w([{])/,"keyword","@pop"],[/(@name|@symbols)(?=[ \t]*[[({"'`]|[ \t]+(?:[+-]?\.?\d|\w))/,{cases:{"@keywords":{token:"keyword",next:"@pop"},"->|<-|>:|<:|<%":{token:"keyword",next:"@pop"},"@default":{token:"@rematch",next:"@pop"}}}],["","","@pop"]],comment:[[/[^\/*]+/,"comment"],[/\/\*/,"comment","@push"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],case:[[/\b_\*/,"key"],[/\b(_|true|false|null|this|super)\b/,"keyword","@allowMethod"],[/\bif\b|=>/,"keyword","@pop"],[/`[^`]+`/,"identifier","@allowMethod"],[/@name/,"variable","@allowMethod"],[/:::?|\||@(?![a-z_$])/,"keyword"],{include:"@root"}],vardef:[[/\b_\*/,"key"],[/\b(_|true|false|null|this|super)\b/,"keyword"],[/@name/,"variable"],[/:::?|\||@(?![a-z_$])/,"keyword"],[/=|:(?!:)/,"operator","@pop"],[/$/,"white","@pop"],{include:"@root"}],string:[[/[^\\"\n\r]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}]],stringt:[[/[^\\"\n\r]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/"/,"string"]],fstring:[[/@escapes/,"string.escape"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/%%/,"string"],[/(%)([\-#+ 0,(])(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","keyword.modifier","number","metatag"]],[/(%)(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","number","metatag"]],[/(%)([\-#+ 0,(])(@fstring_conv)/,["metatag","keyword.modifier","metatag"]],[/(%)(@fstring_conv)/,["metatag","metatag"]],[/./,"string"]],fstringt:[[/@escapes/,"string.escape"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/%%/,"string"],[/(%)([\-#+ 0,(])(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","keyword.modifier","number","metatag"]],[/(%)(\d+|\.\d+|\d+\.\d+)(@fstring_conv)/,["metatag","number","metatag"]],[/(%)([\-#+ 0,(])(@fstring_conv)/,["metatag","keyword.modifier","metatag"]],[/(%)(@fstring_conv)/,["metatag","metatag"]],[/./,"string"]],sstring:[[/@escapes/,"string.escape"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/./,"string"]],sstringt:[[/@escapes/,"string.escape"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/\$\$/,"string"],[/(\$)([a-z_]\w*)/,["operator","identifier"]],[/\$\{/,"operator","@interp"],[/./,"string"]],interp:[[/{/,"operator","@push"],[/}/,"operator","@pop"],{include:"@root"}],rawstring:[[/[^"]/,"string"],[/"/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}]],rawstringt:[[/[^"]/,"string"],[/"(?=""")/,"string"],[/"""/,{token:"string.quote",bracket:"@close",switchTo:"@allowMethod"}],[/"/,"string"]],whitespace:[[/[ \t\r\n]+/,"white"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}}}}]); \ No newline at end of file diff --git a/forge/sterling/build/1886.bundle.js b/forge/sterling/build/1886.bundle.js index 2d1ca2f49..5d2e79c9a 100644 --- a/forge/sterling/build/1886.bundle.js +++ b/forge/sterling/build/1886.bundle.js @@ -1,2 +1,2 @@ /*! For license information please see 1886.bundle.js.LICENSE.txt */ -"use strict";(self.webpackChunksterling_ts=self.webpackChunksterling_ts||[]).push([[1886],{81886:(e,n,i)=>{i.r(n),i.d(n,{conf:()=>t,language:()=>r});var t={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"],["begin","end"],["case","endcase"],["casex","endcase"],["casez","endcase"],["checker","endchecker"],["class","endclass"],["clocking","endclocking"],["config","endconfig"],["function","endfunction"],["generate","endgenerate"],["group","endgroup"],["interface","endinterface"],["module","endmodule"],["package","endpackage"],["primitive","endprimitive"],["program","endprogram"],["property","endproperty"],["specify","endspecify"],["sequence","endsequence"],["table","endtable"],["task","endtask"]],autoClosingPairs:[{open:"[",close:"]"},{open:"{",close:"}"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{offSide:!1,markers:{start:new RegExp("^(?:\\s*|.*(?!\\/[\\/\\*])[^\\w])(?:begin|case(x|z)?|class|clocking|config|covergroup|function|generate|interface|module|package|primitive|property|program|sequence|specify|table|task)\\b"),end:new RegExp("^(?:\\s*|.*(?!\\/[\\/\\*])[^\\w])(?:end|endcase|endclass|endclocking|endconfig|endgroup|endfunction|endgenerate|endinterface|endmodule|endpackage|endprimitive|endproperty|endprogram|endsequence|endspecify|endtable|endtask)\\b")}}},r={defaultToken:"",tokenPostfix:".sv",brackets:[{token:"delimiter.curly",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"},{token:"delimiter.angle",open:"<",close:">"}],keywords:["accept_on","alias","always","always_comb","always_ff","always_latch","and","assert","assign","assume","automatic","before","begin","bind","bins","binsof","bit","break","buf","bufif0","bufif1","byte","case","casex","casez","cell","chandle","checker","class","clocking","cmos","config","const","constraint","context","continue","cover","covergroup","coverpoint","cross","deassign","default","defparam","design","disable","dist","do","edge","else","end","endcase","endchecker","endclass","endclocking","endconfig","endfunction","endgenerate","endgroup","endinterface","endmodule","endpackage","endprimitive","endprogram","endproperty","endspecify","endsequence","endtable","endtask","enum","event","eventually","expect","export","extends","extern","final","first_match","for","force","foreach","forever","fork","forkjoin","function","generate","genvar","global","highz0","highz1","if","iff","ifnone","ignore_bins","illegal_bins","implements","implies","import","incdir","include","initial","inout","input","inside","instance","int","integer","interconnect","interface","intersect","join","join_any","join_none","large","let","liblist","library","local","localparam","logic","longint","macromodule","matches","medium","modport","module","nand","negedge","nettype","new","nexttime","nmos","nor","noshowcancelled","not","notif0","notif1","null","or","output","package","packed","parameter","pmos","posedge","primitive","priority","program","property","protected","pull0","pull1","pulldown","pullup","pulsestyle_ondetect","pulsestyle_onevent","pure","rand","randc","randcase","randsequence","rcmos","real","realtime","ref","reg","reject_on","release","repeat","restrict","return","rnmos","rpmos","rtran","rtranif0","rtranif1","s_always","s_eventually","s_nexttime","s_until","s_until_with","scalared","sequence","shortint","shortreal","showcancelled","signed","small","soft","solve","specify","specparam","static","string","strong","strong0","strong1","struct","super","supply0","supply1","sync_accept_on","sync_reject_on","table","tagged","task","this","throughout","time","timeprecision","timeunit","tran","tranif0","tranif1","tri","tri0","tri1","triand","trior","trireg","type","typedef","union","unique","unique0","unsigned","until","until_with","untyped","use","uwire","var","vectored","virtual","void","wait","wait_order","wand","weak","weak0","weak1","while","wildcard","wire","with","within","wor","xnor","xor"],builtin_gates:["and","nand","nor","or","xor","xnor","buf","not","bufif0","bufif1","notif1","notif0","cmos","nmos","pmos","rcmos","rnmos","rpmos","tran","tranif1","tranif0","rtran","rtranif1","rtranif0"],operators:["=","+=","-=","*=","/=","%=","&=","|=","^=","<<=",">>+","<<<=",">>>=","?",":","+","-","!","~","&","~&","|","~|","^","~^","^~","+","-","*","/","%","==","!=","===","!==","==?","!=?","&&","||","**","<","<=",">",">=","&","|","^",">>","<<",">>>","<<<","++","--","->","<->","inside","dist","::","+:","-:","*>","&&&","|->","|=>","#=#"],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],{include:"@numbers"},[/[;,.]/,"delimiter"],{include:"@strings"}],identifier_or_keyword:[[/@identifier/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}]],numbers:[[/\d+?[\d_]*(?:\.[\d_]+)?[eE][\-+]?\d+/,"number.float"],[/\d+?[\d_]*\.[\d_]+(?:\s*@timeunits)?/,"number.float"],[/(?:\d+?[\d_]*\s*)?'[sS]?[dD]\s*[0-9xXzZ?]+?[0-9xXzZ?_]*/,"number"],[/(?:\d+?[\d_]*\s*)?'[sS]?[bB]\s*[0-1xXzZ?]+?[0-1xXzZ?_]*/,"number.binary"],[/(?:\d+?[\d_]*\s*)?'[sS]?[oO]\s*[0-7xXzZ?]+?[0-7xXzZ?_]*/,"number.octal"],[/(?:\d+?[\d_]*\s*)?'[sS]?[hH]\s*[0-9a-fA-FxXzZ?]+?[0-9a-fA-FxXzZ?_]*/,"number.hex"],[/1step/,"number"],[/[\dxXzZ]+?[\dxXzZ_]*(?:\s*@timeunits)?/,"number"],[/'[01xXzZ]+/,"number"]],module_instance:[{include:"@whitespace"},[/(#?)(\()/,["",{token:"@brackets",next:"@port_connection"}]],[/@identifier\s*[;={}\[\],]/,{token:"@rematch",next:"@pop"}],[/@symbols|[;={}\[\],]/,{token:"@rematch",next:"@pop"}],[/@identifier/,"type"],[/;/,"delimiter","@pop"]],port_connection:[{include:"@identifier_or_keyword"},{include:"@whitespace"},[/@systemcall/,"variable.predefined"],{include:"@numbers"},{include:"@strings"},[/[,]/,"delimiter"],[/\(/,"@brackets","@port_connection"],[/\)/,"@brackets","@pop"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],strings:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],include:[[/(\s*)(")([\w*\/*]*)(.\w*)(")/,["","string.include.identifier","string.include.identifier","string.include.identifier",{token:"string.include.identifier",next:"@pop"}]],[/(\s*)(<)([\w*\/*]*)(.\w*)(>)/,["","string.include.identifier","string.include.identifier","string.include.identifier",{token:"string.include.identifier",next:"@pop"}]]],table:[{include:"@whitespace"},[/[()]/,"@brackets"],[/[:;]/,"delimiter"],[/[01\-*?xXbBrRfFpPnN]/,"variable.predefined"],["endtable","keyword.endtable","@pop"]]}}}}]); \ No newline at end of file +"use strict";(self.webpackChunksterling_layout=self.webpackChunksterling_layout||[]).push([[1886],{81886:(e,n,i)=>{i.r(n),i.d(n,{conf:()=>t,language:()=>r});var t={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"],["begin","end"],["case","endcase"],["casex","endcase"],["casez","endcase"],["checker","endchecker"],["class","endclass"],["clocking","endclocking"],["config","endconfig"],["function","endfunction"],["generate","endgenerate"],["group","endgroup"],["interface","endinterface"],["module","endmodule"],["package","endpackage"],["primitive","endprimitive"],["program","endprogram"],["property","endproperty"],["specify","endspecify"],["sequence","endsequence"],["table","endtable"],["task","endtask"]],autoClosingPairs:[{open:"[",close:"]"},{open:"{",close:"}"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{offSide:!1,markers:{start:new RegExp("^(?:\\s*|.*(?!\\/[\\/\\*])[^\\w])(?:begin|case(x|z)?|class|clocking|config|covergroup|function|generate|interface|module|package|primitive|property|program|sequence|specify|table|task)\\b"),end:new RegExp("^(?:\\s*|.*(?!\\/[\\/\\*])[^\\w])(?:end|endcase|endclass|endclocking|endconfig|endgroup|endfunction|endgenerate|endinterface|endmodule|endpackage|endprimitive|endproperty|endprogram|endsequence|endspecify|endtable|endtask)\\b")}}},r={defaultToken:"",tokenPostfix:".sv",brackets:[{token:"delimiter.curly",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"},{token:"delimiter.angle",open:"<",close:">"}],keywords:["accept_on","alias","always","always_comb","always_ff","always_latch","and","assert","assign","assume","automatic","before","begin","bind","bins","binsof","bit","break","buf","bufif0","bufif1","byte","case","casex","casez","cell","chandle","checker","class","clocking","cmos","config","const","constraint","context","continue","cover","covergroup","coverpoint","cross","deassign","default","defparam","design","disable","dist","do","edge","else","end","endcase","endchecker","endclass","endclocking","endconfig","endfunction","endgenerate","endgroup","endinterface","endmodule","endpackage","endprimitive","endprogram","endproperty","endspecify","endsequence","endtable","endtask","enum","event","eventually","expect","export","extends","extern","final","first_match","for","force","foreach","forever","fork","forkjoin","function","generate","genvar","global","highz0","highz1","if","iff","ifnone","ignore_bins","illegal_bins","implements","implies","import","incdir","include","initial","inout","input","inside","instance","int","integer","interconnect","interface","intersect","join","join_any","join_none","large","let","liblist","library","local","localparam","logic","longint","macromodule","matches","medium","modport","module","nand","negedge","nettype","new","nexttime","nmos","nor","noshowcancelled","not","notif0","notif1","null","or","output","package","packed","parameter","pmos","posedge","primitive","priority","program","property","protected","pull0","pull1","pulldown","pullup","pulsestyle_ondetect","pulsestyle_onevent","pure","rand","randc","randcase","randsequence","rcmos","real","realtime","ref","reg","reject_on","release","repeat","restrict","return","rnmos","rpmos","rtran","rtranif0","rtranif1","s_always","s_eventually","s_nexttime","s_until","s_until_with","scalared","sequence","shortint","shortreal","showcancelled","signed","small","soft","solve","specify","specparam","static","string","strong","strong0","strong1","struct","super","supply0","supply1","sync_accept_on","sync_reject_on","table","tagged","task","this","throughout","time","timeprecision","timeunit","tran","tranif0","tranif1","tri","tri0","tri1","triand","trior","trireg","type","typedef","union","unique","unique0","unsigned","until","until_with","untyped","use","uwire","var","vectored","virtual","void","wait","wait_order","wand","weak","weak0","weak1","while","wildcard","wire","with","within","wor","xnor","xor"],builtin_gates:["and","nand","nor","or","xor","xnor","buf","not","bufif0","bufif1","notif1","notif0","cmos","nmos","pmos","rcmos","rnmos","rpmos","tran","tranif1","tranif0","rtran","rtranif1","rtranif0"],operators:["=","+=","-=","*=","/=","%=","&=","|=","^=","<<=",">>+","<<<=",">>>=","?",":","+","-","!","~","&","~&","|","~|","^","~^","^~","+","-","*","/","%","==","!=","===","!==","==?","!=?","&&","||","**","<","<=",">",">=","&","|","^",">>","<<",">>>","<<<","++","--","->","<->","inside","dist","::","+:","-:","*>","&&&","|->","|=>","#=#"],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],{include:"@numbers"},[/[;,.]/,"delimiter"],{include:"@strings"}],identifier_or_keyword:[[/@identifier/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}]],numbers:[[/\d+?[\d_]*(?:\.[\d_]+)?[eE][\-+]?\d+/,"number.float"],[/\d+?[\d_]*\.[\d_]+(?:\s*@timeunits)?/,"number.float"],[/(?:\d+?[\d_]*\s*)?'[sS]?[dD]\s*[0-9xXzZ?]+?[0-9xXzZ?_]*/,"number"],[/(?:\d+?[\d_]*\s*)?'[sS]?[bB]\s*[0-1xXzZ?]+?[0-1xXzZ?_]*/,"number.binary"],[/(?:\d+?[\d_]*\s*)?'[sS]?[oO]\s*[0-7xXzZ?]+?[0-7xXzZ?_]*/,"number.octal"],[/(?:\d+?[\d_]*\s*)?'[sS]?[hH]\s*[0-9a-fA-FxXzZ?]+?[0-9a-fA-FxXzZ?_]*/,"number.hex"],[/1step/,"number"],[/[\dxXzZ]+?[\dxXzZ_]*(?:\s*@timeunits)?/,"number"],[/'[01xXzZ]+/,"number"]],module_instance:[{include:"@whitespace"},[/(#?)(\()/,["",{token:"@brackets",next:"@port_connection"}]],[/@identifier\s*[;={}\[\],]/,{token:"@rematch",next:"@pop"}],[/@symbols|[;={}\[\],]/,{token:"@rematch",next:"@pop"}],[/@identifier/,"type"],[/;/,"delimiter","@pop"]],port_connection:[{include:"@identifier_or_keyword"},{include:"@whitespace"},[/@systemcall/,"variable.predefined"],{include:"@numbers"},{include:"@strings"},[/[,]/,"delimiter"],[/\(/,"@brackets","@port_connection"],[/\)/,"@brackets","@pop"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],strings:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],include:[[/(\s*)(")([\w*\/*]*)(.\w*)(")/,["","string.include.identifier","string.include.identifier","string.include.identifier",{token:"string.include.identifier",next:"@pop"}]],[/(\s*)(<)([\w*\/*]*)(.\w*)(>)/,["","string.include.identifier","string.include.identifier","string.include.identifier",{token:"string.include.identifier",next:"@pop"}]]],table:[{include:"@whitespace"},[/[()]/,"@brackets"],[/[:;]/,"delimiter"],[/[01\-*?xXbBrRfFpPnN]/,"variable.predefined"],["endtable","keyword.endtable","@pop"]]}}}}]); \ No newline at end of file diff --git a/forge/sterling/build/1960.bundle.js b/forge/sterling/build/1960.bundle.js index 8a27f612d..09ed86c48 100644 --- a/forge/sterling/build/1960.bundle.js +++ b/forge/sterling/build/1960.bundle.js @@ -1,2 +1,2 @@ /*! For license information please see 1960.bundle.js.LICENSE.txt */ -"use strict";(self.webpackChunksterling_ts=self.webpackChunksterling_ts||[]).push([[1960],{71960:(e,t,n)=>{n.r(t),n.d(t,{conf:()=>i,language:()=>r});var i={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"[",close:"]"},{open:"{",close:"}"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*#pragma\\s+region\\b"),end:new RegExp("^\\s*#pragma\\s+endregion\\b")}}},r={defaultToken:"",tokenPostfix:".cpp",brackets:[{token:"delimiter.curly",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"},{token:"delimiter.angle",open:"<",close:">"}],keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/,"number.float"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/,"number.hex"],[/0[0-7']*[0-7](@integersuffix)/,"number.octal"],[/0[bB][0-1']*[0-1](@integersuffix)/,"number.binary"],[/\d[\d']*\d(@integersuffix)/,"number"],[/\d(@integersuffix)/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doccomment"],[/\/\*/,"comment","@comment"],[/\/\/.*\\$/,"comment","@linecomment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],linecomment:[[/.*[^\\]$/,"comment","@pop"],[/[^]+/,"comment"]],doccomment:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],raw:[[/(.*)(\))(?:([^ ()\\\t"]*))(\")/,{cases:{"$3==$S2":["string.raw","string.raw.end","string.raw.end",{token:"string.raw.end",next:"@pop"}],"@default":["string.raw","string.raw","string.raw","string.raw"]}}],[/.*/,"string.raw"]],annotation:[{include:"@whitespace"},[/using|alignas/,"keyword"],[/[a-zA-Z0-9_]+/,"annotation"],[/[,:]/,"delimiter"],[/[()]/,"@brackets"],[/\]\s*\]/,{token:"annotation",next:"@pop"}]],include:[[/(\s*)(<)([^<>]*)(>)/,["","keyword.directive.include.begin","string.include.identifier",{token:"keyword.directive.include.end",next:"@pop"}]],[/(\s*)(")([^"]*)(")/,["","keyword.directive.include.begin","string.include.identifier",{token:"keyword.directive.include.end",next:"@pop"}]]]}}}}]); \ No newline at end of file +"use strict";(self.webpackChunksterling_layout=self.webpackChunksterling_layout||[]).push([[1960],{71960:(e,t,n)=>{n.r(t),n.d(t,{conf:()=>i,language:()=>r});var i={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"[",close:"]"},{open:"{",close:"}"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*#pragma\\s+region\\b"),end:new RegExp("^\\s*#pragma\\s+endregion\\b")}}},r={defaultToken:"",tokenPostfix:".cpp",brackets:[{token:"delimiter.curly",open:"{",close:"}"},{token:"delimiter.parenthesis",open:"(",close:")"},{token:"delimiter.square",open:"[",close:"]"},{token:"delimiter.angle",open:"<",close:">"}],keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/,"number.float"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F](@integersuffix)/,"number.hex"],[/0[0-7']*[0-7](@integersuffix)/,"number.octal"],[/0[bB][0-1']*[0-1](@integersuffix)/,"number.binary"],[/\d[\d']*\d(@integersuffix)/,"number"],[/\d(@integersuffix)/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doccomment"],[/\/\*/,"comment","@comment"],[/\/\/.*\\$/,"comment","@linecomment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],linecomment:[[/.*[^\\]$/,"comment","@pop"],[/[^]+/,"comment"]],doccomment:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],raw:[[/(.*)(\))(?:([^ ()\\\t"]*))(\")/,{cases:{"$3==$S2":["string.raw","string.raw.end","string.raw.end",{token:"string.raw.end",next:"@pop"}],"@default":["string.raw","string.raw","string.raw","string.raw"]}}],[/.*/,"string.raw"]],annotation:[{include:"@whitespace"},[/using|alignas/,"keyword"],[/[a-zA-Z0-9_]+/,"annotation"],[/[,:]/,"delimiter"],[/[()]/,"@brackets"],[/\]\s*\]/,{token:"annotation",next:"@pop"}]],include:[[/(\s*)(<)([^<>]*)(>)/,["","keyword.directive.include.begin","string.include.identifier",{token:"keyword.directive.include.end",next:"@pop"}]],[/(\s*)(")([^"]*)(")/,["","keyword.directive.include.begin","string.include.identifier",{token:"keyword.directive.include.end",next:"@pop"}]]]}}}}]); \ No newline at end of file diff --git a/forge/sterling/build/1961.bundle.js b/forge/sterling/build/1961.bundle.js index 97f63156a..fe5993313 100644 --- a/forge/sterling/build/1961.bundle.js +++ b/forge/sterling/build/1961.bundle.js @@ -1,2 +1,2 @@ /*! For license information please see 1961.bundle.js.LICENSE.txt */ -"use strict";(self.webpackChunksterling_ts=self.webpackChunksterling_ts||[]).push([[1961],{31961:(E,T,S)=>{S.r(T),S.d(T,{conf:()=>R,language:()=>A});var R={comments:{lineComment:"--",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},A={defaultToken:"",tokenPostfix:".sql",ignoreCase:!0,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:["ACCESSIBLE","ADD","ALL","ALTER","ANALYZE","AND","AS","ASC","ASENSITIVE","BEFORE","BETWEEN","BIGINT","BINARY","BLOB","BOTH","BY","CALL","CASCADE","CASE","CHANGE","CHAR","CHARACTER","CHECK","COLLATE","COLUMN","CONDITION","CONSTRAINT","CONTINUE","CONVERT","CREATE","CROSS","CUBE","CUME_DIST","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_USER","CURSOR","DATABASE","DATABASES","DAY_HOUR","DAY_MICROSECOND","DAY_MINUTE","DAY_SECOND","DEC","DECIMAL","DECLARE","DEFAULT","DELAYED","DELETE","DENSE_RANK","DESC","DESCRIBE","DETERMINISTIC","DISTINCT","DISTINCTROW","DIV","DOUBLE","DROP","DUAL","EACH","ELSE","ELSEIF","EMPTY","ENCLOSED","ESCAPED","EXCEPT","EXISTS","EXIT","EXPLAIN","FALSE","FETCH","FIRST_VALUE","FLOAT","FLOAT4","FLOAT8","FOR","FORCE","FOREIGN","FROM","FULLTEXT","FUNCTION","GENERATED","GET","GRANT","GROUP","GROUPING","GROUPS","HAVING","HIGH_PRIORITY","HOUR_MICROSECOND","HOUR_MINUTE","HOUR_SECOND","IF","IGNORE","IN","INDEX","INFILE","INNER","INOUT","INSENSITIVE","INSERT","INT","INT1","INT2","INT3","INT4","INT8","INTEGER","INTERVAL","INTO","IO_AFTER_GTIDS","IO_BEFORE_GTIDS","IS","ITERATE","JOIN","JSON_TABLE","KEY","KEYS","KILL","LAG","LAST_VALUE","LATERAL","LEAD","LEADING","LEAVE","LEFT","LIKE","LIMIT","LINEAR","LINES","LOAD","LOCALTIME","LOCALTIMESTAMP","LOCK","LONG","LONGBLOB","LONGTEXT","LOOP","LOW_PRIORITY","MASTER_BIND","MASTER_SSL_VERIFY_SERVER_CERT","MATCH","MAXVALUE","MEDIUMBLOB","MEDIUMINT","MEDIUMTEXT","MIDDLEINT","MINUTE_MICROSECOND","MINUTE_SECOND","MOD","MODIFIES","NATURAL","NOT","NO_WRITE_TO_BINLOG","NTH_VALUE","NTILE","NULL","NUMERIC","OF","ON","OPTIMIZE","OPTIMIZER_COSTS","OPTION","OPTIONALLY","OR","ORDER","OUT","OUTER","OUTFILE","OVER","PARTITION","PERCENT_RANK","PRECISION","PRIMARY","PROCEDURE","PURGE","RANGE","RANK","READ","READS","READ_WRITE","REAL","RECURSIVE","REFERENCES","REGEXP","RELEASE","RENAME","REPEAT","REPLACE","REQUIRE","RESIGNAL","RESTRICT","RETURN","REVOKE","RIGHT","RLIKE","ROW","ROWS","ROW_NUMBER","SCHEMA","SCHEMAS","SECOND_MICROSECOND","SELECT","SENSITIVE","SEPARATOR","SET","SHOW","SIGNAL","SMALLINT","SPATIAL","SPECIFIC","SQL","SQLEXCEPTION","SQLSTATE","SQLWARNING","SQL_BIG_RESULT","SQL_CALC_FOUND_ROWS","SQL_SMALL_RESULT","SSL","STARTING","STORED","STRAIGHT_JOIN","SYSTEM","TABLE","TERMINATED","THEN","TINYBLOB","TINYINT","TINYTEXT","TO","TRAILING","TRIGGER","TRUE","UNDO","UNION","UNIQUE","UNLOCK","UNSIGNED","UPDATE","USAGE","USE","USING","UTC_DATE","UTC_TIME","UTC_TIMESTAMP","VALUES","VARBINARY","VARCHAR","VARCHARACTER","VARYING","VIRTUAL","WHEN","WHERE","WHILE","WINDOW","WITH","WRITE","XOR","YEAR_MONTH","ZEROFILL"],operators:["AND","BETWEEN","IN","LIKE","NOT","OR","IS","NULL","INTERSECT","UNION","INNER","JOIN","LEFT","OUTER","RIGHT"],builtinFunctions:["ABS","ACOS","ADDDATE","ADDTIME","AES_DECRYPT","AES_ENCRYPT","ANY_VALUE","Area","AsBinary","AsWKB","ASCII","ASIN","AsText","AsWKT","ASYMMETRIC_DECRYPT","ASYMMETRIC_DERIVE","ASYMMETRIC_ENCRYPT","ASYMMETRIC_SIGN","ASYMMETRIC_VERIFY","ATAN","ATAN2","ATAN","AVG","BENCHMARK","BIN","BIT_AND","BIT_COUNT","BIT_LENGTH","BIT_OR","BIT_XOR","Buffer","CAST","CEIL","CEILING","Centroid","CHAR","CHAR_LENGTH","CHARACTER_LENGTH","CHARSET","COALESCE","COERCIBILITY","COLLATION","COMPRESS","CONCAT","CONCAT_WS","CONNECTION_ID","Contains","CONV","CONVERT","CONVERT_TZ","ConvexHull","COS","COT","COUNT","CRC32","CREATE_ASYMMETRIC_PRIV_KEY","CREATE_ASYMMETRIC_PUB_KEY","CREATE_DH_PARAMETERS","CREATE_DIGEST","Crosses","CUME_DIST","CURDATE","CURRENT_DATE","CURRENT_ROLE","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_USER","CURTIME","DATABASE","DATE","DATE_ADD","DATE_FORMAT","DATE_SUB","DATEDIFF","DAY","DAYNAME","DAYOFMONTH","DAYOFWEEK","DAYOFYEAR","DECODE","DEFAULT","DEGREES","DES_DECRYPT","DES_ENCRYPT","DENSE_RANK","Dimension","Disjoint","Distance","ELT","ENCODE","ENCRYPT","EndPoint","Envelope","Equals","EXP","EXPORT_SET","ExteriorRing","EXTRACT","ExtractValue","FIELD","FIND_IN_SET","FIRST_VALUE","FLOOR","FORMAT","FORMAT_BYTES","FORMAT_PICO_TIME","FOUND_ROWS","FROM_BASE64","FROM_DAYS","FROM_UNIXTIME","GEN_RANGE","GEN_RND_EMAIL","GEN_RND_PAN","GEN_RND_SSN","GEN_RND_US_PHONE","GeomCollection","GeomCollFromText","GeometryCollectionFromText","GeomCollFromWKB","GeometryCollectionFromWKB","GeometryCollection","GeometryN","GeometryType","GeomFromText","GeometryFromText","GeomFromWKB","GeometryFromWKB","GET_FORMAT","GET_LOCK","GLength","GREATEST","GROUP_CONCAT","GROUPING","GTID_SUBSET","GTID_SUBTRACT","HEX","HOUR","ICU_VERSION","IF","IFNULL","INET_ATON","INET_NTOA","INET6_ATON","INET6_NTOA","INSERT","INSTR","InteriorRingN","Intersects","INTERVAL","IS_FREE_LOCK","IS_IPV4","IS_IPV4_COMPAT","IS_IPV4_MAPPED","IS_IPV6","IS_USED_LOCK","IS_UUID","IsClosed","IsEmpty","ISNULL","IsSimple","JSON_APPEND","JSON_ARRAY","JSON_ARRAY_APPEND","JSON_ARRAY_INSERT","JSON_ARRAYAGG","JSON_CONTAINS","JSON_CONTAINS_PATH","JSON_DEPTH","JSON_EXTRACT","JSON_INSERT","JSON_KEYS","JSON_LENGTH","JSON_MERGE","JSON_MERGE_PATCH","JSON_MERGE_PRESERVE","JSON_OBJECT","JSON_OBJECTAGG","JSON_OVERLAPS","JSON_PRETTY","JSON_QUOTE","JSON_REMOVE","JSON_REPLACE","JSON_SCHEMA_VALID","JSON_SCHEMA_VALIDATION_REPORT","JSON_SEARCH","JSON_SET","JSON_STORAGE_FREE","JSON_STORAGE_SIZE","JSON_TABLE","JSON_TYPE","JSON_UNQUOTE","JSON_VALID","LAG","LAST_DAY","LAST_INSERT_ID","LAST_VALUE","LCASE","LEAD","LEAST","LEFT","LENGTH","LineFromText","LineStringFromText","LineFromWKB","LineStringFromWKB","LineString","LN","LOAD_FILE","LOCALTIME","LOCALTIMESTAMP","LOCATE","LOG","LOG10","LOG2","LOWER","LPAD","LTRIM","MAKE_SET","MAKEDATE","MAKETIME","MASK_INNER","MASK_OUTER","MASK_PAN","MASK_PAN_RELAXED","MASK_SSN","MASTER_POS_WAIT","MAX","MBRContains","MBRCoveredBy","MBRCovers","MBRDisjoint","MBREqual","MBREquals","MBRIntersects","MBROverlaps","MBRTouches","MBRWithin","MD5","MEMBER OF","MICROSECOND","MID","MIN","MINUTE","MLineFromText","MultiLineStringFromText","MLineFromWKB","MultiLineStringFromWKB","MOD","MONTH","MONTHNAME","MPointFromText","MultiPointFromText","MPointFromWKB","MultiPointFromWKB","MPolyFromText","MultiPolygonFromText","MPolyFromWKB","MultiPolygonFromWKB","MultiLineString","MultiPoint","MultiPolygon","NAME_CONST","NOT IN","NOW","NTH_VALUE","NTILE","NULLIF","NumGeometries","NumInteriorRings","NumPoints","OCT","OCTET_LENGTH","OLD_PASSWORD","ORD","Overlaps","PASSWORD","PERCENT_RANK","PERIOD_ADD","PERIOD_DIFF","PI","Point","PointFromText","PointFromWKB","PointN","PolyFromText","PolygonFromText","PolyFromWKB","PolygonFromWKB","Polygon","POSITION","POW","POWER","PS_CURRENT_THREAD_ID","PS_THREAD_ID","PROCEDURE ANALYSE","QUARTER","QUOTE","RADIANS","RAND","RANDOM_BYTES","RANK","REGEXP_INSTR","REGEXP_LIKE","REGEXP_REPLACE","REGEXP_REPLACE","RELEASE_ALL_LOCKS","RELEASE_LOCK","REPEAT","REPLACE","REVERSE","RIGHT","ROLES_GRAPHML","ROUND","ROW_COUNT","ROW_NUMBER","RPAD","RTRIM","SCHEMA","SEC_TO_TIME","SECOND","SESSION_USER","SHA1","SHA","SHA2","SIGN","SIN","SLEEP","SOUNDEX","SOURCE_POS_WAIT","SPACE","SQRT","SRID","ST_Area","ST_AsBinary","ST_AsWKB","ST_AsGeoJSON","ST_AsText","ST_AsWKT","ST_Buffer","ST_Buffer_Strategy","ST_Centroid","ST_Collect","ST_Contains","ST_ConvexHull","ST_Crosses","ST_Difference","ST_Dimension","ST_Disjoint","ST_Distance","ST_Distance_Sphere","ST_EndPoint","ST_Envelope","ST_Equals","ST_ExteriorRing","ST_FrechetDistance","ST_GeoHash","ST_GeomCollFromText","ST_GeometryCollectionFromText","ST_GeomCollFromTxt","ST_GeomCollFromWKB","ST_GeometryCollectionFromWKB","ST_GeometryN","ST_GeometryType","ST_GeomFromGeoJSON","ST_GeomFromText","ST_GeometryFromText","ST_GeomFromWKB","ST_GeometryFromWKB","ST_HausdorffDistance","ST_InteriorRingN","ST_Intersection","ST_Intersects","ST_IsClosed","ST_IsEmpty","ST_IsSimple","ST_IsValid","ST_LatFromGeoHash","ST_Length","ST_LineFromText","ST_LineStringFromText","ST_LineFromWKB","ST_LineStringFromWKB","ST_LineInterpolatePoint","ST_LineInterpolatePoints","ST_LongFromGeoHash","ST_Longitude","ST_MakeEnvelope","ST_MLineFromText","ST_MultiLineStringFromText","ST_MLineFromWKB","ST_MultiLineStringFromWKB","ST_MPointFromText","ST_MultiPointFromText","ST_MPointFromWKB","ST_MultiPointFromWKB","ST_MPolyFromText","ST_MultiPolygonFromText","ST_MPolyFromWKB","ST_MultiPolygonFromWKB","ST_NumGeometries","ST_NumInteriorRing","ST_NumInteriorRings","ST_NumPoints","ST_Overlaps","ST_PointAtDistance","ST_PointFromGeoHash","ST_PointFromText","ST_PointFromWKB","ST_PointN","ST_PolyFromText","ST_PolygonFromText","ST_PolyFromWKB","ST_PolygonFromWKB","ST_Simplify","ST_SRID","ST_StartPoint","ST_SwapXY","ST_SymDifference","ST_Touches","ST_Transform","ST_Union","ST_Validate","ST_Within","ST_X","ST_Y","StartPoint","STATEMENT_DIGEST","STATEMENT_DIGEST_TEXT","STD","STDDEV","STDDEV_POP","STDDEV_SAMP","STR_TO_DATE","STRCMP","SUBDATE","SUBSTR","SUBSTRING","SUBSTRING_INDEX","SUBTIME","SUM","SYSDATE","SYSTEM_USER","TAN","TIME","TIME_FORMAT","TIME_TO_SEC","TIMEDIFF","TIMESTAMP","TIMESTAMPADD","TIMESTAMPDIFF","TO_BASE64","TO_DAYS","TO_SECONDS","Touches","TRIM","TRUNCATE","UCASE","UNCOMPRESS","UNCOMPRESSED_LENGTH","UNHEX","UNIX_TIMESTAMP","UpdateXML","UPPER","USER","UTC_DATE","UTC_TIME","UTC_TIMESTAMP","UUID","UUID_SHORT","UUID_TO_BIN","VALIDATE_PASSWORD_STRENGTH","VALUES","VAR_POP","VAR_SAMP","VARIANCE","VERSION","WAIT_FOR_EXECUTED_GTID_SET","WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS","WEEK","WEEKDAY","WEEKOFYEAR","WEIGHT_STRING","Within","X","Y","YEAR","YEARWEEK"],builtinVariables:[],tokenizer:{root:[{include:"@comments"},{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},{include:"@complexIdentifiers"},{include:"@scopes"},[/[;,.]/,"delimiter"],[/[()]/,"@brackets"],[/[\w@]+/,{cases:{"@operators":"operator","@builtinVariables":"predefined","@builtinFunctions":"predefined","@keywords":"keyword","@default":"identifier"}}],[/[<>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],comments:[[/--+.*/,"comment"],[/#+.*/,"comment"],[/\/\*/,{token:"comment.quote",next:"@comment"}]],comment:[[/[^*/]+/,"comment"],[/\*\//,{token:"comment.quote",next:"@pop"}],[/./,"comment"]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/'/,{token:"string",next:"@string"}],[/"/,{token:"string.double",next:"@stringDouble"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],stringDouble:[[/[^"]+/,"string.double"],[/""/,"string.double"],[/"/,{token:"string.double",next:"@pop"}]],complexIdentifiers:[[/`/,{token:"identifier.quote",next:"@quotedIdentifier"}]],quotedIdentifier:[[/[^`]+/,"identifier"],[/``/,"identifier"],[/`/,{token:"identifier.quote",next:"@pop"}]],scopes:[]}}}}]); \ No newline at end of file +"use strict";(self.webpackChunksterling_layout=self.webpackChunksterling_layout||[]).push([[1961],{31961:(E,T,S)=>{S.r(T),S.d(T,{conf:()=>R,language:()=>A});var R={comments:{lineComment:"--",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},A={defaultToken:"",tokenPostfix:".sql",ignoreCase:!0,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:["ACCESSIBLE","ADD","ALL","ALTER","ANALYZE","AND","AS","ASC","ASENSITIVE","BEFORE","BETWEEN","BIGINT","BINARY","BLOB","BOTH","BY","CALL","CASCADE","CASE","CHANGE","CHAR","CHARACTER","CHECK","COLLATE","COLUMN","CONDITION","CONSTRAINT","CONTINUE","CONVERT","CREATE","CROSS","CUBE","CUME_DIST","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_USER","CURSOR","DATABASE","DATABASES","DAY_HOUR","DAY_MICROSECOND","DAY_MINUTE","DAY_SECOND","DEC","DECIMAL","DECLARE","DEFAULT","DELAYED","DELETE","DENSE_RANK","DESC","DESCRIBE","DETERMINISTIC","DISTINCT","DISTINCTROW","DIV","DOUBLE","DROP","DUAL","EACH","ELSE","ELSEIF","EMPTY","ENCLOSED","ESCAPED","EXCEPT","EXISTS","EXIT","EXPLAIN","FALSE","FETCH","FIRST_VALUE","FLOAT","FLOAT4","FLOAT8","FOR","FORCE","FOREIGN","FROM","FULLTEXT","FUNCTION","GENERATED","GET","GRANT","GROUP","GROUPING","GROUPS","HAVING","HIGH_PRIORITY","HOUR_MICROSECOND","HOUR_MINUTE","HOUR_SECOND","IF","IGNORE","IN","INDEX","INFILE","INNER","INOUT","INSENSITIVE","INSERT","INT","INT1","INT2","INT3","INT4","INT8","INTEGER","INTERVAL","INTO","IO_AFTER_GTIDS","IO_BEFORE_GTIDS","IS","ITERATE","JOIN","JSON_TABLE","KEY","KEYS","KILL","LAG","LAST_VALUE","LATERAL","LEAD","LEADING","LEAVE","LEFT","LIKE","LIMIT","LINEAR","LINES","LOAD","LOCALTIME","LOCALTIMESTAMP","LOCK","LONG","LONGBLOB","LONGTEXT","LOOP","LOW_PRIORITY","MASTER_BIND","MASTER_SSL_VERIFY_SERVER_CERT","MATCH","MAXVALUE","MEDIUMBLOB","MEDIUMINT","MEDIUMTEXT","MIDDLEINT","MINUTE_MICROSECOND","MINUTE_SECOND","MOD","MODIFIES","NATURAL","NOT","NO_WRITE_TO_BINLOG","NTH_VALUE","NTILE","NULL","NUMERIC","OF","ON","OPTIMIZE","OPTIMIZER_COSTS","OPTION","OPTIONALLY","OR","ORDER","OUT","OUTER","OUTFILE","OVER","PARTITION","PERCENT_RANK","PRECISION","PRIMARY","PROCEDURE","PURGE","RANGE","RANK","READ","READS","READ_WRITE","REAL","RECURSIVE","REFERENCES","REGEXP","RELEASE","RENAME","REPEAT","REPLACE","REQUIRE","RESIGNAL","RESTRICT","RETURN","REVOKE","RIGHT","RLIKE","ROW","ROWS","ROW_NUMBER","SCHEMA","SCHEMAS","SECOND_MICROSECOND","SELECT","SENSITIVE","SEPARATOR","SET","SHOW","SIGNAL","SMALLINT","SPATIAL","SPECIFIC","SQL","SQLEXCEPTION","SQLSTATE","SQLWARNING","SQL_BIG_RESULT","SQL_CALC_FOUND_ROWS","SQL_SMALL_RESULT","SSL","STARTING","STORED","STRAIGHT_JOIN","SYSTEM","TABLE","TERMINATED","THEN","TINYBLOB","TINYINT","TINYTEXT","TO","TRAILING","TRIGGER","TRUE","UNDO","UNION","UNIQUE","UNLOCK","UNSIGNED","UPDATE","USAGE","USE","USING","UTC_DATE","UTC_TIME","UTC_TIMESTAMP","VALUES","VARBINARY","VARCHAR","VARCHARACTER","VARYING","VIRTUAL","WHEN","WHERE","WHILE","WINDOW","WITH","WRITE","XOR","YEAR_MONTH","ZEROFILL"],operators:["AND","BETWEEN","IN","LIKE","NOT","OR","IS","NULL","INTERSECT","UNION","INNER","JOIN","LEFT","OUTER","RIGHT"],builtinFunctions:["ABS","ACOS","ADDDATE","ADDTIME","AES_DECRYPT","AES_ENCRYPT","ANY_VALUE","Area","AsBinary","AsWKB","ASCII","ASIN","AsText","AsWKT","ASYMMETRIC_DECRYPT","ASYMMETRIC_DERIVE","ASYMMETRIC_ENCRYPT","ASYMMETRIC_SIGN","ASYMMETRIC_VERIFY","ATAN","ATAN2","ATAN","AVG","BENCHMARK","BIN","BIT_AND","BIT_COUNT","BIT_LENGTH","BIT_OR","BIT_XOR","Buffer","CAST","CEIL","CEILING","Centroid","CHAR","CHAR_LENGTH","CHARACTER_LENGTH","CHARSET","COALESCE","COERCIBILITY","COLLATION","COMPRESS","CONCAT","CONCAT_WS","CONNECTION_ID","Contains","CONV","CONVERT","CONVERT_TZ","ConvexHull","COS","COT","COUNT","CRC32","CREATE_ASYMMETRIC_PRIV_KEY","CREATE_ASYMMETRIC_PUB_KEY","CREATE_DH_PARAMETERS","CREATE_DIGEST","Crosses","CUME_DIST","CURDATE","CURRENT_DATE","CURRENT_ROLE","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_USER","CURTIME","DATABASE","DATE","DATE_ADD","DATE_FORMAT","DATE_SUB","DATEDIFF","DAY","DAYNAME","DAYOFMONTH","DAYOFWEEK","DAYOFYEAR","DECODE","DEFAULT","DEGREES","DES_DECRYPT","DES_ENCRYPT","DENSE_RANK","Dimension","Disjoint","Distance","ELT","ENCODE","ENCRYPT","EndPoint","Envelope","Equals","EXP","EXPORT_SET","ExteriorRing","EXTRACT","ExtractValue","FIELD","FIND_IN_SET","FIRST_VALUE","FLOOR","FORMAT","FORMAT_BYTES","FORMAT_PICO_TIME","FOUND_ROWS","FROM_BASE64","FROM_DAYS","FROM_UNIXTIME","GEN_RANGE","GEN_RND_EMAIL","GEN_RND_PAN","GEN_RND_SSN","GEN_RND_US_PHONE","GeomCollection","GeomCollFromText","GeometryCollectionFromText","GeomCollFromWKB","GeometryCollectionFromWKB","GeometryCollection","GeometryN","GeometryType","GeomFromText","GeometryFromText","GeomFromWKB","GeometryFromWKB","GET_FORMAT","GET_LOCK","GLength","GREATEST","GROUP_CONCAT","GROUPING","GTID_SUBSET","GTID_SUBTRACT","HEX","HOUR","ICU_VERSION","IF","IFNULL","INET_ATON","INET_NTOA","INET6_ATON","INET6_NTOA","INSERT","INSTR","InteriorRingN","Intersects","INTERVAL","IS_FREE_LOCK","IS_IPV4","IS_IPV4_COMPAT","IS_IPV4_MAPPED","IS_IPV6","IS_USED_LOCK","IS_UUID","IsClosed","IsEmpty","ISNULL","IsSimple","JSON_APPEND","JSON_ARRAY","JSON_ARRAY_APPEND","JSON_ARRAY_INSERT","JSON_ARRAYAGG","JSON_CONTAINS","JSON_CONTAINS_PATH","JSON_DEPTH","JSON_EXTRACT","JSON_INSERT","JSON_KEYS","JSON_LENGTH","JSON_MERGE","JSON_MERGE_PATCH","JSON_MERGE_PRESERVE","JSON_OBJECT","JSON_OBJECTAGG","JSON_OVERLAPS","JSON_PRETTY","JSON_QUOTE","JSON_REMOVE","JSON_REPLACE","JSON_SCHEMA_VALID","JSON_SCHEMA_VALIDATION_REPORT","JSON_SEARCH","JSON_SET","JSON_STORAGE_FREE","JSON_STORAGE_SIZE","JSON_TABLE","JSON_TYPE","JSON_UNQUOTE","JSON_VALID","LAG","LAST_DAY","LAST_INSERT_ID","LAST_VALUE","LCASE","LEAD","LEAST","LEFT","LENGTH","LineFromText","LineStringFromText","LineFromWKB","LineStringFromWKB","LineString","LN","LOAD_FILE","LOCALTIME","LOCALTIMESTAMP","LOCATE","LOG","LOG10","LOG2","LOWER","LPAD","LTRIM","MAKE_SET","MAKEDATE","MAKETIME","MASK_INNER","MASK_OUTER","MASK_PAN","MASK_PAN_RELAXED","MASK_SSN","MASTER_POS_WAIT","MAX","MBRContains","MBRCoveredBy","MBRCovers","MBRDisjoint","MBREqual","MBREquals","MBRIntersects","MBROverlaps","MBRTouches","MBRWithin","MD5","MEMBER OF","MICROSECOND","MID","MIN","MINUTE","MLineFromText","MultiLineStringFromText","MLineFromWKB","MultiLineStringFromWKB","MOD","MONTH","MONTHNAME","MPointFromText","MultiPointFromText","MPointFromWKB","MultiPointFromWKB","MPolyFromText","MultiPolygonFromText","MPolyFromWKB","MultiPolygonFromWKB","MultiLineString","MultiPoint","MultiPolygon","NAME_CONST","NOT IN","NOW","NTH_VALUE","NTILE","NULLIF","NumGeometries","NumInteriorRings","NumPoints","OCT","OCTET_LENGTH","OLD_PASSWORD","ORD","Overlaps","PASSWORD","PERCENT_RANK","PERIOD_ADD","PERIOD_DIFF","PI","Point","PointFromText","PointFromWKB","PointN","PolyFromText","PolygonFromText","PolyFromWKB","PolygonFromWKB","Polygon","POSITION","POW","POWER","PS_CURRENT_THREAD_ID","PS_THREAD_ID","PROCEDURE ANALYSE","QUARTER","QUOTE","RADIANS","RAND","RANDOM_BYTES","RANK","REGEXP_INSTR","REGEXP_LIKE","REGEXP_REPLACE","REGEXP_REPLACE","RELEASE_ALL_LOCKS","RELEASE_LOCK","REPEAT","REPLACE","REVERSE","RIGHT","ROLES_GRAPHML","ROUND","ROW_COUNT","ROW_NUMBER","RPAD","RTRIM","SCHEMA","SEC_TO_TIME","SECOND","SESSION_USER","SHA1","SHA","SHA2","SIGN","SIN","SLEEP","SOUNDEX","SOURCE_POS_WAIT","SPACE","SQRT","SRID","ST_Area","ST_AsBinary","ST_AsWKB","ST_AsGeoJSON","ST_AsText","ST_AsWKT","ST_Buffer","ST_Buffer_Strategy","ST_Centroid","ST_Collect","ST_Contains","ST_ConvexHull","ST_Crosses","ST_Difference","ST_Dimension","ST_Disjoint","ST_Distance","ST_Distance_Sphere","ST_EndPoint","ST_Envelope","ST_Equals","ST_ExteriorRing","ST_FrechetDistance","ST_GeoHash","ST_GeomCollFromText","ST_GeometryCollectionFromText","ST_GeomCollFromTxt","ST_GeomCollFromWKB","ST_GeometryCollectionFromWKB","ST_GeometryN","ST_GeometryType","ST_GeomFromGeoJSON","ST_GeomFromText","ST_GeometryFromText","ST_GeomFromWKB","ST_GeometryFromWKB","ST_HausdorffDistance","ST_InteriorRingN","ST_Intersection","ST_Intersects","ST_IsClosed","ST_IsEmpty","ST_IsSimple","ST_IsValid","ST_LatFromGeoHash","ST_Length","ST_LineFromText","ST_LineStringFromText","ST_LineFromWKB","ST_LineStringFromWKB","ST_LineInterpolatePoint","ST_LineInterpolatePoints","ST_LongFromGeoHash","ST_Longitude","ST_MakeEnvelope","ST_MLineFromText","ST_MultiLineStringFromText","ST_MLineFromWKB","ST_MultiLineStringFromWKB","ST_MPointFromText","ST_MultiPointFromText","ST_MPointFromWKB","ST_MultiPointFromWKB","ST_MPolyFromText","ST_MultiPolygonFromText","ST_MPolyFromWKB","ST_MultiPolygonFromWKB","ST_NumGeometries","ST_NumInteriorRing","ST_NumInteriorRings","ST_NumPoints","ST_Overlaps","ST_PointAtDistance","ST_PointFromGeoHash","ST_PointFromText","ST_PointFromWKB","ST_PointN","ST_PolyFromText","ST_PolygonFromText","ST_PolyFromWKB","ST_PolygonFromWKB","ST_Simplify","ST_SRID","ST_StartPoint","ST_SwapXY","ST_SymDifference","ST_Touches","ST_Transform","ST_Union","ST_Validate","ST_Within","ST_X","ST_Y","StartPoint","STATEMENT_DIGEST","STATEMENT_DIGEST_TEXT","STD","STDDEV","STDDEV_POP","STDDEV_SAMP","STR_TO_DATE","STRCMP","SUBDATE","SUBSTR","SUBSTRING","SUBSTRING_INDEX","SUBTIME","SUM","SYSDATE","SYSTEM_USER","TAN","TIME","TIME_FORMAT","TIME_TO_SEC","TIMEDIFF","TIMESTAMP","TIMESTAMPADD","TIMESTAMPDIFF","TO_BASE64","TO_DAYS","TO_SECONDS","Touches","TRIM","TRUNCATE","UCASE","UNCOMPRESS","UNCOMPRESSED_LENGTH","UNHEX","UNIX_TIMESTAMP","UpdateXML","UPPER","USER","UTC_DATE","UTC_TIME","UTC_TIMESTAMP","UUID","UUID_SHORT","UUID_TO_BIN","VALIDATE_PASSWORD_STRENGTH","VALUES","VAR_POP","VAR_SAMP","VARIANCE","VERSION","WAIT_FOR_EXECUTED_GTID_SET","WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS","WEEK","WEEKDAY","WEEKOFYEAR","WEIGHT_STRING","Within","X","Y","YEAR","YEARWEEK"],builtinVariables:[],tokenizer:{root:[{include:"@comments"},{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},{include:"@complexIdentifiers"},{include:"@scopes"},[/[;,.]/,"delimiter"],[/[()]/,"@brackets"],[/[\w@]+/,{cases:{"@operators":"operator","@builtinVariables":"predefined","@builtinFunctions":"predefined","@keywords":"keyword","@default":"identifier"}}],[/[<>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],comments:[[/--+.*/,"comment"],[/#+.*/,"comment"],[/\/\*/,{token:"comment.quote",next:"@comment"}]],comment:[[/[^*/]+/,"comment"],[/\*\//,{token:"comment.quote",next:"@pop"}],[/./,"comment"]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/'/,{token:"string",next:"@string"}],[/"/,{token:"string.double",next:"@stringDouble"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],stringDouble:[[/[^"]+/,"string.double"],[/""/,"string.double"],[/"/,{token:"string.double",next:"@pop"}]],complexIdentifiers:[[/`/,{token:"identifier.quote",next:"@quotedIdentifier"}]],quotedIdentifier:[[/[^`]+/,"identifier"],[/``/,"identifier"],[/`/,{token:"identifier.quote",next:"@pop"}]],scopes:[]}}}}]); \ No newline at end of file diff --git a/forge/sterling/build/2060.bundle.js b/forge/sterling/build/2060.bundle.js index 9cbe2d548..2db8fc9ab 100644 --- a/forge/sterling/build/2060.bundle.js +++ b/forge/sterling/build/2060.bundle.js @@ -1,2 +1,2 @@ /*! For license information please see 2060.bundle.js.LICENSE.txt */ -"use strict";(self.webpackChunksterling_ts=self.webpackChunksterling_ts||[]).push([[2060],{32060:(e,o,n)=>{n.r(o),n.d(o,{conf:()=>t,language:()=>s});var t={comments:{lineComment:";",blockComment:["#|","|#"]},brackets:[["(",")"],["{","}"],["[","]"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}]},s={defaultToken:"",ignoreCase:!0,tokenPostfix:".scheme",brackets:[{open:"(",close:")",token:"delimiter.parenthesis"},{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"}],keywords:["case","do","let","loop","if","else","when","cons","car","cdr","cond","lambda","lambda*","syntax-rules","format","set!","quote","eval","append","list","list?","member?","load"],constants:["#t","#f"],operators:["eq?","eqv?","equal?","and","or","not","null?"],tokenizer:{root:[[/#[xXoObB][0-9a-fA-F]+/,"number.hex"],[/[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?/,"number.float"],[/(?:\b(?:(define|define-syntax|define-macro))\b)(\s+)((?:\w|\-|\!|\?)*)/,["keyword","white","variable"]],{include:"@whitespace"},{include:"@strings"},[/[a-zA-Z_#][a-zA-Z0-9_\-\?\!\*]*/,{cases:{"@keywords":"keyword","@constants":"constant","@operators":"operators","@default":"identifier"}}]],comment:[[/[^\|#]+/,"comment"],[/#\|/,"comment","@push"],[/\|#/,"comment","@pop"],[/[\|#]/,"comment"]],whitespace:[[/[ \t\r\n]+/,"white"],[/#\|/,"comment","@comment"],[/;.*$/,"comment"]],strings:[[/"$/,"string","@popall"],[/"(?=.)/,"string","@multiLineString"]],multiLineString:[[/[^\\"]+$/,"string","@popall"],[/[^\\"]+/,"string"],[/\\./,"string.escape"],[/"/,"string","@popall"],[/\\$/,"string"]]}}}}]); \ No newline at end of file +"use strict";(self.webpackChunksterling_layout=self.webpackChunksterling_layout||[]).push([[2060],{32060:(e,o,n)=>{n.r(o),n.d(o,{conf:()=>t,language:()=>s});var t={comments:{lineComment:";",blockComment:["#|","|#"]},brackets:[["(",")"],["{","}"],["[","]"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}]},s={defaultToken:"",ignoreCase:!0,tokenPostfix:".scheme",brackets:[{open:"(",close:")",token:"delimiter.parenthesis"},{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"}],keywords:["case","do","let","loop","if","else","when","cons","car","cdr","cond","lambda","lambda*","syntax-rules","format","set!","quote","eval","append","list","list?","member?","load"],constants:["#t","#f"],operators:["eq?","eqv?","equal?","and","or","not","null?"],tokenizer:{root:[[/#[xXoObB][0-9a-fA-F]+/,"number.hex"],[/[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?/,"number.float"],[/(?:\b(?:(define|define-syntax|define-macro))\b)(\s+)((?:\w|\-|\!|\?)*)/,["keyword","white","variable"]],{include:"@whitespace"},{include:"@strings"},[/[a-zA-Z_#][a-zA-Z0-9_\-\?\!\*]*/,{cases:{"@keywords":"keyword","@constants":"constant","@operators":"operators","@default":"identifier"}}]],comment:[[/[^\|#]+/,"comment"],[/#\|/,"comment","@push"],[/\|#/,"comment","@pop"],[/[\|#]/,"comment"]],whitespace:[[/[ \t\r\n]+/,"white"],[/#\|/,"comment","@comment"],[/;.*$/,"comment"]],strings:[[/"$/,"string","@popall"],[/"(?=.)/,"string","@multiLineString"]],multiLineString:[[/[^\\"]+$/,"string","@popall"],[/[^\\"]+/,"string"],[/\\./,"string.escape"],[/"/,"string","@popall"],[/\\$/,"string"]]}}}}]); \ No newline at end of file diff --git a/forge/sterling/build/2075.bundle.js b/forge/sterling/build/2075.bundle.js index 8c169b54e..4515adbbe 100644 --- a/forge/sterling/build/2075.bundle.js +++ b/forge/sterling/build/2075.bundle.js @@ -1,2 +1,2 @@ /*! For license information please see 2075.bundle.js.LICENSE.txt */ -"use strict";(self.webpackChunksterling_ts=self.webpackChunksterling_ts||[]).push([[2075],{62075:(e,t,n)=>{n.r(t),n.d(t,{conf:()=>r,language:()=>i});var r={wordPattern:/(#?-?\d*\.\d\w*%?)|((::|[@#.!:])?[\w-?]+%?)|::|[@#.!:]/g,comments:{blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),end:new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/")}}},i={defaultToken:"",tokenPostfix:".css",ws:"[ \t\n\r\f]*",identifier:"-?-?([a-zA-Z]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",brackets:[{open:"{",close:"}",token:"delimiter.bracket"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],tokenizer:{root:[{include:"@selector"}],selector:[{include:"@comments"},{include:"@import"},{include:"@strings"},["[@](keyframes|-webkit-keyframes|-moz-keyframes|-o-keyframes)",{token:"keyword",next:"@keyframedeclaration"}],["[@](page|content|font-face|-moz-document)",{token:"keyword"}],["[@](charset|namespace)",{token:"keyword",next:"@declarationbody"}],["(url-prefix)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],["(url)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],{include:"@selectorname"},["[\\*]","tag"],["[>\\+,]","delimiter"],["\\[",{token:"delimiter.bracket",next:"@selectorattribute"}],["{",{token:"delimiter.bracket",next:"@selectorbody"}]],selectorbody:[{include:"@comments"},["[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))","attribute.name","@rulevalue"],["}",{token:"delimiter.bracket",next:"@pop"}]],selectorname:[["(\\.|#(?=[^{])|%|(@identifier)|:)+","tag"]],selectorattribute:[{include:"@term"},["]",{token:"delimiter.bracket",next:"@pop"}]],term:[{include:"@comments"},["(url-prefix)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],["(url)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],{include:"@functioninvocation"},{include:"@numbers"},{include:"@name"},{include:"@strings"},["([<>=\\+\\-\\*\\/\\^\\|\\~,])","delimiter"],[",","delimiter"]],rulevalue:[{include:"@comments"},{include:"@strings"},{include:"@term"},["!important","keyword"],[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],warndebug:[["[@](warn|debug)",{token:"keyword",next:"@declarationbody"}]],import:[["[@](import)",{token:"keyword",next:"@declarationbody"}]],urldeclaration:[{include:"@strings"},["[^)\r\n]+","string"],["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],parenthizedterm:[{include:"@term"},["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],declarationbody:[{include:"@term"},[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],comments:[["\\/\\*","comment","@comment"],["\\/\\/+.*","comment"]],comment:[["\\*\\/","comment","@pop"],[/[^*/]+/,"comment"],[/./,"comment"]],name:[["@identifier","attribute.value"]],numbers:[["-?(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?",{token:"attribute.value.number",next:"@units"}],["#[0-9a-fA-F_]+(?!\\w)","attribute.value.hex"]],units:[["(em|ex|ch|rem|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?","attribute.value.unit","@pop"]],keyframedeclaration:[["@identifier","attribute.value"],["{",{token:"delimiter.bracket",switchTo:"@keyframebody"}]],keyframebody:[{include:"@term"},["{",{token:"delimiter.bracket",next:"@selectorbody"}],["}",{token:"delimiter.bracket",next:"@pop"}]],functioninvocation:[["@identifier\\(",{token:"attribute.value",next:"@functionarguments"}]],functionarguments:[["\\$@identifier@ws:","attribute.name"],["[,]","delimiter"],{include:"@term"},["\\)",{token:"attribute.value",next:"@pop"}]],strings:[['~?"',{token:"string",next:"@stringenddoublequote"}],["~?'",{token:"string",next:"@stringendquote"}]],stringenddoublequote:[["\\\\.","string"],['"',{token:"string",next:"@pop"}],[/[^\\"]+/,"string"],[".","string"]],stringendquote:[["\\\\.","string"],["'",{token:"string",next:"@pop"}],[/[^\\']+/,"string"],[".","string"]]}}}}]); \ No newline at end of file +"use strict";(self.webpackChunksterling_layout=self.webpackChunksterling_layout||[]).push([[2075],{62075:(e,t,n)=>{n.r(t),n.d(t,{conf:()=>r,language:()=>i});var r={wordPattern:/(#?-?\d*\.\d\w*%?)|((::|[@#.!:])?[\w-?]+%?)|::|[@#.!:]/g,comments:{blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string","comment"]},{open:"[",close:"]",notIn:["string","comment"]},{open:"(",close:")",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{markers:{start:new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),end:new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/")}}},i={defaultToken:"",tokenPostfix:".css",ws:"[ \t\n\r\f]*",identifier:"-?-?([a-zA-Z]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*",brackets:[{open:"{",close:"}",token:"delimiter.bracket"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],tokenizer:{root:[{include:"@selector"}],selector:[{include:"@comments"},{include:"@import"},{include:"@strings"},["[@](keyframes|-webkit-keyframes|-moz-keyframes|-o-keyframes)",{token:"keyword",next:"@keyframedeclaration"}],["[@](page|content|font-face|-moz-document)",{token:"keyword"}],["[@](charset|namespace)",{token:"keyword",next:"@declarationbody"}],["(url-prefix)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],["(url)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],{include:"@selectorname"},["[\\*]","tag"],["[>\\+,]","delimiter"],["\\[",{token:"delimiter.bracket",next:"@selectorattribute"}],["{",{token:"delimiter.bracket",next:"@selectorbody"}]],selectorbody:[{include:"@comments"},["[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))","attribute.name","@rulevalue"],["}",{token:"delimiter.bracket",next:"@pop"}]],selectorname:[["(\\.|#(?=[^{])|%|(@identifier)|:)+","tag"]],selectorattribute:[{include:"@term"},["]",{token:"delimiter.bracket",next:"@pop"}]],term:[{include:"@comments"},["(url-prefix)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],["(url)(\\()",["attribute.value",{token:"delimiter.parenthesis",next:"@urldeclaration"}]],{include:"@functioninvocation"},{include:"@numbers"},{include:"@name"},{include:"@strings"},["([<>=\\+\\-\\*\\/\\^\\|\\~,])","delimiter"],[",","delimiter"]],rulevalue:[{include:"@comments"},{include:"@strings"},{include:"@term"},["!important","keyword"],[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],warndebug:[["[@](warn|debug)",{token:"keyword",next:"@declarationbody"}]],import:[["[@](import)",{token:"keyword",next:"@declarationbody"}]],urldeclaration:[{include:"@strings"},["[^)\r\n]+","string"],["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],parenthizedterm:[{include:"@term"},["\\)",{token:"delimiter.parenthesis",next:"@pop"}]],declarationbody:[{include:"@term"},[";","delimiter","@pop"],["(?=})",{token:"",next:"@pop"}]],comments:[["\\/\\*","comment","@comment"],["\\/\\/+.*","comment"]],comment:[["\\*\\/","comment","@pop"],[/[^*/]+/,"comment"],[/./,"comment"]],name:[["@identifier","attribute.value"]],numbers:[["-?(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?",{token:"attribute.value.number",next:"@units"}],["#[0-9a-fA-F_]+(?!\\w)","attribute.value.hex"]],units:[["(em|ex|ch|rem|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?","attribute.value.unit","@pop"]],keyframedeclaration:[["@identifier","attribute.value"],["{",{token:"delimiter.bracket",switchTo:"@keyframebody"}]],keyframebody:[{include:"@term"},["{",{token:"delimiter.bracket",next:"@selectorbody"}],["}",{token:"delimiter.bracket",next:"@pop"}]],functioninvocation:[["@identifier\\(",{token:"attribute.value",next:"@functionarguments"}]],functionarguments:[["\\$@identifier@ws:","attribute.name"],["[,]","delimiter"],{include:"@term"},["\\)",{token:"attribute.value",next:"@pop"}]],strings:[['~?"',{token:"string",next:"@stringenddoublequote"}],["~?'",{token:"string",next:"@stringendquote"}]],stringenddoublequote:[["\\\\.","string"],['"',{token:"string",next:"@pop"}],[/[^\\"]+/,"string"],[".","string"]],stringendquote:[["\\\\.","string"],["'",{token:"string",next:"@pop"}],[/[^\\']+/,"string"],[".","string"]]}}}}]); \ No newline at end of file diff --git a/forge/sterling/build/2140.bundle.js b/forge/sterling/build/2140.bundle.js index b0f6741e4..037e25a58 100644 --- a/forge/sterling/build/2140.bundle.js +++ b/forge/sterling/build/2140.bundle.js @@ -1,2 +1,2 @@ /*! For license information please see 2140.bundle.js.LICENSE.txt */ -"use strict";(self.webpackChunksterling_ts=self.webpackChunksterling_ts||[]).push([[2140],{22140:(e,o,r)=>{r.r(o),r.d(o,{conf:()=>t,language:()=>a});var t={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}]},a={defaultToken:"",tokenPostfix:".r",roxygen:["@alias","@aliases","@assignee","@author","@backref","@callGraph","@callGraphDepth","@callGraphPrimitives","@concept","@describeIn","@description","@details","@docType","@encoding","@evalNamespace","@evalRd","@example","@examples","@export","@exportClass","@exportMethod","@exportPattern","@family","@field","@formals","@format","@import","@importClassesFrom","@importFrom","@importMethodsFrom","@include","@inherit","@inheritDotParams","@inheritParams","@inheritSection","@keywords","@md","@method","@name","@noMd","@noRd","@note","@param","@rawNamespace","@rawRd","@rdname","@references","@return","@S3method","@section","@seealso","@setClass","@slot","@source","@template","@templateVar","@title","@TODO","@usage","@useDynLib"],constants:["NULL","FALSE","TRUE","NA","Inf","NaN","NA_integer_","NA_real_","NA_complex_","NA_character_","T","F","LETTERS","letters","month.abb","month.name","pi","R.version.string"],keywords:["break","next","return","if","else","for","in","repeat","while","array","category","character","complex","double","function","integer","list","logical","matrix","numeric","vector","data.frame","factor","library","require","attach","detach","source"],special:["\\n","\\r","\\t","\\b","\\a","\\f","\\v","\\'",'\\"',"\\\\"],brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"}],tokenizer:{root:[{include:"@numbers"},{include:"@strings"},[/[{}\[\]()]/,"@brackets"],{include:"@operators"},[/#'$/,"comment.doc"],[/#'/,"comment.doc","@roxygen"],[/(^#.*$)/,"comment"],[/\s+/,"white"],[/[,:;]/,"delimiter"],[/@[a-zA-Z]\w*/,"tag"],[/[a-zA-Z]\w*/,{cases:{"@keywords":"keyword","@constants":"constant","@default":"identifier"}}]],roxygen:[[/@\w+/,{cases:{"@roxygen":"tag","@eos":{token:"comment.doc",next:"@pop"},"@default":"comment.doc"}}],[/\s+/,{cases:{"@eos":{token:"comment.doc",next:"@pop"},"@default":"comment.doc"}}],[/.*/,{token:"comment.doc",next:"@pop"}]],numbers:[[/0[xX][0-9a-fA-F]+/,"number.hex"],[/-?(\d*\.)?\d+([eE][+\-]?\d+)?/,"number"]],operators:[[/<{1,2}-/,"operator"],[/->{1,2}/,"operator"],[/%[^%\s]+%/,"operator"],[/\*\*/,"operator"],[/%%/,"operator"],[/&&/,"operator"],[/\|\|/,"operator"],[/<>/,"operator"],[/[-+=&|!<>^~*/:$]/,"operator"]],strings:[[/'/,"string.escape","@stringBody"],[/"/,"string.escape","@dblStringBody"]],stringBody:[[/\\./,{cases:{"@special":"string","@default":"error-token"}}],[/'/,"string.escape","@popall"],[/./,"string"]],dblStringBody:[[/\\./,{cases:{"@special":"string","@default":"error-token"}}],[/"/,"string.escape","@popall"],[/./,"string"]]}}}}]); \ No newline at end of file +"use strict";(self.webpackChunksterling_layout=self.webpackChunksterling_layout||[]).push([[2140],{22140:(e,o,r)=>{r.r(o),r.d(o,{conf:()=>t,language:()=>a});var t={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'}]},a={defaultToken:"",tokenPostfix:".r",roxygen:["@alias","@aliases","@assignee","@author","@backref","@callGraph","@callGraphDepth","@callGraphPrimitives","@concept","@describeIn","@description","@details","@docType","@encoding","@evalNamespace","@evalRd","@example","@examples","@export","@exportClass","@exportMethod","@exportPattern","@family","@field","@formals","@format","@import","@importClassesFrom","@importFrom","@importMethodsFrom","@include","@inherit","@inheritDotParams","@inheritParams","@inheritSection","@keywords","@md","@method","@name","@noMd","@noRd","@note","@param","@rawNamespace","@rawRd","@rdname","@references","@return","@S3method","@section","@seealso","@setClass","@slot","@source","@template","@templateVar","@title","@TODO","@usage","@useDynLib"],constants:["NULL","FALSE","TRUE","NA","Inf","NaN","NA_integer_","NA_real_","NA_complex_","NA_character_","T","F","LETTERS","letters","month.abb","month.name","pi","R.version.string"],keywords:["break","next","return","if","else","for","in","repeat","while","array","category","character","complex","double","function","integer","list","logical","matrix","numeric","vector","data.frame","factor","library","require","attach","detach","source"],special:["\\n","\\r","\\t","\\b","\\a","\\f","\\v","\\'",'\\"',"\\\\"],brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.bracket"},{open:"(",close:")",token:"delimiter.parenthesis"}],tokenizer:{root:[{include:"@numbers"},{include:"@strings"},[/[{}\[\]()]/,"@brackets"],{include:"@operators"},[/#'$/,"comment.doc"],[/#'/,"comment.doc","@roxygen"],[/(^#.*$)/,"comment"],[/\s+/,"white"],[/[,:;]/,"delimiter"],[/@[a-zA-Z]\w*/,"tag"],[/[a-zA-Z]\w*/,{cases:{"@keywords":"keyword","@constants":"constant","@default":"identifier"}}]],roxygen:[[/@\w+/,{cases:{"@roxygen":"tag","@eos":{token:"comment.doc",next:"@pop"},"@default":"comment.doc"}}],[/\s+/,{cases:{"@eos":{token:"comment.doc",next:"@pop"},"@default":"comment.doc"}}],[/.*/,{token:"comment.doc",next:"@pop"}]],numbers:[[/0[xX][0-9a-fA-F]+/,"number.hex"],[/-?(\d*\.)?\d+([eE][+\-]?\d+)?/,"number"]],operators:[[/<{1,2}-/,"operator"],[/->{1,2}/,"operator"],[/%[^%\s]+%/,"operator"],[/\*\*/,"operator"],[/%%/,"operator"],[/&&/,"operator"],[/\|\|/,"operator"],[/<>/,"operator"],[/[-+=&|!<>^~*/:$]/,"operator"]],strings:[[/'/,"string.escape","@stringBody"],[/"/,"string.escape","@dblStringBody"]],stringBody:[[/\\./,{cases:{"@special":"string","@default":"error-token"}}],[/'/,"string.escape","@popall"],[/./,"string"]],dblStringBody:[[/\\./,{cases:{"@special":"string","@default":"error-token"}}],[/"/,"string.escape","@popall"],[/./,"string"]]}}}}]); \ No newline at end of file diff --git a/forge/sterling/build/2240.bundle.js b/forge/sterling/build/2240.bundle.js index 9d98af3c7..a408d81d3 100644 --- a/forge/sterling/build/2240.bundle.js +++ b/forge/sterling/build/2240.bundle.js @@ -1,2 +1,2 @@ /*! For license information please see 2240.bundle.js.LICENSE.txt */ -"use strict";(self.webpackChunksterling_ts=self.webpackChunksterling_ts||[]).push([[2240],{92240:(e,t,i)=>{i.r(t),i.d(t,{conf:()=>n,language:()=>o});var n={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'"},{open:'"',close:'"'}],autoClosingPairs:[{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["comment"]},{open:'"""',close:'"""'},{open:"`",close:"`",notIn:["string","comment"]},{open:"(",close:")"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"<<",close:">>"}],indentationRules:{increaseIndentPattern:/^\s*(after|else|catch|rescue|fn|[^#]*(do|<\-|\->|\{|\[|\=))\s*$/,decreaseIndentPattern:/^\s*((\}|\])\s*$|(after|else|catch|rescue|end)\b)/}},o={defaultToken:"source",tokenPostfix:".elixir",brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"{",close:"}",token:"delimiter.curly"},{open:"<<",close:">>",token:"delimiter.angle.special"}],declarationKeywords:["def","defp","defn","defnp","defguard","defguardp","defmacro","defmacrop","defdelegate","defcallback","defmacrocallback","defmodule","defprotocol","defexception","defimpl","defstruct"],operatorKeywords:["and","in","not","or","when"],namespaceKeywords:["alias","import","require","use"],otherKeywords:["after","case","catch","cond","do","else","end","fn","for","if","quote","raise","receive","rescue","super","throw","try","unless","unquote_splicing","unquote","with"],constants:["true","false","nil"],nameBuiltin:["__MODULE__","__DIR__","__ENV__","__CALLER__","__STACKTRACE__"],operator:/-[->]?|!={0,2}|\*{1,2}|\/|\\\\|&{1,3}|\.\.?|\^(?:\^\^)?|\+\+?|<(?:-|<<|=|>|\|>|~>?)?|=~|={1,3}|>(?:=|>>)?|\|~>|\|>|\|{1,3}|~>>?|~~~|::/,variableName:/[a-z_][a-zA-Z0-9_]*[?!]?/,atomName:/[a-zA-Z_][a-zA-Z0-9_@]*[?!]?|@specialAtomName|@operator/,specialAtomName:/\.\.\.|<<>>|%\{\}|%|\{\}/,aliasPart:/[A-Z][a-zA-Z0-9_]*/,moduleName:/@aliasPart(?:\.@aliasPart)*/,sigilSymmetricDelimiter:/"""|'''|"|'|\/|\|/,sigilStartDelimiter:/@sigilSymmetricDelimiter|<|\{|\[|\(/,sigilEndDelimiter:/@sigilSymmetricDelimiter|>|\}|\]|\)/,sigilModifiers:/[a-zA-Z0-9]*/,decimal:/\d(?:_?\d)*/,hex:/[0-9a-fA-F](_?[0-9a-fA-F])*/,octal:/[0-7](_?[0-7])*/,binary:/[01](_?[01])*/,escape:/\\u[0-9a-fA-F]{4}|\\x[0-9a-fA-F]{2}|\\./,tokenizer:{root:[{include:"@whitespace"},{include:"@comments"},{include:"@keywordsShorthand"},{include:"@numbers"},{include:"@identifiers"},{include:"@strings"},{include:"@atoms"},{include:"@sigils"},{include:"@attributes"},{include:"@symbols"}],whitespace:[[/\s+/,"white"]],comments:[[/(#)(.*)/,["comment.punctuation","comment"]]],keywordsShorthand:[[/(@atomName)(:)/,["constant","constant.punctuation"]],[/"(?=([^"]|#\{.*?\}|\\")*":)/,{token:"constant.delimiter",next:"@doubleQuotedStringKeyword"}],[/'(?=([^']|#\{.*?\}|\\')*':)/,{token:"constant.delimiter",next:"@singleQuotedStringKeyword"}]],doubleQuotedStringKeyword:[[/":/,{token:"constant.delimiter",next:"@pop"}],{include:"@stringConstantContentInterpol"}],singleQuotedStringKeyword:[[/':/,{token:"constant.delimiter",next:"@pop"}],{include:"@stringConstantContentInterpol"}],numbers:[[/0b@binary/,"number.binary"],[/0o@octal/,"number.octal"],[/0x@hex/,"number.hex"],[/@decimal\.@decimal([eE]-?@decimal)?/,"number.float"],[/@decimal/,"number"]],identifiers:[[/\b(defp?|defnp?|defmacrop?|defguardp?|defdelegate)(\s+)(@variableName)(?!\s+@operator)/,["keyword.declaration","white",{cases:{unquote:"keyword","@default":"function"}}]],[/(@variableName)(?=\s*\.?\s*\()/,{cases:{"@declarationKeywords":"keyword.declaration","@namespaceKeywords":"keyword","@otherKeywords":"keyword","@default":"function.call"}}],[/(@moduleName)(\s*)(\.)(\s*)(@variableName)/,["type.identifier","white","operator","white","function.call"]],[/(:)(@atomName)(\s*)(\.)(\s*)(@variableName)/,["constant.punctuation","constant","white","operator","white","function.call"]],[/(\|>)(\s*)(@variableName)/,["operator","white",{cases:{"@otherKeywords":"keyword","@default":"function.call"}}]],[/(&)(\s*)(@variableName)/,["operator","white","function.call"]],[/@variableName/,{cases:{"@declarationKeywords":"keyword.declaration","@operatorKeywords":"keyword.operator","@namespaceKeywords":"keyword","@otherKeywords":"keyword","@constants":"constant.language","@nameBuiltin":"variable.language","_.*":"comment.unused","@default":"identifier"}}],[/@moduleName/,"type.identifier"]],strings:[[/"""/,{token:"string.delimiter",next:"@doubleQuotedHeredoc"}],[/'''/,{token:"string.delimiter",next:"@singleQuotedHeredoc"}],[/"/,{token:"string.delimiter",next:"@doubleQuotedString"}],[/'/,{token:"string.delimiter",next:"@singleQuotedString"}]],doubleQuotedHeredoc:[[/"""/,{token:"string.delimiter",next:"@pop"}],{include:"@stringContentInterpol"}],singleQuotedHeredoc:[[/'''/,{token:"string.delimiter",next:"@pop"}],{include:"@stringContentInterpol"}],doubleQuotedString:[[/"/,{token:"string.delimiter",next:"@pop"}],{include:"@stringContentInterpol"}],singleQuotedString:[[/'/,{token:"string.delimiter",next:"@pop"}],{include:"@stringContentInterpol"}],atoms:[[/(:)(@atomName)/,["constant.punctuation","constant"]],[/:"/,{token:"constant.delimiter",next:"@doubleQuotedStringAtom"}],[/:'/,{token:"constant.delimiter",next:"@singleQuotedStringAtom"}]],doubleQuotedStringAtom:[[/"/,{token:"constant.delimiter",next:"@pop"}],{include:"@stringConstantContentInterpol"}],singleQuotedStringAtom:[[/'/,{token:"constant.delimiter",next:"@pop"}],{include:"@stringConstantContentInterpol"}],sigils:[[/~[a-z]@sigilStartDelimiter/,{token:"@rematch",next:"@sigil.interpol"}],[/~[A-Z]@sigilStartDelimiter/,{token:"@rematch",next:"@sigil.noInterpol"}]],sigil:[[/~([a-zA-Z])\{/,{token:"@rematch",switchTo:"@sigilStart.$S2.$1.{.}"}],[/~([a-zA-Z])\[/,{token:"@rematch",switchTo:"@sigilStart.$S2.$1.[.]"}],[/~([a-zA-Z])\(/,{token:"@rematch",switchTo:"@sigilStart.$S2.$1.(.)"}],[/~([a-zA-Z])\"}],[/~([a-zA-Z])(@sigilSymmetricDelimiter)/,{token:"@rematch",switchTo:"@sigilStart.$S2.$1.$2.$2"}]],"sigilStart.interpol.s":[[/~s@sigilStartDelimiter/,{token:"string.delimiter",switchTo:"@sigilContinue.$S2.$S3.$S4.$S5"}]],"sigilContinue.interpol.s":[[/(@sigilEndDelimiter)@sigilModifiers/,{cases:{"$1==$S5":{token:"string.delimiter",next:"@pop"},"@default":"string"}}],{include:"@stringContentInterpol"}],"sigilStart.noInterpol.S":[[/~S@sigilStartDelimiter/,{token:"string.delimiter",switchTo:"@sigilContinue.$S2.$S3.$S4.$S5"}]],"sigilContinue.noInterpol.S":[[/(^|[^\\])\\@sigilEndDelimiter/,"string"],[/(@sigilEndDelimiter)@sigilModifiers/,{cases:{"$1==$S5":{token:"string.delimiter",next:"@pop"},"@default":"string"}}],{include:"@stringContent"}],"sigilStart.interpol.r":[[/~r@sigilStartDelimiter/,{token:"regexp.delimiter",switchTo:"@sigilContinue.$S2.$S3.$S4.$S5"}]],"sigilContinue.interpol.r":[[/(@sigilEndDelimiter)@sigilModifiers/,{cases:{"$1==$S5":{token:"regexp.delimiter",next:"@pop"},"@default":"regexp"}}],{include:"@regexpContentInterpol"}],"sigilStart.noInterpol.R":[[/~R@sigilStartDelimiter/,{token:"regexp.delimiter",switchTo:"@sigilContinue.$S2.$S3.$S4.$S5"}]],"sigilContinue.noInterpol.R":[[/(^|[^\\])\\@sigilEndDelimiter/,"regexp"],[/(@sigilEndDelimiter)@sigilModifiers/,{cases:{"$1==$S5":{token:"regexp.delimiter",next:"@pop"},"@default":"regexp"}}],{include:"@regexpContent"}],"sigilStart.interpol":[[/~([a-zA-Z])@sigilStartDelimiter/,{token:"sigil.delimiter",switchTo:"@sigilContinue.$S2.$S3.$S4.$S5"}]],"sigilContinue.interpol":[[/(@sigilEndDelimiter)@sigilModifiers/,{cases:{"$1==$S5":{token:"sigil.delimiter",next:"@pop"},"@default":"sigil"}}],{include:"@sigilContentInterpol"}],"sigilStart.noInterpol":[[/~([a-zA-Z])@sigilStartDelimiter/,{token:"sigil.delimiter",switchTo:"@sigilContinue.$S2.$S3.$S4.$S5"}]],"sigilContinue.noInterpol":[[/(^|[^\\])\\@sigilEndDelimiter/,"sigil"],[/(@sigilEndDelimiter)@sigilModifiers/,{cases:{"$1==$S5":{token:"sigil.delimiter",next:"@pop"},"@default":"sigil"}}],{include:"@sigilContent"}],attributes:[[/\@(module|type)?doc (~[sS])?"""/,{token:"comment.block.documentation",next:"@doubleQuotedHeredocDocstring"}],[/\@(module|type)?doc (~[sS])?"/,{token:"comment.block.documentation",next:"@doubleQuotedStringDocstring"}],[/\@(module|type)?doc false/,"comment.block.documentation"],[/\@(@variableName)/,"variable"]],doubleQuotedHeredocDocstring:[[/"""/,{token:"comment.block.documentation",next:"@pop"}],{include:"@docstringContent"}],doubleQuotedStringDocstring:[[/"/,{token:"comment.block.documentation",next:"@pop"}],{include:"@docstringContent"}],symbols:[[/\?(\\.|[^\\\s])/,"number.constant"],[/&\d+/,"operator"],[/<<<|>>>/,"operator"],[/[()\[\]\{\}]|<<|>>/,"@brackets"],[/\.\.\./,"identifier"],[/=>/,"punctuation"],[/@operator/,"operator"],[/[:;,.%]/,"punctuation"]],stringContentInterpol:[{include:"@interpolation"},{include:"@escapeChar"},{include:"@stringContent"}],stringContent:[[/./,"string"]],stringConstantContentInterpol:[{include:"@interpolation"},{include:"@escapeChar"},{include:"@stringConstantContent"}],stringConstantContent:[[/./,"constant"]],regexpContentInterpol:[{include:"@interpolation"},{include:"@escapeChar"},{include:"@regexpContent"}],regexpContent:[[/(\s)(#)(\s.*)$/,["white","comment.punctuation","comment"]],[/./,"regexp"]],sigilContentInterpol:[{include:"@interpolation"},{include:"@escapeChar"},{include:"@sigilContent"}],sigilContent:[[/./,"sigil"]],docstringContent:[[/./,"comment.block.documentation"]],escapeChar:[[/@escape/,"constant.character.escape"]],interpolation:[[/#{/,{token:"delimiter.bracket.embed",next:"@interpolationContinue"}]],interpolationContinue:[[/}/,{token:"delimiter.bracket.embed",next:"@pop"}],{include:"@root"}]}}}}]); \ No newline at end of file +"use strict";(self.webpackChunksterling_layout=self.webpackChunksterling_layout||[]).push([[2240],{92240:(e,t,i)=>{i.r(t),i.d(t,{conf:()=>n,language:()=>o});var n={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'"},{open:'"',close:'"'}],autoClosingPairs:[{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["comment"]},{open:'"""',close:'"""'},{open:"`",close:"`",notIn:["string","comment"]},{open:"(",close:")"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"<<",close:">>"}],indentationRules:{increaseIndentPattern:/^\s*(after|else|catch|rescue|fn|[^#]*(do|<\-|\->|\{|\[|\=))\s*$/,decreaseIndentPattern:/^\s*((\}|\])\s*$|(after|else|catch|rescue|end)\b)/}},o={defaultToken:"source",tokenPostfix:".elixir",brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"{",close:"}",token:"delimiter.curly"},{open:"<<",close:">>",token:"delimiter.angle.special"}],declarationKeywords:["def","defp","defn","defnp","defguard","defguardp","defmacro","defmacrop","defdelegate","defcallback","defmacrocallback","defmodule","defprotocol","defexception","defimpl","defstruct"],operatorKeywords:["and","in","not","or","when"],namespaceKeywords:["alias","import","require","use"],otherKeywords:["after","case","catch","cond","do","else","end","fn","for","if","quote","raise","receive","rescue","super","throw","try","unless","unquote_splicing","unquote","with"],constants:["true","false","nil"],nameBuiltin:["__MODULE__","__DIR__","__ENV__","__CALLER__","__STACKTRACE__"],operator:/-[->]?|!={0,2}|\*{1,2}|\/|\\\\|&{1,3}|\.\.?|\^(?:\^\^)?|\+\+?|<(?:-|<<|=|>|\|>|~>?)?|=~|={1,3}|>(?:=|>>)?|\|~>|\|>|\|{1,3}|~>>?|~~~|::/,variableName:/[a-z_][a-zA-Z0-9_]*[?!]?/,atomName:/[a-zA-Z_][a-zA-Z0-9_@]*[?!]?|@specialAtomName|@operator/,specialAtomName:/\.\.\.|<<>>|%\{\}|%|\{\}/,aliasPart:/[A-Z][a-zA-Z0-9_]*/,moduleName:/@aliasPart(?:\.@aliasPart)*/,sigilSymmetricDelimiter:/"""|'''|"|'|\/|\|/,sigilStartDelimiter:/@sigilSymmetricDelimiter|<|\{|\[|\(/,sigilEndDelimiter:/@sigilSymmetricDelimiter|>|\}|\]|\)/,sigilModifiers:/[a-zA-Z0-9]*/,decimal:/\d(?:_?\d)*/,hex:/[0-9a-fA-F](_?[0-9a-fA-F])*/,octal:/[0-7](_?[0-7])*/,binary:/[01](_?[01])*/,escape:/\\u[0-9a-fA-F]{4}|\\x[0-9a-fA-F]{2}|\\./,tokenizer:{root:[{include:"@whitespace"},{include:"@comments"},{include:"@keywordsShorthand"},{include:"@numbers"},{include:"@identifiers"},{include:"@strings"},{include:"@atoms"},{include:"@sigils"},{include:"@attributes"},{include:"@symbols"}],whitespace:[[/\s+/,"white"]],comments:[[/(#)(.*)/,["comment.punctuation","comment"]]],keywordsShorthand:[[/(@atomName)(:)/,["constant","constant.punctuation"]],[/"(?=([^"]|#\{.*?\}|\\")*":)/,{token:"constant.delimiter",next:"@doubleQuotedStringKeyword"}],[/'(?=([^']|#\{.*?\}|\\')*':)/,{token:"constant.delimiter",next:"@singleQuotedStringKeyword"}]],doubleQuotedStringKeyword:[[/":/,{token:"constant.delimiter",next:"@pop"}],{include:"@stringConstantContentInterpol"}],singleQuotedStringKeyword:[[/':/,{token:"constant.delimiter",next:"@pop"}],{include:"@stringConstantContentInterpol"}],numbers:[[/0b@binary/,"number.binary"],[/0o@octal/,"number.octal"],[/0x@hex/,"number.hex"],[/@decimal\.@decimal([eE]-?@decimal)?/,"number.float"],[/@decimal/,"number"]],identifiers:[[/\b(defp?|defnp?|defmacrop?|defguardp?|defdelegate)(\s+)(@variableName)(?!\s+@operator)/,["keyword.declaration","white",{cases:{unquote:"keyword","@default":"function"}}]],[/(@variableName)(?=\s*\.?\s*\()/,{cases:{"@declarationKeywords":"keyword.declaration","@namespaceKeywords":"keyword","@otherKeywords":"keyword","@default":"function.call"}}],[/(@moduleName)(\s*)(\.)(\s*)(@variableName)/,["type.identifier","white","operator","white","function.call"]],[/(:)(@atomName)(\s*)(\.)(\s*)(@variableName)/,["constant.punctuation","constant","white","operator","white","function.call"]],[/(\|>)(\s*)(@variableName)/,["operator","white",{cases:{"@otherKeywords":"keyword","@default":"function.call"}}]],[/(&)(\s*)(@variableName)/,["operator","white","function.call"]],[/@variableName/,{cases:{"@declarationKeywords":"keyword.declaration","@operatorKeywords":"keyword.operator","@namespaceKeywords":"keyword","@otherKeywords":"keyword","@constants":"constant.language","@nameBuiltin":"variable.language","_.*":"comment.unused","@default":"identifier"}}],[/@moduleName/,"type.identifier"]],strings:[[/"""/,{token:"string.delimiter",next:"@doubleQuotedHeredoc"}],[/'''/,{token:"string.delimiter",next:"@singleQuotedHeredoc"}],[/"/,{token:"string.delimiter",next:"@doubleQuotedString"}],[/'/,{token:"string.delimiter",next:"@singleQuotedString"}]],doubleQuotedHeredoc:[[/"""/,{token:"string.delimiter",next:"@pop"}],{include:"@stringContentInterpol"}],singleQuotedHeredoc:[[/'''/,{token:"string.delimiter",next:"@pop"}],{include:"@stringContentInterpol"}],doubleQuotedString:[[/"/,{token:"string.delimiter",next:"@pop"}],{include:"@stringContentInterpol"}],singleQuotedString:[[/'/,{token:"string.delimiter",next:"@pop"}],{include:"@stringContentInterpol"}],atoms:[[/(:)(@atomName)/,["constant.punctuation","constant"]],[/:"/,{token:"constant.delimiter",next:"@doubleQuotedStringAtom"}],[/:'/,{token:"constant.delimiter",next:"@singleQuotedStringAtom"}]],doubleQuotedStringAtom:[[/"/,{token:"constant.delimiter",next:"@pop"}],{include:"@stringConstantContentInterpol"}],singleQuotedStringAtom:[[/'/,{token:"constant.delimiter",next:"@pop"}],{include:"@stringConstantContentInterpol"}],sigils:[[/~[a-z]@sigilStartDelimiter/,{token:"@rematch",next:"@sigil.interpol"}],[/~[A-Z]@sigilStartDelimiter/,{token:"@rematch",next:"@sigil.noInterpol"}]],sigil:[[/~([a-zA-Z])\{/,{token:"@rematch",switchTo:"@sigilStart.$S2.$1.{.}"}],[/~([a-zA-Z])\[/,{token:"@rematch",switchTo:"@sigilStart.$S2.$1.[.]"}],[/~([a-zA-Z])\(/,{token:"@rematch",switchTo:"@sigilStart.$S2.$1.(.)"}],[/~([a-zA-Z])\"}],[/~([a-zA-Z])(@sigilSymmetricDelimiter)/,{token:"@rematch",switchTo:"@sigilStart.$S2.$1.$2.$2"}]],"sigilStart.interpol.s":[[/~s@sigilStartDelimiter/,{token:"string.delimiter",switchTo:"@sigilContinue.$S2.$S3.$S4.$S5"}]],"sigilContinue.interpol.s":[[/(@sigilEndDelimiter)@sigilModifiers/,{cases:{"$1==$S5":{token:"string.delimiter",next:"@pop"},"@default":"string"}}],{include:"@stringContentInterpol"}],"sigilStart.noInterpol.S":[[/~S@sigilStartDelimiter/,{token:"string.delimiter",switchTo:"@sigilContinue.$S2.$S3.$S4.$S5"}]],"sigilContinue.noInterpol.S":[[/(^|[^\\])\\@sigilEndDelimiter/,"string"],[/(@sigilEndDelimiter)@sigilModifiers/,{cases:{"$1==$S5":{token:"string.delimiter",next:"@pop"},"@default":"string"}}],{include:"@stringContent"}],"sigilStart.interpol.r":[[/~r@sigilStartDelimiter/,{token:"regexp.delimiter",switchTo:"@sigilContinue.$S2.$S3.$S4.$S5"}]],"sigilContinue.interpol.r":[[/(@sigilEndDelimiter)@sigilModifiers/,{cases:{"$1==$S5":{token:"regexp.delimiter",next:"@pop"},"@default":"regexp"}}],{include:"@regexpContentInterpol"}],"sigilStart.noInterpol.R":[[/~R@sigilStartDelimiter/,{token:"regexp.delimiter",switchTo:"@sigilContinue.$S2.$S3.$S4.$S5"}]],"sigilContinue.noInterpol.R":[[/(^|[^\\])\\@sigilEndDelimiter/,"regexp"],[/(@sigilEndDelimiter)@sigilModifiers/,{cases:{"$1==$S5":{token:"regexp.delimiter",next:"@pop"},"@default":"regexp"}}],{include:"@regexpContent"}],"sigilStart.interpol":[[/~([a-zA-Z])@sigilStartDelimiter/,{token:"sigil.delimiter",switchTo:"@sigilContinue.$S2.$S3.$S4.$S5"}]],"sigilContinue.interpol":[[/(@sigilEndDelimiter)@sigilModifiers/,{cases:{"$1==$S5":{token:"sigil.delimiter",next:"@pop"},"@default":"sigil"}}],{include:"@sigilContentInterpol"}],"sigilStart.noInterpol":[[/~([a-zA-Z])@sigilStartDelimiter/,{token:"sigil.delimiter",switchTo:"@sigilContinue.$S2.$S3.$S4.$S5"}]],"sigilContinue.noInterpol":[[/(^|[^\\])\\@sigilEndDelimiter/,"sigil"],[/(@sigilEndDelimiter)@sigilModifiers/,{cases:{"$1==$S5":{token:"sigil.delimiter",next:"@pop"},"@default":"sigil"}}],{include:"@sigilContent"}],attributes:[[/\@(module|type)?doc (~[sS])?"""/,{token:"comment.block.documentation",next:"@doubleQuotedHeredocDocstring"}],[/\@(module|type)?doc (~[sS])?"/,{token:"comment.block.documentation",next:"@doubleQuotedStringDocstring"}],[/\@(module|type)?doc false/,"comment.block.documentation"],[/\@(@variableName)/,"variable"]],doubleQuotedHeredocDocstring:[[/"""/,{token:"comment.block.documentation",next:"@pop"}],{include:"@docstringContent"}],doubleQuotedStringDocstring:[[/"/,{token:"comment.block.documentation",next:"@pop"}],{include:"@docstringContent"}],symbols:[[/\?(\\.|[^\\\s])/,"number.constant"],[/&\d+/,"operator"],[/<<<|>>>/,"operator"],[/[()\[\]\{\}]|<<|>>/,"@brackets"],[/\.\.\./,"identifier"],[/=>/,"punctuation"],[/@operator/,"operator"],[/[:;,.%]/,"punctuation"]],stringContentInterpol:[{include:"@interpolation"},{include:"@escapeChar"},{include:"@stringContent"}],stringContent:[[/./,"string"]],stringConstantContentInterpol:[{include:"@interpolation"},{include:"@escapeChar"},{include:"@stringConstantContent"}],stringConstantContent:[[/./,"constant"]],regexpContentInterpol:[{include:"@interpolation"},{include:"@escapeChar"},{include:"@regexpContent"}],regexpContent:[[/(\s)(#)(\s.*)$/,["white","comment.punctuation","comment"]],[/./,"regexp"]],sigilContentInterpol:[{include:"@interpolation"},{include:"@escapeChar"},{include:"@sigilContent"}],sigilContent:[[/./,"sigil"]],docstringContent:[[/./,"comment.block.documentation"]],escapeChar:[[/@escape/,"constant.character.escape"]],interpolation:[[/#{/,{token:"delimiter.bracket.embed",next:"@interpolationContinue"}]],interpolationContinue:[[/}/,{token:"delimiter.bracket.embed",next:"@pop"}],{include:"@root"}]}}}}]); \ No newline at end of file diff --git a/forge/sterling/build/249.bundle.js b/forge/sterling/build/249.bundle.js index 4e91daa45..bbfc84d01 100644 --- a/forge/sterling/build/249.bundle.js +++ b/forge/sterling/build/249.bundle.js @@ -1,2 +1,2 @@ /*! For license information please see 249.bundle.js.LICENSE.txt */ -"use strict";(self.webpackChunksterling_ts=self.webpackChunksterling_ts||[]).push([[249],{80249:(e,n,t)=>{t.r(n),t.d(n,{conf:()=>o,language:()=>s});var o={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"`",close:"`",notIn:["string"]},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"`",close:"`"},{open:'"',close:'"'},{open:"'",close:"'"}]},s={defaultToken:"",tokenPostfix:".go",keywords:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var","bool","true","false","uint8","uint16","uint32","uint64","int8","int16","int32","int64","float32","float64","complex64","complex128","byte","rune","uint","int","uintptr","string","nil"],operators:["+","-","*","/","%","&","|","^","<<",">>","&^","+=","-=","*=","/=","%=","&=","|=","^=","<<=",">>=","&^=","&&","||","<-","++","--","==","<",">","=","!","!=","<=",">=",":=","...","(",")","","]","{","}",",",";",".",":"],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\d+[eE]([\-+]?\d+)?/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F]/,"number.hex"],[/0[0-7']*[0-7]/,"number.octal"],[/0[bB][0-1']*[0-1]/,"number.binary"],[/\d[\d']*/,"number"],[/\d/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/`/,"string","@rawstring"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doccomment"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],doccomment:[[/[^\/*]+/,"comment.doc"],[/\/\*/,"comment.doc.invalid"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],rawstring:[[/[^\`]/,"string"],[/`/,"string","@pop"]]}}}}]); \ No newline at end of file +"use strict";(self.webpackChunksterling_layout=self.webpackChunksterling_layout||[]).push([[249],{80249:(e,n,t)=>{t.r(n),t.d(n,{conf:()=>o,language:()=>s});var o={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"`",close:"`",notIn:["string"]},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"`",close:"`"},{open:'"',close:'"'},{open:"'",close:"'"}]},s={defaultToken:"",tokenPostfix:".go",keywords:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var","bool","true","false","uint8","uint16","uint32","uint64","int8","int16","int32","int64","float32","float64","complex64","complex128","byte","rune","uint","int","uintptr","string","nil"],operators:["+","-","*","/","%","&","|","^","<<",">>","&^","+=","-=","*=","/=","%=","&=","|=","^=","<<=",">>=","&^=","&&","||","<-","++","--","==","<",">","=","!","!=","<=",">=",":=","...","(",")","","]","{","}",",",";",".",":"],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/\d*\d+[eE]([\-+]?\d+)?/,"number.float"],[/\d*\.\d+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F']*[0-9a-fA-F]/,"number.hex"],[/0[0-7']*[0-7]/,"number.octal"],[/0[bB][0-1']*[0-1]/,"number.binary"],[/\d[\d']*/,"number"],[/\d/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/`/,"string","@rawstring"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@doccomment"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],doccomment:[[/[^\/*]+/,"comment.doc"],[/\/\*/,"comment.doc.invalid"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],rawstring:[[/[^\`]/,"string"],[/`/,"string","@pop"]]}}}}]); \ No newline at end of file diff --git a/forge/sterling/build/2571.bundle.js b/forge/sterling/build/2571.bundle.js index 45fe6aee0..958cf2cee 100644 --- a/forge/sterling/build/2571.bundle.js +++ b/forge/sterling/build/2571.bundle.js @@ -1,2 +1,2 @@ /*! For license information please see 2571.bundle.js.LICENSE.txt */ -"use strict";(self.webpackChunksterling_ts=self.webpackChunksterling_ts||[]).push([[2571],{2571:(e,t,n)=>{n.r(t),n.d(t,{conf:()=>l,language:()=>m});var r=n(1593),i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,d={};i(d,"__esModule",{value:!0}),((e,t,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))a.call(e,r)||"default"===r||i(e,r,{get:()=>t[r],enumerable:!(n=o(t,r))||n.enumerable})})(d,r);var p=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],l={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["\x3c!--","--\x3e"]},brackets:[["\x3c!--","--\x3e"],["<",">"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${p.join("|")}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:d.languages.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${p.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:d.languages.IndentAction.Indent}}],folding:{markers:{start:new RegExp("^\\s*\x3c!--\\s*#region\\b.*--\x3e"),end:new RegExp("^\\s*\x3c!--\\s*#endregion\\b.*--\x3e")}}},m={defaultToken:"",tokenPostfix:".html",ignoreCase:!0,tokenizer:{root:[[/)/,["delimiter","tag","","delimiter"]],[/(<)(script)/,["delimiter",{token:"tag",next:"@script"}]],[/(<)(style)/,["delimiter",{token:"tag",next:"@style"}]],[/(<)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/(<\/)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/]+/,"metatag.content"],[/>/,"metatag","@pop"]],comment:[[/-->/,"comment","@pop"],[/[^-]+/,"comment.content"],[/./,"comment.content"]],otherTag:[[/\/?>/,"delimiter","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],scriptAfterType:[[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/>/,{token:"delimiter",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]],style:[[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],styleAfterType:[[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/>/,{token:"delimiter",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]]}}}}]); \ No newline at end of file +"use strict";(self.webpackChunksterling_layout=self.webpackChunksterling_layout||[]).push([[2571],{2571:(e,t,n)=>{n.r(t),n.d(t,{conf:()=>p,language:()=>m});var r=n(1593),i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,d={};i(d,"__esModule",{value:!0}),((e,t,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))a.call(e,r)||"default"===r||i(e,r,{get:()=>t[r],enumerable:!(n=o(t,r))||n.enumerable})})(d,r);var l=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],p={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["\x3c!--","--\x3e"]},brackets:[["\x3c!--","--\x3e"],["<",">"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:'"',close:'"'},{open:"'",close:"'"},{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${l.join("|")}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:d.languages.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${l.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:d.languages.IndentAction.Indent}}],folding:{markers:{start:new RegExp("^\\s*\x3c!--\\s*#region\\b.*--\x3e"),end:new RegExp("^\\s*\x3c!--\\s*#endregion\\b.*--\x3e")}}},m={defaultToken:"",tokenPostfix:".html",ignoreCase:!0,tokenizer:{root:[[/)/,["delimiter","tag","","delimiter"]],[/(<)(script)/,["delimiter",{token:"tag",next:"@script"}]],[/(<)(style)/,["delimiter",{token:"tag",next:"@style"}]],[/(<)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/(<\/)((?:[\w\-]+:)?[\w\-]+)/,["delimiter",{token:"tag",next:"@otherTag"}]],[/]+/,"metatag.content"],[/>/,"metatag","@pop"]],comment:[[/-->/,"comment","@pop"],[/[^-]+/,"comment.content"],[/./,"comment.content"]],otherTag:[[/\/?>/,"delimiter","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],scriptAfterType:[[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@scriptEmbedded",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/>/,{token:"delimiter",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]],style:[[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter","tag",{token:"delimiter",next:"@pop"}]]],styleAfterType:[[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter",next:"@styleEmbedded",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/>/,{token:"delimiter",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}],[/[^<]+/,""]]}}}}]); \ No newline at end of file diff --git a/forge/sterling/build/2798.bundle.js b/forge/sterling/build/2798.bundle.js index 70e31d218..41d2ecb5c 100644 --- a/forge/sterling/build/2798.bundle.js +++ b/forge/sterling/build/2798.bundle.js @@ -1,2 +1,2 @@ /*! For license information please see 2798.bundle.js.LICENSE.txt */ -"use strict";(self.webpackChunksterling_ts=self.webpackChunksterling_ts||[]).push([[2798],{52798:(e,s,n)=>{n.r(s),n.d(s,{conf:()=>t,language:()=>i});var t={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},i={defaultToken:"",tokenPostfix:".ini",escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/^\[[^\]]*\]/,"metatag"],[/(^\w+)(\s*)(\=)/,["key","","delimiter"]],{include:"@whitespace"},[/\d+/,"number"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],whitespace:[[/[ \t\r\n]+/,""],[/^\s*[#;].*$/,"comment"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]]}}}}]); \ No newline at end of file +"use strict";(self.webpackChunksterling_layout=self.webpackChunksterling_layout||[]).push([[2798],{52798:(e,n,s)=>{s.r(n),s.d(n,{conf:()=>t,language:()=>o});var t={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},o={defaultToken:"",tokenPostfix:".ini",escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,tokenizer:{root:[[/^\[[^\]]*\]/,"metatag"],[/(^\w+)(\s*)(\=)/,["key","","delimiter"]],{include:"@whitespace"},[/\d+/,"number"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"]],whitespace:[[/[ \t\r\n]+/,""],[/^\s*[#;].*$/,"comment"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]]}}}}]); \ No newline at end of file diff --git a/forge/sterling/build/2814.bundle.js b/forge/sterling/build/2814.bundle.js index 34e2a167d..0b33f302d 100644 --- a/forge/sterling/build/2814.bundle.js +++ b/forge/sterling/build/2814.bundle.js @@ -1,2 +1,2 @@ /*! For license information please see 2814.bundle.js.LICENSE.txt */ -"use strict";(self.webpackChunksterling_ts=self.webpackChunksterling_ts||[]).push([[2814],{12814:(e,o,t)=>{t.r(o),t.d(o,{conf:()=>n,language:()=>r});var n={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}]},r={defaultToken:"",tokenPostfix:".ecl",ignoreCase:!0,brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],pounds:["append","break","declare","demangle","end","for","getdatatype","if","inmodule","loop","mangle","onwarning","option","set","stored","uniquename"].join("|"),keywords:["__compressed__","after","all","and","any","as","atmost","before","beginc","best","between","case","cluster","compressed","compression","const","counter","csv","default","descend","embed","encoding","encrypt","end","endc","endembed","endmacro","enum","escape","except","exclusive","expire","export","extend","fail","few","fileposition","first","flat","forward","from","full","function","functionmacro","group","grouped","heading","hole","ifblock","import","in","inner","interface","internal","joined","keep","keyed","last","left","limit","linkcounted","literal","little_endian","load","local","locale","lookup","lzw","macro","many","maxcount","maxlength","min skew","module","mofn","multiple","named","namespace","nocase","noroot","noscan","nosort","not","noxpath","of","onfail","only","opt","or","outer","overwrite","packed","partition","penalty","physicallength","pipe","prefetch","quote","record","repeat","retry","return","right","right1","right2","rows","rowset","scan","scope","self","separator","service","shared","skew","skip","smart","soapaction","sql","stable","store","terminator","thor","threshold","timelimit","timeout","token","transform","trim","type","unicodeorder","unordered","unsorted","unstable","update","use","validate","virtual","whole","width","wild","within","wnotrim","xml","xpath"],functions:["abs","acos","aggregate","allnodes","apply","ascii","asin","assert","asstring","atan","atan2","ave","build","buildindex","case","catch","choose","choosen","choosesets","clustersize","combine","correlation","cos","cosh","count","covariance","cron","dataset","dedup","define","denormalize","dictionary","distribute","distributed","distribution","ebcdic","enth","error","evaluate","event","eventextra","eventname","exists","exp","fail","failcode","failmessage","fetch","fromunicode","fromxml","getenv","getisvalid","global","graph","group","hash","hash32","hash64","hashcrc","hashmd5","having","httpcall","httpheader","if","iff","index","intformat","isvalid","iterate","join","keydiff","keypatch","keyunicode","length","library","limit","ln","loadxml","local","log","loop","map","matched","matchlength","matchposition","matchtext","matchunicode","max","merge","mergejoin","min","nofold","nolocal","nonempty","normalize","nothor","notify","output","parallel","parse","pipe","power","preload","process","project","pull","random","range","rank","ranked","realformat","recordof","regexfind","regexreplace","regroup","rejected","rollup","round","roundup","row","rowdiff","sample","sequential","set","sin","sinh","sizeof","soapcall","sort","sorted","sqrt","stepped","stored","sum","table","tan","tanh","thisnode","topn","tounicode","toxml","transfer","transform","trim","truncate","typeof","ungroup","unicodeorder","variance","wait","which","workunit","xmldecode","xmlencode","xmltext","xmlunicode"],typesint:["integer","unsigned"].join("|"),typesnum:["data","qstring","string","unicode","utf8","varstring","varunicode"],typesone:["ascii","big_endian","boolean","data","decimal","ebcdic","grouped","integer","linkcounted","pattern","qstring","real","record","rule","set of","streamed","string","token","udecimal","unicode","unsigned","utf8","varstring","varunicode"].join("|"),operators:["+","-","/",":=","<","<>","=",">","\\","and","in","not","or"],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/[0-9_]*\.[0-9_]+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F_]+/,"number.hex"],[/0[bB][01]+/,"number.hex"],[/[0-9_]+/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\v\f\r\n]+/,""],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],string:[[/[^\\']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"]]}}}}]); \ No newline at end of file +"use strict";(self.webpackChunksterling_layout=self.webpackChunksterling_layout||[]).push([[2814],{12814:(e,o,t)=>{t.r(o),t.d(o,{conf:()=>n,language:()=>r});var n={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}]},r={defaultToken:"",tokenPostfix:".ecl",ignoreCase:!0,brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],pounds:["append","break","declare","demangle","end","for","getdatatype","if","inmodule","loop","mangle","onwarning","option","set","stored","uniquename"].join("|"),keywords:["__compressed__","after","all","and","any","as","atmost","before","beginc","best","between","case","cluster","compressed","compression","const","counter","csv","default","descend","embed","encoding","encrypt","end","endc","endembed","endmacro","enum","escape","except","exclusive","expire","export","extend","fail","few","fileposition","first","flat","forward","from","full","function","functionmacro","group","grouped","heading","hole","ifblock","import","in","inner","interface","internal","joined","keep","keyed","last","left","limit","linkcounted","literal","little_endian","load","local","locale","lookup","lzw","macro","many","maxcount","maxlength","min skew","module","mofn","multiple","named","namespace","nocase","noroot","noscan","nosort","not","noxpath","of","onfail","only","opt","or","outer","overwrite","packed","partition","penalty","physicallength","pipe","prefetch","quote","record","repeat","retry","return","right","right1","right2","rows","rowset","scan","scope","self","separator","service","shared","skew","skip","smart","soapaction","sql","stable","store","terminator","thor","threshold","timelimit","timeout","token","transform","trim","type","unicodeorder","unordered","unsorted","unstable","update","use","validate","virtual","whole","width","wild","within","wnotrim","xml","xpath"],functions:["abs","acos","aggregate","allnodes","apply","ascii","asin","assert","asstring","atan","atan2","ave","build","buildindex","case","catch","choose","choosen","choosesets","clustersize","combine","correlation","cos","cosh","count","covariance","cron","dataset","dedup","define","denormalize","dictionary","distribute","distributed","distribution","ebcdic","enth","error","evaluate","event","eventextra","eventname","exists","exp","fail","failcode","failmessage","fetch","fromunicode","fromxml","getenv","getisvalid","global","graph","group","hash","hash32","hash64","hashcrc","hashmd5","having","httpcall","httpheader","if","iff","index","intformat","isvalid","iterate","join","keydiff","keypatch","keyunicode","length","library","limit","ln","loadxml","local","log","loop","map","matched","matchlength","matchposition","matchtext","matchunicode","max","merge","mergejoin","min","nofold","nolocal","nonempty","normalize","nothor","notify","output","parallel","parse","pipe","power","preload","process","project","pull","random","range","rank","ranked","realformat","recordof","regexfind","regexreplace","regroup","rejected","rollup","round","roundup","row","rowdiff","sample","sequential","set","sin","sinh","sizeof","soapcall","sort","sorted","sqrt","stepped","stored","sum","table","tan","tanh","thisnode","topn","tounicode","toxml","transfer","transform","trim","truncate","typeof","ungroup","unicodeorder","variance","wait","which","workunit","xmldecode","xmlencode","xmltext","xmlunicode"],typesint:["integer","unsigned"].join("|"),typesnum:["data","qstring","string","unicode","utf8","varstring","varunicode"],typesone:["ascii","big_endian","boolean","data","decimal","ebcdic","grouped","integer","linkcounted","pattern","qstring","real","record","rule","set of","streamed","string","token","udecimal","unicode","unsigned","utf8","varstring","varunicode"].join("|"),operators:["+","-","/",":=","<","<>","=",">","\\","and","in","not","or"],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/[0-9_]*\.[0-9_]+([eE][\-+]?\d+)?/,"number.float"],[/0[xX][0-9a-fA-F_]+/,"number.hex"],[/0[bB][01]+/,"number.hex"],[/[0-9_]+/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,"string","@string"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\v\f\r\n]+/,""],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],string:[[/[^\\']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/'/,"string","@pop"]]}}}}]); \ No newline at end of file diff --git a/forge/sterling/build/2867.bundle.js b/forge/sterling/build/2867.bundle.js new file mode 100644 index 000000000..5e9157fc2 --- /dev/null +++ b/forge/sterling/build/2867.bundle.js @@ -0,0 +1,2 @@ +/*! For license information please see 2867.bundle.js.LICENSE.txt */ +(self.webpackChunksterling_layout=self.webpackChunksterling_layout||[]).push([[2867],{94090:(e,t,n)=>{"use strict";n.d(t,{UQ:()=>k,KF:()=>I,XE:()=>M,Qd:()=>D,Hk:()=>T});var i=n(10894),o=n(105),r=n(37496),s=n(44592),a=n(26450),l=n(67294),c=n(40242),d=n(97375);function u(){return u=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}var g=["onChange","defaultIndex","index","allowMultiple","allowToggle"],p=["isDisabled","isFocusable","id"],f=(0,c.n)(),m=f[0],v=(f[1],f[2]),_=f[3];var b=(0,a.kr)({name:"AccordionContext",errorMessage:"useAccordionContext: `context` is undefined. Seems you forgot to wrap the accordion components in ``"}),y=b[0],w=b[1];var C=["children","reduceMotion"],S=["htmlProps","descendants"],x=["htmlProps"],k=(0,o.Gp)((function(e,t){var n=e.children,i=e.reduceMotion,r=h(e,C),a=(0,o.jC)("Accordion",r),c=function(e){var t=e.onChange,n=e.defaultIndex,i=e.index,o=e.allowMultiple,r=e.allowToggle,a=h(e,g);!function(e){var t=e.index||e.defaultIndex,n=!(0,s.o8)(t)&&!(0,s.kJ)(t)&&e.allowMultiple;(0,s.ZK)({condition:!!n,message:"If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: "+typeof t+","})}(e),function(e){(0,s.ZK)({condition:!(!e.allowMultiple||!e.allowToggle),message:"If 'allowMultiple' is passed, 'allowToggle' will be ignored. Either remove 'allowToggle' or 'allowMultiple' depending on whether you want multiple accordions visible or not"})}(e);var c=v(),u=(0,l.useState)(-1),p=u[0],f=u[1];(0,d.zq)((function(){f(-1)}));var m=(0,d.Tx)({value:i,defaultValue:function(){return o?null!=n?n:[]:null!=n?n:-1},onChange:t}),_=m[0],b=m[1];return{index:_,setIndex:b,htmlProps:a,getAccordionItemProps:function(e){var t=!1;return null!==e&&(t=(0,s.kJ)(_)?_.includes(e):_===e),{isOpen:t,onChange:function(t){if(null!==e)if(o&&(0,s.kJ)(_)){var n=t?(0,s.jX)(_,e):(0,s.cl)(_,e);b(n)}else t?b(e):r&&b(-1)}}},focusedIndex:p,setFocusedIndex:f,descendants:c}}((0,o.Lr)(r)),p=c.htmlProps,f=c.descendants,_=h(c,S),b=l.useMemo((function(){return u({},_,{reduceMotion:!!i})}),[_,i]);return l.createElement(m,{value:f},l.createElement(y,{value:b},l.createElement(o.Fo,{value:a},l.createElement(o.m$.div,u({ref:t},p,{className:(0,s.cx)("chakra-accordion",r.className)}),n))))}));s.Ts&&(k.displayName="Accordion");var L=(0,a.kr)({name:"AccordionItemContext",errorMessage:"useAccordionItemContext: `context` is undefined. Seems you forgot to wrap the accordion item parts in `` "}),N=L[0],E=L[1],D=(0,o.Gp)((function(e,t){var n=e.children,i=e.className,r=function(e){var t=e.isDisabled,n=e.isFocusable,i=e.id,o=h(e,p),r=w(),c=r.getAccordionItemProps,g=r.setFocusedIndex,f=(0,l.useRef)(null),m=(0,d.ZS)(i,"accordion-button","accordion-panel"),v=m[0],b=m[1];!function(e){(0,s.ZK)({condition:!(!e.isFocusable||e.isDisabled),message:"Using only 'isFocusable', this prop is reserved for situations where you pass 'isDisabled' but you still want the element to receive focus (A11y). Either remove it or pass 'isDisabled' as well.\n "})}(e);var y=_({disabled:t&&!n}),C=y.register,S=y.index,x=y.descendants,k=c(-1===S?null:S),L=k.isOpen,N=k.onChange;!function(e){(0,s.ZK)({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}({isOpen:L,isDisabled:t});var E=(0,l.useCallback)((function(){null==N||N(!L),g(S)}),[S,g,L,N]),D=(0,l.useCallback)((function(e){var t={ArrowDown:function(){var e=x.nextEnabled(S);e&&(0,s.T_)(e.node)},ArrowUp:function(){var e=x.prevEnabled(S);e&&(0,s.T_)(e.node)},Home:function(){var e=x.firstEnabled();e&&(0,s.T_)(e.node)},End:function(){var e=x.lastEnabled();e&&(0,s.T_)(e.node)}}[(0,s.uh)(e)];t&&(e.preventDefault(),t(e))}),[x,S]),I=(0,l.useCallback)((function(){g(S)}),[g,S]),T=(0,l.useCallback)((function(e,n){return void 0===e&&(e={}),void 0===n&&(n=null),u({},e,{type:"button",ref:(0,a.lq)(C,f,n),id:v,disabled:!!t,"aria-expanded":!!L,"aria-controls":b,onClick:(0,s.v0)(e.onClick,E),onFocus:(0,s.v0)(e.onFocus,I),onKeyDown:(0,s.v0)(e.onKeyDown,D)})}),[v,t,L,E,I,D,b,C]),M=(0,l.useCallback)((function(e,t){return void 0===e&&(e={}),void 0===t&&(t=null),u({},e,{ref:t,role:"region",id:b,"aria-labelledby":v,hidden:!L})}),[v,L,b]);return{isOpen:L,isDisabled:t,isFocusable:n,onOpen:function(){null==N||N(!0)},onClose:function(){null==N||N(!1)},getButtonProps:T,getPanelProps:M,htmlProps:o}}(e),c=r.htmlProps,g=h(r,x),f=u({},(0,o.yK)().container,{overflowAnchor:"none"}),m=l.useMemo((function(){return g}),[g]);return l.createElement(N,{value:m},l.createElement(o.m$.div,u({ref:t},c,{className:(0,s.cx)("chakra-accordion__item",i),__css:f}),(0,s.Pu)(n,{isExpanded:!!g.isOpen,isDisabled:!!g.isDisabled})))}));s.Ts&&(D.displayName="AccordionItem");var I=(0,o.Gp)((function(e,t){var n=(0,E().getButtonProps)(e,t),i=u({display:"flex",alignItems:"center",width:"100%",outline:0},(0,o.yK)().button);return l.createElement(o.m$.button,u({},n,{className:(0,s.cx)("chakra-accordion__button",e.className),__css:i}))}));s.Ts&&(I.displayName="AccordionButton");var T=(0,o.Gp)((function(e,t){var n=w().reduceMotion,i=E(),a=i.getPanelProps,c=i.isOpen,d=a(e,t),h=(0,s.cx)("chakra-accordion__panel",e.className),g=(0,o.yK)();n||delete d.hidden;var p=l.createElement(o.m$.div,u({},d,{__css:g.panel,className:h}));return n?p:l.createElement(r.UO,{in:c},p)}));s.Ts&&(T.displayName="AccordionPanel");var M=function(e){var t=E(),n=t.isOpen,r=t.isDisabled,a=w().reduceMotion,c=(0,s.cx)("chakra-accordion__icon",e.className),d=u({opacity:r?.4:1,transform:n?"rotate(-180deg)":void 0,transition:a?void 0:"transform 0.2s",transformOrigin:"center"},(0,o.yK)().icon);return l.createElement(i.JO,u({viewBox:"0 0 24 24","aria-hidden":!0,className:c,__css:d},e),l.createElement("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}))};s.Ts&&(M.displayName="AccordionIcon")},68921:(e,t,n)=>{"use strict";n.d(t,{zx:()=>E,hE:()=>C,hU:()=>T});var i=n(97375),o=n(105),r=n(44592),s=n(38554),a=n.n(s),l=n(67294),c=n(26450),d=n(70917),u=n(1358);function h(){return h=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(i,g),w=(0,r.cx)("chakra-spinner",b),C=h({display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:d,borderBottomColor:_,borderLeftColor:_,animation:p+" "+m+" linear infinite"},n);return l.createElement(o.m$.div,h({ref:t,__css:C,className:w},y),a&&l.createElement(u.TX,null,a))}));function m(e,t){if(null==e)return{};var n,i,o={},r=Object.keys(e);for(i=0;i=0||(o[n]=e[n]);return o}function v(){return v=Object.assign||function(e){for(var t=1;t *:first-of-type:not(:last-of-type)":{borderEndRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderStartRadius:0}}:{"& > *:not(style) ~ *:not(style)":{marginStart:d}}),l.createElement(y,{value:f},l.createElement(o.m$.div,v({ref:t,role:"group",__css:b,className:p},g)))}));r.Ts&&(C.displayName="ButtonGroup");var S=["label","placement","spacing","children","className","__css"],x=function(e){var t=e.label,n=e.placement;e.spacing;var i=e.children,s=void 0===i?l.createElement(f,{color:"currentColor",width:"1em",height:"1em"}):i,a=e.className,c=e.__css,d=m(e,S),u=(0,r.cx)("chakra-button__spinner",a),h="start"===n?"marginEnd":"marginStart",g=l.useMemo((function(){var e;return v(((e={display:"flex",alignItems:"center",position:t?"relative":"absolute"})[h]=t?"0.5rem":0,e.fontSize="1em",e.lineHeight="normal",e),c)}),[c,t,h]);return l.createElement(o.m$.div,v({className:u},d,{__css:g}),s)};r.Ts&&(x.displayName="ButtonSpinner");var k=["children","className"],L=function(e){var t=e.children,n=e.className,i=m(e,k),s=l.isValidElement(t)?l.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,a=(0,r.cx)("chakra-button__icon",n);return l.createElement(o.m$.span,v({display:"inline-flex",alignSelf:"center",flexShrink:0},i,{className:a}),s)};r.Ts&&(L.displayName="ButtonIcon");var N=["isDisabled","isLoading","isActive","isFullWidth","children","leftIcon","rightIcon","loadingText","iconSpacing","type","spinner","spinnerPlacement","className","as"],E=(0,o.Gp)((function(e,t){var n,s,c,d,u=w(),h=(0,o.mq)("Button",v({},u,e)),g=(0,o.Lr)(e),p=g.isDisabled,f=void 0===p?null==u?void 0:u.isDisabled:p,_=g.isLoading,b=g.isActive,y=g.isFullWidth,C=g.children,S=g.leftIcon,k=g.rightIcon,L=g.loadingText,E=g.iconSpacing,I=void 0===E?"0.5rem":E,T=g.type,M=g.spinner,A=g.spinnerPlacement,O=void 0===A?"start":A,R=g.className,P=g.as,F=m(g,N),B=l.useMemo((function(){var e,t=a()({},null!=(e=null==h?void 0:h._focus)?e:{},{zIndex:1});return v({display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",width:y?"100%":"auto"},h,!!u&&{_focus:t})}),[h,u,y]),W=(n=P,c=(s=l.useState(!n))[0],d=s[1],{ref:l.useCallback((function(e){e&&d("BUTTON"===e.tagName)}),[]),type:c?"button":void 0}),V=W.ref,z=W.type,H={rightIcon:k,leftIcon:S,iconSpacing:I,children:C};return l.createElement(o.m$.button,v({disabled:f||_,ref:(0,i.qq)(t,V),as:P,type:null!=T?T:z,"data-active":(0,r.PB)(b),"data-loading":(0,r.PB)(_),__css:B,className:(0,r.cx)("chakra-button",R)},F),_&&"start"===O&&l.createElement(x,{className:"chakra-button__spinner--start",label:L,placement:"start"},M),_?L||l.createElement(o.m$.span,{opacity:0},l.createElement(D,H)):l.createElement(D,H),_&&"end"===O&&l.createElement(x,{className:"chakra-button__spinner--end",label:L,placement:"end"},M))}));function D(e){var t=e.leftIcon,n=e.rightIcon,i=e.children,o=e.iconSpacing;return l.createElement(l.Fragment,null,t&&l.createElement(L,{marginEnd:o},t),i,n&&l.createElement(L,{marginStart:o},n))}r.Ts&&(E.displayName="Button");var I=["icon","children","isRound","aria-label"],T=(0,o.Gp)((function(e,t){var n=e.icon,i=e.children,o=e.isRound,r=e["aria-label"],s=m(e,I),a=n||i,c=l.isValidElement(a)?l.cloneElement(a,{"aria-hidden":!0,focusable:!1}):null;return l.createElement(E,v({padding:"0",borderRadius:o?"full":void 0,ref:t,"aria-label":r},s),c)}));r.Ts&&(T.displayName="IconButton")},84746:(e,t,n)=>{"use strict";n.d(t,{P:()=>d});var i=n(10894),o=n(105),r=n(44592),s=n(67294);function a(){return a=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(i,l);return s.createElement(o.m$.button,a({type:"button","aria-label":"Close",ref:t,disabled:d,__css:a({},{outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},n,u)},h),r||s.createElement(c,{width:"1em",height:"1em"}))}));r.Ts&&(d.displayName="CloseButton")},20949:(e,t,n)=>{"use strict";n.d(t,{kc:()=>f,SG:()=>v,If:()=>m});var i=n(85393),o=n(44592),r=n(67294),s="chakra-ui-light",a="chakra-ui-dark",l={classList:{add:o.ZT,remove:o.ZT}};var c="(prefers-color-scheme: dark)";var d=function(){return document.documentElement.style.getPropertyValue("--chakra-ui-color-mode")},u=function(e){o.jU&&document.documentElement.style.setProperty("--chakra-ui-color-mode",e)},h=function(){return"undefined"!=typeof Storage},g="chakra-ui-color-mode",p={get:function(e){if(!h())return e;try{var t=localStorage.getItem(g);return null!=t?t:e}catch(t){return o.Ts&&console.log(t),e}},set:function(e){if(h())try{localStorage.setItem(g,e)}catch(e){o.Ts&&console.log(e)}},type:"localStorage"},f=r.createContext({});o.Ts&&(f.displayName="ColorModeContext");var m=function(){var e=r.useContext(f);if(void 0===e)throw new Error("useColorMode must be used within a ColorModeProvider");return e};function v(e){var t=e.value,n=e.children,h=e.options,g=h.useSystemColorMode,m=h.initialColorMode,v=e.colorModeManager,_=void 0===v?p:v,b="dark"===m?"dark":"light",y=r.useState("cookie"===_.type?_.get(b):b),w=y[0],C=y[1],S=(0,i.O)().document;r.useEffect((function(){if(o.jU&&"localStorage"===_.type){var e=(i=b,(null!=(r=function(e){var t=null==window.matchMedia?void 0:window.matchMedia("(prefers-color-scheme: dark)");if(t)return!!t.media===t.matches}())?r:"dark"===i)?"dark":"light");if(g)return C(e);var t=d(),n=_.get();return C(t||(n||("system"===m?e:b)))}var i,r}),[_,g,b,m]),r.useEffect((function(){var e="dark"===w;(function(e,t){var n=function(e){return o.jU?e.body:l}(t);n.classList.add(e?a:s),n.classList.remove(e?s:a)})(e,S),u(e?"dark":"light")}),[w,S]);var x=r.useCallback((function(e,t){if(void 0===t&&(t=!1),t){if(_.get()&&!g)return}else _.set(e);C(e)}),[_,g]),k=r.useCallback((function(){x("light"===w?"dark":"light")}),[w,x]);r.useEffect((function(){var e,t=g||"system"===m;return t&&(e=function(e){if(!("matchMedia"in window))return o.ZT;var t=window.matchMedia(c),n=function(){e(t.matches?"dark":"light",!0)};return t.addEventListener("change",n),function(){t.removeEventListener("change",n)}}(x)),function(){e&&t&&e()}}),[x,g,m]);var L=r.useMemo((function(){return{colorMode:null!=t?t:w,toggleColorMode:t?o.ZT:k,setColorMode:t?o.ZT:x}}),[w,x,k,t]);return r.createElement(f.Provider,{value:L},n)}o.Ts&&(v.displayName="ColorModeProvider"),o.Ts,o.Ts},40242:(e,t,n)=>{"use strict";n.d(t,{n:()=>p});var i=n(26450),o=n(67294);function r(){return r=Object.assign||function(e){for(var t=1;t=t&&(i=0),i}function l(e,t,n){var i=e-1;return n&&i<0&&(i=t),i}var c="undefined"!=typeof window?o.useLayoutEffect:o.useEffect,d=function(){var e=this;this.descendants=new Map,this.register=function(t){var n;if(null!=t)return"object"==typeof(n=t)&&"nodeType"in n&&n.nodeType===Node.ELEMENT_NODE?e.registerNode(t):function(n){e.registerNode(n,t)}},this.unregister=function(t){e.descendants.delete(t);var n=s(Array.from(e.descendants.keys()));e.assignIndex(n)},this.destroy=function(){e.descendants.clear()},this.assignIndex=function(t){e.descendants.forEach((function(e){var n=t.indexOf(e.node);e.index=n,e.node.dataset.index=e.index.toString()}))},this.count=function(){return e.descendants.size},this.enabledCount=function(){return e.enabledValues().length},this.values=function(){return Array.from(e.descendants.values()).sort((function(e,t){return e.index-t.index}))},this.enabledValues=function(){return e.values().filter((function(e){return!e.disabled}))},this.item=function(t){if(0!==e.count())return e.values()[t]},this.enabledItem=function(t){if(0!==e.enabledCount())return e.enabledValues()[t]},this.first=function(){return e.item(0)},this.firstEnabled=function(){return e.enabledItem(0)},this.last=function(){return e.item(e.descendants.size-1)},this.lastEnabled=function(){var t=e.enabledValues().length-1;return e.enabledItem(t)},this.indexOf=function(t){var n,i;return t&&null!=(n=null==(i=e.descendants.get(t))?void 0:i.index)?n:-1},this.enabledIndexOf=function(t){return null==t?-1:e.enabledValues().findIndex((function(e){return e.node.isSameNode(t)}))},this.next=function(t,n){void 0===n&&(n=!0);var i=a(t,e.count(),n);return e.item(i)},this.nextEnabled=function(t,n){void 0===n&&(n=!0);var i=e.item(t);if(i){var o=a(e.enabledIndexOf(i.node),e.enabledCount(),n);return e.enabledItem(o)}},this.prev=function(t,n){void 0===n&&(n=!0);var i=l(t,e.count()-1,n);return e.item(i)},this.prevEnabled=function(t,n){void 0===n&&(n=!0);var i=e.item(t);if(i){var o=l(e.enabledIndexOf(i.node),e.enabledCount()-1,n);return e.enabledItem(o)}},this.registerNode=function(t,n){if(t&&!e.descendants.has(t)){var i=s(Array.from(e.descendants.keys()).concat(t));null!=n&&n.disabled&&(n.disabled=!!n.disabled);var o=r({node:t,index:-1},n);e.descendants.set(t,o),e.assignIndex(i)}}},u=(0,i.kr)({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"}),h=u[0],g=u[1];function p(){return[h,function(){return g()},function(){return e=(0,o.useRef)(new d),c((function(){return function(){return e.current.destroy()}})),e.current;var e},function(e){return function(e){var t=g(),n=(0,o.useState)(-1),r=n[0],s=n[1],a=(0,o.useRef)(null);c((function(){return function(){a.current&&t.unregister(a.current)}}),[]),c((function(){if(a.current){var e=Number(a.current.dataset.index);r==e||Number.isNaN(e)||s(e)}}));var l=e?t.register(e):t.register;return{descendants:t,index:r,enabledIndex:t.enabledIndexOf(a.current),register:(0,i.lq)(l,a)}}(e)}]}},79762:(e,t,n)=>{"use strict";n.d(t,{NI:()=>m,lX:()=>k,Yp:()=>y,NJ:()=>f,Kn:()=>w});var i=n(97375),o=n(105),r=n(44592),s=n(26450),a=n(67294),l=n(10894);function c(){return c=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}var u=["id","isRequired","isInvalid","isDisabled","isReadOnly"],h=["getRootProps","htmlProps"],g=(0,s.kr)({strict:!1,name:"FormControlContext"}),p=g[0],f=g[1],m=(0,o.Gp)((function(e,t){var n=(0,o.jC)("Form",e),l=function(e){var t=e.id,n=e.isRequired,o=e.isInvalid,l=e.isDisabled,h=e.isReadOnly,g=d(e,u),p=(0,i.Me)(),f=t||"field-"+p,m=f+"-label",v=f+"-feedback",_=f+"-helptext",b=a.useState(!1),y=b[0],w=b[1],C=a.useState(!1),S=C[0],x=C[1],k=(0,i.kt)(),L=k[0],N=k[1],E=a.useCallback((function(e,t){return void 0===e&&(e={}),void 0===t&&(t=null),c({id:_},e,{ref:(0,s.lq)(t,(function(e){e&&x(!0)}))})}),[_]),D=a.useCallback((function(e,t){var n,i;return void 0===e&&(e={}),void 0===t&&(t=null),c({},e,{ref:t,"data-focus":(0,r.PB)(L),"data-disabled":(0,r.PB)(l),"data-invalid":(0,r.PB)(o),"data-readonly":(0,r.PB)(h),id:null!=(n=e.id)?n:m,htmlFor:null!=(i=e.htmlFor)?i:f})}),[f,l,L,o,h,m]),I=a.useCallback((function(e,t){return void 0===e&&(e={}),void 0===t&&(t=null),c({id:v},e,{ref:(0,s.lq)(t,(function(e){e&&w(!0)})),"aria-live":"polite"})}),[v]),T=a.useCallback((function(e,t){return void 0===e&&(e={}),void 0===t&&(t=null),c({},e,g,{ref:t,role:"group"})}),[g]),M=a.useCallback((function(e,t){return void 0===e&&(e={}),void 0===t&&(t=null),c({},e,{ref:t,role:"presentation","aria-hidden":!0,children:e.children||"*"})}),[]);return{isRequired:!!n,isInvalid:!!o,isReadOnly:!!h,isDisabled:!!l,isFocused:!!L,onFocus:N.on,onBlur:N.off,hasFeedbackText:y,setHasFeedbackText:w,hasHelpText:S,setHasHelpText:x,id:f,labelId:m,feedbackId:v,helpTextId:_,htmlProps:g,getHelpTextProps:E,getErrorMessageProps:I,getRootProps:T,getLabelProps:D,getRequiredIndicatorProps:M}}((0,o.Lr)(e)),g=l.getRootProps;l.htmlProps;var f=d(l,h),m=(0,r.cx)("chakra-form-control",e.className),v=a.useMemo((function(){return f}),[f]);return a.createElement(p,{value:v},a.createElement(o.Fo,{value:n},a.createElement(o.m$.div,c({},g({},t),{className:m,__css:n.container}))))}));r.Ts&&(m.displayName="FormControl");var v=(0,o.Gp)((function(e,t){var n=f(),i=(0,o.yK)(),s=(0,r.cx)("chakra-form__helper-text",e.className);return a.createElement(o.m$.div,c({},null==n?void 0:n.getHelpTextProps(e,t),{__css:i.helperText,className:s}))}));r.Ts&&(v.displayName="FormHelperText");var _=["isDisabled","isInvalid","isReadOnly","isRequired"],b=["id","disabled","readOnly","required","isRequired","isInvalid","isReadOnly","isDisabled","onFocus","onBlur"];function y(e){var t=w(e),n=t.isDisabled,i=t.isInvalid,o=t.isReadOnly,s=t.isRequired;return c({},d(t,_),{disabled:n,readOnly:o,required:s,"aria-invalid":(0,r.Qm)(i),"aria-required":(0,r.Qm)(s),"aria-readonly":(0,r.Qm)(o)})}function w(e){var t,n,i,o=f(),s=e.id,a=e.disabled,l=e.readOnly,u=e.required,h=e.isRequired,g=e.isInvalid,p=e.isReadOnly,m=e.isDisabled,v=e.onFocus,_=e.onBlur,y=d(e,b),w=e["aria-describedby"]?[e["aria-describedby"]]:[];return null!=o&&o.hasFeedbackText&&null!=o&&o.isInvalid&&w.push(o.feedbackId),null!=o&&o.hasHelpText&&w.push(o.helpTextId),c({},y,{"aria-describedby":w.join(" ")||void 0,id:null!=s?s:null==o?void 0:o.id,isDisabled:null!=(t=null!=a?a:m)?t:null==o?void 0:o.isDisabled,isReadOnly:null!=(n=null!=l?l:p)?n:null==o?void 0:o.isReadOnly,isRequired:null!=(i=null!=u?u:h)?i:null==o?void 0:o.isRequired,isInvalid:null!=g?g:null==o?void 0:o.isInvalid,onFocus:(0,r.v0)(null==o?void 0:o.onFocus,v),onBlur:(0,r.v0)(null==o?void 0:o.onBlur,_)})}var C=(0,o.Gp)((function(e,t){var n=(0,o.jC)("FormError",e),i=(0,o.Lr)(e),s=f();return null!=s&&s.isInvalid?a.createElement(o.Fo,{value:n},a.createElement(o.m$.div,c({},null==s?void 0:s.getErrorMessageProps(i,t),{className:(0,r.cx)("chakra-form__error-message",e.className),__css:c({display:"flex",alignItems:"center"},n.text)}))):null}));r.Ts&&(C.displayName="FormErrorMessage");var S=(0,o.Gp)((function(e,t){var n=(0,o.yK)(),i=f();if(null==i||!i.isInvalid)return null;var s=(0,r.cx)("chakra-form__error-icon",e.className);return a.createElement(l.ZP,c({ref:t,"aria-hidden":!0},e,{__css:n.icon,className:s}),a.createElement("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"}))}));r.Ts&&(S.displayName="FormErrorIcon");var x=["className","children","requiredIndicator"],k=(0,o.Gp)((function(e,t){var n,i=(0,o.mq)("FormLabel",e),s=(0,o.Lr)(e);s.className;var l=s.children,u=s.requiredIndicator,h=void 0===u?a.createElement(L,null):u,g=d(s,x),p=f(),m=null!=(n=null==p?void 0:p.getLabelProps(g,t))?n:c({ref:t},g);return a.createElement(o.m$.label,c({},m,{className:(0,r.cx)("chakra-form__label",s.className),__css:c({display:"block",textAlign:"start"},i)}),l,null!=p&&p.isRequired?h:null)}));r.Ts&&(k.displayName="FormLabel");var L=(0,o.Gp)((function(e,t){var n=f(),i=(0,o.yK)();if(null==n||!n.isRequired)return null;var s=(0,r.cx)("chakra-form__required-indicator",e.className);return a.createElement(o.m$.span,c({},null==n?void 0:n.getRequiredIndicatorProps(e,t),{__css:i.requiredIndicator,className:s}))}));r.Ts&&(L.displayName="RequiredIndicator")},97375:(e,t,n)=>{"use strict";n.d(t,{vc:()=>g,kt:()=>r,W6:()=>a,pY:()=>l,Tx:()=>c,qY:()=>m,OR:()=>v,Ck:()=>b,NW:()=>w,Me:()=>p,ZS:()=>f,Yz:()=>C,qq:()=>x,O3:()=>k,Gw:()=>s,bx:()=>N,KS:()=>E,zq:()=>y,rf:()=>_});var i=n(67294),o=n(44592);function r(e){void 0===e&&(e=!1);var t=(0,i.useState)(e),n=t[0],o=t[1];return[n,{on:(0,i.useCallback)((function(){o(!0)}),[]),off:(0,i.useCallback)((function(){o(!1)}),[]),toggle:(0,i.useCallback)((function(){o((function(e){return!e}))}),[])}]}n(20640);var s=o.jU?i.useLayoutEffect:i.useEffect;function a(e,t){void 0===t&&(t=[]);var n=i.useRef(e);return s((function(){n.current=e})),i.useCallback((function(){for(var e=arguments.length,t=new Array(e),i=0;i1?t-1:0),o=1;o0)&&(!(i&&!(0,o.lZ)(i).body.contains(i))&&!(null!=(n=t.current)&&n.contains(i)))}function N(e){void 0===e&&(e={});var t=e,n=t.timeout,o=void 0===n?300:n,r=t.preventDefault,s=void 0===r?function(){return!0}:r,a=i.useState([]),l=a[0],c=a[1],d=i.useRef(),u=function(){d.current&&(clearTimeout(d.current),d.current=null)};return i.useEffect((function(){return u}),[]),function(e){return function(t){if("Backspace"===t.key){var n=[].concat(l);return n.pop(),void c(n)}if(function(e){var t=e.key;return 1===t.length||t.length>1&&/[^a-zA-Z0-9]/.test(t)}(t)){var i=l.concat(t.key);s(t)&&(t.preventDefault(),t.stopPropagation()),c(i),e(i.join("")),u(),d.current=setTimeout((function(){c([]),d.current=null}),o)}}}}function E(e,t){var n=a(e);i.useEffect((function(){var e;if(null!=t)return e=window.setTimeout((function(){n()}),t),function(){e&&window.clearTimeout(e)}}),[t,n])}},10894:(e,t,n)=>{"use strict";n.d(t,{JO:()=>c,IU:()=>u,ZP:()=>d});var i=n(105),o=n(44592),r=n(67294);function s(){return s=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,a),_={ref:t,focusable:g,className:(0,o.cx)("chakra-icon",f),__css:s({w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:u},m)},b=null!=c?c:l.viewBox;if(n&&"string"!=typeof n)return r.createElement(i.m$.svg,s({as:n},_,v));var y=null!=p?p:l.path;return r.createElement(i.m$.svg,s({verticalAlign:"middle",viewBox:b},_,v),y)}));o.Ts&&(c.displayName="Icon");var d=c;function u(e){var t=e.viewBox,n=void 0===t?"0 0 24 24":t,a=e.d,l=e.path,d=e.displayName,u=e.defaultProps,h=void 0===u?{}:u,g=(0,i.Gp)((function(e,t){return r.createElement(c,s({ref:t,viewBox:n},h,e),null!=l?l:r.createElement("path",{fill:"currentColor",d:a}))}));return o.Ts&&(g.displayName=d),g}},59876:(e,t,n)=>{"use strict";n.d(t,{XC:()=>r});var i=n(10894),o=n(67294),r=((0,i.IU)({d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",displayName:"CopyIcon"}),(0,i.IU)({d:"M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z",displayName:"SearchIcon"}),(0,i.IU)({d:"M23.414,20.591l-4.645-4.645a10.256,10.256,0,1,0-2.828,2.829l4.645,4.644a2.025,2.025,0,0,0,2.828,0A2,2,0,0,0,23.414,20.591ZM10.25,3.005A7.25,7.25,0,1,1,3,10.255,7.258,7.258,0,0,1,10.25,3.005Z",displayName:"Search2Icon"}),(0,i.IU)({d:"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z",displayName:"MoonIcon"}),(0,i.IU)({displayName:"SunIcon",path:o.createElement("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor"},o.createElement("circle",{cx:"12",cy:"12",r:"5"}),o.createElement("path",{d:"M12 1v2"}),o.createElement("path",{d:"M12 21v2"}),o.createElement("path",{d:"M4.22 4.22l1.42 1.42"}),o.createElement("path",{d:"M18.36 18.36l1.42 1.42"}),o.createElement("path",{d:"M1 12h2"}),o.createElement("path",{d:"M21 12h2"}),o.createElement("path",{d:"M4.22 19.78l1.42-1.42"}),o.createElement("path",{d:"M18.36 5.64l1.42-1.42"}))}),(0,i.IU)({d:"M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z",displayName:"AddIcon"}),(0,i.IU)({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:o.createElement("path",{fill:"currentColor",d:"M14 9h-3V6c0-.55-.45-1-1-1s-1 .45-1 1v3H6c-.55 0-1 .45-1 1s.45 1 1 1h3v3c0 .55.45 1 1 1s1-.45 1-1v-3h3c.55 0 1-.45 1-1s-.45-1-1-1z",fillRule:"evenodd"})}),(0,i.IU)({viewBox:"0 0 14 14",d:"M14,7.77 L14,6.17 L12.06,5.53 L11.61,4.44 L12.49,2.6 L11.36,1.47 L9.55,2.38 L8.46,1.93 L7.77,0.01 L6.17,0.01 L5.54,1.95 L4.43,2.4 L2.59,1.52 L1.46,2.65 L2.37,4.46 L1.92,5.55 L0,6.23 L0,7.82 L1.94,8.46 L2.39,9.55 L1.51,11.39 L2.64,12.52 L4.45,11.61 L5.54,12.06 L6.23,13.98 L7.82,13.98 L8.45,12.04 L9.56,11.59 L11.4,12.47 L12.53,11.34 L11.61,9.53 L12.08,8.44 L14,7.75 L14,7.77 Z M7,10 C5.34,10 4,8.66 4,7 C4,5.34 5.34,4 7,4 C8.66,4 10,5.34 10,7 C10,8.66 8.66,10 7,10 Z",displayName:"SettingsIcon"}),(0,i.IU)({displayName:"CheckCircleIcon",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"}),(0,i.IU)({d:"M19.5,9.5h-.75V6.75a6.75,6.75,0,0,0-13.5,0V9.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5ZM7.75,6.75a4.25,4.25,0,0,1,8.5,0V9a.5.5,0,0,1-.5.5H8.25a.5.5,0,0,1-.5-.5Z",displayName:"LockIcon"}),(0,i.IU)({d:"M19.5,9.5h-.75V6.75A6.751,6.751,0,0,0,5.533,4.811a1.25,1.25,0,1,0,2.395.717A4.251,4.251,0,0,1,16.25,6.75V9a.5.5,0,0,1-.5.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5Z",displayName:"UnlockIcon"}),(0,i.IU)({displayName:"ViewIcon",path:o.createElement("g",{fill:"currentColor"},o.createElement("path",{d:"M23.432,10.524C20.787,7.614,16.4,4.538,12,4.6,7.6,4.537,3.213,7.615.568,10.524a2.211,2.211,0,0,0,0,2.948C3.182,16.351,7.507,19.4,11.839,19.4h.308c4.347,0,8.671-3.049,11.288-5.929A2.21,2.21,0,0,0,23.432,10.524ZM7.4,12A4.6,4.6,0,1,1,12,16.6,4.6,4.6,0,0,1,7.4,12Z"}),o.createElement("circle",{cx:"12",cy:"12",r:"2"}))}),(0,i.IU)({displayName:"ViewOffIcon",path:o.createElement("g",{fill:"currentColor"},o.createElement("path",{d:"M23.2,10.549a20.954,20.954,0,0,0-4.3-3.6l4-3.995a1,1,0,1,0-1.414-1.414l-.018.018a.737.737,0,0,1-.173.291l-19.5,19.5c-.008.007-.018.009-.026.017a1,1,0,0,0,1.631,1.088l4.146-4.146a11.26,11.26,0,0,0,4.31.939h.3c4.256,0,8.489-2.984,11.051-5.8A2.171,2.171,0,0,0,23.2,10.549ZM16.313,13.27a4.581,4.581,0,0,1-3,3.028,4.3,4.3,0,0,1-3.1-.19.253.253,0,0,1-.068-.407l5.56-5.559a.252.252,0,0,1,.407.067A4.3,4.3,0,0,1,16.313,13.27Z"}),o.createElement("path",{d:"M7.615,13.4a.244.244,0,0,0,.061-.24A4.315,4.315,0,0,1,7.5,12,4.5,4.5,0,0,1,12,7.5a4.276,4.276,0,0,1,1.16.173.244.244,0,0,0,.24-.062l1.941-1.942a.254.254,0,0,0-.1-.421A10.413,10.413,0,0,0,12,4.75C7.7,4.692,3.4,7.7.813,10.549a2.15,2.15,0,0,0-.007,2.9,21.209,21.209,0,0,0,3.438,3.03.256.256,0,0,0,.326-.029Z"}))}),(0,i.IU)({d:"M11.2857,6.05714 L10.08571,4.85714 L7.85714,7.14786 L7.85714,1 L6.14286,1 L6.14286,7.14786 L3.91429,4.85714 L2.71429,6.05714 L7,10.42857 L11.2857,6.05714 Z M1,11.2857 L1,13 L13,13 L13,11.2857 L1,11.2857 Z",displayName:"DownloadIcon",viewBox:"0 0 14 14"}),(0,i.IU)({displayName:"DeleteIcon",path:o.createElement("g",{fill:"currentColor"},o.createElement("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"}))}),(0,i.IU)({displayName:"RepeatIcon",path:o.createElement("g",{fill:"currentColor"},o.createElement("path",{d:"M10.319,4.936a7.239,7.239,0,0,1,7.1,2.252,1.25,1.25,0,1,0,1.872-1.657A9.737,9.737,0,0,0,9.743,2.5,10.269,10.269,0,0,0,2.378,9.61a.249.249,0,0,1-.271.178l-1.033-.13A.491.491,0,0,0,.6,9.877a.5.5,0,0,0-.019.526l2.476,4.342a.5.5,0,0,0,.373.248.43.43,0,0,0,.062,0,.5.5,0,0,0,.359-.152l3.477-3.593a.5.5,0,0,0-.3-.844L5.15,10.172a.25.25,0,0,1-.2-.333A7.7,7.7,0,0,1,10.319,4.936Z"}),o.createElement("path",{d:"M23.406,14.1a.5.5,0,0,0,.015-.526l-2.5-4.329A.5.5,0,0,0,20.546,9a.489.489,0,0,0-.421.151l-3.456,3.614a.5.5,0,0,0,.3.842l1.848.221a.249.249,0,0,1,.183.117.253.253,0,0,1,.023.216,7.688,7.688,0,0,1-5.369,4.9,7.243,7.243,0,0,1-7.1-2.253,1.25,1.25,0,1,0-1.872,1.656,9.74,9.74,0,0,0,9.549,3.03,10.261,10.261,0,0,0,7.369-7.12.251.251,0,0,1,.27-.179l1.058.127a.422.422,0,0,0,.06,0A.5.5,0,0,0,23.406,14.1Z"}))}),(0,i.IU)({displayName:"RepeatClockIcon",path:o.createElement("g",{fill:"currentColor"},o.createElement("path",{d:"M12.965,6a1,1,0,0,0-1,1v5.5a1,1,0,0,0,1,1h5a1,1,0,0,0,0-2h-3.75a.25.25,0,0,1-.25-.25V7A1,1,0,0,0,12.965,6Z"}),o.createElement("path",{d:"M12.567,1.258A10.822,10.822,0,0,0,2.818,8.4a.25.25,0,0,1-.271.163L.858,8.309a.514.514,0,0,0-.485.213.5.5,0,0,0-.021.53l2.679,4.7a.5.5,0,0,0,.786.107l3.77-3.746a.5.5,0,0,0-.279-.85L5.593,9.007a.25.25,0,0,1-.192-.35,8.259,8.259,0,1,1,7.866,11.59,1.25,1.25,0,0,0,.045,2.5h.047a10.751,10.751,0,1,0-.792-21.487Z"}))}),(0,i.IU)({displayName:"EditIcon",path:o.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},o.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),o.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))}),(0,i.IU)({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"}),(0,i.IU)({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"}));(0,i.IU)({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}),(0,i.IU)({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"}),(0,i.IU)({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"}),(0,i.IU)({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"}),(0,i.IU)({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"}),(0,i.IU)({viewBox:"0 0 16 16",d:"M11.891 9.992a1 1 0 1 1 1.416 1.415l-4.3 4.3a1 1 0 0 1-1.414 0l-4.3-4.3A1 1 0 0 1 4.71 9.992l3.59 3.591 3.591-3.591zm0-3.984L8.3 2.417 4.709 6.008a1 1 0 0 1-1.416-1.415l4.3-4.3a1 1 0 0 1 1.414 0l4.3 4.3a1 1 0 1 1-1.416 1.415z",displayName:"ArrowUpDownIcon"}),(0,i.IU)({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"}),(0,i.IU)({displayName:"ExternalLinkIcon",path:o.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},o.createElement("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),o.createElement("path",{d:"M15 3h6v6"}),o.createElement("path",{d:"M10 14L21 3"}))}),(0,i.IU)({displayName:"LinkIcon",path:o.createElement("g",{fill:"currentColor"},o.createElement("path",{d:"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z"}),o.createElement("path",{d:"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z"}))}),(0,i.IU)({displayName:"PlusSquareIcon",path:o.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},o.createElement("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"}),o.createElement("path",{d:"M12 8v8"}),o.createElement("path",{d:"M8 12h8"}))}),(0,i.IU)({displayName:"CalendarIcon",viewBox:"0 0 14 14",d:"M10.8889,5.5 L3.11111,5.5 L3.11111,7.05556 L10.8889,7.05556 L10.8889,5.5 Z M12.4444,1.05556 L11.6667,1.05556 L11.6667,0 L10.1111,0 L10.1111,1.05556 L3.88889,1.05556 L3.88889,0 L2.33333,0 L2.33333,1.05556 L1.55556,1.05556 C0.692222,1.05556 0.00777777,1.75556 0.00777777,2.61111 L0,12.5 C0,13.3556 0.692222,14 1.55556,14 L12.4444,14 C13.3,14 14,13.3556 14,12.5 L14,2.61111 C14,1.75556 13.3,1.05556 12.4444,1.05556 Z M12.4444,12.5 L1.55556,12.5 L1.55556,3.94444 L12.4444,3.94444 L12.4444,12.5 Z M8.55556,8.61111 L3.11111,8.61111 L3.11111,10.1667 L8.55556,10.1667 L8.55556,8.61111 Z"}),(0,i.IU)({d:"M0.913134,0.920639 C1.49851,0.331726 2.29348,0 3.12342,0 L10.8766,0 C11.7065,0 12.5015,0.331725 13.0869,0.920639 C13.6721,1.50939 14,2.30689 14,3.13746 L14,8.12943 C13.9962,8.51443 13.9059,8.97125 13.7629,9.32852 C13.6128,9.683 13.3552,10.0709 13.0869,10.3462 C12.813,10.6163 12.4265,10.8761 12.0734,11.0274 C11.7172,11.1716 11.2607,11.263 10.8766,11.2669 L10.1234,11.2669 L10.1234,12.5676 L10.1209,12.5676 C10.1204,12.793 10.0633,13.0791 9.97807,13.262 C9.8627,13.466 9.61158,13.7198 9.40818,13.8382 L9.40824,13.8383 C9.4077,13.8386 9.40716,13.8388 9.40661,13.8391 C9.40621,13.8393 9.4058,13.8396 9.40539,13.8398 L9.40535,13.8397 C9.22958,13.9254 8.94505,13.9951 8.75059,14 L8.74789,14 C8.35724,13.9963 7.98473,13.8383 7.71035,13.5617 L5.39553,11.2669 L3.12342,11.2669 C2.29348,11.2669 1.49851,10.9352 0.913134,10.3462 C0.644826,10.0709 0.387187,9.683 0.23711,9.32852 C0.0941235,8.97125 0.00379528,8.51443 0,8.12943 L0,3.13746 C0,2.30689 0.327915,1.50939 0.913134,0.920639 Z M3.12342,1.59494 C2.71959,1.59494 2.33133,1.75628 2.04431,2.04503 C1.75713,2.33395 1.59494,2.72681 1.59494,3.13746 L1.59494,8.12943 C1.59114,8.35901 1.62114,8.51076 1.71193,8.72129 C1.79563,8.9346 1.88065,9.06264 2.04431,9.22185 C2.33133,9.5106 2.71959,9.67195 3.12342,9.67195 L5.72383,9.67195 C5.93413,9.67195 6.13592,9.75502 6.28527,9.90308 L8.52848,12.1269 L8.52848,10.4694 C8.52848,10.029 8.88552,9.67195 9.32595,9.67195 L10.8766,9.67195 C11.1034,9.67583 11.2517,9.64614 11.4599,9.55518 C11.6712,9.47132 11.7976,9.38635 11.9557,9.22185 C12.1193,9.06264 12.2044,8.9346 12.2881,8.72129 C12.3789,8.51076 12.4089,8.35901 12.4051,8.12943 L12.4051,3.13746 C12.4051,2.72681 12.2429,2.33394 11.9557,2.04503 C11.6687,1.75628 11.2804,1.59494 10.8766,1.59494 L3.12342,1.59494 Z",displayName:"ChatIcon",viewBox:"0 0 14 14"}),(0,i.IU)({displayName:"TimeIcon",path:o.createElement("g",{fill:"currentColor"},o.createElement("path",{d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm0,22A10,10,0,1,1,22,12,10.011,10.011,0,0,1,12,22Z"}),o.createElement("path",{d:"M17.134,15.81,12.5,11.561V6.5a1,1,0,0,0-2,0V12a1,1,0,0,0,.324.738l4.959,4.545a1.01,1.01,0,0,0,1.413-.061A1,1,0,0,0,17.134,15.81Z"}))}),(0,i.IU)({displayName:"ArrowRightIcon",path:o.createElement("g",{fill:"currentColor"},o.createElement("path",{d:"M13.584,12a2.643,2.643,0,0,1-.775,1.875L3.268,23.416a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L.768,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,13.584,12Z"}),o.createElement("path",{d:"M23.75,12a2.643,2.643,0,0,1-.775,1.875l-9.541,9.541a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L10.934,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,23.75,12Z"}))}),(0,i.IU)({displayName:"ArrowLeftIcon",path:o.createElement("g",{fill:"currentColor"},o.createElement("path",{d:"M10.416,12a2.643,2.643,0,0,1,.775-1.875L20.732.584a1.768,1.768,0,0,1,2.5,2.5l-8.739,8.739a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5l-9.541-9.541A2.643,2.643,0,0,1,10.416,12Z"}),o.createElement("path",{d:"M.25,12a2.643,2.643,0,0,1,.775-1.875L10.566.584a1.768,1.768,0,0,1,2.5,2.5L4.327,11.823a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5L1.025,13.875A2.643,2.643,0,0,1,.25,12Z"}))}),(0,i.IU)({displayName:"AtSignIcon",d:"M12,.5A11.634,11.634,0,0,0,.262,12,11.634,11.634,0,0,0,12,23.5a11.836,11.836,0,0,0,6.624-2,1.25,1.25,0,1,0-1.393-2.076A9.34,9.34,0,0,1,12,21a9.132,9.132,0,0,1-9.238-9A9.132,9.132,0,0,1,12,3a9.132,9.132,0,0,1,9.238,9v.891a1.943,1.943,0,0,1-3.884,0V12A5.355,5.355,0,1,0,12,17.261a5.376,5.376,0,0,0,3.861-1.634,4.438,4.438,0,0,0,7.877-2.736V12A11.634,11.634,0,0,0,12,.5Zm0,14.261A2.763,2.763,0,1,1,14.854,12,2.812,2.812,0,0,1,12,14.761Z"}),(0,i.IU)({displayName:"AttachmentIcon",d:"M21.843,3.455a6.961,6.961,0,0,0-9.846,0L1.619,13.832a5.128,5.128,0,0,0,7.252,7.252L17.3,12.653A3.293,3.293,0,1,0,12.646,8L7.457,13.184A1,1,0,1,0,8.871,14.6L14.06,9.409a1.294,1.294,0,0,1,1.829,1.83L7.457,19.67a3.128,3.128,0,0,1-4.424-4.424L13.411,4.869a4.962,4.962,0,1,1,7.018,7.018L12.646,19.67a1,1,0,1,0,1.414,1.414L21.843,13.3a6.96,6.96,0,0,0,0-9.846Z"}),(0,i.IU)({displayName:"UpDownIcon",viewBox:"-1 -1 9 11",d:"M 3.5 0L 3.98809 -0.569442L 3.5 -0.987808L 3.01191 -0.569442L 3.5 0ZM 3.5 9L 3.01191 9.56944L 3.5 9.98781L 3.98809 9.56944L 3.5 9ZM 0.488094 3.56944L 3.98809 0.569442L 3.01191 -0.569442L -0.488094 2.43056L 0.488094 3.56944ZM 3.01191 0.569442L 6.51191 3.56944L 7.48809 2.43056L 3.98809 -0.569442L 3.01191 0.569442ZM -0.488094 6.56944L 3.01191 9.56944L 3.98809 8.43056L 0.488094 5.43056L -0.488094 6.56944ZM 3.98809 9.56944L 7.48809 6.56944L 6.51191 5.43056L 3.01191 8.43056L 3.98809 9.56944Z"}),(0,i.IU)({d:"M23.555,8.729a1.505,1.505,0,0,0-1.406-.98H16.062a.5.5,0,0,1-.472-.334L13.405,1.222a1.5,1.5,0,0,0-2.81,0l-.005.016L8.41,7.415a.5.5,0,0,1-.471.334H1.85A1.5,1.5,0,0,0,.887,10.4l5.184,4.3a.5.5,0,0,1,.155.543L4.048,21.774a1.5,1.5,0,0,0,2.31,1.684l5.346-3.92a.5.5,0,0,1,.591,0l5.344,3.919a1.5,1.5,0,0,0,2.312-1.683l-2.178-6.535a.5.5,0,0,1,.155-.543l5.194-4.306A1.5,1.5,0,0,0,23.555,8.729Z",displayName:"StarIcon"}),(0,i.IU)({displayName:"EmailIcon",path:o.createElement("g",{fill:"currentColor"},o.createElement("path",{d:"M11.114,14.556a1.252,1.252,0,0,0,1.768,0L22.568,4.87a.5.5,0,0,0-.281-.849A1.966,1.966,0,0,0,22,4H2a1.966,1.966,0,0,0-.289.021.5.5,0,0,0-.281.849Z"}),o.createElement("path",{d:"M23.888,5.832a.182.182,0,0,0-.2.039l-6.2,6.2a.251.251,0,0,0,0,.354l5.043,5.043a.75.75,0,1,1-1.06,1.061l-5.043-5.043a.25.25,0,0,0-.354,0l-2.129,2.129a2.75,2.75,0,0,1-3.888,0L7.926,13.488a.251.251,0,0,0-.354,0L2.529,18.531a.75.75,0,0,1-1.06-1.061l5.043-5.043a.251.251,0,0,0,0-.354l-6.2-6.2a.18.18,0,0,0-.2-.039A.182.182,0,0,0,0,6V18a2,2,0,0,0,2,2H22a2,2,0,0,0,2-2V6A.181.181,0,0,0,23.888,5.832Z"}))}),(0,i.IU)({d:"M2.20731,0.0127209 C2.1105,-0.0066419 1.99432,-0.00664663 1.91687,0.032079 C0.871279,0.438698 0.212942,1.92964 0.0580392,2.95587 C-0.426031,6.28627 2.20731,9.17133 4.62766,11.0689 C6.77694,12.7534 10.9012,15.5223 13.3409,12.8503 C13.6507,12.5211 14.0186,12.037 13.9993,11.553 C13.9412,10.7397 13.186,10.1588 12.6051,9.71349 C12.1598,9.38432 11.2304,8.47427 10.6495,8.49363 C10.1267,8.51299 9.79754,9.05515 9.46837,9.38432 L8.88748,9.96521 C8.79067,10.062 7.55145,9.24878 7.41591,9.15197 C6.91248,8.8228 6.4284,8.45491 6.00242,8.04829 C5.57644,7.64167 5.18919,7.19632 4.86002,6.73161 C4.7632,6.59607 3.96933,5.41495 4.04678,5.31813 C4.04678,5.31813 4.72448,4.58234 4.91811,4.2919 C5.32473,3.67229 5.63453,3.18822 5.16982,2.45243 C4.99556,2.18135 4.78257,1.96836 4.55021,1.73601 C4.14359,1.34875 3.73698,0.942131 3.27227,0.612963 C3.02055,0.419335 2.59457,0.0708094 2.20731,0.0127209 Z",displayName:"PhoneIcon",viewBox:"0 0 14 14"}),(0,i.IU)({viewBox:"0 0 10 10",d:"M3,2 C2.44771525,2 2,1.55228475 2,1 C2,0.44771525 2.44771525,0 3,0 C3.55228475,0 4,0.44771525 4,1 C4,1.55228475 3.55228475,2 3,2 Z M3,6 C2.44771525,6 2,5.55228475 2,5 C2,4.44771525 2.44771525,4 3,4 C3.55228475,4 4,4.44771525 4,5 C4,5.55228475 3.55228475,6 3,6 Z M3,10 C2.44771525,10 2,9.55228475 2,9 C2,8.44771525 2.44771525,8 3,8 C3.55228475,8 4,8.44771525 4,9 C4,9.55228475 3.55228475,10 3,10 Z M7,2 C6.44771525,2 6,1.55228475 6,1 C6,0.44771525 6.44771525,0 7,0 C7.55228475,0 8,0.44771525 8,1 C8,1.55228475 7.55228475,2 7,2 Z M7,6 C6.44771525,6 6,5.55228475 6,5 C6,4.44771525 6.44771525,4 7,4 C7.55228475,4 8,4.44771525 8,5 C8,5.55228475 7.55228475,6 7,6 Z M7,10 C6.44771525,10 6,9.55228475 6,9 C6,8.44771525 6.44771525,8 7,8 C7.55228475,8 8,8.44771525 8,9 C8,9.55228475 7.55228475,10 7,10 Z",displayName:"DragHandleIcon"}),(0,i.IU)({displayName:"SpinnerIcon",path:o.createElement(o.Fragment,null,o.createElement("defs",null,o.createElement("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a"},o.createElement("stop",{stopColor:"currentColor",offset:"0%"}),o.createElement("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"}))),o.createElement("g",{transform:"translate(2)",fill:"none"},o.createElement("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"}),o.createElement("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"}),o.createElement("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"})))}),(0,i.IU)({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"}),(0,i.IU)({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:o.createElement("path",{d:"M9.41 8l2.29-2.29c.19-.18.3-.43.3-.71a1.003 1.003 0 0 0-1.71-.71L8 6.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42L6.59 8 4.3 10.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71L8 9.41l2.29 2.29c.18.19.43.3.71.3a1.003 1.003 0 0 0 .71-1.71L9.41 8z",fillRule:"evenodd",fill:"currentColor"})}),(0,i.IU)({d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z",displayName:"NotAllowedIcon"}),(0,i.IU)({d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z",displayName:"TriangleDownIcon"}),(0,i.IU)({d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z",displayName:"TriangleUpIcon"}),(0,i.IU)({displayName:"InfoOutlineIcon",path:o.createElement("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2"},o.createElement("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"}),o.createElement("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"}),o.createElement("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"}))}),(0,i.IU)({displayName:"BellIcon",d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"}),(0,i.IU)({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"}),(0,i.IU)({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm0,19a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,12,19Zm1.6-6.08a1,1,0,0,0-.6.917,1,1,0,1,1-2,0,3,3,0,0,1,1.8-2.75A2,2,0,1,0,10,9.255a1,1,0,1,1-2,0,4,4,0,1,1,5.6,3.666Z",displayName:"QuestionIcon"}),(0,i.IU)({displayName:"QuestionOutlineIcon",path:o.createElement("g",{stroke:"currentColor",strokeWidth:"1.5"},o.createElement("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),o.createElement("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),o.createElement("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"}))}),(0,i.IU)({d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z",displayName:"WarningIcon"}),(0,i.IU)({displayName:"WarningTwoIcon",d:"M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"}),(0,i.IU)({viewBox:"0 0 14 14",path:o.createElement("g",{fill:"currentColor"},o.createElement("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"}))}),(0,i.IU)({displayName:"MinusIcon",path:o.createElement("g",{fill:"currentColor"},o.createElement("rect",{height:"4",width:"20",x:"2",y:"10"}))}),(0,i.IU)({displayName:"HamburgerIcon",viewBox:"0 0 24 24",d:"M 3 5 A 1.0001 1.0001 0 1 0 3 7 L 21 7 A 1.0001 1.0001 0 1 0 21 5 L 3 5 z M 3 11 A 1.0001 1.0001 0 1 0 3 13 L 21 13 A 1.0001 1.0001 0 1 0 21 11 L 3 11 z M 3 17 A 1.0001 1.0001 0 1 0 3 19 L 21 19 A 1.0001 1.0001 0 1 0 21 17 L 3 17 z"})},4612:(e,t,n)=>{"use strict";n.d(t,{II:()=>c});var i=n(79762),o=n(105),r=n(44592),s=n(67294),a=n(26450);function l(){return l=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}r.Ts&&(c.displayName="Input"),c.id="Input";var u=["placement"],h={left:{marginEnd:"-1px",borderEndRadius:0,borderEndColor:"transparent"},right:{marginStart:"-1px",borderStartRadius:0,borderStartColor:"transparent"}},g=(0,o.m$)("div",{baseStyle:{flex:"0 0 auto",width:"auto",display:"flex",alignItems:"center",whiteSpace:"nowrap"}}),p=(0,o.Gp)((function(e,t){var n,i=e.placement,r=void 0===i?"left":i,a=d(e,u),c=null!=(n=h[r])?n:{},p=(0,o.yK)();return s.createElement(g,l({ref:t},a,{__css:l({},p.addon,c)}))}));r.Ts&&(p.displayName="InputAddon");var f=(0,o.Gp)((function(e,t){return s.createElement(p,l({ref:t,placement:"left"},e,{className:(0,r.cx)("chakra-input__left-addon",e.className)}))}));r.Ts&&(f.displayName="InputLeftAddon"),f.id="InputLeftAddon";var m=(0,o.Gp)((function(e,t){return s.createElement(p,l({ref:t,placement:"right"},e,{className:(0,r.cx)("chakra-input__right-addon",e.className)}))}));r.Ts&&(m.displayName="InputRightAddon"),m.id="InputRightAddon";var v=["children","className"],_=(0,o.Gp)((function(e,t){var n=(0,o.jC)("Input",e),i=(0,o.Lr)(e),c=i.children,u=i.className,h=d(i,v),g=(0,r.cx)("chakra-input__group",u),p={},f=(0,a.WR)(c),m=n.field;f.forEach((function(e){var t,i;n&&(m&&"InputLeftElement"===e.type.id&&(p.paddingStart=null!=(t=m.height)?t:m.h),m&&"InputRightElement"===e.type.id&&(p.paddingEnd=null!=(i=m.height)?i:m.h),"InputRightAddon"===e.type.id&&(p.borderEndRadius=0),"InputLeftAddon"===e.type.id&&(p.borderStartRadius=0))}));var _=f.map((function(t){var n,i,o={size:(null==(n=t.props)?void 0:n.size)||e.size,variant:(null==(i=t.props)?void 0:i.variant)||e.variant};return"Input"!==t.type.id?s.cloneElement(t,o):s.cloneElement(t,Object.assign(o,p,t.props))}));return s.createElement(o.m$.div,l({className:g,ref:t,__css:{width:"100%",display:"flex",position:"relative"}},h),s.createElement(o.Fo,{value:n},_))}));r.Ts&&(_.displayName="InputGroup");var b=["placement"],y=["className"],w=["className"],C=(0,o.m$)("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),S=(0,o.Gp)((function(e,t){var n,i,r,a=e.placement,c=void 0===a?"left":a,u=d(e,b),h=(0,o.yK)().field,g=((r={})["left"===c?"insetStart":"insetEnd"]="0",r.width=null!=(n=null==h?void 0:h.height)?n:null==h?void 0:h.h,r.height=null!=(i=null==h?void 0:h.height)?i:null==h?void 0:h.h,r.fontSize=null==h?void 0:h.fontSize,r);return s.createElement(C,l({ref:t,__css:g},u))}));S.id="InputElement",r.Ts&&(S.displayName="InputElement");var x=(0,o.Gp)((function(e,t){var n=e.className,i=d(e,y),o=(0,r.cx)("chakra-input__left-element",n);return s.createElement(S,l({ref:t,placement:"left",className:o},i))}));x.id="InputLeftElement",r.Ts&&(x.displayName="InputLeftElement");var k=(0,o.Gp)((function(e,t){var n=e.className,i=d(e,w),o=(0,r.cx)("chakra-input__right-element",n);return s.createElement(S,l({ref:t,placement:"right",className:o},i))}));k.id="InputRightElement",r.Ts&&(k.displayName="InputRightElement")},68527:(e,t,n)=>{"use strict";n.d(t,{Ct:()=>p,xu:()=>v,M5:()=>y,EK:()=>C,iz:()=>N,kC:()=>D,rj:()=>T,Ug:()=>J,X6:()=>A,LZ:()=>Z,Kq:()=>X,xv:()=>ne,gC:()=>ee});var i=n(105),o=n(94244),r=n(44592),s=n(67294),a=n(10894),l=n(26450);function c(){return c=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}var u=["ratio","children","className"],h=(0,i.Gp)((function(e,t){var n=e.ratio,o=void 0===n?4/3:n,a=e.children,l=e.className,h=d(e,u),g=s.Children.only(a),p=(0,r.cx)("chakra-aspect-ratio",l);return s.createElement(i.m$.div,c({ref:t,position:"relative",className:p,_before:{height:0,content:'""',display:"block",paddingBottom:(0,r.XQ)(o,(function(e){return 1/e*100+"%"}))},__css:{"& > *:not(style)":{overflow:"hidden",position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},"& > img, & > video":{objectFit:"cover"}}},h),g)}));r.Ts&&(h.displayName="AspectRatio");var g=["className"],p=(0,i.Gp)((function(e,t){var n=(0,i.mq)("Badge",e),o=(0,i.Lr)(e);o.className;var a=d(o,g);return s.createElement(i.m$.span,c({ref:t,className:(0,r.cx)("chakra-badge",e.className)},a,{__css:c({display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle"},n)}))}));r.Ts&&(p.displayName="Badge");var f=["size","centerContent"],m=["size"],v=(0,i.m$)("div");r.Ts&&(v.displayName="Box");var _=(0,i.Gp)((function(e,t){var n=e.size,i=e.centerContent,o=void 0===i||i,r=d(e,f),a=o?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return s.createElement(v,c({ref:t,boxSize:n,__css:c({},a,{flexShrink:0,flexGrow:0})},r))}));r.Ts&&(_.displayName="Square");var b=(0,i.Gp)((function(e,t){var n=e.size,i=d(e,m);return s.createElement(_,c({size:n,ref:t,borderRadius:"9999px"},i))}));r.Ts&&(b.displayName="Circle");var y=(0,i.m$)("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});r.Ts&&(y.displayName="Center");var w=["className"],C=(0,i.Gp)((function(e,t){var n=(0,i.mq)("Code",e),o=(0,i.Lr)(e);o.className;var a=d(o,w);return s.createElement(i.m$.code,c({ref:t,className:(0,r.cx)("chakra-code",e.className)},a,{__css:c({display:"inline-block"},n)}))}));r.Ts&&(C.displayName="Code");var S=["className","centerContent"],x=(0,i.Gp)((function(e,t){var n=(0,i.Lr)(e),o=n.className,a=n.centerContent,l=d(n,S),u=(0,i.mq)("Container",e);return s.createElement(i.m$.div,c({ref:t,className:(0,r.cx)("chakra-container",o)},l,{__css:c({},u,a&&{display:"flex",flexDirection:"column",alignItems:"center"})}))}));r.Ts&&(x.displayName="Container");var k=["borderLeftWidth","borderBottomWidth","borderTopWidth","borderRightWidth","borderWidth","borderStyle","borderColor"],L=["className","orientation","__css"],N=(0,i.Gp)((function(e,t){var n=(0,i.mq)("Divider",e),o=n.borderLeftWidth,a=n.borderBottomWidth,l=n.borderTopWidth,u=n.borderRightWidth,h=n.borderWidth,g=n.borderStyle,p=n.borderColor,f=d(n,k),m=(0,i.Lr)(e),v=m.className,_=m.orientation,b=void 0===_?"horizontal":_,y=m.__css,w=d(m,L),C={vertical:{borderLeftWidth:o||u||h||"1px",height:"100%"},horizontal:{borderBottomWidth:a||l||h||"1px",width:"100%"}};return s.createElement(i.m$.hr,c({ref:t,"aria-orientation":b},w,{__css:c({},f,{border:"0",borderColor:p,borderStyle:g},C[b],y),className:(0,r.cx)("chakra-divider",v)}))}));r.Ts&&(N.displayName="Divider");var E=["direction","align","justify","wrap","basis","grow","shrink"],D=(0,i.Gp)((function(e,t){var n=e.direction,o=e.align,r=e.justify,a=e.wrap,l=e.basis,u=e.grow,h=e.shrink,g=d(e,E),p={display:"flex",flexDirection:n,alignItems:o,justifyContent:r,flexWrap:a,flexBasis:l,flexGrow:u,flexShrink:h};return s.createElement(i.m$.div,c({ref:t,__css:p},g))}));r.Ts&&(D.displayName="Flex");var I=["area","templateAreas","gap","rowGap","columnGap","column","row","autoFlow","autoRows","templateRows","autoColumns","templateColumns"],T=(0,i.Gp)((function(e,t){var n=e.area,o=e.templateAreas,r=e.gap,a=e.rowGap,l=e.columnGap,u=e.column,h=e.row,g=e.autoFlow,p=e.autoRows,f=e.templateRows,m=e.autoColumns,v=e.templateColumns,_=d(e,I),b={display:"grid",gridArea:n,gridTemplateAreas:o,gridGap:r,gridRowGap:a,gridColumnGap:l,gridAutoColumns:m,gridColumn:u,gridRow:h,gridAutoFlow:g,gridAutoRows:p,gridTemplateRows:f,gridTemplateColumns:v};return s.createElement(i.m$.div,c({ref:t,__css:b},_))}));r.Ts&&(T.displayName="Grid");var M=["className"],A=(0,i.Gp)((function(e,t){var n=(0,i.mq)("Heading",e),o=(0,i.Lr)(e);o.className;var a=d(o,M);return s.createElement(i.m$.h2,c({ref:t,className:(0,r.cx)("chakra-heading",e.className)},a,{__css:n}))}));r.Ts&&(A.displayName="Heading");var O=["className"],R=(0,i.Gp)((function(e,t){var n=(0,i.mq)("Kbd",e),o=(0,i.Lr)(e),a=o.className,l=d(o,O);return s.createElement(i.m$.kbd,c({ref:t,className:(0,r.cx)("chakra-kbd",a)},l,{__css:c({fontFamily:"mono"},n)}))}));r.Ts&&(R.displayName="Kbd");var P=["className","isExternal"],F=(0,i.Gp)((function(e,t){var n=(0,i.mq)("Link",e),o=(0,i.Lr)(e),a=o.className,l=o.isExternal,u=d(o,P);return s.createElement(i.m$.a,c({target:l?"_blank":void 0,rel:l?"noopener noreferrer":void 0,ref:t,className:(0,r.cx)("chakra-link",a)},u,{__css:n}))}));r.Ts&&(F.displayName="Link");var B=["children","styleType","stylePosition","spacing"],W=["as"],V=["as"],z=(0,i.Gp)((function(e,t){var n,o=(0,i.jC)("List",e),r=(0,i.Lr)(e),a=r.children,u=r.styleType,h=void 0===u?"none":u,g=r.stylePosition,p=r.spacing,f=d(r,B),m=(0,l.WR)(a),v=p?((n={})["& > *:not(style) ~ *:not(style)"]={mt:p},n):{};return s.createElement(i.Fo,{value:o},s.createElement(i.m$.ul,c({ref:t,listStyleType:h,listStylePosition:g,role:"list",__css:c({},o.container,v)},f),m))}));r.Ts&&(z.displayName="List");var H=(0,i.Gp)((function(e,t){e.as;var n=d(e,W);return s.createElement(z,c({ref:t,as:"ol",styleType:"decimal",marginStart:"1em"},n))}));r.Ts&&(H.displayName="OrderedList");var j=(0,i.Gp)((function(e,t){e.as;var n=d(e,V);return s.createElement(z,c({ref:t,as:"ul",styleType:"initial",marginStart:"1em"},n))}));r.Ts&&(j.displayName="UnorderedList");var U=(0,i.Gp)((function(e,t){var n=(0,i.yK)();return s.createElement(i.m$.li,c({ref:t},e,{__css:n.item}))}));r.Ts&&(U.displayName="ListItem");var K=(0,i.Gp)((function(e,t){var n=(0,i.yK)();return s.createElement(a.JO,c({ref:t,role:"presentation"},e,{__css:n.icon}))}));r.Ts&&(K.displayName="ListIcon");var $=["columns","spacingX","spacingY","spacing","minChildWidth"],q=(0,i.Gp)((function(e,t){var n,i,o=e.columns,a=e.spacingX,l=e.spacingY,u=e.spacing,h=e.minChildWidth,g=d(e,$),p=h?(i=h,(0,r.XQ)(i,(function(e){return(0,r.Ft)(e)?null:"repeat(auto-fit, minmax("+(t=e,((0,r.hj)(t)?t+"px":t)+", 1fr))");var t}))):(n=o,(0,r.XQ)(n,(function(e){return(0,r.Ft)(e)?null:"repeat("+e+", minmax(0, 1fr))"})));return s.createElement(T,c({ref:t,gap:u,columnGap:a,rowGap:l,templateColumns:p},g))}));r.Ts&&(q.displayName="SimpleGrid");var Z=(0,i.m$)("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});r.Ts&&(Z.displayName="Spacer");var G="& > *:not(style) ~ *:not(style)",Y=["isInline","direction","align","justify","spacing","wrap","children","divider","className","shouldWrapChildren"],Q=function(e){return s.createElement(i.m$.div,c({className:"chakra-stack__item"},e,{__css:c({display:"inline-block",flex:"0 0 auto",minWidth:0},e.__css)}))},X=(0,i.Gp)((function(e,t){var n,o=e.isInline,a=e.direction,u=e.align,h=e.justify,g=e.spacing,p=void 0===g?"0.5rem":g,f=e.wrap,m=e.children,v=e.divider,_=e.className,b=e.shouldWrapChildren,y=d(e,Y),w=o?"row":null!=a?a:"column",C=s.useMemo((function(){return function(e){var t,n=e.spacing,i=e.direction,o={column:{marginTop:n,marginEnd:0,marginBottom:0,marginStart:0},row:{marginTop:0,marginEnd:0,marginBottom:0,marginStart:n},"column-reverse":{marginTop:0,marginEnd:0,marginBottom:n,marginStart:0},"row-reverse":{marginTop:0,marginEnd:n,marginBottom:0,marginStart:0}};return(t={flexDirection:i})[G]=(0,r.XQ)(i,(function(e){return o[e]})),t}({direction:w,spacing:p})}),[w,p]),S=s.useMemo((function(){return function(e){var t=e.spacing,n=e.direction,i={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":(0,r.XQ)(n,(function(e){return i[e]}))}}({spacing:p,direction:w})}),[p,w]),x=!!v,k=!b&&!x,L=(0,l.WR)(m),N=k?L:L.map((function(e,t){var n=void 0!==e.key?e.key:t,i=t+1===L.length,o=b?s.createElement(Q,{key:n},e):e;if(!x)return o;var r=i?null:s.cloneElement(v,{__css:S});return s.createElement(s.Fragment,{key:n},o,r)})),E=(0,r.cx)("chakra-stack",_);return s.createElement(i.m$.div,c({ref:t,display:"flex",alignItems:u,justifyContent:h,flexDirection:C.flexDirection,flexWrap:f,className:E,__css:x?{}:(n={},n[G]=C[G],n)},y),N)}));r.Ts&&(X.displayName="Stack");var J=(0,i.Gp)((function(e,t){return s.createElement(X,c({align:"center"},e,{direction:"row",ref:t}))}));r.Ts&&(J.displayName="HStack");var ee=(0,i.Gp)((function(e,t){return s.createElement(X,c({align:"center"},e,{direction:"column",ref:t}))}));r.Ts&&(ee.displayName="VStack");var te=["className","align","decoration","casing"],ne=(0,i.Gp)((function(e,t){var n=(0,i.mq)("Text",e),o=(0,i.Lr)(e);o.className,o.align,o.decoration,o.casing;var a=d(o,te),l=(0,r.YU)({textAlign:e.align,textDecoration:e.decoration,textTransform:e.casing});return s.createElement(i.m$.p,c({ref:t,className:(0,r.cx)("chakra-text",e.className)},l,a,{__css:n}))}));r.Ts&&(ne.displayName="Text");var ie=["spacing","children","justify","direction","align","className","shouldWrapChildren"],oe=["className"],re=(0,i.Gp)((function(e,t){var n=e.spacing,a=void 0===n?"0.5rem":n,l=e.children,u=e.justify,h=e.direction,g=e.align,p=e.className,f=e.shouldWrapChildren,m=d(e,ie),v=s.useMemo((function(){return{"--chakra-wrap-spacing":function(e){return(0,r.XQ)(a,(function(t){return(0,o.fr)("space",t)(e)}))},"--wrap-spacing":"calc(var(--chakra-wrap-spacing) / 2)",display:"flex",flexWrap:"wrap",justifyContent:u,alignItems:g,flexDirection:h,listStyleType:"none",padding:"0",margin:"calc(var(--wrap-spacing) * -1)","& > *:not(style)":{margin:"var(--wrap-spacing)"}}}),[a,u,g,h]),_=f?s.Children.map(l,(function(e,t){return s.createElement(se,{key:t},e)})):l;return s.createElement(i.m$.div,c({ref:t,className:(0,r.cx)("chakra-wrap",p)},m),s.createElement(i.m$.ul,{className:"chakra-wrap__list",__css:v},_))}));r.Ts&&(re.displayName="Wrap");var se=(0,i.Gp)((function(e,t){var n=e.className,o=d(e,oe);return s.createElement(i.m$.li,c({ref:t,__css:{display:"flex",alignItems:"flex-start"},className:(0,r.cx)("chakra-wrap__listitem",n)},o))}));r.Ts&&(se.displayName="WrapItem")},57324:(e,t,n)=>{"use strict";n.d(t,{v2:()=>F,j2:()=>W,sN:()=>U,qy:()=>H});var i=n(105),o=n(44592),r=n(99860),s=n(67294),a=n(26450);function l(){return l=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}var m=["id","closeOnSelect","closeOnBlur","autoSelect","isLazy","isOpen","defaultIsOpen","onClose","onOpen","placement","lazyBehavior","direction","computePositionOnMount"],v=["onMouseEnter","onMouseMove","onMouseLeave","onClick","isDisabled","isFocusable","closeOnSelect"],_=["type","isChecked"],b=(0,u.n)(),y=b[0],w=b[1],C=b[2],S=b[3],x=(0,a.kr)({strict:!1,name:"MenuContext"}),k=x[0],L=x[1];function N(e){var t;return(0,o.Re)(e)&&!(null==(t=e.getAttribute("role"))||!t.startsWith("menuitem"))}function E(e,t){void 0===e&&(e={}),void 0===t&&(t=null);var n=e,i=n.onMouseEnter,r=n.onMouseMove,u=n.onMouseLeave,g=n.onClick,m=n.isDisabled,_=n.isFocusable,b=n.closeOnSelect,y=f(n,v),w=L(),C=w.setFocusedIndex,x=w.focusedIndex,k=w.closeOnSelect,E=w.onClose,D=w.menuRef,I=w.isOpen,T=w.menuId,M=s.useRef(null),A=T+"-menuitem-"+(0,h.Me)(),O=S({disabled:m&&!_}),R=O.index,P=O.register,F=s.useCallback((function(e){null==i||i(e),m||C(R)}),[C,R,m,i]),B=s.useCallback((function(e){null==r||r(e),M.current&&!(0,o.H9)(M.current)&&F(e)}),[F,r]),W=s.useCallback((function(e){null==u||u(e),m||C(-1)}),[C,m,u]),V=s.useCallback((function(e){null==g||g(e),N(e.currentTarget)&&(null!=b?b:k)&&E()}),[E,g,k,b]),z=R===x,H=m&&!_;return(0,h.rf)((function(){I&&(z&&!H&&M.current?(0,o.T_)(M.current,{nextTick:!0,selectTextIfInput:!1,preventScroll:!1}):D.current&&!(0,o.H9)(D.current)&&(0,o.T_)(D.current,{preventScroll:!1}))}),[z,H,D,I]),p({},y,function(e){void 0===e&&(e={});var t=e,n=t.ref,i=t.isDisabled,r=t.isFocusable,u=t.clickOnEnter,h=void 0===u||u,g=t.clickOnSpace,p=void 0===g||g,f=t.onMouseDown,m=t.onMouseUp,v=t.onClick,_=t.onKeyDown,b=t.onKeyUp,y=t.tabIndex,w=t.onMouseOver,C=t.onMouseLeave,S=function(e,t){if(null==e)return{};var n,i,o={},r=Object.keys(e);for(i=0;i=0||(o[n]=e[n]);return o}(t,c),x=s.useState(!0),k=x[0],L=x[1],N=s.useState(!1),E=N[0],D=N[1],I=function(){var e=s.useRef(new Map),t=e.current,n=s.useCallback((function(t,n,i,o){e.current.set(i,{type:n,el:t,options:o}),t.addEventListener(n,i,o)}),[]),i=s.useCallback((function(t,n,i,o){t.removeEventListener(n,i,o),e.current.delete(i)}),[]);return s.useEffect((function(){return function(){t.forEach((function(e,t){i(e.el,e.type,t,e.options)}))}}),[i,t]),{add:n,remove:i}}(),T=k?y:y||0,M=i&&!r,A=s.useCallback((function(e){if(i)return e.stopPropagation(),void e.preventDefault();e.currentTarget.focus(),null==v||v(e)}),[i,v]),O=s.useCallback((function(e){E&&d(e)&&(e.preventDefault(),e.stopPropagation(),D(!1),I.remove(document,"keyup",O,!1))}),[E,I]),R=s.useCallback((function(e){if(null==_||_(e),!(i||e.defaultPrevented||e.metaKey)&&d(e.nativeEvent)&&!k){var t=h&&"Enter"===e.key;p&&" "===e.key&&(e.preventDefault(),D(!0)),t&&(e.preventDefault(),e.currentTarget.click()),I.add(document,"keyup",O,!1)}}),[i,k,_,h,p,I,O]),P=s.useCallback((function(e){null==b||b(e),i||e.defaultPrevented||e.metaKey||d(e.nativeEvent)&&!k&&p&&" "===e.key&&(e.preventDefault(),D(!1),e.currentTarget.click())}),[p,k,i,b]),F=s.useCallback((function(e){0===e.button&&(D(!1),I.remove(document,"mouseup",F,!1))}),[I]),B=s.useCallback((function(e){if(!(0,o.n_)(e)){if(i)return e.stopPropagation(),void e.preventDefault();k||D(!0),e.currentTarget.focus({preventScroll:!0}),I.add(document,"mouseup",F,!1),null==f||f(e)}}),[i,k,f,I,F]),W=s.useCallback((function(e){(0,o.n_)(e)||(k||D(!1),null==m||m(e))}),[m,k]),V=s.useCallback((function(e){i?e.preventDefault():null==w||w(e)}),[i,w]),z=s.useCallback((function(e){E&&(e.preventDefault(),D(!1)),null==C||C(e)}),[E,C]),H=(0,a.lq)(n,(function(e){e&&"BUTTON"!==e.tagName&&L(!1)}));return l({},S,k?{ref:H,type:"button","aria-disabled":M?void 0:i,disabled:M,onClick:A,onMouseDown:f,onMouseUp:m,onKeyUp:b,onKeyDown:_,onMouseOver:w,onMouseLeave:C}:{ref:H,role:"button","data-active":(0,o.PB)(E),"aria-disabled":i?"true":void 0,tabIndex:M?void 0:T,onClick:A,onMouseDown:B,onMouseUp:W,onKeyUp:P,onKeyDown:R,onMouseOver:V,onMouseLeave:z})}({onClick:V,onMouseEnter:F,onMouseMove:B,onMouseLeave:W,ref:(0,a.lq)(P,M,t),isDisabled:m,isFocusable:_}),{id:A,role:"menuitem",tabIndex:z?0:-1})}var D=["descendants"],I=["children","as"],T=["rootProps"],M=["type"],A=["icon","iconSpacing","command","commandSpacing","children"],O=["icon","iconSpacing"],R=["title","children","className"],P=["className","children"],F=function(e){var t=e.children,n=(0,i.jC)("Menu",e),r=function(e){void 0===e&&(e={});var t=e,n=t.id,i=t.closeOnSelect,r=void 0===i||i,a=t.closeOnBlur,l=void 0===a||a,c=t.autoSelect,d=void 0===c||c,u=t.isLazy,v=t.isOpen,_=t.defaultIsOpen,b=t.onClose,y=t.onOpen,w=t.placement,S=void 0===w?"bottom-start":w,x=t.lazyBehavior,k=void 0===x?"unmount":x,L=t.direction,N=t.computePositionOnMount,E=void 0!==N&&N,D=f(t,m),I=s.useRef(null),T=s.useRef(null),M=C(),A=s.useCallback((function(){(0,o.T_)(I.current,{nextTick:!0,selectTextIfInput:!1})}),[]),O=s.useCallback((function(){var e=setTimeout((function(){var e=M.firstEnabled();e&&K(e.index)}));Y.current.add(e)}),[M]),R=s.useCallback((function(){var e=setTimeout((function(){var e=M.lastEnabled();e&&K(e.index)}));Y.current.add(e)}),[M]),P=s.useCallback((function(){null==y||y(),d?O():A()}),[d,O,A,y]),F=(0,h.qY)({isOpen:v,defaultIsOpen:_,onClose:b,onOpen:P}),B=F.isOpen,W=F.onOpen,V=F.onClose,z=F.onToggle;(0,h.O3)({enabled:B&&l,ref:I,handler:function(e){var t;null!=(t=T.current)&&t.contains(e.target)||V()}});var H=(0,g.D)(p({},D,{enabled:B||E,placement:S,direction:L})),j=s.useState(-1),U=j[0],K=j[1];(0,h.rf)((function(){B||K(-1)}),[B]),(0,h.Ck)(I,{focusRef:T,visible:B,shouldFocus:!0});var $=(0,h.ZS)(n,"menu-button","menu-list"),q=$[0],Z=$[1],G=s.useCallback((function(){W(),A()}),[W,A]),Y=s.useRef(new Set([]));return(0,h.zq)((function(){Y.current.forEach((function(e){return clearTimeout(e)})),Y.current.clear()})),{openAndFocusMenu:G,openAndFocusFirstItem:s.useCallback((function(){W(),O()}),[O,W]),openAndFocusLastItem:s.useCallback((function(){W(),R()}),[W,R]),onTransitionEnd:s.useCallback((function(){var e,t,n=(0,o.lZ)(I.current),i=null==(e=I.current)?void 0:e.contains(n.activeElement);if(B&&!i){var r=null==(t=M.item(U))?void 0:t.node;r&&(0,o.T_)(r,{selectTextIfInput:!1,preventScroll:!1})}}),[B,U,M]),descendants:M,popper:H,buttonId:q,menuId:Z,forceUpdate:H.forceUpdate,orientation:"vertical",isOpen:B,onToggle:z,onOpen:W,onClose:V,menuRef:I,buttonRef:T,focusedIndex:U,closeOnSelect:r,closeOnBlur:l,autoSelect:d,setFocusedIndex:K,isLazy:u,lazyBehavior:k}}(p({},(0,i.Lr)(e),{direction:(0,i.Fg)().direction})),a=r.descendants,l=f(r,D),c=s.useMemo((function(){return l}),[l]),d=c.isOpen,u=c.onClose,v=c.forceUpdate;return s.createElement(y,{value:a},s.createElement(k,{value:c},s.createElement(i.Fo,{value:n},(0,o.Pu)(t,{isOpen:d,onClose:u,forceUpdate:v}))))};o.Ts&&(F.displayName="Menu");var B=(0,i.Gp)((function(e,t){var n=(0,i.yK)();return s.createElement(i.m$.button,p({ref:t},e,{__css:p({display:"inline-flex",appearance:"none",alignItems:"center",outline:0},n.button)}))})),W=(0,i.Gp)((function(e,t){e.children;var n=e.as,r=function(e,t){void 0===e&&(e={}),void 0===t&&(t=null);var n=L(),i=n.onToggle,r=n.popper,l=n.openAndFocusFirstItem,c=n.openAndFocusLastItem,d=s.useCallback((function(e){var t=(0,o.uh)(e),n={Enter:l,ArrowDown:l,ArrowUp:c}[t];n&&(e.preventDefault(),e.stopPropagation(),n(e))}),[l,c]);return p({},e,{ref:(0,a.lq)(n.buttonRef,t,r.referenceRef),id:n.buttonId,"data-active":(0,o.PB)(n.isOpen),"aria-expanded":n.isOpen,"aria-haspopup":"menu","aria-controls":n.menuId,onClick:(0,o.v0)(e.onClick,i),onKeyDown:(0,o.v0)(e.onKeyDown,d)})}(f(e,I),t),l=n||B;return s.createElement(l,p({},r,{className:(0,o.cx)("chakra-menu__menu-button",e.className)}),s.createElement(i.m$.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0}},e.children))}));o.Ts&&(W.displayName="MenuButton");var V={enter:{visibility:"visible",opacity:1,scale:1,transition:{duration:.2,ease:[.4,0,.2,1]}},exit:{transitionEnd:{visibility:"hidden"},opacity:0,scale:.8,transition:{duration:.1,easings:"easeOut"}}},z="custom"in r.E?r.E.custom(i.m$.div):(0,r.E)(i.m$.div),H=(0,i.Gp)((function(e,t){var n,r,l=e.rootProps,c=f(e,T),d=L(),u=d.isOpen,g=d.onTransitionEnd,m=function(e,t){void 0===e&&(e={}),void 0===t&&(t=null);var n=L();if(!n)throw new Error("useMenuContext: context is undefined. Seems you forgot to wrap component within ");var i=n.focusedIndex,r=n.setFocusedIndex,l=n.menuRef,c=n.isOpen,d=n.onClose,u=n.menuId,g=n.isLazy,f=n.lazyBehavior,m=w(),v=(0,h.bx)({preventDefault:function(e){return" "!==e.key&&N(e.target)}}),_=s.useCallback((function(e){var t=(0,o.uh)(e),n={Tab:function(e){return e.preventDefault()},Escape:d,ArrowDown:function(){var e=m.nextEnabled(i);e&&r(e.index)},ArrowUp:function(){var e=m.prevEnabled(i);e&&r(e.index)}},s=n[t];if(s)return e.preventDefault(),void s(e);var a=v((function(e){var t=(0,o.LP)(m.values(),e,(function(e){var t,n;return null!=(t=null==e||null==(n=e.node)?void 0:n.textContent)?t:""}),m.item(i));if(t){var n=m.indexOf(t.node);r(n)}}));N(e.target)&&a(e)}),[m,i,v,d,r]),b=s.useRef(!1);c&&(b.current=!0);var y=(0,o.VI)({hasBeenSelected:b.current,isLazy:g,lazyBehavior:f,isSelected:c});return p({},e,{ref:(0,a.lq)(l,t),children:y?e.children:null,tabIndex:-1,role:"menu",id:u,style:p({},e.style,{transformOrigin:"var(--popper-transform-origin)"}),"aria-orientation":"vertical",onKeyDown:(0,o.v0)(e.onKeyDown,_)})}(c,t),v=function(e){void 0===e&&(e={});var t=L(),n=t.popper,i=t.isOpen;return n.getPopperProps(p({},e,{style:p({visibility:i?"visible":"hidden"},e.style)}))}(l),_=(0,i.yK)();return s.createElement(i.m$.div,p({},v,{__css:{zIndex:null!=(n=e.zIndex)?n:null==(r=_.list)?void 0:r.zIndex}}),s.createElement(z,p({},m,{onUpdate:g,className:(0,o.cx)("chakra-menu__menu-list",m.className),variants:V,initial:!1,animate:u?"enter":"exit",__css:p({outline:0},_.list)})))}));o.Ts&&(H.displayName="MenuList");var j=(0,i.Gp)((function(e,t){var n=e.type,o=f(e,M),r=(0,i.yK)(),a=o.as?null!=n?n:void 0:"button",l=p({textDecoration:"none",color:"inherit",userSelect:"none",display:"flex",width:"100%",alignItems:"center",textAlign:"start",flex:"0 0 auto",outline:0},r.item);return s.createElement(i.m$.button,p({ref:t,type:a},o,{__css:l}))})),U=(0,i.Gp)((function(e,t){var n=e.icon,i=e.iconSpacing,r=void 0===i?"0.75rem":i,a=e.command,l=e.commandSpacing,c=void 0===l?"0.75rem":l,d=e.children,u=E(f(e,A),t),h=n||a?s.createElement("span",{style:{pointerEvents:"none",flex:1}},d):d;return s.createElement(j,p({},u,{className:(0,o.cx)("chakra-menu__menuitem",u.className)}),n&&s.createElement(G,{fontSize:"0.8em",marginEnd:r},n),h,a&&s.createElement(Z,{marginStart:c},a))}));o.Ts&&(U.displayName="MenuItem");var K=function(e){return s.createElement("svg",p({viewBox:"0 0 14 14",width:"1em",height:"1em"},e),s.createElement("polygon",{fill:"currentColor",points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"}))},$=(0,i.Gp)((function(e,t){var n=e.icon,i=e.iconSpacing,r=void 0===i?"0.75rem":i,a=f(e,O),l=function(e,t){void 0===e&&(e={}),void 0===t&&(t=null);var n=e,i=n.type,o=void 0===i?"radio":i,r=n.isChecked;return p({},E(f(n,_),t),{role:"menuitem"+o,"aria-checked":r})}(a,t);return s.createElement(j,p({},l,{className:(0,o.cx)("chakra-menu__menuitem-option",a.className)}),s.createElement(G,{fontSize:"0.8em",marginEnd:r,opacity:e.isChecked?1:0},n||s.createElement(K,null)),s.createElement("span",{style:{flex:1}},l.children))}));$.id="MenuItemOption",o.Ts&&($.displayName="MenuItemOption"),o.Ts;var q=(0,i.Gp)((function(e,t){var n=e.title,r=e.children,a=e.className,l=f(e,R),c=(0,o.cx)("chakra-menu__group__title",a),d=(0,i.yK)();return s.createElement("div",{ref:t,className:"chakra-menu__group",role:"group"},n&&s.createElement(i.m$.p,p({className:c},l,{__css:d.groupTitle}),n),r)}));o.Ts&&(q.displayName="MenuGroup");var Z=(0,i.Gp)((function(e,t){var n=(0,i.yK)();return s.createElement(i.m$.span,p({ref:t},e,{__css:n.command,className:"chakra-menu__command"}))}));o.Ts&&(Z.displayName="MenuCommand");var G=function(e){var t=e.className,n=e.children,r=f(e,P),a=s.Children.only(n),l=s.isValidElement(a)?s.cloneElement(a,{focusable:"false","aria-hidden":!0,className:(0,o.cx)("chakra-menu__icon",a.props.className)}):null,c=(0,o.cx)("chakra-menu__icon-wrapper",t);return s.createElement(i.m$.span,p({className:c},r,{__css:{flexShrink:0}}),l)};o.Ts&&(G.displayName="MenuIcon"),o.Ts},45073:(e,t,n)=>{"use strict";n.d(t,{u_:()=>Lt,fe:()=>Mt,ol:()=>Ot,hz:()=>Et,mz:()=>At,xB:()=>Tt,ZA:()=>It});var i=n(84746),o=n(67294),r=n(87462),s=(n(45697),"data-focus-lock"),a="data-focus-lock-disabled";function l(e,t){return n=t,i=function(t){return e.forEach((function(e){return function(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}(e,t)}))},(r=(0,o.useState)((function(){return{value:n,callback:i,facade:{get current(){return r.value},set current(e){var t=r.value;t!==e&&(r.value=e,r.callback(e,t))}}}}))[0]).callback=i,r.facade;var n,i,r}var c={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},d=function(e){var t=e.children;return o.createElement(o.Fragment,null,o.createElement("div",{key:"guard-first","data-focus-guard":!0,"data-focus-auto-guard":!0,style:c}),t,t&&o.createElement("div",{key:"guard-last","data-focus-guard":!0,"data-focus-auto-guard":!0,style:c}))};d.propTypes={},d.defaultProps={children:null};var u=function(){return u=Object.assign||function(e){for(var t,n=1,i=arguments.length;n1?L(e[0],e):e[0]},E=function(e,t){return e.length>1?e.indexOf(L(e[t],e)):t},D=function(e,t){var n=e.get(t);if(void 0!==n)return n;var i=function(e,t){return!e||e===document||e&&e.nodeType===Node.DOCUMENT_NODE||!function(e){if(e.nodeType!==Node.ELEMENT_NODE)return!1;var t=window.getComputedStyle(e,null);return!(!t||!t.getPropertyValue||"none"!==t.getPropertyValue("display")&&"hidden"!==t.getPropertyValue("visibility"))}(e)&&t(e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode)}(t,D.bind(void 0,e));return e.set(t,i),i},I=function(e){return Boolean(e&&e.dataset&&e.dataset.focusGuard)},T=function(e){return!I(e)},M=function(e){return Boolean(e)},A="NEW_FOCUS",O=function(e){for(var t=Array(e.length),n=0;n0&&t.add(o),(r&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(i)}return e.filter((function(e,n){return!t.has(n)}))}(O(P(t).querySelectorAll('[data-focus-lock="'+n+'"]:not(['+a+'="disabled"])'))):[t]),e}),[])},B=function(e,t){var n=e.tabIndex-t.tabIndex,i=e.index-t.index;if(n){if(!e.tabIndex)return 1;if(!t.tabIndex)return-1}return n||i},W=function(e,t,n){return O(e).map((function(e,t){return{node:e,index:t,tabIndex:n&&-1===e.tabIndex?(e.dataset||{}).focusGuard?0:-1:e.tabIndex}})).filter((function(e){return!t||e.tabIndex>=0})).sort(B)},V=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"].join(","),z=V+", [data-focus-guard]",H=function(e,t){return e.reduce((function(e,n){return e.concat(O(n.querySelectorAll(t?z:V)),n.parentNode?O(n.parentNode.querySelectorAll(V)).filter((function(e){return e===n})):[])}),[])},j=function(e,t){return O(e).filter((function(e){return D(t,e)})).filter((function(e){return function(e){return!(("INPUT"===e.tagName||"BUTTON"===e.tagName)&&("hidden"===e.type||e.disabled))}(e)}))},U=function(e,t,n){return W(j(H(e,n),t),!0,n)},K=function(e,t){return W(j(H(e),t),!1)},$=function(e,t){return void 0===t&&(t=[]),t.push(e),e.parentNode&&$(e.parentNode,t),t},q=function(e,t){for(var n=$(e),i=$(t),o=0;o=0)return r}return!1},Z=function(e,t,n){var i=R(e),o=R(t),r=i[0],s=!1;return o.filter(Boolean).forEach((function(e){s=q(s||e,e)||s,n.filter(Boolean).forEach((function(e){var t=q(r,e);t&&(s=!s||t.contains(s)?t:q(t,s))}))})),s},G=function(e,t){var n=document&&document.activeElement,i=F(e).filter(T),o=Z(n||e,e,i),r=new Map,s=K(i,r),a=U(i,r).filter((function(e){var t=e.node;return T(t)}));if(a[0]||(a=s)[0]){var l,c,d,u,h=K([o],r).map((function(e){return e.node})),g=(l=h,c=a,d=new Map,c.forEach((function(e){return d.set(e.node,e)})),l.map((function(e){return d.get(e)})).filter(M)),p=g.map((function(e){return e.node})),f=function(e,t,n,i){var o=e.length,r=e[0],s=e[o-1],a=I(n);if(!(e.indexOf(n)>=0)){var l,c,d=t.indexOf(n),u=i?t.indexOf(i):d,h=i?e.indexOf(i):-1,g=d-u,p=t.indexOf(r),f=t.indexOf(s),m=(l=t,c=new Set,l.forEach((function(e){return c.add(L(e,l))})),l.filter((function(e){return c.has(e)}))),v=m.indexOf(n)-(i?m.indexOf(i):d),_=E(e,0),b=E(e,o-1);return-1===d||-1===h?A:!g&&h>=0?h:d<=p&&a&&Math.abs(g)>1?b:d>=f&&a&&Math.abs(g)>1?_:g&&Math.abs(v)>1?h:d<=p?b:d>f?_:g?Math.abs(g)>1?h:(o+h+g)%o:void 0}}(p,h,n,t);if(f===A){var m=s.map((function(e){return e.node})).filter((u=function(e,t){return e.reduce((function(e,n){return e.concat(function(e,t){return j((n=e.querySelectorAll("[data-autofocus-inside]"),O(n).map((function(e){return H([e])})).reduce((function(e,t){return e.concat(t)}),[])),t);var n}(n,t))}),[])}(i,r),function(e){return e.autofocus||e.dataset&&!!e.dataset.autofocus||u.indexOf(e)>=0}));return{node:m&&m.length?N(m):N(p)}}return void 0===f?f:g[f]}},Y=0,Q=!1;const X=function(e,t){var n,i=G(e,t);if(!Q&&i){if(Y>2)return console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),Q=!0,void setTimeout((function(){Q=!1}),1);Y++,(n=i.node).focus(),"contentWindow"in n&&n.contentWindow&&n.contentWindow.focus(),Y--}};var J=function(e){var t=document&&document.activeElement;return!(!t||t.dataset&&t.dataset.focusGuard)&&F(e).reduce((function(e,n){return e||n.contains(t)||function(e){return Boolean(O(e.querySelectorAll("iframe")).some((function(e){return e===document.activeElement})))}(n)}),!1)};function ee(e){var t=window.setImmediate;void 0!==t?t(e):setTimeout(e,1)}var te=null,ne=null,ie=null,oe=!1,re=function(){return!0};function se(e,t,n,i){var o=null,r=e;do{var s=i[r];if(s.guard)s.node.dataset.focusAutoGuard&&(o=s);else{if(!s.lockItem)break;if(r!==e)return;o=null}}while((r+=n)!==t);o&&(o.node.tabIndex=0)}var ae=function(e){return e&&"current"in e?e.current:e},le=function(){var e,t,n,i,o,r,s,a=!1;if(te){var l=te,c=l.observed,d=l.persistentFocus,u=l.autoFocus,h=l.shards,g=l.crossFrame,p=c||ie&&ie.portaledElement,f=document&&document.activeElement;if(p){var m=[p].concat(h.map(ae).filter(Boolean));if(f&&!function(e){return(te.whiteList||re)(e)}(f)||(d||(g?Boolean(oe):"meanwhile"===oe)||!(document&&document.activeElement===document.body||document&&O(document.querySelectorAll("[data-no-focus-lock]")).some((function(e){return e.contains(document.activeElement)})))||!ne&&u)&&(!p||J(m)||(s=f,ie&&ie.portaledElement===s)||(document&&!ne&&f&&!u?(f.blur&&f.blur(),document.body.focus()):(a=X(m,ne),ie={})),oe=!1,ne=document&&document.activeElement),document){var v=document&&document.activeElement,_=(t=F(e=m).filter(T),n=Z(e,e,t),i=new Map,o=U([n],i,!0),r=U(t,i).filter((function(e){var t=e.node;return T(t)})).map((function(e){return e.node})),o.map((function(e){var t=e.node;return{node:t,index:e.index,lockItem:r.indexOf(t)>=0,guard:I(t)}}))),b=_.map((function(e){return e.node})).indexOf(v);b>-1&&(_.filter((function(e){var t=e.guard,n=e.node;return t&&n.dataset.focusAutoGuard})).forEach((function(e){return e.node.removeAttribute("tabIndex")})),se(b,_.length,1,_),se(b,-1,-1,_))}}}return a},ce=function(e){le()&&e&&(e.stopPropagation(),e.preventDefault())},de=function(){return ee(le)},ue=function(){oe="just",setTimeout((function(){oe="meanwhile"}),0)};m.assignSyncMedium((function(e){var t=e.target,n=e.currentTarget;n.contains(t)||(ie={observerNode:n,portaledElement:t})})),v.assignMedium(de),_.assignMedium((function(e){return e({moveFocusInside:X,focusInside:J})}));const he=(ge=function(e){return e.filter((function(e){return!e.disabled}))},pe=function(e){var t=e.slice(-1)[0];t&&!te&&(document.addEventListener("focusin",ce,!0),document.addEventListener("focusout",de),window.addEventListener("blur",ue));var n=te,i=n&&t&&t.id===n.id;te=t,n&&!i&&(n.onDeactivation(),e.filter((function(e){return e.id===n.id})).length||n.returnFocus(!t)),t?(ne=null,i&&n.observed===t.observed||t.onActivation(),le(),ee(le)):(document.removeEventListener("focusin",ce,!0),document.removeEventListener("focusout",de),window.removeEventListener("blur",ue),ne=null)},function(e){var t,n=[];function i(){t=ge(n.map((function(e){return e.props}))),pe(t)}var r=function(r){var s,a;function l(){return r.apply(this,arguments)||this}a=r,(s=l).prototype=Object.create(a.prototype),s.prototype.constructor=s,S(s,a),l.peek=function(){return t};var c=l.prototype;return c.componentDidMount=function(){n.push(this),i()},c.componentDidUpdate=function(){i()},c.componentWillUnmount=function(){var e=n.indexOf(this);n.splice(e,1),i()},c.render=function(){return o.createElement(e,this.props)},l}(o.PureComponent);return(0,x.Z)(r,"displayName","SideEffect("+function(e){return e.displayName||e.name||"Component"}(e)+")"),r})((function(){return null}));var ge,pe,fe=o.forwardRef((function(e,t){return o.createElement(C,(0,r.Z)({sideCar:he,ref:t},e))})),me=C.propTypes||{};me.sideCar,function(e,t){if(null==e)return{};var n,i,o={},r=Object.keys(e);for(i=0;i=0||(o[n]=e[n])}(me,["sideCar"]),fe.propTypes={};const ve=fe;var _e=n(44592),be=function(e){var t=e.initialFocusRef,n=e.finalFocusRef,i=e.contentRef,r=e.restoreFocus,s=e.children,a=e.isDisabled,l=e.autoFocus,c=e.persistentFocus,d=e.lockFocusAcrossFrames,u=o.useCallback((function(){null!=t&&t.current?t.current.focus():null!=i&&i.current&&0===(0,_e.t5)(i.current).length&&(0,_e.T_)(i.current,{nextTick:!0})}),[t,i]),h=o.useCallback((function(){var e;null==n||null==(e=n.current)||e.focus()}),[n]),g=r&&!n;return o.createElement(ve,{crossFrame:d,persistentFocus:c,autoFocus:l,disabled:a,onActivation:u,onDeactivation:h,returnFocus:g},s)};_e.Ts&&(be.displayName="FocusLock");var ye=n(46871),we=n(105),Ce=n(37496),Se=n(26450),xe=n(99860),ke=n(53869),Le=n(69283),Ne=function(){return Ne=Object.assign||function(e){for(var t,n=1,i=arguments.length;n