max_stars_repo_path
stringlengths
4
261
max_stars_repo_name
stringlengths
6
106
max_stars_count
int64
0
38.8k
id
stringlengths
1
6
text
stringlengths
7
1.05M
experiments/test-suite/fsm.als
saiema/ARepair
5
301
<reponame>saiema/ARepair<filename>experiments/test-suite/fsm.als -- Automatically generated tests. pred test3 { some disj FSM0: FSM {some disj State0, State1: State { FSM = FSM0 start = FSM0->State1 stop = FSM0->State0 State = State0 + State1 transition = State1->State0 }} } run test3 for 3 expect 1 pred test7 { some disj FSM0: FSM {some disj State0, State1, State2: State { FSM = FSM0 start = FSM0->State1 + FSM0->State2 stop = FSM0->State0 State = State0 + State1 + State2 transition = State1->State0 + State2->State0 }} } run test7 for 3 expect 0 pred test4 { some disj FSM0: FSM {some disj State0, State1, State2: State { FSM = FSM0 start = FSM0->State1 stop = FSM0->State0 State = State0 + State1 + State2 transition = State1->State2 + State2->State0 + State2->State2 }} } run test4 for 3 expect 1 pred test5 { some disj FSM0: FSM {some disj State0, State1: State { FSM = FSM0 start = FSM0->State0 stop = FSM0->State1 State = State0 + State1 transition = State0->State1 }} } run test5 for 3 expect 1 pred test12 { some disj FSM0: FSM {some disj State0, State1: State { FSM = FSM0 start = FSM0->State1 stop = FSM0->State0 State = State0 + State1 transition = State0->State0 + State1->State0 }} } run test12 for 3 expect 0 pred test11 { some disj FSM0: FSM {some disj State0, State1: State { FSM = FSM0 start = FSM0->State1 stop = FSM0->State0 State = State0 + State1 transition = State1->State0 + State1->State1 }} } run test11 for 3 expect 0 pred test1 { some disj FSM0, FSM1: FSM {some disj State0, State1, State2: State { FSM = FSM0 + FSM1 start = FSM0->State2 + FSM1->State2 stop = FSM1->State1 State = State0 + State1 + State2 transition = State0->State1 + State2->State0 + State2->State1 }} } run test1 for 3 expect 0 pred test6 { some disj FSM0: FSM {some disj State0, State1: State { FSM = FSM0 start = FSM0->State1 no stop State = State0 + State1 transition = State0->State0 + State1->State0 }} } run test6 for 3 expect 0 pred test2 { some disj FSM0, FSM1: FSM {some disj State0, State1: State { FSM = FSM0 + FSM1 start = FSM1->State1 stop = FSM1->State0 State = State0 + State1 transition = State1->State0 }} } run test2 for 3 expect 0 pred test9 { some disj FSM0: FSM {some disj State0, State1: State { FSM = FSM0 start = FSM0->State1 stop = FSM0->State0 State = State0 + State1 transition = State0->State0 + State1->State0 + State1->State1 }} } run test9 for 3 expect 0 pred test15 { some disj FSM0: FSM {some disj State0, State1, State2: State { FSM = FSM0 start = FSM0->State2 stop = FSM0->State1 State = State0 + State1 + State2 transition = State0->State0 + State2->State0 + State2->State1 }} } run test15 for 3 expect 0 pred test10 { some disj FSM0: FSM {some disj State0: State { FSM = FSM0 start = FSM0->State0 stop = FSM0->State0 State = State0 no transition }} } run test10 for 3 expect 0 pred test14 { some disj FSM0: FSM {some disj State0, State1, State2: State { FSM = FSM0 start = FSM0->State2 stop = FSM0->State1 State = State0 + State1 + State2 transition = State0->State1 + State2->State1 }} } run test14 for 3 expect 0 pred test8 { some disj FSM0: FSM {some disj State0, State1, State2: State { FSM = FSM0 start = FSM0->State2 no stop State = State0 + State1 + State2 transition = State1->State1 + State2->State0 + State2->State1 }} } run test8 for 3 expect 0 pred test13 { some disj FSM0: FSM {some disj State0, State1: State { FSM = FSM0 start = FSM0->State1 stop = FSM0->State0 State = State0 + State1 no transition }} } run test13 for 3 expect 0
notes-import.scpt
panicsteve/notes-import
59
811
// // notes-import.scpt // <NAME> <<EMAIL>> // // Import a folder full of HTML or text files into Notes.app. // Crude, but better than nothing. Maybe? // // Usage: // - Open this file in Script Editor // - Change Script Editor language popup from AppleScript to JavaScript // - Run // - Select folder containing files to import // // Known issues: // - Attachments don't get imported // - Formatting/HTML is not preserved // - No idea how text encoding is handled // - File extension should be stripped from title of new note // var notesApp = Application('Notes') notesApp.includeStandardAdditions = true notesApp.activate() // Prompt user to pick a folder var folderName = notesApp.chooseFolder() var folderContents = Application('System Events').folders.byName(folderName.toString()).diskItems.name() var notesFolder = getNotesFolder(); folderContents.forEach(function(item) { var fileContents = fileContentsAtPath(folderName + '/' + item) if ( fileContents !== false ) { var note = notesApp.Note({ 'name': item.replace(/\.\w{3,4}$/, ''), 'body': fileContents }) notesFolder.notes.push(note) } }) function fileContentsAtPath(pathAsString) { var path = Path(pathAsString) var app = Application.currentApplication() app.includeStandardAdditions = true try { var file = app.openForAccess(path); } catch (e) { return false; } var eof = app.getEof(file) var data = null try { data = app.read(file, { 'to': eof }); } catch (e) { return false; } finally { app.closeAccess(file); } return data; } // Prompt user to pick a folder from chosen account if more than one function getNotesFolder() { var folderChoice; var acct = getNotesAccount(); var folders = []; var msg = 'Which folder in ' + acct.name() + '?'; if (acct.folders.length === 1) { return acct.folders[0]; } for (var e in acct.folders) { folders.push(acct.folders[e].name()) } folderChoice = notesApp.chooseFromList(folders, { withTitle: 'Folder for import', withPrompt: msg }); return acct.folders[ folderChoice[0] ]; } // Prompt user to pick an account in Notes app if more than one function getNotesAccount() { var acctChoice, acct; var options = []; var accts = notesApp.accounts; if (accts.length === 1) { return notesApp } for (var e in accts) { options.push(accts[e].name()); } acctChoice = notesApp.chooseFromList(options, { withTitle: 'Notes Account', withPrompt: 'Which account do you want to use to import your notes?' }); return notesApp.accounts[ acctChoice[0] ]; }
demo/src/main/java/org/antlr4gwt/demo/shared/grammar/SimpleG.g4
Rikkola/antlr4-gwt
7
4072
/** * * @author <NAME> * */ grammar SimpleG; @lexer::header { package org.antlr4gwt.demo.shared.grammar; //This file had been generated by Antlr4.4 the desktop version } @parser::header { package org.antlr4gwt.demo.shared.grammar; //This file had been generated by Antlr4.4 the desktop version } root : expr+; expr : cell | NUMBER | STRING | WORD ; cell : LEFT_P first_cell params+=expr (params+=expr)* RIGHT_P; first_cell : cell | OP | WORD ; LEFT_P : '('; RIGHT_P : ')'; OP : '+' | '-' | '*' | '/' | 'mod'; STRING : '\''~[']*'\''; WORD : [a-zA-Z0-9_]+; NUMBER : [0-9]+; WS : [ \t\n\r]+ -> skip;
Chapter1/#15.agda
CodaFi/HoTT-Exercises
0
14248
module #15 where {- Show that indiscernability of identicals follows from path induction -} open import Data.Product open import Relation.Binary.PropositionalEquality id : ∀{x}{A : Set x} → A → A id x = x ind₌ : ∀{a}{A : Set a} → (C : (x y : A) → (x ≡ y) → Set) → ((x : A) → C x x refl) → (x y : A) → (p : x ≡ y) → C x y p ind₌ C c x y p rewrite p = c y based-ind₌ : ∀{x}{A : Set x} → (a : A) → (C : (x : A) → (a ≡ x) → Set) → C a refl → (x : A) → (p : a ≡ x) → C x p based-ind₌ a C c b p rewrite p = c indiscernability-of-identicals : {A : Set}{C : A → Set} → Σ[ f ∈ ((x y : A) → (x ≡ y) → C x → C y) ]((x : A) → f x x refl ≡ id {A = C x}) indiscernability-of-identicals {A} {C} = transport , (λ _ → refl) where transport : (x y : A) → (p : x ≡ y) → C x → C y transport = ind₌ (λ x y _ → C x → C y) (λ x z → z)
Altair101/asm/programsUntested/opMoveData.asm
tigerfarm/arduino
2
164645
; -------------------------------------- ; Test moving data around. ; ; -------------------------------------- jmp Start ; Jump to Start test section. ; ; -------------------------------------- ; Data declarations. ; ; Strings to print out. Test1 db 'Test1' Test2 db 'Test2' Hello db 'Hello' There db 'there.' ; ------------------- ; Special characters. SPACE equ 32 ; 32 is space, ' '. NL equ 10 ; 10 is new line, '\n'. TERMB equ 0ffh ; String terminator. ; ; -------------------------------------- Halt: hlt ; The program will halt at each iteration, after the first. ; -------------------------------------- Start: lxi h,Test1 call sPrintln ; lxi h,Hello ; Copy string address, Hello, to H:L. Byte 1 is lxi. Byte 2 move to L. Byte 3 move to H. out 36 ; Print the register values for H:L, and the content at that address. ; 'H' is ascii 72. ; ------------------------------------------ mvi a,NL out 3 lxi h,Test2 call sPrintln ; lda Hello ; Load the data from Hello address to register A. out 37 ; Echo the register A. mov a,m ; Move the data from H:L address to register A. (HL) -> A. out 37 ; Echo the register A. mvi a,NL out 3 ; Out register A to the serial terminal port. ; ------------------------------------------ ; Print the next character. inr m ; Increment M, H:L address. (HL)+1 -> (HL). mov a,m ; Move the data from H:L address to register A. (HL) -> A. out 3 ; ------------------------------------------ jmp Halt ; Stop to confirm the correct addresses and data. ; ; ------------------------------------------ ; Routines to print a DB strings. sPrint: mov a,m ; Move the data from H:L address to register A. (HL) -> A. cpi TERMB ; Compare to see if it's the string terminate byte. jz sPrintDone out 3 ; Out register A to the serial terminal port. inr m ; Increment H:L register pair. jmp sPrint sPrintDone: ret ; sPrintln: mov a,m ; Move the data from H:L address to register A. (HL) -> A. cpi TERMB ; Compare to see if it's the string terminate byte. jz sPrintlnDone out 3 ; Out register A to the serial terminal port. inr m ; Increment H:L register pair. jmp sPrintln sPrintlnDone: mvi a,NL ; Finish by printing a new line character. out 3 ret ; ------------------------------------------ ; End
programs/oeis/227/A227177.asm
jmorken/loda
1
169316
; A227177: n occurs n^2 - n + 1 times. ; 0,1,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9 lpb $0 sub $0,1 trn $0,$2 add $1,1 add $2,$1 add $2,$1 lpe
programs/oeis/066/A066211.asm
neoneye/loda
22
11003
<filename>programs/oeis/066/A066211.asm ; A066211: a(n) = Sum_{j=0..n} (2*n)!/(2*n-j)!. ; 1,3,17,157,2081,36101,773665,19726085,582913217,19582414021,736891600001,30699450566885,1402556105125345,69719685409234277,3745929254826233441,216310377722912693701,13359435408855851031425,878701820865582786218885,61320957119042580664595137,4525280594748425506670362661,352095792080402162190469751201,28806813296345629102651925968165,2472297892863347223825749800568225,222088491494731167434265412104225797 add $0,1 mov $2,$0 lpb $0 sub $0,1 add $1,1 mul $1,$2 add $2,1 mov $3,$0 cmp $3,0 add $0,$3 lpe add $1,1 mov $0,$1
LibraBFT/Concrete/Properties/VotesOnce.agda
lisandrasilva/bft-consensus-agda-1
0
14417
{- Byzantine Fault Tolerant Consensus Verification in Agda, version 0.9. Copyright (c) 2020 Oracle and/or its affiliates. Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.oracle.com/licenses/upl -} open import Optics.All open import LibraBFT.Prelude open import LibraBFT.Hash open import LibraBFT.Lemmas open import LibraBFT.Base.KVMap open import LibraBFT.Base.PKCS open import LibraBFT.Abstract.Types open EpochConfig open import LibraBFT.Impl.NetworkMsg open import LibraBFT.Impl.Consensus.Types open import LibraBFT.Impl.Util.Crypto open import LibraBFT.Impl.Handle sha256 sha256-cr open import LibraBFT.Concrete.System.Parameters open import LibraBFT.Yasm.Base open import LibraBFT.Yasm.AvailableEpochs using (AvailableEpochs ; lookup'; lookup'') open import LibraBFT.Yasm.System ConcSysParms open import LibraBFT.Yasm.Properties ConcSysParms -- In this module, we define two "implementation obligations" -- (ImplObligationᵢ for i ∈ {1 , 2}), which are predicates over -- reachable states of a system defined by -- 'LibraBFT.Concrete.System.Parameters'. These two properties relate -- votes sent by the same sender, ensuring that if they are for the -- same epoch and round, then they vote for the same blockID; the -- first relates a vote output by the handler to a vote sent -- previously, and the second relates two votes both sent by the -- handler. -- -- We then prove that, if an implementation satisfies these two -- semantic obligations, along with a structural one about messages -- sent by honest peers in the implementation, then the implemenation -- satisfies the LibraBFT.Abstract.Properties.VotesOnce invariant. module LibraBFT.Concrete.Properties.VotesOnce where -- TODO-3: This may not be the best way to state the implementation obligation. Why not reduce -- this as much as possible before giving the obligation to the implementation? For example, this -- will still require the implementation to deal with hash collisons (v and v' could be different, -- but yield the same bytestring and therefore same signature). Also, avoid the need for the -- implementation to reason about messages sent by step-cheat, or give it something to make this -- case easy to eliminate. ImplObligation₁ : Set₁ ImplObligation₁ = ∀{e pid sndr s' outs pk}{pre : SystemState e} → ReachableSystemState pre -- For any honest call to /handle/ or /init/, → StepPeerState pid (availEpochs pre) (msgPool pre) (Map-lookup pid (peerStates pre)) s' outs → ∀{v m v' m'} → Meta-Honest-PK pk -- For signed every vote v of every outputted message → v ⊂Msg m → m ∈ outs → (sig : WithVerSig pk v) -- If v is really new and valid -- Note that this does not directly exclude possibility of previous message with -- same signature, but sent by someone else. We could prove it implies it though. → ¬ (MsgWithSig∈ pk (ver-signature sig) (msgPool pre)) → ValidPartForPK (availEpochs pre) v pk -- And if there exists another v' that has been sent before → v' ⊂Msg m' → (sndr , m') ∈ (msgPool pre) → WithVerSig pk v' -- If v and v' share the same epoch and round → (v ^∙ vEpoch) ≡ (v' ^∙ vEpoch) → (v ^∙ vProposed ∙ biRound) ≡ (v' ^∙ vProposed ∙ biRound) ---------------------------------------------------------- -- Then an honest implemenation promises v and v' vote for the same blockId. → (v ^∙ vProposed ∙ biId) ≡ (v' ^∙ vProposed ∙ biId) ImplObligation₂ : Set₁ ImplObligation₂ = ∀{e pid s' outs pk}{pre : SystemState e} → ReachableSystemState pre -- For any honest call to /handle/ or /init/, → StepPeerState pid (availEpochs pre) (msgPool pre) (Map-lookup pid (peerStates pre)) s' outs → ∀{v m v' m'} → Meta-Honest-PK pk -- For every vote v represented in a message output by the call → v ⊂Msg m → m ∈ outs → (sig : WithVerSig pk v) -- If v is really new and valid → ¬ (MsgWithSig∈ pk (ver-signature sig) (msgPool pre)) → ValidPartForPK (availEpochs pre) v pk -- And if there exists another v' that is also new and valid → v' ⊂Msg m' → m' ∈ outs → (sig' : WithVerSig pk v') → ¬ (MsgWithSig∈ pk (ver-signature sig') (msgPool pre)) → ValidPartForPK (availEpochs pre) v' pk -- If v and v' share the same epoch and round → (v ^∙ vEpoch) ≡ (v' ^∙ vEpoch) → (v ^∙ vProposed ∙ biRound) ≡ (v' ^∙ vProposed ∙ biRound) ---------------------------------------------------------- -- Then, an honest implemenation promises v and v' vote for the same blockId. → (v ^∙ vProposed ∙ biId) ≡ (v' ^∙ vProposed ∙ biId) -- Next, we prove that, given the necessary obligations, module Proof (sps-corr : StepPeerState-AllValidParts) (Impl-VO1 : ImplObligation₁) (Impl-VO2 : ImplObligation₂) where -- Any reachable state satisfies the VO rule for any epoch in the system. module _ {e}(st : SystemState e)(r : ReachableSystemState st)(eid : Fin e) where -- Bring in 'unwind', 'ext-unforgeability' and friends open Structural sps-corr -- Bring in ConcSystemState open import LibraBFT.Concrete.System sps-corr open PerState st r open PerEpoch eid open import LibraBFT.Abstract.Obligations.VotesOnce 𝓔 Hash _≟Hash_ (ConcreteVoteEvidence 𝓔) as VO -- The VO proof is done by induction on the execution trace leading to 'st'. In -- Agda, this is 'r : RechableSystemState st' above. We will use induction to -- construct a predicate Pred'' below, which holds for every state on the trace. private -- First we specify the predicate we need: it relates two votes verified -- by the same public key, such that both are elements of the same message pool Pred'' : PK → Vote → Vote → SentMessages → Set Pred'' pk v v' pool = Meta-Honest-PK pk → (ver : WithVerSig pk v) → MsgWithSig∈ pk (ver-signature ver) pool → (ver' : WithVerSig pk v') → MsgWithSig∈ pk (ver-signature ver') pool → v ^∙ vEpoch ≡ v' ^∙ vEpoch → v ^∙ vRound ≡ v' ^∙ vRound → v ^∙ vProposedId ≡ v' ^∙ vProposedId -- Usually, we want to universally quantify Pred'' over arbitrary votes and pks Pred' : SentMessages → Set Pred' pool = ∀{pk}{v v' : Vote} → Pred'' pk v v' pool -- Finally, we state Pred' in terms of SystemSate Pred : ∀{e} → SystemState e → Set Pred = Pred' ∘ msgPool ------------------- -- * Base Case * -- ------------------- -- Pred above is trivially true for the initial state: there are no messages in the pool Pred₀ : Pred initialState Pred₀ _ _ () -------------------------------------------------- -- * Inductive Case: New Epochs in the System * -- -------------------------------------------------- -- Because pushEpoch does not alter the msgPool, the proof is trivial. Pred𝓔 : ∀{e}{st : SystemState e}(𝓔 : EpochConfigFor e) → Pred st → Pred (pushEpoch 𝓔 st) Pred𝓔 𝓔 p = p ---------------------------------------------- -- * Inductive Case: Transition by a Peer * -- ---------------------------------------------- -- From this point onwards, it might be easier to read this proof starting at 'voo' -- at the end of the file. Next, we provide an overview the proof. -- -- We wish to prove that, for any two votes v and v' cast by an honest α in the message pool of -- a state st, if v and v' have equal rounds and epochs, then they vote for the same block. As -- we have seen above, the base case and the case for a new epoch in the system are -- trivial. Next, we look at the PeerStep case. -- -- The induction hypothesis tells us that the property holds in the pre-state. Next, we reason -- about the post-state. We start by analyzing whether v and v' have been sent as outputs of -- the PeerStep under scrutiny or were already in the pool before (captured by the PredStep -- function). There are four possibilities: -- -- i) v and v' were aleady present in the msgPool before: use induction hypothesis. -- ii) v and v' are both in the output produced by the PeerStep under scrutiny. -- iii) v was present before, but v' is new. -- iv) v' was present before, but v is new. -- -- Case (i) is trivial; cases (iii) and (iv) are symmetric and reduce to an implementation -- obligation (Impl-VO1) and case (ii) reduces to a different implementation obligation (Impl-VO2). -- -- The proofs of cases (iii) and (iv) are in PredStep-wlog-ht and PredStep-wlog-ht'. The 'ht' -- suffix refers to 'Here-There' as in one vote is "here" and the other is old, or "there". We -- first analyze whether the new vote is really new or a replay; sps-cor provides us this -- information. If the new vote is, in fact, a replay of an old message, we have two old -- messages and can call the induction hypothesis. If it is really new, we must rely on the -- implementation obligation. But to do so, we must prove that the old vote was also sent by -- the same peer. We can see that is the case by reasoning about PK-inj and IsValidEpochMember. -- -- Finally, the proof of case (ii) also branches on whether either of the "new" votes -- are replays or are really new. In case at least one is a replay we fallback to cases (iii) and (iv) -- or just call the induction hypothesis when both are replays. -- When both votes are in fact new, we rely on Impl-VO2 to conclude. -- -- In both PredSetp-wlog-ht and PredStep-wlog-hh, we must eliminate the possibility of -- either vote being produced by a cheat step. This is easy because we received -- a proof that the PK in question is honest, hence, it must be the case that a cheat -- step is at most replaying these votes, not producing them. Producing them would -- require the cheater to forge a signature. This is the purpose of the isCheat constraint. PredStep-wlog-ht' : ∀{e pid pid' s' outs pk}{pre : SystemState e} → ReachableSystemState pre → Pred pre → StepPeerState pid (availEpochs pre) (msgPool pre) (Map-lookup pid (peerStates pre)) s' outs → ∀{v m v' m'} → v ⊂Msg m → m ∈ outs → v' ⊂Msg m' → (pid' , m') ∈ msgPool pre → WithVerSig pk v → WithVerSig pk v' → Meta-Honest-PK pk → (v ^∙ vEpoch) ≡ (v' ^∙ vEpoch) → (v ^∙ vProposed ∙ biRound) ≡ (v' ^∙ vProposed ∙ biRound) → (v ^∙ vProposed ∙ biId) ≡ (v' ^∙ vProposed ∙ biId) PredStep-wlog-ht' {pre = pre} preach hip ps {v} v⊂m m∈outs v'⊂m' m'∈pool ver ver' hpk eids≡ r≡ -- (1) The first step is branching on whether 'v' above is a /new/ vote or not. -- (1.1) If it's new: with sps-corr preach hpk ps m∈outs v⊂m ver ...| inj₁ (vValid , vNew) with honestPartValid preach hpk v'⊂m' m'∈pool ver' ...| v'Old , vOldValid with sameHonestSig⇒sameVoteData hpk ver' (msgSigned v'Old) (sym (msgSameSig v'Old)) ...| inj₁ abs = ⊥-elim (meta-sha256-cr abs) ...| inj₂ refl = Impl-VO1 preach ps hpk v⊂m m∈outs ver vNew vValid (msg⊆ v'Old) (msg∈pool v'Old) (msgSigned v'Old) eids≡ r≡ -- (1.1) If 'v' is not new, then there exists a msg sent with the -- same signature. PredStep-wlog-ht' preach hip ps {v} v⊂m m∈outs v'⊂m' m'∈pool ver ver' hpk e≡ r≡ | inj₂ vOld with honestPartValid preach hpk v'⊂m' m'∈pool ver' ...| sv' , _ = hip hpk ver vOld ver' sv' e≡ r≡ -- Here we prove a modified version of Pred'' where we assume w.l.o.g that -- one vote is sent by "pstep" and another was present in the prestate. PredStep-wlog-ht : ∀{e pid st' outs}{pre : SystemState e} → ReachableSystemState pre → (pstep : StepPeer pre pid st' outs) → Pred pre → ∀{pk v v'} -- Below is a inline expansion of "Pred'' pk v v' (msgPool (StepPeer-post pstep))", -- but with the added information that one vote (v) was sent by pstep whereas the -- other (v') was in the pool of the prestate. → let pool = msgPool (StepPeer-post pstep) in Meta-Honest-PK pk → (ver : WithVerSig pk v )(sv : MsgWithSig∈ pk (ver-signature ver ) pool) → (msgSender sv , msgWhole sv) ∈ List-map (pid ,_) outs → (ver' : WithVerSig pk v')(sv' : MsgWithSig∈ pk (ver-signature ver') pool) → (msgSender sv' , msgWhole sv') ∈ msgPool pre → v ^∙ vEpoch ≡ v' ^∙ vEpoch → v ^∙ vRound ≡ v' ^∙ vRound → v ^∙ vProposedId ≡ v' ^∙ vProposedId PredStep-wlog-ht preach (step-cheat fm isCheat) hip hpk ver sv (here refl) ver' sv' furtherBack' epoch≡ r≡ with isCheat (msg⊆ sv) (msgSigned sv) ...| inj₁ abs = ⊥-elim (hpk abs) -- The key was honest by hypothesis. ...| inj₂ sentb4 -- the cheater replayed the message; which means the message was sent before this -- step; hence, call induction hypothesis. with msgSameSig sv ...| refl = hip hpk ver sentb4 ver' (MsgWithSig∈-transp sv' furtherBack') epoch≡ r≡ PredStep-wlog-ht preach (step-honest x) hip hpk ver sv thisStep ver' sv' furtherBack' epoch≡ r≡ with sameHonestSig⇒sameVoteData hpk ver (msgSigned sv) (sym (msgSameSig sv)) ...| inj₁ abs = ⊥-elim (meta-sha256-cr abs) ...| inj₂ refl with sameHonestSig⇒sameVoteData hpk ver' (msgSigned sv') (sym (msgSameSig sv')) ...| inj₁ abs = ⊥-elim (meta-sha256-cr abs) ...| inj₂ refl = PredStep-wlog-ht' preach hip x (msg⊆ sv) (Any-map (cong proj₂) (Any-map⁻ thisStep)) (msg⊆ sv') furtherBack' (msgSigned sv) (msgSigned sv') hpk epoch≡ r≡ -- Analogous to PredStep-wlog-ht', but here we must reason about two messages that are in the -- outputs of a step. PredStep-hh' : ∀{e pid s' outs pk}{pre : SystemState e} → ReachableSystemState pre → Pred pre → StepPeerState pid (availEpochs pre) (msgPool pre) (Map-lookup pid (peerStates pre)) s' outs → ∀{v m v' m'} → v ⊂Msg m → m ∈ outs → v' ⊂Msg m' → m' ∈ outs → WithVerSig pk v → WithVerSig pk v' → Meta-Honest-PK pk → (v ^∙ vEpoch) ≡ (v' ^∙ vEpoch) → (v ^∙ vProposed ∙ biRound) ≡ (v' ^∙ vProposed ∙ biRound) → (v ^∙ vProposed ∙ biId) ≡ (v' ^∙ vProposed ∙ biId) -- Since the step is from an honest peer, we can check whether the messages are in fact -- new or not. PredStep-hh' preach hip ps {v} v⊂m m∈outs v'⊂m' m'∈outs ver ver' hpk e≡ r≡ with sps-corr preach hpk ps m∈outs v⊂m ver | sps-corr preach hpk ps m'∈outs v'⊂m' ver' -- (A) Both are old: call induction hypothesis ...| inj₂ vOld | inj₂ v'Old = hip hpk ver vOld ver' v'Old e≡ r≡ -- (B) One is new, one is old: use PredStep-wlog-ht' PredStep-hh' preach hip ps {v} v⊂m m∈outs v'⊂m' m'∈outs ver ver' hpk e≡ r≡ | inj₁ (vValid , vNew) | inj₂ v'Old with sameHonestSig⇒sameVoteData hpk ver' (msgSigned v'Old) (sym (msgSameSig v'Old)) ...| inj₁ abs = ⊥-elim (meta-sha256-cr abs) ...| inj₂ refl = PredStep-wlog-ht' preach hip ps v⊂m m∈outs (msg⊆ v'Old) (msg∈pool v'Old) ver (msgSigned v'Old) hpk e≡ r≡ -- (C) One is old, one is new: use PredStep-wlog-ht' PredStep-hh' preach hip ps {v} v⊂m m∈outs v'⊂m' m'∈outs ver ver' hpk e≡ r≡ | inj₂ vOld | inj₁ (v'Valid , v'New) with sameHonestSig⇒sameVoteData hpk ver (msgSigned vOld) (sym (msgSameSig vOld)) ...| inj₁ abs = ⊥-elim (meta-sha256-cr abs) ...| inj₂ refl = sym (PredStep-wlog-ht' preach hip ps v'⊂m' m'∈outs (msg⊆ vOld) (msg∈pool vOld) ver' (msgSigned vOld) hpk (sym e≡) (sym r≡)) -- (D) Finally, both votes are new in this step. The proof is then trivially -- forwarded to the implementation obligation. PredStep-hh' preach hip ps {v} v⊂m m∈outs v'⊂m' m'∈outs ver ver' hpk e≡ r≡ | inj₁ (vValid , vNew) | inj₁ (v'Valid , v'New) = Impl-VO2 preach ps hpk v⊂m m∈outs ver vNew vValid v'⊂m' m'∈outs ver' v'New v'Valid e≡ r≡ PredStep-hh : ∀{e pid st' outs}{pre : SystemState e} → ReachableSystemState pre → (pstep : StepPeer pre pid st' outs) → Pred pre → ∀{pk v v'} → let pool = msgPool (StepPeer-post pstep) in Meta-Honest-PK pk → (ver : WithVerSig pk v )(sv : MsgWithSig∈ pk (ver-signature ver ) pool) → (msgSender sv , msgWhole sv) ∈ List-map (pid ,_) outs → (ver' : WithVerSig pk v')(sv' : MsgWithSig∈ pk (ver-signature ver') pool) → (msgSender sv' , msgWhole sv') ∈ List-map (pid ,_) outs → v ^∙ vEpoch ≡ v' ^∙ vEpoch → v ^∙ vRound ≡ v' ^∙ vRound → v ^∙ vProposedId ≡ v' ^∙ vProposedId PredStep-hh preach (step-cheat fm isCheat) hip hpk ver sv (here refl) ver' sv' (here refl) epoch≡ r≡ with isCheat (msg⊆ sv) (msgSigned sv) ...| inj₁ abs = ⊥-elim (hpk abs) -- The key was honest by hypothesis. ...| inj₂ sentb4 with isCheat (msg⊆ sv') (msgSigned sv') ...| inj₁ abs = ⊥-elim (hpk abs) -- The key was honest by hypothesis. ...| inj₂ sentb4' with msgSameSig sv | msgSameSig sv' ...| refl | refl = hip hpk ver sentb4 ver' sentb4' epoch≡ r≡ PredStep-hh preach (step-honest x) hip hpk ver sv thisStep ver' sv' thisStep' epoch≡ r≡ with sameHonestSig⇒sameVoteData hpk ver (msgSigned sv) (sym (msgSameSig sv)) ...| inj₁ abs = ⊥-elim (meta-sha256-cr abs) ...| inj₂ refl with sameHonestSig⇒sameVoteData hpk ver' (msgSigned sv') (sym (msgSameSig sv')) ...| inj₁ abs = ⊥-elim (meta-sha256-cr abs) ...| inj₂ refl = PredStep-hh' preach hip x (msg⊆ sv ) (Any-map (cong proj₂) (Any-map⁻ thisStep)) (msg⊆ sv') (Any-map (cong proj₂) (Any-map⁻ thisStep')) (msgSigned sv) (msgSigned sv') hpk epoch≡ r≡ PredStep : ∀{e pid st' outs}{pre : SystemState e} → ReachableSystemState pre → (pstep : StepPeer pre pid st' outs) → Pred pre → Pred (StepPeer-post pstep) PredStep {e} {pid} {st'} {outs} {pre} preach pstep hip hpk ver sv ver' sv' epoch≡ r≡ -- First we check when have the votes been sent: with Any-++⁻ (List-map (pid ,_) outs) {msgPool pre} (msg∈pool sv) | Any-++⁻ (List-map (pid ,_) outs) {msgPool pre} (msg∈pool sv') -- (A) Neither vote has been sent by the step under scrutiny: invoke inductive hypothesis ...| inj₂ furtherBack | inj₂ furtherBack' = hip hpk ver (MsgWithSig∈-transp sv furtherBack) ver' (MsgWithSig∈-transp sv' furtherBack') epoch≡ r≡ -- (B) One vote was cast here; the other was cast in the past. PredStep {e} {pid} {st'} {outs} {pre} preach pstep hip hpk ver sv ver' sv' epoch≡ r≡ | inj₁ thisStep | inj₂ furtherBack' = PredStep-wlog-ht preach pstep hip hpk ver sv thisStep ver' sv' furtherBack' epoch≡ r≡ -- (C) Symmetric to (B) PredStep {e} {pid} {st'} {outs} {pre} preach pstep hip hpk ver sv ver' sv' epoch≡ r≡ | inj₂ furtherBack | inj₁ thisStep' = sym (PredStep-wlog-ht preach pstep hip hpk ver' sv' thisStep' ver sv furtherBack (sym epoch≡) (sym r≡)) -- (D) Both votes were cast here PredStep {e} {pid} {st'} {outs} {pre} preach pstep hip hpk ver sv ver' sv' epoch≡ r≡ | inj₁ thisStep | inj₁ thisStep' = PredStep-hh preach pstep hip hpk ver sv thisStep ver' sv' thisStep' epoch≡ r≡ voo : VO.Type ConcSystemState voo hpk refl sv refl sv' round≡ with Step*-Step-fold Pred (λ {e} {st} _ → Pred𝓔 {e} {st}) PredStep Pred₀ r ...| res with vmsg≈v (vmFor sv) | vmsg≈v (vmFor sv') ...| refl | refl = res hpk (vmsgSigned (vmFor sv)) (mkMsgWithSig∈ (nm (vmFor sv)) (cv (vmFor sv)) (cv∈nm (vmFor sv)) _ (nmSentByAuth sv) (vmsgSigned (vmFor sv)) refl) (vmsgSigned (vmFor sv')) (mkMsgWithSig∈ (nm (vmFor sv')) (cv (vmFor sv')) (cv∈nm (vmFor sv')) _ (nmSentByAuth sv') (vmsgSigned (vmFor sv')) refl) (trans (vmsgEpoch (vmFor sv)) (sym (vmsgEpoch (vmFor sv')))) round≡
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/sso/t1.adb
best08618/asylo
7
2367
<gh_stars>1-10 -- { dg-do run } with Init1; use Init1; with Text_IO; use Text_IO; with Dump; procedure T1 is Local_R1 : R1; Local_R2 : R2; begin Local_R1.I := My_R1.I + 1; Put ("Local_R1 :"); Dump (Local_R1'Address, R1'Max_Size_In_Storage_Elements); New_Line; -- { dg-output "Local_R1 : 79 56 34 12.*\n" } Local_R2.I := My_R2.I + 1; Put ("Local_R2 :"); Dump (Local_R2'Address, R2'Max_Size_In_Storage_Elements); New_Line; -- { dg-output "Local_R2 : 12 34 56 79.*\n" } Local_R1.I := 16#12345678#; Put ("Local_R1 :"); Dump (Local_R1'Address, R1'Max_Size_In_Storage_Elements); New_Line; -- { dg-output "Local_R1 : 78 56 34 12.*\n" } Local_R2.I := 16#12345678#; Put ("Local_R2 :"); Dump (Local_R2'Address, R2'Max_Size_In_Storage_Elements); New_Line; -- { dg-output "Local_R2 : 12 34 56 78.*\n" } Local_R1.I := Local_R1.I + 1; Put ("Local_R1 :"); Dump (Local_R1'Address, R1'Max_Size_In_Storage_Elements); New_Line; -- { dg-output "Local_R1 : 79 56 34 12.*\n" } Local_R2.I := Local_R2.I + 1; Put ("Local_R2 :"); Dump (Local_R2'Address, R2'Max_Size_In_Storage_Elements); New_Line; -- { dg-output "Local_R2 : 12 34 56 79.*\n" } end;
electrum/src/main/resources/models/util/time.als
haslab/Electrum
29
4278
<gh_stars>10-100 open util/ordering[Time] sig Time { } let dynamic[x] = x one-> Time let dynamicSet[x] = x -> Time let then [a, b, t, t2] { some x:Time | a[t,x] && b[x,t2] } let while = while3 let while9 [cond, body, t, t2] { some x:Time | (cond[t] => body[t,x] else t=x) && while8[cond,body,x,t2] } let while8 [cond, body, t, t2] { some x:Time | (cond[t] => body[t,x] else t=x) && while7[cond,body,x,t2] } let while7 [cond, body, t, t2] { some x:Time | (cond[t] => body[t,x] else t=x) && while6[cond,body,x,t2] } let while6 [cond, body, t, t2] { some x:Time | (cond[t] => body[t,x] else t=x) && while5[cond,body,x,t2] } let while5 [cond, body, t, t2] { some x:Time | (cond[t] => body[t,x] else t=x) && while4[cond,body,x,t2] } let while4 [cond, body, t, t2] { some x:Time | (cond[t] => body[t,x] else t=x) && while3[cond,body,x,t2] } let while3 [cond, body, t, t2] { some x:Time | (cond[t] => body[t,x] else t=x) && while2[cond,body,x,t2] } let while2 [cond, body, t, t2] { some x:Time | (cond[t] => body[t,x] else t=x) && while1[cond,body,x,t2] } let while1 [cond, body, t, t2] { some x:Time | (cond[t] => body[t,x] else t=x) && while0[cond,body,x,t2] } let while0 [cond, body, t, t2] { !cond[t] && t=t2 }
StandardHandlesLab/StandardHandlesLab/Debug/StandardHandleState.asm
txwizard/DLLServices2
1
241827
; Listing generated by Microsoft (R) Optimizing Compiler Version 18.00.31101.0 TITLE C:\Users\DAVE\Documents\Visual Studio 2013\Projects\WizardWrx_Libs\DLLServices2\StandardHandlesLab\StandardHandlesLab\StandardHandleState.C .686P .XMM include listing.inc .model flat INCLUDELIB MSVCRTD INCLUDELIB OLDNAMES _DATA SEGMENT _dwStdConsoleHandleIDs DD 0ffffffffH DD 0fffffff6H DD 0fffffff5H DD 0fffffff4H DD 0ffffffffH _DATA ENDS PUBLIC _SHS_StandardHandleState@4 EXTRN __imp__GetStdHandle@4:PROC EXTRN __imp__GetLastError@0:PROC EXTRN __imp__SetLastError@4:PROC EXTRN __imp__GetConsoleMode@8:PROC EXTRN @_RTC_CheckStackVars@8:PROC EXTRN __RTC_CheckEsp:PROC EXTRN __RTC_InitBase:PROC EXTRN __RTC_Shutdown:PROC ; COMDAT rtc$TMZ rtc$TMZ SEGMENT __RTC_Shutdown.rtc$TMZ DD FLAT:__RTC_Shutdown rtc$TMZ ENDS ; COMDAT rtc$IMZ rtc$IMZ SEGMENT __RTC_InitBase.rtc$IMZ DD FLAT:__RTC_InitBase rtc$IMZ ENDS ; Function compile flags: /Odtp /RTCsu /ZI ; File c:\users\dave\documents\visual studio 2013\projects\wizardwrx_libs\dllservices2\standardhandleslab\standardhandleslab\standardhandlestate.c ; COMDAT _SHS_StandardHandleState@4 _TEXT SEGMENT tv64 = -220 ; size = 4 _dwModde$ = -20 ; size = 4 _hThis$ = -8 ; size = 4 _penmStdHandleID$ = 8 ; size = 4 _SHS_StandardHandleState@4 PROC ; COMDAT ; 97 : { push ebp mov ebp, esp sub esp, 220 ; 000000dcH push ebx push esi push edi lea edi, DWORD PTR [ebp-220] mov ecx, 55 ; 00000037H mov eax, -858993460 ; ccccccccH rep stosd ; 98 : HANDLE hThis ; // The first use of this variable initializes it. ; 99 : DWORD dwModde ; // The first use of this variable initializes it, AND it's a throwaway. ; 100 : ; 101 : switch ( penmStdHandleID ) mov eax, DWORD PTR _penmStdHandleID$[ebp] mov DWORD PTR tv64[ebp], eax cmp DWORD PTR tv64[ebp], 0 je SHORT $LN9@SHS_Standa cmp DWORD PTR tv64[ebp], 0 jle $LN1@SHS_Standa cmp DWORD PTR tv64[ebp], 3 jle SHORT $LN8@SHS_Standa jmp $LN1@SHS_Standa $LN9@SHS_Standa: ; 102 : { ; 103 : case SHS_UNDEFINED : // Argument penmStdHandleID is uninitialized. ; 104 : return SHS_UNDETERMINABLE; xor eax, eax jmp $LN12@SHS_Standa $LN8@SHS_Standa: ; 105 : ; 106 : case SHS_INPUT : ; 107 : case SHS_OUTPUT : ; 108 : case SHS_ERROR : ; 109 : if ( ( hThis = GetStdHandle ( dwStdConsoleHandleIDs [ ( int ) penmStdHandleID ] ) ) != INVALID_HANDLE_VALUE ) mov esi, esp mov eax, DWORD PTR _penmStdHandleID$[ebp] mov ecx, DWORD PTR _dwStdConsoleHandleIDs[eax*4] push ecx call DWORD PTR __imp__GetStdHandle@4 cmp esi, esp call __RTC_CheckEsp mov DWORD PTR _hThis$[ebp], eax cmp DWORD PTR _hThis$[ebp], -1 je SHORT $LN7@SHS_Standa ; 110 : { ; 111 : if ( GetConsoleMode ( hThis , &dwModde ) ) mov esi, esp lea eax, DWORD PTR _dwModde$[ebp] push eax mov ecx, DWORD PTR _hThis$[ebp] push ecx call DWORD PTR __imp__GetConsoleMode@8 cmp esi, esp call __RTC_CheckEsp test eax, eax je SHORT $LN6@SHS_Standa ; 112 : { ; 113 : return SHS_ATTACHED; mov eax, 1 jmp SHORT $LN12@SHS_Standa ; 114 : } // TRUE (Handle is attached to its console.) block, if ( GetConsoleMode ( hThis , &dwModde ) ) ; 115 : else jmp SHORT $LN5@SHS_Standa $LN6@SHS_Standa: ; 116 : { ; 117 : if ( GetLastError ( ) == ERROR_INVALID_HANDLE ) mov esi, esp call DWORD PTR __imp__GetLastError@0 cmp esi, esp call __RTC_CheckEsp cmp eax, 6 jne SHORT $LN4@SHS_Standa ; 118 : { ; 119 : SetLastError ( ERROR_SUCCESS ); mov esi, esp push 0 call DWORD PTR __imp__SetLastError@4 cmp esi, esp call __RTC_CheckEsp ; 120 : return SHS_REDIRECTED; mov eax, 2 jmp SHORT $LN12@SHS_Standa ; 121 : } // TRUE (anticipated outcome) block, if ( GetLastError ( ) == ERROR_INVALID_HANDLE ) ; 122 : else jmp SHORT $LN5@SHS_Standa $LN4@SHS_Standa: ; 123 : { ; 124 : return SHS_SYSTEM_ERROR; mov eax, 3 jmp SHORT $LN12@SHS_Standa $LN5@SHS_Standa: ; 125 : } // FALSE (UNanticipated outcome) block, if ( GetLastError ( ) == ERROR_INVALID_HANDLE ) ; 126 : } // FALSE (Handle is redirected from its console into a file or pipe.) block, if ( GetConsoleMode ( hThis , &dwModde ) ) ; 127 : } // TRUE (anticipated outcome) block, if ( ( hThis = GetStdHandle ( dwStdConsoleHandleIDs [ ( int ) penmStdHandleID ] ) ) != INVALID_HANDLE_VALUE ) ; 128 : else jmp SHORT $LN1@SHS_Standa $LN7@SHS_Standa: ; 129 : { ; 130 : return SHS_SYSTEM_ERROR; mov eax, 3 jmp SHORT $LN12@SHS_Standa $LN1@SHS_Standa: ; 131 : } // FALSE (UNanticipated outcome) block, if ( ( hThis = GetStdHandle ( dwStdConsoleHandleIDs [ ( int ) penmStdHandleID ] ) ) != INVALID_HANDLE_VALUE ) ; 132 : ; 133 : default: // Argument penmStdHandleID is out of range. ; 134 : return SHS_SYSTEM_ERROR; mov eax, 3 $LN12@SHS_Standa: ; 135 : } // switch ( penmStdHandleID ) ; 136 : } // SHS_HANDLE_STATE SHS_STANDARDHANDLESTATE_API SHS_StandardHandleState push edx mov ecx, ebp push eax lea edx, DWORD PTR $LN16@SHS_Standa call @_RTC_CheckStackVars@8 pop eax pop edx pop edi pop esi pop ebx add esp, 220 ; 000000dcH cmp ebp, esp call __RTC_CheckEsp mov esp, ebp pop ebp ret 4 npad 1 $LN16@SHS_Standa: DD 1 DD $LN15@SHS_Standa $LN15@SHS_Standa: DD -20 ; ffffffecH DD 4 DD $LN14@SHS_Standa $LN14@SHS_Standa: DB 100 ; 00000064H DB 119 ; 00000077H DB 77 ; 0000004dH DB 111 ; 0000006fH DB 100 ; 00000064H DB 100 ; 00000064H DB 101 ; 00000065H DB 0 _SHS_StandardHandleState@4 ENDP _TEXT ENDS END
gfx/pokemon/wurmple/anim.asm
Ebernacher90/pokecrystal-allworld
0
243161
setrepeat 2 frame 1, 12 frame 2, 08 frame 3, 08 dorepeat 1 endanim
Library/Config/Toc/tocManager.asm
steakknife/pcgeos
504
2200
<reponame>steakknife/pcgeos COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1992 -- All Rights Reserved PROJECT: PC GEOS MODULE: FILE: tocManager.asm AUTHOR: <NAME> ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- CDB 5/ 6/92 Initial version. DESCRIPTION: Routines to deal with the TOC file $Id: tocManager.asm,v 1.1 97/04/04 17:50:56 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ include configGeode.def include tocVariables.def include tocConstants.def TocCode segment resource include tocCategory.asm include tocDB.asm include tocDisk.asm include tocSortedNameArray.asm include tocOpenClose.asm include tocUtils.asm TocCode ends
libsrc/_DEVELOPMENT/alloc/obstack/c/sdcc_iy/obstack_1grow_fast_callee.asm
jpoikela/z88dk
640
102410
<reponame>jpoikela/z88dk ; void *obstack_1grow_fast_callee(struct obstack *ob, char c) SECTION code_clib SECTION code_alloc_obstack PUBLIC _obstack_1grow_fast_callee, l0_obstack_1grow_fast_callee EXTERN asm_obstack_1grow_fast _obstack_1grow_fast_callee: pop af pop hl pop de push af l0_obstack_1grow_fast_callee: ld a,e jp asm_obstack_1grow_fast
oeis/049/A049626.asm
neoneye/loda-programs
11
170775
<reponame>neoneye/loda-programs ; A049626: a(n) = T(n,4), array T as in A049615. ; Submitted by <NAME>(s3) ; 3,3,6,8,11,12,16,17,20,22,25,26,30,31,34,36,39,40,44,45,48,50,53,54,58,59,62,64,67,68,72,73,76,78,81,82,86,87,90,92,95,96,100,101,104,106,109,110,114,115,118,120,123,124,128,129,132,134,137,138,142 mul $0,3 div $0,2 mul $0,14 div $0,9 trn $0,1 add $0,3
src/Control/Functor/Product.agda
andreasabel/cubical
0
13828
<reponame>andreasabel/cubical -- Product of functors module Control.Functor.Product where open import Function using (id) renaming (_∘′_ to _∘_) open import Data.Product using (_×_; _,_; proj₁; proj₂; <_,_>) open import Relation.Binary.PropositionalEquality open ≡-Reasoning open import Control.Functor _×̂_ : Functor → Functor → Functor FF ×̂ GG = functor (λ X → F X × G X) record { ops = record { map = map } ; laws = record { map-id = map-id ; map-∘ = λ {A}{B}{C}{f}{g} → map-∘ f g } } where open Functor FF using () renaming (F to F; map to mapF; map-id to mapF-id; map-∘ to mapF-∘) open Functor GG using () renaming (F to G; map to mapG; map-id to mapG-id; map-∘ to mapG-∘) map : ∀ {A B : Set} (f : A → B) (p : F A × G A) → F B × G B map f = < mapF f ∘ proj₁ , mapG f ∘ proj₂ > map-id : ∀ {A : Set} → map {A = A} id ≡ id map-id = begin map id ≡⟨⟩ < mapF id ∘ proj₁ , mapG id ∘ proj₂ > ≡⟨ cong (λ z → < z ∘ proj₁ , _ >) mapF-id ⟩ < proj₁ , mapG id ∘ proj₂ > ≡⟨ cong (λ z → < _ , z ∘ proj₂ >) mapG-id ⟩ < proj₁ , proj₂ > ≡⟨⟩ id ∎ map-∘ : ∀ {A B C : Set} (f : A → B) (g : B → C) → map (g ∘ f) ≡ map g ∘ map f map-∘ f g = begin map (g ∘ f) ≡⟨⟩ < mapF (g ∘ f) ∘ proj₁ , mapG (g ∘ f) ∘ proj₂ > ≡⟨ cong (λ z → < z ∘ proj₁ , _ >) mapF-∘ ⟩ < mapF g ∘ mapF f ∘ proj₁ , mapG (g ∘ f) ∘ proj₂ > ≡⟨ cong (λ z → < mapF g ∘ _ , z ∘ proj₂ >) mapG-∘ ⟩ < mapF g ∘ mapF f ∘ proj₁ , mapG g ∘ mapG f ∘ proj₂ > ≡⟨⟩ map g ∘ map f ∎
src/cedille-options.agda
ice1k/cedille
0
16750
module cedille-options where open import general-util open import options-types public open import cedille-types record options : Set where constructor mk-options field include-path : 𝕃 string × stringset use-cede-files : 𝔹 make-rkt-files : 𝔹 generate-logs : 𝔹 show-qualified-vars : 𝔹 erase-types : 𝔹 datatype-encoding : maybe (filepath × maybe file) pretty-print-columns : ℕ -- Internal use only during-elaboration : 𝔹 pretty-print : 𝔹 show-progress-updates : 𝔹 default-options : options default-options = record { include-path = [] , empty-stringset; use-cede-files = tt; make-rkt-files = ff; generate-logs = ff; show-qualified-vars = ff; erase-types = tt; datatype-encoding = nothing; pretty-print-columns = 80; during-elaboration = ff; pretty-print = ff ; show-progress-updates = ff} include-path-insert : string → 𝕃 string × stringset → 𝕃 string × stringset include-path-insert s (l , ss) = if stringset-contains ss s then l , ss else s :: l , stringset-insert ss s options-to-rope : options → rope options-to-rope ops = comment "Cedille Options File" ⊹⊹ [[ "\n" ]] ⊹⊹ comment "List of directories to search for imported files in" ⊹⊹ comment "Each directory should be space-delimited and inside double quotes" ⊹⊹ comment "The current file's directory is automatically searched first, before import-directories" ⊹⊹ comment "If a filepath is relative, it is considered relative to this options file" ⊹⊹ option "import-directories" (𝕃-to-string (λ fp → "\"" ^ fp ^ "\"") " " (fst (options.include-path ops))) ⊹⊹ comment "Cache navigation spans for performance" ⊹⊹ option "use-cede-files" (𝔹-s options.use-cede-files) ⊹⊹ -- comment "Compile Cedille files to Racket after they are checked"⊹⊹ -- option "make-rkt-files" (𝔹-s options.make-rkt-files) ⊹⊹ comment "Write logs to ~/.cedille/log" ⊹⊹ option "generate-logs" (𝔹-s options.generate-logs) ⊹⊹ comment "Print variables fully qualified" ⊹⊹ option "show-qualified-vars" (𝔹-s options.show-qualified-vars) ⊹⊹ comment "Print types erased" ⊹⊹ option "erase-types" (𝔹-s options.erase-types) ⊹⊹ comment "Preferred number of columns to pretty print elaborated files with" ⊹⊹ option "pretty-print-columns" (ℕ-to-string (options.pretty-print-columns ops)) ⊹⊹ comment "Encoding to use when elaborating datatypes to Cedille Core" ⊹⊹ option "datatype-encoding" (maybe-else' (options.datatype-encoding ops) "" λ fp → "\"" ^ fst fp ^ "\"") where 𝔹-s : (options → 𝔹) → string 𝔹-s f = if f ops then "true" else "false" comment : string → rope comment s = [[ "-- " ]] ⊹⊹ [[ s ]] ⊹⊹ [[ "\n" ]] option : (name : string) → (value : string) → rope option name value = [[ name ]] ⊹⊹ [[ " = " ]] ⊹⊹ [[ value ]] ⊹⊹ [[ ".\n\n" ]]
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_1131.asm
ljhsiun2/medusa
9
14768
<filename>Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_1131.asm .global s_prepare_buffers s_prepare_buffers: push %r11 push %rbp push %rcx push %rdi push %rsi lea addresses_A_ht+0x643, %rsi lea addresses_A_ht+0x1b4c3, %rdi nop cmp %r11, %r11 mov $0, %rcx rep movsq nop nop nop nop and %rbp, %rbp pop %rsi pop %rdi pop %rcx pop %rbp pop %r11 ret .global s_faulty_load s_faulty_load: push %r14 push %r15 push %r8 push %r9 push %rbx push %rcx push %rdx // Store lea addresses_D+0x17baf, %r14 nop nop nop nop nop and $29755, %rbx mov $0x5152535455565758, %r8 movq %r8, %xmm2 movups %xmm2, (%r14) nop cmp $37394, %r14 // Faulty Load lea addresses_WT+0x18cc3, %r8 nop nop xor %r15, %r15 movb (%r8), %dl lea oracles, %r15 and $0xff, %rdx shlq $12, %rdx mov (%r15,%rdx,1), %rdx pop %rdx pop %rcx pop %rbx pop %r9 pop %r8 pop %r15 pop %r14 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_WT', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 2}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_WT', 'same': True, 'AVXalign': False, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 7}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 9}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
Ada/client/src/corbacbsg.ads
FredPraca/distributed_cbsg
4
13077
pragma Style_Checks ("NM32766"); pragma Wide_Character_Encoding (Brackets); --------------------------------------------------- -- This file has been generated automatically from -- cbsg.idl -- by IAC (IDL to Ada Compiler) 20.0w (rev. 90136cd4). --------------------------------------------------- -- NOTE: If you modify this file by hand, your -- changes will be lost when you re-run the -- IDL to Ada compiler. --------------------------------------------------- -- Source: cbsg.idl -- module CorbaCBSG -- { -- struct timestamped_Sentence { -- long timestamp; -- string sentence; -- }; -- -- interface CBSG -- { -- timestamped_Sentence createTimestampedSentence(); -- string createSentence(); -- string createWorkshop(); -- string createShortWorkshop(); -- string createFinancialReport(); -- }; -- }; -- End source: cbsg.idl -- 17 lines --------------------------------------------------- with PolyORB.Std; with CORBA; pragma Elaborate_All (CORBA); package CorbaCBSG is Repository_Id : constant PolyORB.Std.String := "IDL:CorbaCBSG:1.0"; type timestamped_Sentence is record timestamp : CORBA.Long; sentence : CORBA.String; end record; timestamped_Sentence_Repository_Id : constant PolyORB.Std.String := "IDL:CorbaCBSG/timestamped_Sentence:1.0"; end CorbaCBSG;
src/NetCoreCompiler/NetCoreCompiler/Cool.g4
matcom-compilers-2019/cool-compiler-ricardo-gilbert
0
2412
grammar Cool; options{ language = CSharp; } program: (classDefine ';')+ EOF ; classDefine: CLASS TYPE (INHERITS TYPE)? '{' (feature ';')* '}' ; feature: method | property ; method: ID '(' (formal (',' formal)*)* ')' ':' TYPE '{' expr '}' ; property: formal (ASSIGNMENT expr)? ; formal: ID ':' TYPE; /* method argument */ expr: result_expr = expr ('@' TYPE)? '.' ID '(' (expr (',' expr)*)* ')' # dispatchExplicit | ID '(' (expr (',' expr)*)* ')' # dispatchImplicit | 'if' cond = expr 'then' result = expr 'else' else = expr 'fi' # if | 'while' while = expr 'loop' loop = expr 'pool' # while | '{' (expressions+=expr';')+ '}' # block | CASE case_expr = expr OF (formal IMPLY imply_expr = expr ';')+ ESAC # case | NEW TYPE # new | '~' expr # bitcompl | ISVOID expr # isvoid | left = expr op = (MUL | DIV) right = expr # muldiv | left = expr op = (ADD | SUB) right = expr # addsub | left = expr op = (LOW | LOE | EQU) right = expr # comparer | 'not' cond = expr # not | '(' midexp = expr ')' # parens | ID # id | INT # int | STRING # string | value = (TRUE|FALSE) # boolean | var_name = ID ASSIGNMENT var_value = expr # assign | LET property (',' property)* IN expr # letIn ; // key words CLASS : C L A S S ; CASE : C A S E ; ESAC : E S A C; OF : O F; TRUE : 't' R U E ; FALSE : 'f' A L S E ; INHERITS : I N H E R I T S; ISVOID : I S V O I D ; NEW : N E W ; IN : I N ; LET : L E T ; STRING :'"' (ESC | ~ ["\\])* '"'; INT :[0-9]+; TYPE :[A-Z][_0-9A-Za-z]*; ID :[a-z][_0-9A-Za-z]*; ASSIGNMENT :'<-'; IMPLY :'=>'; WHITESPACE: [ \t\r\n\f]+ -> skip; BLOCK_COMMENT : '(*' (BLOCK_COMMENT|.)*? '*)' -> channel(HIDDEN); LINE_COMMENT : '--' .*? '\n' -> channel(HIDDEN); MUL : '*' ; DIV : '/' ; ADD : '+' ; SUB : '-' ; LOW : '<' ; LOE : '<=' ; EQU : '=' ; fragment A: [aA]; fragment C: [cC]; fragment D: [dD]; fragment E: [eE]; fragment F: [fF]; fragment H: [hH]; fragment I: [iI]; fragment L: [lL]; fragment N: [nN]; fragment O: [oO]; fragment P: [pP]; fragment R: [rR]; fragment S: [sS]; fragment T: [tT]; fragment U: [uU]; fragment V: [vV]; fragment W: [wW]; fragment ESC: '\\' (["\\/bfnrt] | UNICODE); fragment UNICODE: 'u' HEX HEX HEX HEX; fragment HEX: [0-9a-fA-F];
Task/Web-scraping/Ada/web-scraping.ada
LaudateCorpus1/RosettaCodeData
1
20288
<gh_stars>1-10 with AWS.Client, AWS.Response, AWS.Resources, AWS.Messages; with Ada.Text_IO, Ada.Strings.Fixed; use Ada, AWS, AWS.Resources, AWS.Messages; procedure Get_UTC_Time is Page : Response.Data; File : Resources.File_Type; Buffer : String (1 .. 1024); Position, Last : Natural := 0; S : Messages.Status_Code; begin Page := Client.Get ("http://tycho.usno.navy.mil/cgi-bin/timer.pl"); S := Response.Status_Code (Page); if S not in Success then Text_IO.Put_Line ("Unable to retrieve data => Status Code :" & Image (S) & " Reason :" & Reason_Phrase (S)); return; end if; Response.Message_Body (Page, File); while not End_Of_File (File) loop Resources.Get_Line (File, Buffer, Last); Position := Strings.Fixed.Index (Source => Buffer (Buffer'First .. Last), Pattern => "UTC"); if Position > 0 then Text_IO.Put_Line (Buffer (5 .. Position + 2)); return; end if; end loop; end Get_UTC_Time;
microcode/microcode.asm
rj45/rj32
28
9107
<filename>microcode/microcode.asm #bits 32 HALT = 1 << 0 ERROR = 1 << 1 JUMP = 1 << 2 ; alu ops ADD = 0 << 3 SUB = 1 << 3 SHR = 2 << 3 SHL = 3 << 3 ASR = 4 << 3 XOR = 5 << 3 AND = 6 << 3 OR = 7 << 3 ; mem ops MEM = 1 << 6 STORE = 1 << 7 ; reg write WRITE = 1 << 8 ; wrmux -- write mux WM_RESULT = 0 << 9 WM_L = 1 << 9 WM_MEMDATA = 2 << 9 WM_R = 3 << 9 ; cond EQ = 1 << 11 NE = 2 << 11 LT = 3 << 11 GE = 4 << 11 LO = 5 << 11 HS = 6 << 11 ; imm bit IMM = 1 << 14 ; flags FL_ACK = 1 << 0 FL_NOP1 = 1 << 1 FL_NOP2 = 1 << 2 #ruledef { done {value} => le( 0`5 @ 0`5 @ 0`3 @ value`19) done => le( 0`5 @ 0`5 @ 0`3 @ 0`19) next {value}, {flags}, {nextt}, {nextf} => le(nextf`5 @ nextt`5 @ flags`3 @ value`19) loop {value}, {nextt} => le(nextt`5 @ nextt`5 @ 0`3 @ value`19) } nop: done rets: done error: loop ERROR, infinierror halt: loop HALT, infinihalt #addr 0b00110 move: done WM_R | WRITE #addr 0b01000 jump: done JUMP | ADD imm: done IMM call: done JUMP | ADD | WM_L | WRITE imm2: done IMM #addr 0b01100 load: next MEM | ADD, FL_ACK, loaddone, loadwait store: next MEM | ADD | STORE, FL_ACK, storedone, storewait loadb: done WM_MEMDATA | MEM | ADD | WRITE storeb: done ADD | MEM | STORE #addr 0b10000 add: done ADD | WRITE sub: done SUB | WRITE addc: done ADD | WRITE subc: done SUB | WRITE xor: done XOR | WRITE and: done AND | WRITE or: done OR | WRITE shl: done SHL | WRITE shr: done SHR | WRITE asr: done ASR | WRITE ifeq: done SUB | EQ ifne: done SUB | NE iflt: done SUB | LT ifge: done SUB | GE iflo: done SUB | LO ifhs: done SUB | HS #addr 0b100001 infinierror: loop ERROR, infinierror infinihalt: loop HALT, infinihalt loaddone: done WRITE | WM_MEMDATA loadwait: next MEM | ADD, FL_ACK, loaddone, loadwait storedone: done storewait: next MEM | ADD | STORE, FL_ACK, storedone, storewait
cia.asm
b3lial/c64-demo1
0
95955
/* Constants for the C64's 2 Complex Interface Adapters (CIA) */ .namespace cia { .label VIC_BANK_MASK = %00000011 .label VIC_BANK_REVERSE_MASK = %11111100 .label BANK_0_MASK = %11 .label BANK_1_MASK = %10 .label BANK_2_MASK = %01 .label BANK_3_MASK = %00 .label CIAPRA = $dc00 .label CIAPRB = $dc01 .label CIDDRA = $dc02 .label CIDDRB = $dc03 .label TIMALO = $dc04 .label TIMAHI = $dc05 .label TIMBLO = $dc06 .label TIMBHI = $dc07 .label TODTEN = $dc08 .label TODSEC = $dc09 .label TODMIN = $dc0a .label TODHRS = $dc0b .label CIASDR = $dc0c .label CIAICR = $dc0d .label CIACRA = $dc0e .label CIACRB = $dc0f .label CI2PRA = $dd00 .label CI2PRB = $dd01 .label C2DDRA = $dd02 .label C2DDRB = $dd03 .label TI2ALO = $dd04 .label TI2AHI = $dd05 .label TI2BLO = $dd06 .label TI2BHI = $dd07 .label TO2TEN = $dd08 .label TO2SEC = $dd09 .label TO2MIN = $dd0a .label TO2HRS = $dd0b .label CI2SDR = $dd0c .label CI2ICR = $dd0d .label CI2CRA = $dd0e .label CI2CRB = $dd0f }
src/lab-code/calendar_package/src/mycalendar.ads
hannesb0/rtpl18
0
14622
<filename>src/lab-code/calendar_package/src/mycalendar.ads package mycalendar is type daynum is range 1 .. 31; type monthnum is range 1 .. 12; type monthname is (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec); type weekday is (Mon, Tue, Wed, Thu, Fri, Sat, Sun); procedure makecal(w: in weekday; d: in daynum; m:in monthnum); end mycalendar;
src/fixed_types-long.ads
gusthoff/fixed_types
0
22611
------------------------------------------------------------------------------- -- -- FIXED TYPES -- -- Fixed_Long & Fixed_Sat_Long definitions -- -- The MIT License (MIT) -- -- Copyright (c) 2015 <NAME> -- -- Permission is hereby granted, free of charge, to any person obtaining a copy -- of this software and associated documentation files (the "Software"), to -- deal in the Software without restriction, including without limitation the -- rights to use, copy, modify, merge, publish, distribute, sublicense, and / -- or sell copies of the Software, and to permit persons to whom the Software -- is furnished to do so, subject to the following conditions: -- -- The above copyright notice and this permission notice shall be included in -- all copies or substantial portions of the Software. -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -- IN THE SOFTWARE. ------------------------------------------------------------------------------- with Ada.Unchecked_Conversion; package Fixed_Types.Long is -- Fixed_Depth : constant Positive := 32; type Fixed_Long is delta 1.0 / 2.0 ** (Fixed_Depth - 1) range -1.0 .. 1.0 with Size => Fixed_Depth; type Fixed_Sat_Long is new Fixed_Long; pragma Suppress (Overflow_Check, on => Fixed_Long); pragma Suppress (Range_Check, on => Fixed_Long); -- pragma Suppress (All_checks, on => Fixed_Long); type Fixed_Integer_Long is range -2**(Fixed_Depth - 1) .. 2**(Fixed_Depth - 1) - 1 with Size => Fixed_Depth; type Modular_Long is mod 2 ** Fixed_Depth with Size => Fixed_Depth; function To_Fixed_Integer_Long is new Ada.Unchecked_Conversion (Fixed_Long, Fixed_Integer_Long); function To_Fixed_Integer_Long is new Ada.Unchecked_Conversion (Fixed_Sat_Long, Fixed_Integer_Long); function To_Fixed_Long is new Ada.Unchecked_Conversion (Fixed_Integer_Long, Fixed_Long); function To_Fixed_Sat_Long is new Ada.Unchecked_Conversion (Fixed_Integer_Long, Fixed_Sat_Long); function Fixed_Long_To_Mod_Long is new Ada.Unchecked_Conversion (Fixed_Long, Modular_Long); function Fixed_Sat_Long_To_Mod_Long is new Ada.Unchecked_Conversion (Fixed_Sat_Long, Modular_Long); overriding function "abs" (A : Fixed_Sat_Long) return Fixed_Sat_Long; overriding function "+" (A, B : Fixed_Sat_Long) return Fixed_Sat_Long; overriding function "-" (A, B : Fixed_Sat_Long) return Fixed_Sat_Long; overriding function "-" (A : Fixed_Sat_Long) return Fixed_Sat_Long; not overriding function "*" (A, B : Fixed_Sat_Long) return Fixed_Sat_Long; overriding function "*" (A : Fixed_Sat_Long; B : Integer) return Fixed_Sat_Long; end Fixed_Types.Long;
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_21829_609.asm
ljhsiun2/medusa
9
84091
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r9 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_D_ht+0xf6ae, %r9 nop nop nop nop add $13654, %rdx mov $0x6162636465666768, %rbx movq %rbx, (%r9) nop sub $17569, %r9 lea addresses_D_ht+0xfbae, %rsi lea addresses_D_ht+0x87ae, %rdi clflush (%rsi) nop nop nop nop cmp $662, %r11 mov $59, %rcx rep movsq nop add $27079, %rdi lea addresses_WC_ht+0x34ae, %rbx nop nop nop xor $60339, %rsi mov $0x6162636465666768, %rcx movq %rcx, (%rbx) nop nop cmp %rdx, %rdx lea addresses_D_ht+0xa3ae, %rdx nop nop nop nop nop add %r9, %r9 vmovups (%rdx), %ymm0 vextracti128 $1, %ymm0, %xmm0 vpextrq $0, %xmm0, %rdi nop nop nop nop lfence lea addresses_D_ht+0x1fae, %rdx nop nop and %rcx, %rcx movups (%rdx), %xmm0 vpextrq $0, %xmm0, %rsi nop nop cmp $35604, %rdi lea addresses_WT_ht+0xa2e, %r11 xor $12083, %rsi mov $0x6162636465666768, %rdi movq %rdi, %xmm6 vmovups %ymm6, (%r11) nop nop nop nop and $39913, %rcx lea addresses_WC_ht+0x4bae, %rsi lea addresses_D_ht+0x183ae, %rdi nop nop nop xor $13961, %r10 mov $64, %rcx rep movsl nop nop nop nop nop sub %rdi, %rdi lea addresses_WT_ht+0x18e86, %rdi add $17149, %r10 movb (%rdi), %bl nop and $12921, %r10 lea addresses_WC_ht+0x7ae, %rsi lea addresses_A_ht+0x676e, %rdi nop nop nop nop dec %r11 mov $107, %rcx rep movsq nop nop nop cmp %rdi, %rdi lea addresses_UC_ht+0x1c92e, %rdi add %r9, %r9 and $0xffffffffffffffc0, %rdi movaps (%rdi), %xmm2 vpextrq $0, %xmm2, %rbx nop nop xor %rcx, %rcx lea addresses_D_ht+0xfb0e, %rsi lea addresses_normal_ht+0x151fe, %rdi nop sub %rdx, %rdx mov $63, %rcx rep movsb nop cmp $13013, %rdi pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r9 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r14 push %rcx push %rdi push %rsi // REPMOV lea addresses_normal+0xbcae, %rsi lea addresses_WC+0x1bfae, %rdi nop xor %r11, %r11 mov $84, %rcx rep movsw nop nop sub %rsi, %rsi // Faulty Load lea addresses_PSE+0x113ae, %rsi nop nop nop nop nop inc %r10 vmovups (%rsi), %ymm7 vextracti128 $1, %ymm7, %xmm7 vpextrq $0, %xmm7, %r14 lea oracles, %rsi and $0xff, %r14 shlq $12, %r14 mov (%rsi,%r14,1), %r14 pop %rsi pop %rdi pop %rcx pop %r14 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_WC', 'congruent': 10, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False, 'NT': True, 'congruent': 8, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False, 'NT': True, 'congruent': 2, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': True}, 'dst': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': True, 'NT': False, 'congruent': 5, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}} {'33': 21829} 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 */
Practica5/Practica5/main.asm
Pedejeca135/ELECTRONICA-B_UASLP
1
91321
<reponame>Pedejeca135/ELECTRONICA-B_UASLP<gh_stars>1-10 ; ; Practica5.asm ; ; Created: 2/26/2020 1:27:22 PM ; Author : pjco9 ; ; Replace with your application code start: inc r16 rjmp start
src/main/antlr4/tl/antlr4/TL.g4
RieqyNS13/AtLanguage2
0
3437
grammar TL; parse : AtBegin block AtEnd EOF ; block : ( statement | functionDecl )* ( Return expression ';' )? ; statement : assignment ';' | functionCall ';' | ifStatement | forStatement | whileStatement ; assignment : Identifier indexes? '=' expression ; functionCall : Identifier '(' exprList? ')' #identifierFunctionCall | Println '(' expression? ')' #printlnFunctionCall | Print '(' expression ')' #printFunctionCall | Assert '(' expression ')' #assertFunctionCall | Size '(' expression ')' #sizeFunctionCall ; ifStatement : ifStat elseIfStat* elseStat? End ; ifStat : If expression Do block ; elseIfStat : Else If expression Do block ; elseStat : Else Do block ; functionDecl : Def Identifier '(' idList? ')' block End ; forStatement : For Identifier '=' expression To expression Do block End ; whileStatement : While expression Do block End ; idList : Identifier ( ',' Identifier )* ; exprList : expression ( ',' expression )* ; expression : '-' expression #unaryMinusExpression | '!' expression #notExpression | <assoc=right> expression '^' expression #powerExpression | expression op=( '*' | '/' | '%' ) expression #multExpression | expression op=( '+' | '-' ) expression #addExpression | expression op=( '>=' | '<=' | '>' | '<' ) expression #compExpression | expression op=( '==' | '!=' ) expression #eqExpression | expression '&&' expression #andExpression | expression '||' expression #orExpression | expression '?' expression ':' expression #ternaryExpression | expression In expression #inExpression | Number #numberExpression | Bool #boolExpression | Null #nullExpression | functionCall indexes? #functionCallExpression | list indexes? #listExpression | Identifier indexes? #identifierExpression | String indexes? #stringExpression | '(' expression ')' indexes? #expressionExpression | Input '(' String? ')' #inputExpression ; list : '[' exprList? ']' ; indexes : ( '[' expression ']' )+ ; AtBegin : 'AtBegin'; AtEnd : 'AtEnd'; Println : 'println' | 'sayln'; Print : 'print' | 'say'; Input : 'input'; Assert : 'assert'; Size : 'size'; Def : 'def'; If : 'if'; Else : 'else'; Return : 'return'; For : 'for'; While : 'while'; To : 'to'; Do : 'do'; End : 'end'; In : 'in'; Null : 'null'; Or : '||'; And : '&&'; Equals : '=='; NEquals : '!='; GTEquals : '>='; LTEquals : '<='; Pow : '^'; Excl : '!'; GT : '>'; LT : '<'; Add : '+'; Subtract : '-'; Multiply : '*'; Divide : '/'; Modulus : '%'; OBrace : '{'; CBrace : '}'; OBracket : '['; CBracket : ']'; OParen : '('; CParen : ')'; SColon : ';'; Assign : '='; Comma : ','; QMark : '?'; Colon : ':'; Bool : 'true' | 'false' ; Number : Int ( '.' Digit* )? ; Identifier : [a-zA-Z_] [a-zA-Z_0-9]* ; String : ["] ( ~["\r\n\\] | '\\' ~[\r\n] )* ["] | ['] ( ~['\r\n\\] | '\\' ~[\r\n] )* ['] ; Comment : ( '//' ~[\r\n]* | '/*' .*? '*/' ) -> skip ; Space : [ \t\r\n\u000C] -> skip ; fragment Int : [1-9] Digit* | '0' ; fragment Digit : [0-9] ;
programs/oeis/070/A070940.asm
neoneye/loda
22
240878
; A070940: Number of digits that must be counted from left to right to reach the last 1 in the binary representation of n. ; 1,1,2,1,3,2,3,1,4,3,4,2,4,3,4,1,5,4,5,3,5,4,5,2,5,4,5,3,5,4,5,1,6,5,6,4,6,5,6,3,6,5,6,4,6,5,6,2,6,5,6,4,6,5,6,3,6,5,6,4,6,5,6,1,7,6,7,5,7,6,7,4,7,6,7,5,7,6,7,3,7,6,7,5,7,6,7,4,7,6,7,5,7,6,7,2,7,6,7,5 add $0,1 lpb $0 dif $0,2 lpe lpb $0 div $0,2 add $1,4 lpe div $1,4 mov $0,$1
src/main/fragment/mos6502-common/vdsm1_le_vdsm2_then_la1.asm
jbrandwood/kickc
2
92801
lda {m1} cmp {m2} lda {m1}+1 sbc {m2}+1 lda {m1}+2 sbc {m2}+2 lda {m1}+3 sbc {m2}+3 bvc !+ eor #$80 bmi {la1} !:
core/src/main/antlr4/edp.moonbox.core.parser/CMD.g4
gnawoal/moonbox
523
6937
<gh_stars>100-1000 grammar CMD; tokens { DELIMITER } singleCmd : cmd EOF ; cmd : MOUNT DATASOURCE identifier OPTIONS tablePropertyList #mountDataSource | UNMOUNT DATASOURCE identifier #unmountDataSource | MOUNT DATABASE identifier OPTIONS tablePropertyList #mountDatabase | UNMOUNT DATABASE identifier #unmountDatabase | MOUNT TABLE tableIdentifier OPTIONS tablePropertyList #mountTable | UNMOUNT TABLE tableIdentifier #unmountTable | CREATE TABLE (IF NOT EXISTS)? tableIdentifier (OPTIONS tablePropertyList)? #createTableOnly | CREATE TABLE (IF NOT EXISTS)? tableIdentifier (OPTIONS tablePropertyList)? AS query #createTableAsSelect | CREATE VIEW (IF NOT EXISTS)? tableIdentifier AS query #createViewAsSelect | INSERT INTO tableIdentifier (OPTIONS tablePropertyList)? AS query #insertAsSelect | DROP TABLE tableIdentifier #dropTable | TRUNCATE TABLE tableIdentifier #truncateTable | DESCRIBE DATABASE identifier #describeDatabase | DESCRIBE TABLE tableIdentifier #describeTable | query #cmdDefault ; query : SELECT (.)*? | WITH (.)*? ; tableIdentifier : (db=identifier '.')? table=identifier ; identifier : IDENTIFIER ; tablePropertyList : '(' tableProperty (',' tableProperty)* ')' ; tableProperty : key=tablePropertyKey (EQ? value=STRING)? ; tablePropertyKey : identifier ('.' identifier)* | STRING ; SELECT: 'SELECT'; WITH: 'WITH'; CREATE: 'CREATE'; TABLE: 'TABLE'; VIEW: 'VIEW'; IF: 'IF'; NOT: 'NOT'; EXISTS: 'EXISTS'; AS: 'AS'; MOUNT: 'MOUNT'; UNMOUNT: 'UNMOUNT'; DATASOURCE: 'DATASOURCE'; DATABASE: 'DATABASE'; OPTIONS: 'OPTIONS'; INSERT: 'INSERT'; INTO: 'INTO'; DROP: 'DROP'; TRUNCATE: 'TRUNCATE'; DESCRIBE: 'DESCRIBE'; EQ: '='| '=='; STRING : '\'' ( ~('\''|'\\') | ('\\' .) )* '\'' | '\"' ( ~('\"'|'\\') | ('\\' .) )* '\"' ; IDENTIFIER : (LETTER | DIGIT | '_' )+ | '\'' (LETTER | DIGIT | '_' )+ '\'' | '"' (LETTER | DIGIT | '_' )+ '"' ; fragment DIGIT : [0-9] ; fragment LETTER : [A-Z] | [a-z] ; SIMPLE_COMMENT : '--' ~[\r\n]* '\r'? '\n'? -> channel(HIDDEN) ; BRACKETED_COMMENT : '/*' .*? '*/' -> channel(HIDDEN) ; WS : [ \r\n\t]+ -> channel(HIDDEN) ; UNRECOGNIZED : . ;
test/Succeed/Issue4267/A1.agda
cruhland/agda
1,989
14468
module Issue4267.A1 where record RA1 : Set₁ where field A : Set
src/test/resources/data/searchtests/test-min-expected.asm
cpcitor/mdlz80optimizer
36
162145
<gh_stars>10-100 sub h ld b, a sbc a, a and b add a, h ---- sub h ld b, a sbc a, b and b add a, h
source/asis/asis-gela-classes.ads
faelys/gela-asis
4
21371
<filename>source/asis/asis-gela-classes.ads ------------------------------------------------------------------------------ -- G E L A A S I S -- -- ASIS implementation for Gela project, a portable Ada compiler -- -- http://gela.ada-ru.org -- -- - - - - - - - - - - - - - - - -- -- Read copyright and license at the end of this file -- ------------------------------------------------------------------------------ -- $Revision: 209 $ $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $ -- Purpose: -- Represent information about a type and operations to classify it. package Asis.Gela.Classes is type Type_Info is private; function Type_From_Declaration (Tipe : Asis.Declaration; Place : Asis.Element) return Type_Info; -- Return information about a type given by type_declaration. -- Place element is used to provide "point of view", because -- type could be private from one point, but concrete from -- another. -- If Place is null, return last completion in the same enclosing -- declaration function Type_From_Subtype_Mark (Mark : Asis.Expression; Place : Asis.Element) return Type_Info; -- Return information about a type given by subtype_mark function Type_From_Indication (Ind : Asis.Definition; Place : Asis.Element) return Type_Info; -- Return information about a type given by subtype_indication -- Ind should be subtype_indication -- (or access_definition from parameter_and_result_profile) function Type_From_Discrete_Def (Def : Asis.Definition; Place : Asis.Element) return Type_Info; -- Return information about a type given by discrete_definition function Type_Of_Declaration (Decl : Asis.Declaration; Place : Asis.Element) return Type_Info; -- Return information about a type used in object declaration function Type_Of_Name (Name : Asis.Defining_Name; Place : Asis.Element) return Type_Info; -- Return information about a type given by defining_name function Type_Of_Range (Lower, Upper : Asis.Expression) return Type_Info; function Type_Of_Range (Lower, Upper : Type_Info) return Type_Info; procedure Set_Class_Wide (Info : in out Type_Info); -- Turn type into class-wide function Drop_Class (Info : Type_Info) return Type_Info; -- Remove 'Class from Type_Info procedure Set_Access (Info : in out Type_Info; Value : Boolean); -- Turn type into anonymouse access -- Clasification requests function Is_Not_Type (Info : Type_Info) return Boolean; function Is_Declaration (Info : Type_Info) return Boolean; function Is_Definition (Info : Type_Info) return Boolean; function Is_Class_Wide (Info : Type_Info) return Boolean; function Is_Anonymous_Access (Info : Type_Info) return Boolean; function Is_Limited (Info : Type_Info) return Boolean; function Is_Elementary (Info : Type_Info) return Boolean; function Is_Scalar (Info : Type_Info) return Boolean; function Is_Discrete (Info : Type_Info) return Boolean; function Is_Enumeration (Info : Type_Info) return Boolean; function Is_Character (Info : Type_Info) return Boolean; function Is_Boolean (Info : Type_Info) return Boolean; function Is_Signed_Integer (Info : Type_Info) return Boolean; function Is_Modular_Integer (Info : Type_Info) return Boolean; function Is_Float_Point (Info : Type_Info) return Boolean; function Is_Ordinary_Fixed_Point (Info : Type_Info) return Boolean; function Is_Decimal_Fixed_Point (Info : Type_Info) return Boolean; function Is_Constant_Access (Info : Type_Info) return Boolean; function Is_Variable_Access (Info : Type_Info) return Boolean; function Is_Object_Access (Info : Type_Info) return Boolean; function Is_General_Access (Info : Type_Info) return Boolean; function Is_Procedure_Access (Info : Type_Info) return Boolean; function Is_Function_Access (Info : Type_Info) return Boolean; function Is_Subprogram_Access (Info : Type_Info) return Boolean; function Is_String (Info : Type_Info) return Boolean; function Is_Array (Info : Type_Info) return Boolean; function Is_Boolean_Array (Info : Type_Info) return Boolean; function Is_Discrete_Array (Info : Type_Info) return Boolean; function Is_Untagged_Record (Info : Type_Info) return Boolean; function Is_Tagged (Info : Type_Info) return Boolean; function Is_Task (Info : Type_Info) return Boolean; function Is_Protected (Info : Type_Info) return Boolean; function Is_Integer (Info : Type_Info) return Boolean; function Is_Real (Info : Type_Info) return Boolean; function Is_Fixed_Point (Info : Type_Info) return Boolean; function Is_Numeric (Info : Type_Info) return Boolean; function Is_Access (Info : Type_Info) return Boolean; function Is_Composite (Info : Type_Info) return Boolean; function Is_Universal (Info : Type_Info) return Boolean; function Is_Incomplete (Info : Type_Info) return Boolean; function Is_Array (Tipe : Type_Info; Length : Asis.List_Index) return Boolean; function Get_Subtype (Info : Type_Info) return Asis.Declaration; -- Misc functions function Is_Equal (Left, Right : Type_Info) return Boolean; function Is_Equal_Class (Left, Right : Type_Info) return Boolean; function Hash (Info : Type_Info) return Asis.ASIS_Integer; function Is_Covered (Specific : Type_Info; Class_Wide : Type_Info) return Boolean; function Is_Expected_Type (Specific : Type_Info; Expected : Type_Info) return Boolean; function Is_Subtype_Mark (Mark : Asis.Expression) return Boolean; function Is_Type_Declaration (Decl : Asis.Declaration) return Boolean; function Debug_Image (Info : Type_Info) return Wide_String; function Destination_Type (Tipe : Type_Info) return Type_Info; function Get_Array_Element_Type (Tipe : Type_Info) return Type_Info; function Get_Array_Index_Type (Tipe : Type_Info; Index : Asis.List_Index := 1) return Type_Info; function Parent_Type (Tipe : Type_Info) return Type_Info; function Top_Parent_Type (Tipe : Type_Info) return Type_Info; function Function_Result_Type (Tipe : Type_Info) return Type_Info; function Subprogram_Parameters (Tipe : Type_Info) return Asis.Parameter_Specification_List; function Conform_Access_Type (Decl : Asis.Declaration; Tipe : Type_Info) return Boolean; function Destinated_Are_Type_Conformant (Left, Right : Type_Info) return Boolean; -- Left, Right should be Is_Subprogram_Access and Is_Anonymous_Access function Find_Component (Tipe : Type_Info; Name : Asis.Program_Text) return Asis.Declaration; function Get_Declaration (Info : Type_Info) return Asis.Declaration; function Get_Type_View (Info : Type_Info) return Asis.Declaration; function Get_Place (Info : Type_Info) return Asis.Element; function Get_Type_Def (Tipe : Type_Info) return Asis.Definition; function Is_Child_Of (Child, Parent : Type_Info) return Boolean; Not_A_Type : constant Type_Info; private type Class_Kinds is (An_Incomplete, A_Character, A_Boolean, An_Other_Enum, An_Universal_Integer, A_Signed_Integer, A_Modular_Integer, An_Universal_Real, A_Float_Point, An_Universal_Fixed, A_Ordinary_Fixed_Point, A_Decimal_Fixed_Point, A_Constant_Access, A_Variable_Access, A_Pool_Access, A_Procedure_Access, A_Function_Access, A_Universal_Access, A_String, A_Boolean_Array, A_Other_Discrete_Array, An_Other_Array, A_Untagged_Record, A_Tagged, A_Task, A_Protected, A_Private); subtype An_Elementary is Class_Kinds range A_Character .. A_Universal_Access; subtype A_Scalar is Class_Kinds range A_Character .. A_Decimal_Fixed_Point; subtype A_Discrete is Class_Kinds range A_Character .. A_Modular_Integer; subtype An_Enumeration is Class_Kinds range A_Character .. An_Other_Enum; subtype An_Integer is Class_Kinds range An_Universal_Integer .. A_Modular_Integer; subtype A_Real is Class_Kinds range An_Universal_Real .. A_Decimal_Fixed_Point; subtype A_Fixed_Point is Class_Kinds range An_Universal_Fixed .. A_Decimal_Fixed_Point; subtype A_Numeric is Class_Kinds range An_Universal_Integer .. A_Decimal_Fixed_Point; subtype An_Access is Class_Kinds range A_Constant_Access .. A_Universal_Access; subtype A_Subprogram_Access is Class_Kinds range A_Procedure_Access .. A_Function_Access; subtype An_Object_Access is Class_Kinds range A_Constant_Access .. A_Pool_Access; subtype A_General_Access is Class_Kinds range A_Constant_Access .. A_Variable_Access; subtype A_Composite is Class_Kinds range A_String .. A_Private; subtype An_Array is Class_Kinds range A_String .. An_Other_Array; subtype A_Discrete_Array is Class_Kinds range A_String .. A_Other_Discrete_Array; type Info_Kinds is (Declaration_Info, -- Ordinary type declaration Defining_Name_Info, -- Anonymous type other then in return Return_Info); -- Anonymous type in function return type Type_Info (Kind : Info_Kinds := Declaration_Info) is record Class_Kind : Class_Kinds; Is_Class_Wide : Boolean := False; Is_Access : Boolean := False; Is_Limited : Boolean := False; Place : Asis.Element; -- type viewed from Place case Kind is when Declaration_Info => Base_Type : Asis.Declaration; Type_View : Asis.Declaration; Subtipe : Asis.Declaration; when Defining_Name_Info => Object_Name : Asis.Defining_Name; -- name of object of anon type when Return_Info => Access_Definition : Asis.Definition; end case; end record; Not_A_Type : constant Type_Info := (Declaration_Info, Class_Kinds'First, False, False, False, others => Asis.Nil_Element); end Asis.Gela.Classes; ------------------------------------------------------------------------------ -- Copyright (c) 2006-2013, <NAME> -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- * Neither the name of the <NAME>, IE nor the names of its -- contributors may be used to endorse or promote products derived from -- this software without specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------
factorial_nomult.asm
danielzy95/MIPS-Random
0
28563
<reponame>danielzy95/MIPS-Random .text main: li $a0, 12 jal factorial move $a0, $v0 jal print_int li $v0, 10 syscall factorial: addiu $sp, $sp, -8 sw $ra, 0($sp) sw $s0, 4($sp) slti $t0, $a0, 2 beq $t0, $zero, recurs return1: li $v0, 1 j end_funct recurs: move $s0, $a0 addiu $a0, $a0, -1 jal factorial li $t0, 1 move $t1, $v0 cycle_mult: beq $t0, $s0, end_funct addu $v0, $v0, $t1 addiu $t0, $t0, 1 j cycle_mult end_funct: lw $s0, 4($sp) lw $ra, 0($sp) addiu $sp, $sp, 8 jr $ra print_int: li $v0, 1 syscall jr $ra
LibraBFT/Concrete/Properties/VotesOnce.agda
cwjnkins/bft-consensus-agda
0
15015
<reponame>cwjnkins/bft-consensus-agda {- Byzantine Fault Tolerant Consensus Verification in Agda, version 0.9. Copyright (c) 2020, 2021, Oracle and/or its affiliates. Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.oracle.com/licenses/upl -} open import Optics.All open import LibraBFT.Prelude open import LibraBFT.Lemmas open import LibraBFT.Base.KVMap open import LibraBFT.Base.PKCS open import LibraBFT.Impl.Base.Types open import LibraBFT.Impl.NetworkMsg open import LibraBFT.Impl.Consensus.Types open import LibraBFT.Impl.Util.Crypto open import LibraBFT.Impl.Handle open import LibraBFT.Impl.Handle.Properties open import LibraBFT.Concrete.System.Parameters open import LibraBFT.Concrete.System open EpochConfig open import LibraBFT.Yasm.Types open import LibraBFT.Yasm.Yasm ℓ-RoundManager ℓ-VSFP ConcSysParms PeerCanSignForPK (λ {st} {part} {pk} → PeerCanSignForPK-stable {st} {part} {pk}) -- In this module, we define two "implementation obligations" -- (ImplObligationᵢ for i ∈ {1 , 2}), which are predicates over -- reachable states of a system defined by -- 'LibraBFT.Concrete.System.Parameters'. These two properties relate -- votes sent by the same sender, ensuring that if they are for the -- same epoch and round, then they vote for the same blockID; the -- first relates a vote output by the handler to a vote sent -- previously, and the second relates two votes both sent by the -- handler. -- -- We then prove that, if an implementation satisfies these two -- semantic obligations, along with a structural one about messages -- sent by honest peers in the implementation, then the implemenation -- satisfies the LibraBFT.Abstract.Properties.VotesOnce invariant. module LibraBFT.Concrete.Properties.VotesOnce where -- TODO-3: This may not be the best way to state the implementation obligation. Why not reduce -- this as much as possible before giving the obligation to the implementation? For example, this -- will still require the implementation to deal with hash collisons (v and v' could be different, -- but yield the same bytestring and therefore same signature). Also, avoid the need for the -- implementation to reason about messages sent by step-cheat, or give it something to make this -- case easy to eliminate. ImplObligation₁ : Set (ℓ+1 ℓ-RoundManager) ImplObligation₁ = ∀{pid pid' s' outs pk}{pre : SystemState} → ReachableSystemState pre -- For any honest call to /handle/ or /init/, → (sps : StepPeerState pid (msgPool pre) (initialised pre) (peerStates pre pid) (s' , outs)) → ∀{v m v' m'} → Meta-Honest-PK pk -- For signed every vote v of every outputted message → v ⊂Msg m → send m ∈ outs → (sig : WithVerSig pk v) → ¬ (∈GenInfo (ver-signature sig)) -- If v is really new and valid → ¬ (MsgWithSig∈ pk (ver-signature sig) (msgPool pre)) → PeerCanSignForPK (StepPeer-post {pre = pre} (step-honest sps)) v pid pk -- And if there exists another v' that has been sent before → v' ⊂Msg m' → (pid' , m') ∈ (msgPool pre) → (sig' : WithVerSig pk v') → ¬ (∈GenInfo (ver-signature sig')) -- If v and v' share the same epoch and round → v ^∙ vEpoch ≡ v' ^∙ vEpoch → v ^∙ vRound ≡ v' ^∙ vRound ---------------------------------------------------------- -- Then an honest implemenation promises v and v' vote for the same blockId. → v ^∙ vProposedId ≡ v' ^∙ vProposedId ImplObligation₂ : Set (ℓ+1 ℓ-RoundManager) ImplObligation₂ = ∀{pid s' outs pk}{pre : SystemState} → ReachableSystemState pre -- For any honest call to /handle/ or /init/, → (sps : StepPeerState pid (msgPool pre) (initialised pre) (peerStates pre pid) (s' , outs)) → ∀{v m v' m'} → Meta-Honest-PK pk -- For every vote v represented in a message output by the call → v ⊂Msg m → send m ∈ outs → (sig : WithVerSig pk v) → ¬ (∈GenInfo (ver-signature sig)) -- If v is really new and valid → ¬ (MsgWithSig∈ pk (ver-signature sig) (msgPool pre)) → PeerCanSignForPK (StepPeer-post {pre = pre} (step-honest sps)) v pid pk -- And if there exists another v' that is also new and valid → v' ⊂Msg m' → send m' ∈ outs → (sig' : WithVerSig pk v') → ¬ (∈GenInfo (ver-signature sig')) → ¬ (MsgWithSig∈ pk (ver-signature sig') (msgPool pre)) → PeerCanSignForPK (StepPeer-post {pre = pre} (step-honest sps)) v' pid pk -- If v and v' share the same epoch and round → v ^∙ vEpoch ≡ v' ^∙ vEpoch → v ^∙ vRound ≡ v' ^∙ vRound ---------------------------------------------------------- -- Then, an honest implemenation promises v and v' vote for the same blockId. → v ^∙ vProposedId ≡ v' ^∙ vProposedId -- Next, we prove that, given the necessary obligations, module Proof (sps-corr : StepPeerState-AllValidParts) (Impl-VO1 : ImplObligation₁) (Impl-VO2 : ImplObligation₂) where -- Any reachable state satisfies the VO rule for any epoch in the system. module _ (st : SystemState)(r : ReachableSystemState st)(𝓔 : EpochConfig) where open Structural sps-corr -- Bring in IntSystemState open WithSPS sps-corr open PerState st r open PerEpoch 𝓔 open import LibraBFT.Concrete.Obligations.VotesOnce 𝓔 (ConcreteVoteEvidence 𝓔) as VO -- The VO proof is done by induction on the execution trace leading to 'st'. In -- Agda, this is 'r : RechableSystemState st' above. private -- From this point onwards, it might be easier to read this proof starting at 'voo' -- at the end of the file. Next, we provide an overview the proof. -- -- We wish to prove that, for any two votes v and v' cast by an honest α in the message -- pool of a state st, if v and v' have equal rounds and epochs, then they vote for the -- same block. -- -- The base case and the case for a new epoch in the system are trivial. For the base case -- we get to a contradiction because it's not possible to have any message in the msgpool. -- -- Regarding the PeerStep case. The induction hypothesis tells us that the property holds -- in the pre-state. Next, we reason about the post-state. We start by analyzing whether -- v and v' have been sent as outputs of the PeerStep under scrutiny or were already in -- the pool before. -- -- There are four possibilities: -- -- i) v and v' were aleady present in the msgPool before: use induction hypothesis. -- ii) v and v' are both in the output produced by the PeerStep under scrutiny. -- iii) v was present before, but v' is new. -- iv) v' was present before, but v is new. -- -- In order to obtain this four possiblities we invoke newMsg⊎msgSent4 lemma, which -- receives proof that some vote is in a message that is in the msgPool of the post state -- and returns evidence that either the vote is new or that some message with the same -- signature was sent before. -- -- Case (i) is trivial; cases (iii) and (iv) are symmetric and reduce to an implementation -- obligation (Impl-VO1) and case (ii) reduces to a different implementation obligation -- (Impl-VO2). VotesOnceProof : ∀ {v v' pk} {st : SystemState} → ReachableSystemState st → Meta-Honest-PK pk → (vv : WithVerSig pk v) → MsgWithSig∈ pk (ver-signature vv) (msgPool st) → (vv' : WithVerSig pk v') → MsgWithSig∈ pk (ver-signature vv') (msgPool st) → v ^∙ vEpoch ≡ v' ^∙ vEpoch → v ^∙ vRound ≡ v' ^∙ vRound → v ^∙ vProposedId ≡ v' ^∙ vProposedId VotesOnceProof step-0 _ _ msv _ _ _ _ = ⊥-elim (¬Any[] (msg∈pool msv)) VotesOnceProof {v} {v'} (step-s r theStep) pkH vv msv vv' msv' eid≡ r≡ with msgSameSig msv | msgSameSig msv' ...| refl | refl with sameSig⇒sameVoteDataNoCol (msgSigned msv) vv (msgSameSig msv ) | sameSig⇒sameVoteDataNoCol (msgSigned msv') vv' (msgSameSig msv') ...| refl | refl with ∈GenInfo? (₋vSignature (msgPart msv)) | ∈GenInfo? (₋vSignature (msgPart msv')) ...| yes init | yes init' = genVotesConsistent (msgPart msv) (msgPart msv') init init' -- A signature in GenInfo is for a vote with round 0, and a signature for which we have a -- MsgWithSig∈ that is not in GenInfo and is for an honest PK is for a round ≢ 0, so we can -- derive a contradiction using r≡. ...| yes init | no ¬init = ⊥-elim (¬genVotesRound≢0 (step-s r theStep) pkH msv' ¬init ((trans (sym r≡) (genVotesRound≡0 vv init)))) ...| no ¬init | yes init = ⊥-elim (¬genVotesRound≢0 (step-s r theStep) pkH msv ¬init ((trans r≡ (genVotesRound≡0 vv' init)))) ...| no ¬init | no ¬init' with theStep ...| step-peer cheat@(step-cheat c) with ¬cheatForgeNew cheat refl unit pkH msv ¬init | ¬cheatForgeNew cheat refl unit pkH msv' ¬init' ...| msb4 | m'sb4 with msgSameSig msb4 | msgSameSig m'sb4 ...| refl | refl = VotesOnceProof r pkH vv msb4 vv' m'sb4 eid≡ r≡ VotesOnceProof (step-s r theStep) pkH vv msv vv' msv' eid≡ r≡ | refl | refl | refl | refl | no ¬init | no ¬init' | step-peer (step-honest stPeer) with newMsg⊎msgSentB4 r stPeer pkH (msgSigned msv) ¬init (msg⊆ msv) (msg∈pool msv) | newMsg⊎msgSentB4 r stPeer pkH (msgSigned msv') ¬init' (msg⊆ msv') (msg∈pool msv') ...| inj₂ msb4 | inj₂ m'sb4 = VotesOnceProof r pkH vv msb4 vv' m'sb4 eid≡ r≡ ...| inj₁ (m∈outs , vspk , newV) | inj₁ (m'∈outs , v'spk , newV') = Impl-VO2 r stPeer pkH (msg⊆ msv) m∈outs (msgSigned msv) ¬init newV vspk (msg⊆ msv') m'∈outs (msgSigned msv') ¬init' newV' v'spk eid≡ r≡ ...| inj₁ (m∈outs , vspk , newV) | inj₂ m'sb4 with sameSig⇒sameVoteData (msgSigned m'sb4) vv' (msgSameSig m'sb4) ...| inj₁ hb = ⊥-elim (meta-sha256-cr hb) ...| inj₂ refl rewrite sym (msgSameSig msv') = Impl-VO1 r stPeer pkH (msg⊆ msv) m∈outs (msgSigned msv) ¬init newV vspk (msg⊆ m'sb4) (msg∈pool m'sb4) (msgSigned m'sb4) (¬subst ¬init' (msgSameSig m'sb4)) eid≡ r≡ VotesOnceProof (step-s r theStep) pkH vv msv vv' msv' eid≡ r≡ | refl | refl | refl | refl | no ¬init | no ¬init' | step-peer (step-honest stPeer) | inj₂ msb4 | inj₁ (m'∈outs , v'spk , newV') with sameSig⇒sameVoteData (msgSigned msb4) vv (msgSameSig msb4) ...| inj₁ hb = ⊥-elim (meta-sha256-cr hb) ...| inj₂ refl = sym (Impl-VO1 r stPeer pkH (msg⊆ msv') m'∈outs (msgSigned msv') ¬init' newV' v'spk (msg⊆ msb4) (msg∈pool msb4) (msgSigned msb4) (¬subst ¬init (msgSameSig msb4)) (sym eid≡) (sym r≡)) voo : VO.Type IntSystemState voo hpk refl sv refl sv' round≡ with vmsg≈v (vmFor sv) | vmsg≈v (vmFor sv') ...| refl | refl = let ver = vmsgSigned (vmFor sv) mswsv = mkMsgWithSig∈ (nm (vmFor sv)) (cv (vmFor sv)) (cv∈nm (vmFor sv)) _ (nmSentByAuth sv) (vmsgSigned (vmFor sv)) refl ver' = vmsgSigned (vmFor sv') mswsv' = mkMsgWithSig∈ (nm (vmFor sv')) (cv (vmFor sv')) (cv∈nm (vmFor sv')) _ (nmSentByAuth sv') (vmsgSigned (vmFor sv')) refl epoch≡ = trans (vmsgEpoch (vmFor sv)) (sym (vmsgEpoch (vmFor sv'))) in VotesOnceProof r hpk ver mswsv ver' mswsv' epoch≡ round≡
programs/oeis/071/A071919.asm
neoneye/loda
22
12794
<filename>programs/oeis/071/A071919.asm ; A071919: Number of monotone nondecreasing functions [n]->[m] for n>=0, m>=0, read by antidiagonals. ; 1,1,0,1,1,0,1,2,1,0,1,3,3,1,0,1,4,6,4,1,0,1,5,10,10,5,1,0,1,6,15,20,15,6,1,0,1,7,21,35,35,21,7,1,0,1,8,28,56,70,56,28,8,1,0,1,9,36,84,126,126,84,36,9,1,0,1,10,45,120,210,252,210,120,45,10,1,0,1,11,55,165,330,462,462,330,165,55,11,1,0,1,12,66,220,495,792,924,792,495 sub $0,1 lpb $0 sub $0,2 add $1,1 mov $2,$0 trn $0,$1 lpe bin $1,$2 mov $0,$1
oeis/020/A020572.asm
neoneye/loda-programs
11
242474
<filename>oeis/020/A020572.asm ; A020572: Expansion of 1/((1-6x)(1-7x)(1-10x)). ; Submitted by <NAME>(s2) ; 1,23,357,4675,55781,628803,6831637,72401555,754291461,7764923683,79263766517,804302170035,8126850016741,81868359076163,822960967286997,8260021493532115,82815918789863621,829686041539878243,8307649950844145077,83152635616298999795,832062965076432904101,8324407850109069761923,83270657518207724932757,832893418032119494125075,8330246818652828976450181,83311685085137757940599203,833181539723372036216882037,8332269242828050637314299955,83325875488383032763976853861,833281073150201299164498502083 add $0,1 mov $3,1 lpb $0 sub $0,1 add $2,$3 add $1,$2 mul $1,6 mul $2,10 mul $3,7 lpe mov $0,$1 div $0,6
src/main/fragment/mos6502-common/vbuaa=pbuz1_derefidx_vbuyy_minus_vbuc1.asm
jbrandwood/kickc
2
167476
<reponame>jbrandwood/kickc sec lda ({z1}),y sbc #{c1}
src/Utilities/config_string_parsers.ads
fintatarta/eugen
0
16110
<reponame>fintatarta/eugen with Ada.Containers.Indefinite_Ordered_Maps; with Ada.Containers.Indefinite_Holders; with Ada.Strings.Maps.Constants; use Ada.Strings.Maps.Constants, Ada.Strings.Maps; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; -- -- -- Syntax: -- -- line = [header] parameter ("," parameter)* -- header = name ":" -- parameter = name ["=" value] -- value = "{" [^}]* "}" | [^{][^,]* -- name = begin body* (S body+)* -- generic type Name_Type (<>) is private; type Value_Type (<>) is private; No_Value : Value_Type; with function "<" (X, Y : Name_Type) return Boolean is <>; with function To_Name (X : String) return Name_Type; with function To_Value (X : String) return Value_Type; package Config_String_Parsers is -- This type is used to describe the parameters that we expect, -- if they are mandatory or not and any default value. type Syntax_Descriptor is private; Empty_Syntax : constant Syntax_Descriptor; -- What to do when a mandatory parameter is missing type Missing_Action is (Die, -- raise Parsing_Error Ignore, -- OK, the parameter is optional Use_Default); -- use a default value -- Add a new parameter to the descriptor. Note that the precondition -- requires that Default is specified only if If_Missing = Use_Default procedure Add_Parameter_Syntax (Syntax : in out Syntax_Descriptor; Parameter_Name : Name_Type; If_Missing : Missing_Action; Default : Value_Type := No_Value) with Pre => (if Default /= No_Value then If_Missing = Use_Default); package Parameter_Maps is new Ada.Containers.Indefinite_Ordered_Maps (Key_Type => Name_Type, Element_Type => Value_Type); -- This type represents the result of a parsing. It holds the -- header value (if present) and the parameter list as a map -- parameter -> value type Parsing_Result is private; -- Return true if an header was given function Has_Header (H : Parsing_Result) return Boolean; -- Return the name used for the header function Header (H : Parsing_Result) return Name_Type with Pre => Has_Header (H); -- Return the parameter list function Parameters (H : Parsing_Result) return Parameter_Maps.Map; -- This type is used to hold several "configuration options" of the -- parser, for example: the separator after the header, the separator -- between parameters, etc. type Parser_Options (<>) is private; -- Is the header required? type Header_Expected is (Yes, -- The header is mandatory No, -- The header is prohibited Maybe); -- The header is optional -- What to do when a parameter not included in the syntax is found? type Unknown_Name_Action is (OK, -- accept it Die, -- raise Parsing_Error Default); -- Like OK if no syntax is specified, otherwise Die -- Create a Parser_Options specifier. Note that all parameters are -- optional, so that only the parameters that need to change need to -- be specified. function Config (Expect_Header : Header_Expected := No; Name_Start : Character_Set := Letter_Set; Name_Body : Character_Set := Alphanumeric_Set; Name_Separators : Character_Set := To_Set ("-_"); Header_Separator : String := ":"; Parameter_Separator : String := ","; Value_Separator : String := "="; Open_Block : String := "{"; Close_Block : String := "}") return Parser_Options; function Parse (Input : String; Syntax : Syntax_Descriptor := Empty_Syntax; On_Unknown_Name : Unknown_Name_Action := Default; Options : Parser_Options := Config) return Parsing_Result; function Parse (Input : String; Syntax : String; On_Unknown_Name : Unknown_Name_Action := Default; Options : Parser_Options := Config) return Parsing_Result with Pre => False; pragma Compile_Time_Warning (Standard.True, "Parse version unimplemented"); Parsing_Error : exception; private package Value_Holders is new Ada.Containers.Indefinite_Holders (Value_Type); package Name_Holders is new Ada.Containers.Indefinite_Holders (Name_Type); -- overriding function Copy (X : Parameter_Holder) return Parameter_Holder; type Parsing_Result is record Parameters : Parameter_Maps.Map; Header : Name_Holders.Holder; end record; function Has_Header (H : Parsing_Result) return Boolean is (not H.Header.Is_Empty); function Header (H : Parsing_Result) return Name_Type is (H.Header.Element); function Parameters (H : Parsing_Result) return Parameter_Maps.Map is (H.Parameters); type Parser_Options is record Expect_Header : Header_Expected; Name_Start : Character_Set; Name_Body : Character_Set; Name_Separators : Character_Set; Header_Separator : Unbounded_String; Parameter_Separator : Unbounded_String; Value_Separator : Unbounded_String; Open_Block : Unbounded_String; Close_Block : Unbounded_String; end record; type Syntax_Entry is record If_Missing : Missing_Action; Default : Value_Holders.Holder; end record; package Syntax_Maps is new Ada.Containers.Indefinite_Ordered_Maps (Key_Type => Name_Type, Element_Type => Syntax_Entry); type Syntax_Descriptor is record S : Syntax_Maps.Map; end record; Empty_Syntax : constant Syntax_Descriptor := (S => Syntax_Maps.Empty_Map); end Config_String_Parsers;
Classes/alias/info for/file type/smaft folder.applescript
looking-for-a-job/applescript-examples
1
3575
<reponame>looking-for-a-job/applescript-examples #!/usr/bin/osascript set home to POSIX path of (path to home folder) set smart to home & "/git/Smart Folders.gist/python.savedSearch" file type of smart
install/lib/disk/dos_seek.asm
minblock/msdos
0
29661
<reponame>minblock/msdos<gh_stars>0 ;======================================================== COMMENT # DOS_SEEK.ASM Copyright (c) 1991 - Microsoft Corp. All rights reserved. Microsoft Confidential ================================================= Seeks to the specified offset in an open disk disk file. long _dos_seek( int Handle, long lOffset, int Mode ) ARGUMENTS: Handle - Open DOS file handle lOffset - Offset to seek to in bytes Mode - Seek mode as described below 0 = Beginning of file + offset 1 = Current file position + offset 2 = End of file + offset RETURNS: long - New offset in file is success or -1L if error ================================================= johnhe - 06/06/89 END COMMENT # ; ======================================================= INCLUDE disk_io.inc INCLUDE model.inc ; ======================================================= .CODE ; ======================================================= _dos_seek PROC USES ES, Handle:WORD, lOffset:DWORD, Mode:BYTE mov AH,42h mov AL,Mode mov BX,Handle LoadOffset: les DX,lOffset mov CX,ES Int21Call: int 21h jc SeekError jmp SHORT SeekReturn SeekError: mov AX,-1 ; Error code cwd ; Extend sign to make a LONG (dword) SeekReturn: ret _dos_seek ENDP ; ======================================================= END ; =======================================================
gcc-gcc-7_3_0-release/gcc/ada/s-intman-mingw.adb
best08618/asylo
7
23218
<gh_stars>1-10 ------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . I N T E R R U P T _ M A N A G E M E N T -- -- -- -- B o d y -- -- -- -- Copyright (C) 1991-2009, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- ------------------------------------------------------------------------------ -- This is the NT version of this package with System.OS_Interface; use System.OS_Interface; package body System.Interrupt_Management is ---------------- -- Initialize -- ---------------- procedure Initialize is begin -- "Reserve" all the interrupts, except those that are explicitly -- defined. for J in Interrupt_ID'Range loop Reserve (J) := True; end loop; Reserve (SIGINT) := False; Reserve (SIGILL) := False; Reserve (SIGABRT) := False; Reserve (SIGFPE) := False; Reserve (SIGSEGV) := False; Reserve (SIGTERM) := False; end Initialize; end System.Interrupt_Management;
plugins/notify/resources/fails-on-iterm-nightly.applescript
jamesob/oh-my-zsh
1
730
tell application id "com.googlecode.iterm2" current terminal end tell
Ada/src/fakelib/utilities-hybrid_files.adb
fintatarta/fakedsp
0
11910
pragma Ada_2012; package body Utilities.Hybrid_Files is -------------- -- Put_Line -- -------------- procedure Put_Line (To : Hybrid_File; Item : String) is begin if To.Standard_IO then Text_IO.Put_Line (Item); else Text_IO.Put_Line (To.File, Item); end if; end Put_Line; -------------- -- New_Line -- -------------- procedure New_Line (To : Hybrid_File) is begin if to.Standard_IO then Text_IO.New_Line; else Text_IO.New_Line (To.File); end if; end New_Line; ---------- -- Open -- ---------- procedure Open (File : in out Hybrid_File; Name : String; M : Text_IO.File_Mode) is begin Text_IO.Open (File => File.File, Mode => M, Name => Name); File.Opened := True; File.Standard_IO := False; File.Mode := M; end Open; ------------ -- Create -- ------------ procedure Create (File : in out Hybrid_File; Name : String; M : Text_IO.File_Mode) is begin Text_IO.Create (File => File.File, Mode => M, Name => Name); File.Opened := True; File.Standard_IO := False; File.Mode := M; end Create; ---------- -- Open -- ---------- procedure Open (File : in out Hybrid_File; M : Text_IO.File_Mode) is begin File.Opened := True; File.Standard_IO := True; File.Mode := M; end Open; ----------- -- Close -- ----------- procedure Close (File : in out Hybrid_File) is begin if not File.Standard_IO then Text_IO.Close (File.File); end if; File.Opened := False; end Close; end Utilities.Hybrid_Files;
src/gen/gstreamer-gst_low_level-gstreamer_0_10_gst_gstpadtemplate_h.ads
persan/A-gst
1
19744
pragma Ada_2005; pragma Style_Checks (Off); pragma Warnings (Off); with Interfaces.C; use Interfaces.C; with glib; with glib.Values; with System; with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstobject_h; with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h; with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h; with glib; package GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpadtemplate_h is -- unsupported macro: GST_TYPE_STATIC_PAD_TEMPLATE (gst_static_pad_template_get_type ()) -- unsupported macro: GST_TYPE_PAD_TEMPLATE (gst_pad_template_get_type ()) -- arg-macro: function GST_PAD_TEMPLATE (obj) -- return G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PAD_TEMPLATE,GstPadTemplate); -- arg-macro: function GST_PAD_TEMPLATE_CLASS (klass) -- return G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PAD_TEMPLATE,GstPadTemplateClass); -- arg-macro: function GST_IS_PAD_TEMPLATE (obj) -- return G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PAD_TEMPLATE); -- arg-macro: function GST_IS_PAD_TEMPLATE_CLASS (klass) -- return G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PAD_TEMPLATE); -- arg-macro: function GST_PAD_TEMPLATE_NAME_TEMPLATE (templ) -- return ((GstPadTemplate *)(templ)).name_template; -- arg-macro: function GST_PAD_TEMPLATE_DIRECTION (templ) -- return ((GstPadTemplate *)(templ)).direction; -- arg-macro: function GST_PAD_TEMPLATE_PRESENCE (templ) -- return ((GstPadTemplate *)(templ)).presence; -- arg-macro: function GST_PAD_TEMPLATE_CAPS (templ) -- return ((GstPadTemplate *)(templ)).caps; -- arg-macro: function GST_PAD_TEMPLATE_IS_FIXED (templ) -- return GST_OBJECT_FLAG_IS_SET(templ, GST_PAD_TEMPLATE_FIXED); -- arg-macro: procedure GST_STATIC_PAD_TEMPLATE (padname, dir, pres, caps) -- { padname, dir, pres, caps } -- GStreamer -- * Copyright (C) 1999,2000 <NAME> <<EMAIL>> -- * 2000 <NAME> <<EMAIL>> -- * -- * gstpadtemplate.h: Header for GstPadTemplate object -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Library General Public -- * License as published by the Free Software Foundation; either -- * version 2 of the License, or (at your option) any later version. -- * -- * This library is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * Library General Public License for more details. -- * -- * You should have received a copy of the GNU Library General Public -- * License along with this library; if not, write to the -- * Free Software Foundation, Inc., 59 Temple Place - Suite 330, -- * Boston, MA 02111-1307, USA. -- -- FIXME: this awful circular dependency need to be resolved properly (see pad.h) --typedef struct _GstPadTemplate GstPadTemplate; type GstPadTemplateClass; type GstPadTemplateClass_u_gst_reserved_array is array (0 .. 3) of System.Address; -- subtype GstPadTemplateClass is GstPadTemplateClass; -- gst/gstpadtemplate.h:40 type GstStaticPadTemplate; --subtype GstStaticPadTemplate is u_GstStaticPadTemplate; -- gst/gstpadtemplate.h:41 --* -- * GstPadPresence: -- * @GST_PAD_ALWAYS: the pad is always available -- * @GST_PAD_SOMETIMES: the pad will become available depending on the media stream -- * @GST_PAD_REQUEST: the pad is only available on request with -- * gst_element_get_request_pad(). -- * -- * Indicates when this pad will become available. -- type GstPadPresence is (GST_PAD_ALWAYS, GST_PAD_SOMETIMES, GST_PAD_REQUEST); pragma Convention (C, GstPadPresence); -- gst/gstpadtemplate.h:64 --* -- * GST_PAD_TEMPLATE_NAME_TEMPLATE: -- * @templ: the template to query -- * -- * Get the nametemplate of the padtemplate. -- --* -- * GST_PAD_TEMPLATE_DIRECTION: -- * @templ: the template to query -- * -- * Get the #GstPadDirection of the padtemplate. -- --* -- * GST_PAD_TEMPLATE_PRESENCE: -- * @templ: the template to query -- * -- * Get the #GstPadPresence of the padtemplate. -- --* -- * GST_PAD_TEMPLATE_CAPS: -- * @templ: the template to query -- * -- * Get a handle to the padtemplate #GstCaps -- --* -- * GstPadTemplateFlags: -- * @GST_PAD_TEMPLATE_FIXED: the padtemplate has no variable properties -- * @GST_PAD_TEMPLATE_FLAG_LAST: first flag that can be used by subclasses. -- * -- * Flags for the padtemplate -- -- FIXME0.11: this is not used and the purpose is unclear -- padding subtype GstPadTemplateFlags is unsigned; GST_PAD_TEMPLATE_FIXED : constant GstPadTemplateFlags := 16; GST_PAD_TEMPLATE_FLAG_LAST : constant GstPadTemplateFlags := 256; -- gst/gstpadtemplate.h:110 --* -- * GST_PAD_TEMPLATE_IS_FIXED: -- * @templ: the template to query -- * -- * Check if the properties of the padtemplate are fixed -- --* -- * GstPadTemplate: -- * -- * The padtemplate object. -- type GstPadTemplate_u_gst_reserved_array is array (0 .. 3) of System.Address; type GstPadTemplate is record object : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstobject_h.GstObject; -- gst/gstpadtemplate.h:126 name_template : access GLIB.gchar; -- gst/gstpadtemplate.h:128 direction : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstPadDirection; -- gst/gstpadtemplate.h:129 presence : aliased GstPadPresence; -- gst/gstpadtemplate.h:130 caps : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps; -- gst/gstpadtemplate.h:131 u_gst_reserved : GstPadTemplate_u_gst_reserved_array; -- gst/gstpadtemplate.h:133 end record; pragma Convention (C_Pass_By_Copy, GstPadTemplate); -- gst/gstpadtemplate.h:125 type GstPadTemplateClass is record parent_class : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstobject_h.GstObjectClass; -- gst/gstpadtemplate.h:137 pad_created : access procedure (arg1 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpadtemplate_h.GstPadTemplate; arg2 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstPad); -- gst/gstpadtemplate.h:140 u_gst_reserved : GstPadTemplateClass_u_gst_reserved_array; -- gst/gstpadtemplate.h:142 end record; pragma Convention (C_Pass_By_Copy, GstPadTemplateClass); -- gst/gstpadtemplate.h:136 -- signal callbacks --* -- * GstStaticPadTemplate: -- * @name_template: the name of the template -- * @direction: the direction of the template -- * @presence: the presence of the template -- * @static_caps: the caps of the template. -- * -- * Structure describing the #GstStaticPadTemplate. -- type GstStaticPadTemplate is record name_template : access GLIB.gchar; -- gst/gstpadtemplate.h:155 direction : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstPadDirection; -- gst/gstpadtemplate.h:156 presence : aliased GstPadPresence; -- gst/gstpadtemplate.h:157 static_caps : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstStaticCaps; -- gst/gstpadtemplate.h:158 end record; pragma Convention (C_Pass_By_Copy, GstStaticPadTemplate); -- gst/gstpadtemplate.h:154 --* -- * GST_STATIC_PAD_TEMPLATE: -- * @padname: the name template of the pad -- * @dir: the GstPadDirection of the pad -- * @pres: the GstPadPresence of the pad -- * @caps: the GstStaticCaps of the pad -- * -- * Convenience macro to fill the values of a GstStaticPadTemplate -- * structure. -- -- templates and factories function gst_pad_template_get_type return GLIB.GType; -- gst/gstpadtemplate.h:180 pragma Import (C, gst_pad_template_get_type, "gst_pad_template_get_type"); function gst_static_pad_template_get_type return GLIB.GType; -- gst/gstpadtemplate.h:181 pragma Import (C, gst_static_pad_template_get_type, "gst_static_pad_template_get_type"); function gst_pad_template_new (name_template : access GLIB.gchar; direction : GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstPadDirection; presence : GstPadPresence; caps : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpadtemplate_h.GstPadTemplate; -- gst/gstpadtemplate.h:183 pragma Import (C, gst_pad_template_new, "gst_pad_template_new"); function gst_static_pad_template_get (pad_template : access GstStaticPadTemplate) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpadtemplate_h.GstPadTemplate; -- gst/gstpadtemplate.h:187 pragma Import (C, gst_static_pad_template_get, "gst_static_pad_template_get"); function gst_static_pad_template_get_caps (templ : access GstStaticPadTemplate) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps; -- gst/gstpadtemplate.h:188 pragma Import (C, gst_static_pad_template_get_caps, "gst_static_pad_template_get_caps"); function gst_pad_template_get_caps (templ : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpadtemplate_h.GstPadTemplate) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstcaps_h.GstCaps; -- gst/gstpadtemplate.h:189 pragma Import (C, gst_pad_template_get_caps, "gst_pad_template_get_caps"); procedure gst_pad_template_pad_created (templ : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpadtemplate_h.GstPadTemplate; pad : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstPad); -- gst/gstpadtemplate.h:191 pragma Import (C, gst_pad_template_pad_created, "gst_pad_template_pad_created"); end GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpadtemplate_h;
bb-runtimes/src/i-raspberry_pi.ads
JCGobbi/Nucleo-STM32G474RE
0
2857
<filename>bb-runtimes/src/i-raspberry_pi.ads ------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- I N T E R F A C E S . R A S P B E R R Y _ P I -- -- -- -- S p e c -- -- -- -- Copyright (C) 2016-2017, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- ------------------------------------------------------------------------------ -- This package provides declarations for hardware registers on Raspberry-Pi 2 pragma Ada_2012; -- Uses aspects with System; package Interfaces.Raspberry_Pi is pragma No_Elaboration_Code_All; pragma Preelaborate; IO_Base : constant := 16#3f00_0000#; -- IO peripherals base address. Depends on the Raspberry Pi version: -- 16#2000_000# for RPi1 -- 16#3f00_000# for RPi2 and RPi3 -- Local peripherals defined in Quad-A7 control (QA7_rev3.4.pdf) type Core_Unsigned_32 is array (1 .. 4) of Unsigned_32; type Core_Mailbox_Unsigned_32 is array (1 .. 4, 0 .. 3) of Unsigned_32; type Local_Registers_Type is record -- At 0x00: Control : Unsigned_32; Unused_1 : Unsigned_32; Core_Timer_Prescaler : Unsigned_32; GPU_Int_Routing : Unsigned_32; -- At 0x10: PMU_Int_Routing_Set : Unsigned_32; PMU_Int_Routing_Clr : Unsigned_32; Unused_2 : Unsigned_32; Core_Timer_LS : Unsigned_32; -- At 0x20: Core_Timer_MS : Unsigned_32; Local_Int_Routing : Unsigned_32; Unused_3 : Unsigned_32; AXI_Counters : Unsigned_32; -- At 0x30: AXI_Int : Unsigned_32; Local_Timer_Ctr : Unsigned_32; Local_Timer_Flags : Unsigned_32; Unused_4 : Unsigned_32; -- At 0x40 - 0x7f: Cores_Timer_Int_Ctr : Core_Unsigned_32; Cores_Mailboxes_Int_Ctr : Core_Unsigned_32; Cores_IRQ_Source : Core_Unsigned_32; Cores_FIQ_Source : Core_Unsigned_32; -- At 0x80: Cores_Mailboxes_Write_Set : Core_Mailbox_Unsigned_32; -- At 0xc0: Cores_Mailboxes_Read_Clr : Core_Mailbox_Unsigned_32; end record; Local_Registers_Base : constant := 16#4000_0000#; Local_Registers : Local_Registers_Type with Import, Volatile, Address => System'To_Address (Local_Registers_Base); -- GPIO registers GP_Base : constant := IO_Base + 16#20_0000#; type GPIO_Registers_Type is record GPFSEL0 : Unsigned_32; GPFSEL1 : Unsigned_32; GPFSEL2 : Unsigned_32; GPFSEL3 : Unsigned_32; GPFSEL4 : Unsigned_32; GPFSEL5 : Unsigned_32; Pad_18 : Unsigned_32; GPSET0 : Unsigned_32; GPSET1 : Unsigned_32; Pad_24 : Unsigned_32; GPCLR0 : Unsigned_32; GPCLR1 : Unsigned_32; Pad_30 : Unsigned_32; GPLEV0 : Unsigned_32; GPLEV1 : Unsigned_32; Pad_3c : Unsigned_32; GPEDS0 : Unsigned_32; GPEDS1 : Unsigned_32; Pad_48 : Unsigned_32; GPREN0 : Unsigned_32; GPREN1 : Unsigned_32; Pad_54 : Unsigned_32; GPFEN0 : Unsigned_32; GPFEN1 : Unsigned_32; Pad_60 : Unsigned_32; GPHEN0 : Unsigned_32; GPHEN1 : Unsigned_32; Pad_6c : Unsigned_32; GPLEN0 : Unsigned_32; GPLEN1 : Unsigned_32; Pad_78 : Unsigned_32; GPAREN0 : Unsigned_32; GPAREN1 : Unsigned_32; Pad_84 : Unsigned_32; GPAFEN0 : Unsigned_32; GPAFEN1 : Unsigned_32; Pad_90 : Unsigned_32; GPPUD : Unsigned_32; GPPUDCLK0 : Unsigned_32; GPPUDCLK1 : Unsigned_32; Pad_A0 : Unsigned_32; Pad_A4 : Unsigned_32; Pad_A8 : Unsigned_32; Pad_Ac : Unsigned_32; Test : Unsigned_32; end record; GPIO_Registers : GPIO_Registers_Type with Address => System'To_Address (GP_Base), Volatile, Import; -- Mini-UART registers MU_Base : constant := IO_Base + 16#21_5000#; Aux_ENB : Unsigned_32 with Address => System'To_Address (MU_Base + 16#04#), Import, Volatile; MU_IO : Unsigned_32 with Address => System'To_Address (MU_Base + 16#40#), Import, Volatile; MU_IIR : Unsigned_32 with Address => System'To_Address (MU_Base + 16#44#), Import, Volatile; MU_IER : Unsigned_32 with Address => System'To_Address (MU_Base + 16#48#), Import, Volatile; MU_LCR : Unsigned_32 with Address => System'To_Address (MU_Base + 16#4c#), Import, Volatile; MU_LSR : Unsigned_32 with Address => System'To_Address (MU_Base + 16#54#), Import, Volatile; MU_CNTL : Unsigned_32 with Address => System'To_Address (MU_Base + 16#60#), Import, Volatile; MU_BAUD : Unsigned_32 with Address => System'To_Address (MU_Base + 16#68#), Import, Volatile; -- Mailboxes Mail_Base_Addr : constant := IO_Base + 16#00_b880#; Mail_Read_Reg : Unsigned_32 with Address => System'To_Address (Mail_Base_Addr + 16#00#), Volatile, Import; Mail_Status_Reg : Unsigned_32 with Address => System'To_Address (Mail_Base_Addr + 16#18#), Volatile, Import; Mail_Write_Reg : Unsigned_32 with Address => System'To_Address (Mail_Base_Addr + 16#20#), Volatile, Import; -- For status: Mail_Empty : constant Unsigned_32 := 16#4000_0000#; -- Cannot read Mail_Full : constant Unsigned_32 := 16#8000_0000#; -- Cannot write -- Peripheral interrupt controller Arm_Interrupt_Base : constant := IO_Base + 16#00_b200#; type Arm_Interrupt_Type is record Irq_Basic_Pending : Unsigned_32; Irq_Pending_1 : Unsigned_32; Irq_Pending_2 : Unsigned_32; Fiq_Control : Unsigned_32; Enable_Irq_1 : Unsigned_32; Enable_Irq_2 : Unsigned_32; Enable_Basic_Irq : Unsigned_32; Disable_Irq_1 : Unsigned_32; Disable_Irq_2 : Unsigned_32; Disable_Basic_Irq : Unsigned_32; end record; Arm_Interrupts : Arm_Interrupt_Type with Import, Volatile, Address => System'To_Address (Arm_Interrupt_Base); -- Peripheral timer type Arm_Timer_Type is record Load : Unsigned_32; Value : Unsigned_32; Ctl : Unsigned_32; Irq_Ack : Unsigned_32; Raw_Irq : Unsigned_32; Masked_Irq : Unsigned_32; Reload : Unsigned_32; Divider : Unsigned_32; Free_Counter : Unsigned_32; end record; Arm_Timer_Base : constant := IO_Base + 16#00_b400#; Arm_Timer : Arm_Timer_Type with Import, Volatile, Address => System'To_Address (Arm_Timer_Base); -- EMMC type EMMC_Registers_Type is record -- At 0x00 ACMD : Unsigned_32; BLKSIZECNT : Unsigned_32; Arg1 : Unsigned_32; CMDTM : Unsigned_32; -- At 0x10 RSP0 : Unsigned_32; RSP1 : Unsigned_32; RSP2 : Unsigned_32; RSP3 : Unsigned_32; -- At 0x20 Data : Unsigned_32; Status : Unsigned_32; Control0 : Unsigned_32; Control1 : Unsigned_32; -- At 0x30 Interrupt : Unsigned_32; IRPT_Mask : Unsigned_32; IRPT_En : Unsigned_32; Control2 : Unsigned_32; -- At 0x40 Pad_40 : Unsigned_32; Pad_44 : Unsigned_32; Pad_48 : Unsigned_32; Pad_4c : Unsigned_32; -- At 0x50 Force_IRPT : Unsigned_32; Pad_54 : Unsigned_32; Pad_58 : Unsigned_32; Pad_5c : Unsigned_32; -- At 0x60 Pad_60 : Unsigned_32; Pad_64 : Unsigned_32; Pad_68 : Unsigned_32; Pad_6c : Unsigned_32; -- At 0x70 Boot_Timeout : Unsigned_32; DBG_Sel : Unsigned_32; Pad_78 : Unsigned_32; Pad_7c : Unsigned_32; -- At 0x80 EXRDFIFO_CFG : Unsigned_32; EXRDFIFO_En : Unsigned_32; Tune_Step : Unsigned_32; Tune_Steps_STD : Unsigned_32; -- At 0x90 Tune_Steps_DDR : Unsigned_32; Pad_94 : Unsigned_32; Pad_98 : Unsigned_32; Pad_9c : Unsigned_32; -- At 0xa0 Pad_a0 : Unsigned_32; Pad_a4 : Unsigned_32; Pad_a8 : Unsigned_32; Pad_ac : Unsigned_32; -- At 0xb0 Pad_b0 : Unsigned_32; Pad_b4 : Unsigned_32; Pad_b8 : Unsigned_32; Pad_bc : Unsigned_32; -- At 0xc0 Pad_c0 : Unsigned_32; Pad_c4 : Unsigned_32; Pad_c8 : Unsigned_32; Pad_cc : Unsigned_32; -- At 0xd0 Pad_d0 : Unsigned_32; Pad_d4 : Unsigned_32; Pad_d8 : Unsigned_32; Pad_dc : Unsigned_32; -- At 0xe0 Pad_e0 : Unsigned_32; Pad_e4 : Unsigned_32; Pad_e8 : Unsigned_32; Pad_ec : Unsigned_32; -- At 0xf0 Spi_Int_Spt : Unsigned_32; Pad_f4 : Unsigned_32; Pad_f8 : Unsigned_32; SlotISR_Ver : Unsigned_32; end record; package EMMC_Bits is -- Status CMD_INHIBIT : constant := 2**0; DAT_INHIBIT : constant := 2**1; -- Control 1 SRST_DATA : constant := 2**26; SRST_CMD : constant := 2**25; SRST_HC : constant := 2**24; CLK_INTLEN : constant := 2**0; CLK_STABLE : constant := 2**1; CLK_EN : constant := 2**2; -- Interrupt CMD_DONE : constant := 2**0; DATA_DONE : constant := 2**1; WRITE_RDY : constant := 2**4; READ_RDY : constant := 2**5; ERR : constant := 2**15; end EMMC_Bits; EMMC_Base : constant := IO_Base + 16#30_0000#; EMMC : EMMC_Registers_Type with Import, Volatile, Address => System'To_Address (EMMC_Base); -- Mailbox interface with VC package Mailbox_Interfaces is -- Channels Channel_Frame_Buffer : constant Unsigned_32 := 1; Channel_Tags_ARM_To_VC : constant Unsigned_32 := 8; -- Header of message is aligned on 16 bytes, and contains: -- Size : Unsigned_32; -- Code : Unsigned_32; -- Request or answer Request_Code : constant Unsigned_32 := 16#0#; Response_Success : constant Unsigned_32 := 16#8000_0000#; Response_Error : constant Unsigned_32 := 16#8000_0001#; -- The header is then followed by tags and then by a null word: -- Tag : Unsigned_32; -- Size : Unsigned_32; -- In bytes -- Indicator : Unsigned_32; Request_Indicator : constant Unsigned_32 := 0; Response_Indicator : constant Unsigned_32 := 16#8000_0000#; -- Tags Tag_Get_Board_Serial : constant Unsigned_32 := 16#1_0004#; Tag_Get_ARM_Memory : constant Unsigned_32 := 16#1_0005#; Tag_Get_VC_Memory : constant Unsigned_32 := 16#1_0006#; Tag_Get_Power_State : constant Unsigned_32 := 16#2_0001#; Tag_Set_Power_State : constant Unsigned_32 := 16#2_8001#; Tag_Get_Clock_Rate : constant Unsigned_32 := 16#3_0002#; Tag_Allocate_Buffer : constant Unsigned_32 := 16#4_0001#; Tag_Release_Buffer : constant Unsigned_32 := 16#4_8001#; Tag_Blank_Screen : constant Unsigned_32 := 16#4_0002#; Tag_Set_Physical_Size : constant Unsigned_32 := 16#4_8003#; Tag_Set_Virtual_Size : constant Unsigned_32 := 16#4_8004#; Tag_Set_Depth : constant Unsigned_32 := 16#4_8005#; Tag_Get_Pitch : constant Unsigned_32 := 16#4_0008#; -- Power Id Power_Id_SDCard : constant Unsigned_32 := 0; Power_Id_UART0 : constant Unsigned_32 := 1; Power_Id_UART1 : constant Unsigned_32 := 2; Power_Id_USB : constant Unsigned_32 := 3; Power_Id_I2C0 : constant Unsigned_32 := 4; Power_Id_I2C1 : constant Unsigned_32 := 5; Power_Id_I2C2 : constant Unsigned_32 := 6; Power_Id_SPI : constant Unsigned_32 := 7; Power_Id_CCP2TX : constant Unsigned_32 := 8; -- Clocks Id Clock_Id_EMMC : constant Unsigned_32 := 1; Clock_Id_UART : constant Unsigned_32 := 2; Clock_Id_ARM : constant Unsigned_32 := 3; Clock_Id_Core : constant Unsigned_32 := 4; Clock_Id_V3D : constant Unsigned_32 := 5; Clock_Id_H264 : constant Unsigned_32 := 6; Clock_Id_ISP : constant Unsigned_32 := 7; Clock_Id_SDRAM : constant Unsigned_32 := 8; Clock_Id_PIXEL : constant Unsigned_32 := 9; Clock_Id_PWM : constant Unsigned_32 := 10; end Mailbox_Interfaces; -- PL011 (UART0) type Pl011_Registers_Type is record DR : Unsigned_32; RSRECR : Unsigned_32; Pad08 : Unsigned_32; Pad0c : Unsigned_32; Pad10 : Unsigned_32; Pad14 : Unsigned_32; FR : Unsigned_32; Pad1c : Unsigned_32; ILPR : Unsigned_32; IBRD : Unsigned_32; FBRD : Unsigned_32; LCRH : Unsigned_32; CR : Unsigned_32; IFLS : Unsigned_32; IMSC : Unsigned_32; RIS : Unsigned_32; MIS : Unsigned_32; ICR : Unsigned_32; DMACR : Unsigned_32; Pad4c : Unsigned_32; end record; PL011_Base : constant := IO_Base + 16#20_1000#; PL011_Registers : Pl011_Registers_Type with Address => System'To_Address (PL011_Base), Volatile, Import; package PL011_Bits is FR_TXFF : constant := 2**5; FR_RXFE : constant := 2**4; FR_BUSY : constant := 2**3; MASK_RT : constant := 2**6; MASK_TX : constant := 2**5; MASK_RX : constant := 2**4; end PL011_Bits; end Interfaces.Raspberry_Pi;
applescript/show_app.applescript
jtraver/dev
0
4082
<filename>applescript/show_app.applescript display dialog (get name of current application)
examples/nrf24/main.adb
ekoeppen/STM32_Generic_Ada_Drivers
1
12181
with Ada.Real_Time; use Ada.Real_Time; with STM32GD.Board; with STM32GD.GPIO; with STM32GD.GPIO.Pin; with Peripherals; use Peripherals; procedure Main is package GPIO renames STM32GD.GPIO; package Board renames STM32GD.Board; package Text_IO renames Board.Text_IO; procedure Print_Registers is new Peripherals.Radio.Print_Registers ( Put_Line => Text_IO.Put_Line); procedure RX_Test is RX_Address : constant Radio.Address_Type := ( 16#00#, 16#F0#, 16#F0#, 16#F0#, 16#F0#); begin Text_IO.Put_Line ("Starting RX test"); Radio.Set_RX_Address (RX_Address); Radio.RX_Mode; Print_Registers; loop STM32GD.Board.LED.Toggle; Peripherals.Timer.After (Seconds (10), Radio.Cancel'Access); if Radio.Wait_For_RX then Text_IO.New_Line; Text_IO.Put_Line ("Packet received"); else Text_IO.Put_Line ("*"); end if; Print_Registers; end loop; end RX_Test; procedure TX_Test is Period : constant Time_Span := Seconds (3); Broadcast_Address : constant Radio.Address_Type := ( 16#00#, 16#F0#, 16#F0#, 16#F0#, 16#F0#); TX_Data : constant Radio.Packet_Type := ( 16#00#, 16#FF#, 16#00#, 16#00#, 16#00#, 16#00#, 16#00#, 16#FF#, 16#55#); begin Text_IO.Put_Line ("Starting TX test"); Radio.Set_TX_Address (Broadcast_Address); Radio.TX_Mode; loop STM32GD.Board.LED.Toggle; Radio.TX (TX_Data); Print_Registers; delay until Clock + Period; end loop; end TX_Test; begin STM32GD.Board.Init; Peripherals.Init; Radio.Set_Channel (70); loop RX_Test; end loop; end Main;
formalization/agda/Spire/Denotational.agda
spire/spire
43
15697
<reponame>spire/spire open import Spire.Type module Spire.Denotational where ---------------------------------------------------------------------- data Term : Set → Set₁ eval : {A : Set} → Term A → A ---------------------------------------------------------------------- data Term where {- Type introduction -} `⊥ `⊤ `Bool `ℕ `Desc `Type : ∀{ℓ} → Term (Type ℓ) `Π `Σ : ∀{ℓ} (A : Term (Type ℓ)) (B : ⟦ ℓ ∣ eval A ⟧ → Term (Type ℓ)) → Term (Type ℓ) `⟦_⟧ : ∀{ℓ} (A : Term (Type ℓ)) → Term (Type (suc ℓ)) `⟦_⟧ᵈ : ∀{ℓ} (D : Term (Desc ℓ)) (X : Term (Type ℓ)) → Term (Type ℓ) `μ : ∀{ℓ} (D : Term (Desc ℓ)) → Term (Type ℓ) {- Type elimination -} `elimType : ∀{ℓ} (P : (n : ℕ) → Type n → Term (Type ℓ)) → ((n : ℕ) → Term ⟦ ℓ ∣ eval (P n `⊥) ⟧) → ((n : ℕ) → Term ⟦ ℓ ∣ eval (P n `⊤) ⟧) → ((n : ℕ) → Term ⟦ ℓ ∣ eval (P n `Bool) ⟧) → ((n : ℕ) → Term ⟦ ℓ ∣ eval (P n `ℕ) ⟧) → ((n : ℕ) (A : Type n) (B : ⟦ n ∣ A ⟧ → Type n) (rec₁ : ⟦ ℓ ∣ eval (P n A) ⟧) (rec₂ : (a : ⟦ n ∣ A ⟧) → ⟦ ℓ ∣ eval (P n (B a)) ⟧) → Term ⟦ ℓ ∣ eval (P n (`Π A B)) ⟧) → ((n : ℕ) (A : Type n) (B : ⟦ n ∣ A ⟧ → Type n) (rec₁ : ⟦ ℓ ∣ eval (P n A) ⟧) (rec₂ : (a : ⟦ n ∣ A ⟧) → ⟦ ℓ ∣ eval (P n (B a)) ⟧) → Term ⟦ ℓ ∣ eval (P n (`Σ A B)) ⟧) → ((n : ℕ) → Term ⟦ ℓ ∣ eval (P n `Desc) ⟧) → ((n : ℕ) (D : Desc n) (X : Type n) (rec : ⟦ ℓ ∣ eval (P n X) ⟧) → Term ⟦ ℓ ∣ eval (P n (`⟦ D ⟧ᵈ X)) ⟧) → ((n : ℕ) (D : Desc n) → Term ⟦ ℓ ∣ eval (P n (`μ D)) ⟧) → ((n : ℕ) → Term ⟦ ℓ ∣ eval (P n `Type) ⟧) → ((n : ℕ) (A : Type n) (rec : ⟦ ℓ ∣ eval (P n A) ⟧) → Term ⟦ ℓ ∣ eval (P (suc n) `⟦ A ⟧) ⟧) → (n : Term ℕ) (A : Term (Type (eval n))) → Term ⟦ ℓ ∣ eval (P (eval n) (eval A)) ⟧ {- Desc introduction -} `⊤ᵈ `Xᵈ : ∀{ℓ} → Term (Desc ℓ) `Πᵈ `Σᵈ : ∀{ℓ} (A : Term (Type ℓ)) (B : ⟦ ℓ ∣ eval A ⟧ → Term (Desc (suc ℓ))) → Term (Desc (suc ℓ)) {- Desc elimination -} `elimDesc : ∀{ℓ} (P : (n : ℕ) → Desc n → Term (Type ℓ)) → ((n : ℕ) → Term ⟦ ℓ ∣ eval (P n `⊤) ⟧) → ((n : ℕ) → Term ⟦ ℓ ∣ eval (P n `X) ⟧) → ((n : ℕ) (A : Type n) (D : ⟦ n ∣ A ⟧ → Desc (suc n)) (rec : (a : ⟦ n ∣ A ⟧) → ⟦ ℓ ∣ eval (P (suc n) (D a)) ⟧) → Term ⟦ ℓ ∣ eval (P (suc n) (`Π A D)) ⟧) → ((n : ℕ) (A : Type n) (D : ⟦ n ∣ A ⟧ → Desc (suc n)) (rec : (a : ⟦ n ∣ A ⟧) → ⟦ ℓ ∣ eval (P (suc n) (D a)) ⟧) → Term ⟦ ℓ ∣ eval (P (suc n) (`Σ A D)) ⟧) → (n : Term ℕ) (D : Term (Desc (eval n))) → Term ⟦ ℓ ∣ eval (P (eval n) (eval D)) ⟧ {- Value introduction -} `tt : Term ⊤ `true `false : Term Bool `zero : Term ℕ `suc : Term ℕ → Term ℕ `λ : ∀{A} {B : A → Set} (f : (a : A) → Term (B a)) → Term ((a : A) → B a) _`,_ : ∀{A B} (a : Term A) (b : Term (B (eval a))) → Term (Σ A B) `con : ∀{ℓ D} (x : Term (⟦ ℓ ∣ D ⟧ᵈ (μ D))) → Term (μ D) {- Value elimination -} `elim⊥ : ∀{A} → Term ⊥ → Term A `elimBool : ∀{ℓ} (P : Bool → Term (Type ℓ)) (pt : Term ⟦ ℓ ∣ eval (P true) ⟧) (pf : Term ⟦ ℓ ∣ eval (P false) ⟧) (b : Term Bool) → Term ⟦ ℓ ∣ eval (P (eval b)) ⟧ `elimℕ : ∀{ℓ} (P : ℕ → Term (Type ℓ)) (pz : Term ⟦ ℓ ∣ eval (P zero) ⟧) (ps : (n : ℕ) → ⟦ ℓ ∣ eval (P n) ⟧ → Term ⟦ ℓ ∣ eval (P (suc n)) ⟧) (n : Term ℕ) → Term ⟦ ℓ ∣ eval (P (eval n)) ⟧ `proj₁ : ∀{A B} (ab : Term (Σ A B)) → Term A `proj₂ : ∀{A B} (ab : Term (Σ A B)) → Term (B (proj₁ (eval ab))) _`$_ : ∀{A} {B : A → Set} (f : Term ((a : A) → B a)) (a : Term A) → Term (B (eval a)) `des : ∀{ℓ} {D : Desc ℓ} → (Term (μ D)) → Term (⟦ ℓ ∣ D ⟧ᵈ (μ D)) ---------------------------------------------------------------------- {- Type introduction -} eval `⊥ = `⊥ eval `⊤ = `⊤ eval `Bool = `Bool eval `ℕ = `ℕ eval `Desc = `Desc eval `Type = `Type eval (`Π A B) = `Π (eval A) (λ a → eval (B a)) eval (`Σ A B) = `Σ (eval A) (λ a → eval (B a)) eval (`μ D) = `μ (eval D) eval (`⟦ D ⟧ᵈ X) = `⟦ eval D ⟧ᵈ (eval X) eval `⟦ A ⟧ = `⟦ eval A ⟧ {- Type elimination -} eval (`elimType {ℓ = ℓ} P p⊥ p⊤ pBool pℕ pΠ pΣ pDesc p⟦D⟧ᵈ pμ pType p⟦A⟧ n A) = elimType (λ n A → ⟦ ℓ ∣ eval (P n A) ⟧) (λ n → eval (p⊥ n)) (λ n → eval (p⊤ n)) (λ n → eval (pBool n)) (λ n → eval (pℕ n)) (λ n A B rec₁ rec₂ → eval (pΠ n A B rec₁ rec₂)) (λ n A B rec₁ rec₂ → eval (pΣ n A B rec₁ rec₂)) (λ n → eval (pDesc n)) (λ n D X rec → eval (p⟦D⟧ᵈ n D X rec)) (λ n D → eval (pμ n D)) (λ n → eval (pType n)) (λ n A rec → eval (p⟦A⟧ n A rec)) (eval n) (eval A) {- Desc introduction -} eval `⊤ᵈ = `⊤ eval `Xᵈ = `X eval (`Πᵈ A D) = `Π (eval A) (λ a → eval (D a)) eval (`Σᵈ A D) = `Σ (eval A) (λ a → eval (D a)) {- Desc elimination -} eval (`elimDesc {ℓ = ℓ} P p⊤ pX pΠ pΣ n D) = elimDesc (λ n D → ⟦ ℓ ∣ eval (P n D) ⟧) (λ n → eval (p⊤ n)) (λ n → eval (pX n)) (λ n A D rec → eval (pΠ n A D rec)) (λ n A D rec → eval (pΣ n A D rec)) (eval n) (eval D) {- Value introduction -} eval `tt = tt eval `true = true eval `false = false eval `zero = zero eval (`suc n) = suc (eval n) eval (`λ f) = λ a → eval (f a) eval (a `, b) = eval a , eval b eval (`con x) = con (eval x) {- Value elimination -} eval (`elim⊥ bot) = elim⊥ (eval bot) eval (`elimBool {ℓ = ℓ} P pt pf b) = elimBool (λ b → ⟦ ℓ ∣ eval (P b) ⟧) (eval pt) (eval pf) (eval b) eval (`elimℕ {ℓ = ℓ} P pz ps n) = elimℕ (λ n → ⟦ ℓ ∣ eval (P n) ⟧) (eval pz) (λ n pn → eval (ps n pn)) (eval n) eval (`proj₁ ab) = proj₁ (eval ab) eval (`proj₂ ab) = proj₂ (eval ab) eval (f `$ a) = (eval f) (eval a) eval (`des {ℓ = ℓ} x) = des {ℓ = ℓ} (eval x) ----------------------------------------------------------------------
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_2315.asm
ljhsiun2/medusa
9
14637
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r13 push %r14 push %r8 push %rbx push %rcx push %rdi push %rsi lea addresses_A_ht+0x14538, %r13 nop add $24977, %rbx mov (%r13), %r14 nop nop nop xor %rdi, %rdi lea addresses_A_ht+0x16020, %rbx nop nop nop nop and $58241, %rdi movb (%rbx), %r14b nop nop dec %r11 lea addresses_UC_ht+0x5e48, %r8 nop nop nop nop nop and %r12, %r12 movb (%r8), %r14b nop nop nop nop nop and %r13, %r13 lea addresses_UC_ht+0x6822, %r11 clflush (%r11) nop nop nop nop and $8465, %rbx movups (%r11), %xmm5 vpextrq $1, %xmm5, %r13 nop nop nop sub $58140, %r13 lea addresses_WC_ht+0x155a0, %rsi lea addresses_WC_ht+0x13820, %rdi nop nop nop and $37338, %rbx mov $30, %rcx rep movsl nop nop nop nop nop add $56246, %rbx lea addresses_UC_ht+0x1ac20, %rsi lea addresses_A_ht+0x14520, %rdi nop xor %r8, %r8 mov $110, %rcx rep movsq nop cmp %rsi, %rsi lea addresses_UC_ht+0x11e20, %rsi lea addresses_A_ht+0x14ca0, %rdi nop nop nop nop add %r14, %r14 mov $108, %rcx rep movsb nop nop nop nop nop add $33365, %r11 lea addresses_A_ht+0x2593, %rbx nop nop nop nop and %r11, %r11 mov $0x6162636465666768, %r12 movq %r12, (%rbx) nop nop nop cmp %rdi, %rdi lea addresses_D_ht+0xaeb0, %rcx clflush (%rcx) nop nop nop nop and $5350, %r14 movw $0x6162, (%rcx) nop nop nop nop nop xor %rbx, %rbx lea addresses_normal_ht+0x9c20, %rsi lea addresses_UC_ht+0x19e70, %rdi nop nop cmp $36591, %r12 mov $76, %rcx rep movsq nop nop xor $56824, %r12 lea addresses_WT_ht+0x11a08, %rsi lea addresses_UC_ht+0x1ca20, %rdi nop add %r13, %r13 mov $81, %rcx rep movsb nop add %rdi, %rdi lea addresses_UC_ht+0xf820, %rsi lea addresses_D_ht+0x9120, %rdi nop sub %rbx, %rbx mov $93, %rcx rep movsw nop nop nop xor $48906, %r12 lea addresses_normal_ht+0x13510, %rsi lea addresses_normal_ht+0x17a20, %rdi nop nop nop nop nop inc %r13 mov $82, %rcx rep movsq add $20809, %r13 lea addresses_UC_ht+0x880c, %rcx nop nop nop nop nop add %r11, %r11 mov $0x6162636465666768, %r14 movq %r14, (%rcx) nop nop nop inc %rsi lea addresses_D_ht+0x10a20, %rsi lea addresses_D_ht+0x1c620, %rdi add %r13, %r13 mov $111, %rcx rep movsq nop nop xor %r11, %r11 pop %rsi pop %rdi pop %rcx pop %rbx pop %r8 pop %r14 pop %r13 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r8 push %rax push %rbp push %rcx push %rdx // Faulty Load lea addresses_UC+0xba20, %r8 nop xor %r11, %r11 movb (%r8), %dl lea oracles, %r11 and $0xff, %rdx shlq $12, %rdx mov (%r11,%rdx,1), %rdx pop %rdx pop %rcx pop %rbp pop %rax pop %r8 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_UC', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_UC', 'same': True, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_A_ht', 'same': False, 'size': 8, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A_ht', 'same': False, 'size': 1, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 1, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 16, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 2, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': True}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': True}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': True}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_UC_ht', 'same': True, 'size': 8, 'congruent': 2, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_D_ht', 'congruent': 9, 'same': True}, 'dst': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM'} {'37': 21829} 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 */
test/Succeed/Issue133.agda
cruhland/agda
1,989
2437
module Issue133 where data Nat : Set where zz : Nat ss : Nat → Nat data _==_ {X : Set}(x : X) : X → Set where refl : x == x data Zero : Set where data Eq? (x : Nat) : Nat → Set where same : Eq? x x diff : {y : Nat} → (x == y → Zero) → Eq? x y -- This failed before due to absurd lambda checking not getting -- postponed. ioo : {y : Nat} → Eq? zz (ss y) ioo {y} = diff λ () foo : {y : Nat} → zz == ss y → Zero foo () goo : {y : Nat} → zz == ss y → Zero goo = λ () hoo : {y : Nat}{X : Set} → ((zz == ss y → Zero) → X) → X hoo boo = boo λ ()
alloy4fun_models/trainstlt/models/5/wuCDCiTwZyhEezyC4.als
Kaixi26/org.alloytools.alloy
0
3672
<reponame>Kaixi26/org.alloytools.alloy open main pred idwuCDCiTwZyhEezyC4_prop6 { always all s : Signal | eventually s' != s } pred __repair { idwuCDCiTwZyhEezyC4_prop6 } check __repair { idwuCDCiTwZyhEezyC4_prop6 <=> prop6o }
tests/fn_le/6.asm
NullMember/customasm
414
167823
<filename>tests/fn_le/6.asm<gh_stars>100-1000 #d le(0x0000ff) ; = 0xff0000
src/posix/l10n-langinfo.ads
VitalijBondarenko/AdaNLS
0
21106
------------------------------------------------------------------------------ -- -- -- Copyright (c) 2014-2016 <NAME> <<EMAIL>> -- -- -- ------------------------------------------------------------------------------ -- -- -- The MIT License (MIT) -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- -- "Software"), to deal in the Software without restriction, including -- -- without limitation the rights to use, copy, modify, merge, publish, -- -- distribute, sublicense, and/or sell copies of the Software, and to -- -- permit persons to whom the Software is furnished to do so, subject to -- -- the following conditions: -- -- -- -- The above copyright notice and this permission notice shall be included -- -- in all copies or substantial portions of the Software. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- -- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -- -- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -- -- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -- -- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- ------------------------------------------------------------------------------ -- X/Open’s nl_langinfo. with Interfaces; use Interfaces; package L10n.Langinfo is type Locale_Item is (CODESET, -- String with the name of the coded character set used in the selected -- locale. RADIXCHAR, -- Radix character (decimal point). -- The same as the value returned by Localeconv in the Decimal_Point -- element of the Lconv_Record. THOUSEP, -- Separator for thousands. -- The same as the value returned by Localeconv in the Thousands_Sep -- element of the Lconv_Record. ABDAY_1, ABDAY_2, ABDAY_3, ABDAY_4, ABDAY_5, ABDAY_6, ABDAY_7, -- ABDAY_{1-7} is abbreviated weekday names. -- ABDAY_1 corresponds to Sunday. DAY_1, DAY_2, DAY_3, DAY_4, DAY_5, DAY_6, DAY_7, -- DAY_{1-7} is full weekday names. -- DAY_1 corresponds to Sunday. ABMON_1, ABMON_2, ABMON_3, ABMON_4, ABMON_5, ABMON_6, ABMON_7, ABMON_8, ABMON_9, ABMON_10, ABMON_11, ABMON_12, -- ABMON_{1-12} is abbreviated month names. -- ABMON_1 corresponds to January. MON_1, MON_2, MON_3, MON_4, MON_5, MON_6, MON_7, MON_8, MON_9, MON_10, MON_11, MON_12, -- MON_{1-12} is full month names. -- MON_1 corresponds to January. AM_STR, PM_STR, -- Strings with appropriate ante-meridiem/post-meridiem affix. -- NOTE that in locales which do not use this time representation these -- strings might be empty, in which case the am/pm format cannot be -- used at all. D_T_FMT, -- Value can be used as a format string for represent time and date in -- a locale-specific way. D_FMT, -- Value can be used as a format string for represent date in a -- locale-specific way. T_FMT, -- Value can be used as a format string for represent time in a -- locale-specific way. T_FMT_AMPM, -- Value can be used as a format string for represent time in the -- 12-hour clock format with AM_STR and PM_STR. -- NOTE that if the am/pm format does not make any sense for the -- selected locale, the return value might be the same as the one for -- T_FMT. ERA, -- Value represents the era used in the current locale. Most locales do -- not define this value. Normally it should not be necessary to use -- this value directly. ERA_D_FMT, -- Value can be used as a format string for represent a date in a -- locale-specific era-based way. ALT_DIGITS, -- Value is a representation of up to 100 values used to represent the -- values 0 to 99. As for ERA this value is not intended to be used -- directly. ERA_D_T_FMT, -- Value can be used as a format string for represent dates and times in -- a locale-specific era-based way. ERA_T_FMT, -- Value can be used as a format string for represent time in a -- locale-specific era-based way. CRNCYSTR, -- Local currency symbol, preceded by '-' if the symbol should appear -- before the value, '+' if the symbol should appear after the value, -- or '.' if the symbol should replace the radix character. If the local -- currency symbol is the empty string, implementations may return the -- empty string. YESEXPR, -- Regular expression which can be used to recognize a positive response -- to a yes/no question. NOEXPR -- Regular expression which can be used to recognize a negative response -- to a yes/no question. ); pragma Convention (C, Locale_Item); -- Enumeration of locale items that can be queried with 'Nl_Langinfo'. function Nl_Langinfo (Item : Locale_Item) return String; -- The function shall return a string containing information relevant to -- the particular language or cultural area defined in the current locale. private for Locale_Item use (CODESET => 16#0000E#, RADIXCHAR => 16#10000#, THOUSEP => 16#10001#, ABDAY_1 => 16#20000#, ABDAY_2 => 16#20001#, ABDAY_3 => 16#20002#, ABDAY_4 => 16#20003#, ABDAY_5 => 16#20004#, ABDAY_6 => 16#20005#, ABDAY_7 => 16#20006#, DAY_1 => 16#20007#, DAY_2 => 16#20008#, DAY_3 => 16#20009#, DAY_4 => 16#2000A#, DAY_5 => 16#2000B#, DAY_6 => 16#2000C#, DAY_7 => 16#2000D#, ABMON_1 => 16#2000E#, ABMON_2 => 16#2000F#, ABMON_3 => 16#20010#, ABMON_4 => 16#20011#, ABMON_5 => 16#20012#, ABMON_6 => 16#20013#, ABMON_7 => 16#20014#, ABMON_8 => 16#20015#, ABMON_9 => 16#20016#, ABMON_10 => 16#20017#, ABMON_11 => 16#20018#, ABMON_12 => 16#20019#, MON_1 => 16#2001A#, MON_2 => 16#2001B#, MON_3 => 16#2001C#, MON_4 => 16#2001D#, MON_5 => 16#2001E#, MON_6 => 16#2001F#, MON_7 => 16#20020#, MON_8 => 16#20021#, MON_9 => 16#20022#, MON_10 => 16#20023#, MON_11 => 16#20024#, MON_12 => 16#20025#, AM_STR => 16#20026#, PM_STR => 16#20027#, D_T_FMT => 16#20028#, D_FMT => 16#20029#, T_FMT => 16#2002A#, T_FMT_AMPM => 16#2002B#, ERA => 16#2002C#, ERA_D_FMT => 16#2002E#, ALT_DIGITS => 16#2002F#, ERA_D_T_FMT => 16#20030#, ERA_T_FMT => 16#20031#, CRNCYSTR => 16#4000F#, YESEXPR => 16#50000#, NOEXPR => 16#50001#); end L10n.Langinfo;
testsuite/ubivm/output/method_4.asm
alexgarzao/UOP
0
4806
.constant_pool .const 0 string [start] .const 1 string [constructor] .const 2 string [oi] .const 3 string [oi de novo !!!] .const 4 string [x] .const 5 string [msg1] .const 6 string [msg2] .const 7 string [msg1=] .const 8 int [2] .const 9 string [io.writeln] .const 10 string [msg2=] .end .entity start .valid_context_when (always) .method constructor ldconst 2 --> [oi] ldconst 3 --> [oi de novo !!!] ldself mcall 4 --> [x] exit .end .method x .param 0 string msg1 .param 1 string msg2 ldconst 7 --> [msg1=] ldparam 0 --> [msg1] ldconst 8 --> [2] lcall 9 --> [io.writeln] ldconst 10 --> [msg2=] ldparam 1 --> [msg2] ldconst 8 --> [2] lcall 9 --> [io.writeln] ret .end .end
src/Implicits/Semantics/RewriteContext.agda
metaborg/ts.agda
4
16715
open import Prelude module Implicits.Semantics.RewriteContext where open import Implicits.Syntax open import Implicits.Substitutions open import Implicits.Substitutions.Lemmas open import Data.Vec open import Data.List.All as All open import Extensions.Vec -- rewrite context (relation between implicit and explicit context) _#_ : ∀ {ν n} (Γ : Ctx ν n) (Δ : ICtx ν) → Set Γ # Δ = All (λ i → i ∈ Γ) Δ K# : ∀ {ν n} (K : Ktx ν n) → Set K# (Γ , Δ) = Γ # Δ #tvar : ∀ {ν n} {K : Ktx ν n} → K# K → K# (ktx-weaken K) #tvar All.[] = All.[] #tvar (px All.∷ K#K) = (∈⋆map px (λ t → t tp/tp TypeLemmas.wk)) All.∷ (#tvar K#K) #var : ∀ {ν n} {K : Ktx ν n} → (a : Type ν) → K# K → K# (a ∷Γ K) #var a All.[] = All.[] #var a (px All.∷ K#K) = there px All.∷ (#var a K#K) #ivar : ∀ {ν n} {K : Ktx ν n} → (a : Type ν) → K# K → K# (a ∷K K) #ivar a K#K = here All.∷ (All.map there K#K)
oeis/172/A172244.asm
neoneye/loda-programs
11
21288
; A172244: Integers (up to a sign) that are not representable in the form 2x^2 + xy + 3y^2 + z^3 - z for integer x,y,z. ; Submitted by <NAME> ; 1,599,14951,9314449,232488049,144839681351,3615189146999,2252257035693601,56216191003346401,35022596760195814199,874161766486847388551,544601377368787875100849,13593215412654285888621649,8468551383062054697622387751,211374498792612379081219253399,131685973462013573179240254427201,3286873442631907082058673501732801,2047716878865759679875131258720587799,51110881821551656333399993870725802151,31841997334676589560044717893864885847249,794774209038254813352462822631112721715249 mul $0,3 mov $3,1 mov $4,1 lpb $0 sub $0,$3 mov $1,$4 mul $1,21 add $2,$4 add $2,$4 add $2,$1 mov $3,2 add $4,$2 lpe mov $0,$4
oeis/059/A059145.asm
neoneye/loda-programs
11
178203
; A059145: A hierarchical sequence (S(W3{2,2}*cc) - see A059126). ; 15,54,141,324,699,1458,2985,6048,12183,24462,49029,98172,196467,393066,786273 add $0,2 mov $1,2 pow $1,$0 sub $0,$1 mul $0,3 sub $1,$0 sub $1,5 mov $0,$1 mul $0,3
tests/_g_00/_g_00.asm
RL-Bin/RLBin
0
92216
global _main extern _printf ; Uncomment under Windows section .data fmtStr: db 'hello, world',0xA,0 section .text _main: sub esp, 4 ; Allocate space on the stack for one 4 byte parameter lea eax, [fmtStr] mov [esp], eax ; Arg1: pointer to format string call _printf ; Call printf(3): ; int printf(const char *format, ...); add esp, 4 ; Pop stack once ret
src/tcl-lists.adb
thindil/tashy2
2
28797
<reponame>thindil/tashy2 -- Copyright (c) 2021 <NAME> <<EMAIL>> -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. with Interfaces.C; use Interfaces.C; with Interfaces.C.Strings; use Interfaces.C.Strings; with Tashy2; with Tcl.Commands; package body Tcl.Lists is function Split_List (List: String; Interpreter: Tcl_Interpreter := Get_Interpreter) return Array_List with SPARK_Mode => Off is use Tcl.Commands; function Tcl_Split_List (Interp: Tcl_Interpreter; Tcl_List: chars_ptr; Argc_Ptr: out int; Argv_Ptr: out Argv_Pointer.Pointer) return Tcl_Results with Import, Convention => C, External_Name => "Tcl_SplitList"; Amount: Natural := 0; Values: Argv_Pointer.Pointer; begin if Tcl_Split_List (Interp => Interpreter, Tcl_List => New_String(Str => List), Argc_Ptr => int(Amount), Argv_Ptr => Values) = TCL_ERROR then return Empty_Array_List; end if; if Amount = 0 then return Empty_Array_List; end if; return Ada_Array: Array_List(1 .. Amount) := (others => Null_Tcl_String) do Convert_List_To_Array_Loop : for I in Ada_Array'Range loop Ada_Array(I) := To_Unbounded_String (Source => Get_Argument(Arguments_Pointer => Values, Index => I - 1)); end loop Convert_List_To_Array_Loop; end return; end Split_List; function Merge_List(List: Array_List) return String is use Tashy2; function Tcl_Merge (Argc: int; Argv: chars_ptr_array) return chars_ptr with Global => null, Import, Convention => C, External_Name => "Tcl_Merge"; New_List: chars_ptr_array(1 .. List'Length) := (others => Null_Ptr); Index: size_t := New_List'First; begin Convert_Ada_String_To_C_Loop : for Item of List loop pragma Loop_Invariant(Index in New_List'Range); New_List(Index) := To_C_String(Str => To_Ada_String(Source => Item)); Index := Index + 1; exit Convert_Ada_String_To_C_Loop when Index > New_List'Last; end loop Convert_Ada_String_To_C_Loop; return From_C_String (Item => Tcl_Merge(Argc => List'Length, Argv => New_List)); end Merge_List; end Tcl.Lists;
programs/oeis/185/A185907.asm
neoneye/loda
22
6397
<gh_stars>10-100 ; A185907: Weight array of A185908, by antidiagonals. ; 1,0,1,0,1,1,0,0,0,1,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0 mul $0,2 mov $1,1 lpb $0 cmp $2,0 add $1,$2 sub $0,$1 lpe cmp $0,$2
src/sys/serialize/util-beans-objects-readers.adb
RREE/ada-util
60
13839
----------------------------------------------------------------------- -- util-beans-objects-readers -- Datasets -- Copyright (C) 2017, 2020 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package body Util.Beans.Objects.Readers is use type Maps.Map_Bean_Access; use type Vectors.Vector_Bean_Access; -- Start a document. overriding procedure Start_Document (Handler : in out Reader) is begin Object_Stack.Clear (Handler.Context); end Start_Document; -- ----------------------- -- Start a new object associated with the given name. This is called when -- the '{' is reached. The reader must be updated so that the next -- <b>Set_Member</b> procedure will associate the name/value pair on the -- new object. -- ----------------------- overriding procedure Start_Object (Handler : in out Reader; Name : in String; Logger : in out Util.Log.Logging'Class) is pragma Unreferenced (Logger); Current : constant Object_Context_Access := Object_Stack.Current (Handler.Context); Next : Object_Context_Access; begin Object_Stack.Push (Handler.Context); Next := Object_Stack.Current (Handler.Context); Next.Map := new Maps.Map_Bean; Next.List := null; if Current = null then Handler.Root := To_Object (Next.Map, DYNAMIC); elsif Current.Map /= null then Current.Map.Include (Name, To_Object (Next.Map, DYNAMIC)); else Current.List.Append (To_Object (Next.Map, DYNAMIC)); end if; end Start_Object; -- ----------------------- -- Finish an object associated with the given name. The reader must be -- updated to be associated with the previous object. -- ----------------------- overriding procedure Finish_Object (Handler : in out Reader; Name : in String; Logger : in out Util.Log.Logging'Class) is pragma Unreferenced (Name, Logger); begin Object_Stack.Pop (Handler.Context); end Finish_Object; overriding procedure Start_Array (Handler : in out Reader; Name : in String; Logger : in out Util.Log.Logging'Class) is pragma Unreferenced (Logger); Current : constant Object_Context_Access := Object_Stack.Current (Handler.Context); Next : Object_Context_Access; begin Object_Stack.Push (Handler.Context); Next := Object_Stack.Current (Handler.Context); Next.List := new Vectors.Vector_Bean; Next.Map := null; if Current = null then Handler.Root := To_Object (Next.List, DYNAMIC); elsif Current.Map /= null then Current.Map.Include (Name, To_Object (Next.List, DYNAMIC)); else Current.List.Append (To_Object (Next.List, DYNAMIC)); end if; end Start_Array; overriding procedure Finish_Array (Handler : in out Reader; Name : in String; Count : in Natural; Logger : in out Util.Log.Logging'Class) is pragma Unreferenced (Name, Count, Logger); begin Object_Stack.Pop (Handler.Context); end Finish_Array; -- ----------------------- -- Set the name/value pair on the current object. For each active mapping, -- find whether a rule matches our name and execute it. -- ----------------------- overriding procedure Set_Member (Handler : in out Reader; Name : in String; Value : in Util.Beans.Objects.Object; Logger : in out Util.Log.Logging'Class; Attribute : in Boolean := False) is pragma Unreferenced (Logger, Attribute); Current : constant Object_Context_Access := Object_Stack.Current (Handler.Context); begin if Current = null then Handler.Root := Value; elsif Current.Map /= null then Current.Map.Set_Value (Name, Value); else Current.List.Append (Value); end if; end Set_Member; -- ----------------------- -- Get the root object. -- ----------------------- function Get_Root (Handler : in Reader) return Object is begin return Handler.Root; end Get_Root; end Util.Beans.Objects.Readers;
libsrc/stdio_new/fd/open.asm
andydansby/z88dk-mk2
1
97227
; CALLER linkage for function pointers XLIB open LIB open_callee XREF ASMDISP_OPEN_CALLEE .open pop hl pop bc pop de push de push bc push hl jp open_callee + ASMDISP_OPEN_CALLEE
Palmtree.Math.Core.Sint/vs_build/x86_Debug/TEST_op_Equals.asm
rougemeilland/Palmtree.Math.Core.Sint
0
29307
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.16.27026.1 TITLE Z:\Sources\Lunor\Repos\rougemeilland\Palmtree.Math.Core.Sint\Palmtree.Math.Core.Sint\TEST_op_Equals.c .686P .XMM include listing.inc .model flat INCLUDELIB MSVCRTD INCLUDELIB OLDNAMES _DATA SEGMENT COMM _uint_number_zero:DWORD COMM _uint_number_one:DWORD _DATA ENDS msvcjmc SEGMENT __7B7A869E_ctype@h DB 01H __457DD326_basetsd@h DB 01H __4384A2D9_corecrt_memcpy_s@h DB 01H __4E51A221_corecrt_wstring@h DB 01H __2140C079_string@h DB 01H __1887E595_winnt@h DB 01H __9FC7C64B_processthreadsapi@h DB 01H __FA470AEC_memoryapi@h DB 01H __F37DAFF1_winerror@h DB 01H __7A450CCC_winbase@h DB 01H __B4B40122_winioctl@h DB 01H __86261D59_stralign@h DB 01H __059414E1_pmc_sint_debug@h DB 01H __2415E362_test_op_equals@c DB 01H msvcjmc ENDS PUBLIC _TEST_Equals_I_X PUBLIC _TEST_Equals_L_X PUBLIC _TEST_Equals_UX_X PUBLIC _TEST_Equals_X_I PUBLIC _TEST_Equals_X_L PUBLIC _TEST_Equals_X_UX PUBLIC _TEST_Equals_X_X PUBLIC __JustMyCode_Default PUBLIC ??_C@_1EC@NPMCAPKO@?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ@ ; `string' PUBLIC ??_C@_1CG@ECJOMMLD@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAI?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ ; `string' PUBLIC ??_C@_1DM@DIPCKLML@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAI?$AA_?$AAX?$AAn?$PP?$KJ?$AA0?$PP?$LD?$PP?$PM@ ; `string' PUBLIC ??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@ ; `string' PUBLIC ??_C@_1CG@KKLNDHML@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAL?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ ; `string' PUBLIC ??_C@_1DM@GDGMFIFF@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAL?$AA_?$AAX?$AAn?$PP?$KJ?$AA0?$PP?$LD?$PP?$PM@ ; `string' PUBLIC ??_C@_1CI@OFNPDABI@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAU?$AAX?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd@ ; `string' PUBLIC ??_C@_1DO@PEPKKHHD@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAU?$AAX?$AA_?$AAX?$AAn?$PP?$KJ?$AA0?$PP?$LD@ ; `string' PUBLIC ??_C@_1CG@DJHBEGMK@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAI?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ ; `string' PUBLIC ??_C@_1DM@GEGJHNOM@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAI?$AAn?$PP?$KJ?$AA0?$PP?$LD?$PP?$PM@ ; `string' PUBLIC ??_C@_1CG@BCPLJGNF@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAL?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ ; `string' PUBLIC ??_C@_1DM@CMCFOAHJ@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAL?$AAn?$PP?$KJ?$AA0?$PP?$LD?$PP?$PM@ ; `string' PUBLIC ??_C@_1CI@NLHEPFBK@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAU?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd@ ; `string' PUBLIC ??_C@_1DO@HDBPOJFD@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAU?$AAX?$AAn?$PP?$KJ?$AA0?$PP?$LD@ ; `string' PUBLIC ??_C@_1CG@LMNANGKJ@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ ; `string' PUBLIC ??_C@_1DM@NGGGJAGM@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAX?$AAn?$PP?$KJ?$AA0?$PP?$LD?$PP?$PM@ ; `string' EXTRN _TEST_Assert:PROC EXTRN _FormatTestLabel:PROC EXTRN _FormatTestMesssage:PROC EXTRN @_RTC_CheckStackVars@8:PROC EXTRN @__CheckForDebuggerJustMyCode@4:PROC EXTRN @__security_check_cookie@4:PROC EXTRN __RTC_CheckEsp:PROC EXTRN __RTC_InitBase:PROC EXTRN __RTC_Shutdown:PROC EXTRN ___security_cookie:DWORD ; COMDAT rtc$TMZ rtc$TMZ SEGMENT __RTC_Shutdown.rtc$TMZ DD FLAT:__RTC_Shutdown rtc$TMZ ENDS ; COMDAT rtc$IMZ rtc$IMZ SEGMENT __RTC_InitBase.rtc$IMZ DD FLAT:__RTC_InitBase rtc$IMZ ENDS ; COMDAT ??_C@_1DM@NGGGJAGM@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAX?$AAn?$PP?$KJ?$AA0?$PP?$LD?$PP?$PM@ CONST SEGMENT ??_C@_1DM@NGGGJAGM@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAX?$AAn?$PP?$KJ?$AA0?$PP?$LD?$PP?$PM@ DB 'E' DB 00H, 'q', 00H, 'u', 00H, 'a', 00H, 'l', 00H, 's', 00H, '_', 00H DB 'X', 00H, '_', 00H, 'X', 00H, 'n0', 0a9H, '_0^', 0b3H, '0', 0fcH DB '0', 0c9H, '0L0', 01fH, 'g', 085H, '_', 01aH, 090H, 08aH, '0g0' DB 'o0j0D0(', 00H, '%', 00H, 'd', 00H, ')', 00H, 00H, 00H ; `string' CONST ENDS ; COMDAT ??_C@_1CG@LMNANGKJ@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ CONST SEGMENT ??_C@_1CG@LMNANGKJ@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ DB 'E' DB 00H, 'q', 00H, 'u', 00H, 'a', 00H, 'l', 00H, 's', 00H, '_', 00H DB 'X', 00H, '_', 00H, 'X', 00H, ' ', 00H, '(', 00H, '%', 00H, 'd' DB 00H, '.', 00H, '%', 00H, 'd', 00H, ')', 00H, 00H, 00H ; `string' CONST ENDS ; COMDAT ??_C@_1DO@HDBPOJFD@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAU?$AAX?$AAn?$PP?$KJ?$AA0?$PP?$LD@ CONST SEGMENT ??_C@_1DO@HDBPOJFD@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAU?$AAX?$AAn?$PP?$KJ?$AA0?$PP?$LD@ DB 'E' DB 00H, 'q', 00H, 'u', 00H, 'a', 00H, 'l', 00H, 's', 00H, '_', 00H DB 'X', 00H, '_', 00H, 'U', 00H, 'X', 00H, 'n0', 0a9H, '_0^', 0b3H DB '0', 0fcH, '0', 0c9H, '0L0', 01fH, 'g', 085H, '_', 01aH, 090H, 08aH DB '0g0o0j0D0(', 00H, '%', 00H, 'd', 00H, ')', 00H, 00H, 00H ; `string' CONST ENDS ; COMDAT ??_C@_1CI@NLHEPFBK@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAU?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd@ CONST SEGMENT ??_C@_1CI@NLHEPFBK@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAU?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd@ DB 'E' DB 00H, 'q', 00H, 'u', 00H, 'a', 00H, 'l', 00H, 's', 00H, '_', 00H DB 'X', 00H, '_', 00H, 'U', 00H, 'X', 00H, ' ', 00H, '(', 00H, '%' DB 00H, 'd', 00H, '.', 00H, '%', 00H, 'd', 00H, ')', 00H, 00H, 00H ; `string' CONST ENDS ; COMDAT ??_C@_1DM@CMCFOAHJ@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAL?$AAn?$PP?$KJ?$AA0?$PP?$LD?$PP?$PM@ CONST SEGMENT ??_C@_1DM@CMCFOAHJ@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAL?$AAn?$PP?$KJ?$AA0?$PP?$LD?$PP?$PM@ DB 'E' DB 00H, 'q', 00H, 'u', 00H, 'a', 00H, 'l', 00H, 's', 00H, '_', 00H DB 'X', 00H, '_', 00H, 'L', 00H, 'n0', 0a9H, '_0^', 0b3H, '0', 0fcH DB '0', 0c9H, '0L0', 01fH, 'g', 085H, '_', 01aH, 090H, 08aH, '0g0' DB 'o0j0D0(', 00H, '%', 00H, 'd', 00H, ')', 00H, 00H, 00H ; `string' CONST ENDS ; COMDAT ??_C@_1CG@BCPLJGNF@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAL?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ CONST SEGMENT ??_C@_1CG@BCPLJGNF@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAL?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ DB 'E' DB 00H, 'q', 00H, 'u', 00H, 'a', 00H, 'l', 00H, 's', 00H, '_', 00H DB 'X', 00H, '_', 00H, 'L', 00H, ' ', 00H, '(', 00H, '%', 00H, 'd' DB 00H, '.', 00H, '%', 00H, 'd', 00H, ')', 00H, 00H, 00H ; `string' CONST ENDS ; COMDAT ??_C@_1DM@GEGJHNOM@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAI?$AAn?$PP?$KJ?$AA0?$PP?$LD?$PP?$PM@ CONST SEGMENT ??_C@_1DM@GEGJHNOM@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAI?$AAn?$PP?$KJ?$AA0?$PP?$LD?$PP?$PM@ DB 'E' DB 00H, 'q', 00H, 'u', 00H, 'a', 00H, 'l', 00H, 's', 00H, '_', 00H DB 'X', 00H, '_', 00H, 'I', 00H, 'n0', 0a9H, '_0^', 0b3H, '0', 0fcH DB '0', 0c9H, '0L0', 01fH, 'g', 085H, '_', 01aH, 090H, 08aH, '0g0' DB 'o0j0D0(', 00H, '%', 00H, 'd', 00H, ')', 00H, 00H, 00H ; `string' CONST ENDS ; COMDAT ??_C@_1CG@DJHBEGMK@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAI?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ CONST SEGMENT ??_C@_1CG@DJHBEGMK@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAI?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ DB 'E' DB 00H, 'q', 00H, 'u', 00H, 'a', 00H, 'l', 00H, 's', 00H, '_', 00H DB 'X', 00H, '_', 00H, 'I', 00H, ' ', 00H, '(', 00H, '%', 00H, 'd' DB 00H, '.', 00H, '%', 00H, 'd', 00H, ')', 00H, 00H, 00H ; `string' CONST ENDS ; COMDAT ??_C@_1DO@PEPKKHHD@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAU?$AAX?$AA_?$AAX?$AAn?$PP?$KJ?$AA0?$PP?$LD@ CONST SEGMENT ??_C@_1DO@PEPKKHHD@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAU?$AAX?$AA_?$AAX?$AAn?$PP?$KJ?$AA0?$PP?$LD@ DB 'E' DB 00H, 'q', 00H, 'u', 00H, 'a', 00H, 'l', 00H, 's', 00H, '_', 00H DB 'U', 00H, 'X', 00H, '_', 00H, 'X', 00H, 'n0', 0a9H, '_0^', 0b3H DB '0', 0fcH, '0', 0c9H, '0L0', 01fH, 'g', 085H, '_', 01aH, 090H, 08aH DB '0g0o0j0D0(', 00H, '%', 00H, 'd', 00H, ')', 00H, 00H, 00H ; `string' CONST ENDS ; COMDAT ??_C@_1CI@OFNPDABI@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAU?$AAX?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd@ CONST SEGMENT ??_C@_1CI@OFNPDABI@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAU?$AAX?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd@ DB 'E' DB 00H, 'q', 00H, 'u', 00H, 'a', 00H, 'l', 00H, 's', 00H, '_', 00H DB 'U', 00H, 'X', 00H, '_', 00H, 'X', 00H, ' ', 00H, '(', 00H, '%' DB 00H, 'd', 00H, '.', 00H, '%', 00H, 'd', 00H, ')', 00H, 00H, 00H ; `string' CONST ENDS ; COMDAT ??_C@_1DM@GDGMFIFF@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAL?$AA_?$AAX?$AAn?$PP?$KJ?$AA0?$PP?$LD?$PP?$PM@ CONST SEGMENT ??_C@_1DM@GDGMFIFF@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAL?$AA_?$AAX?$AAn?$PP?$KJ?$AA0?$PP?$LD?$PP?$PM@ DB 'E' DB 00H, 'q', 00H, 'u', 00H, 'a', 00H, 'l', 00H, 's', 00H, '_', 00H DB 'L', 00H, '_', 00H, 'X', 00H, 'n0', 0a9H, '_0^', 0b3H, '0', 0fcH DB '0', 0c9H, '0L0', 01fH, 'g', 085H, '_', 01aH, 090H, 08aH, '0g0' DB 'o0j0D0(', 00H, '%', 00H, 'd', 00H, ')', 00H, 00H, 00H ; `string' CONST ENDS ; COMDAT ??_C@_1CG@KKLNDHML@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAL?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ CONST SEGMENT ??_C@_1CG@KKLNDHML@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAL?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ DB 'E' DB 00H, 'q', 00H, 'u', 00H, 'a', 00H, 'l', 00H, 's', 00H, '_', 00H DB 'L', 00H, '_', 00H, 'X', 00H, ' ', 00H, '(', 00H, '%', 00H, 'd' DB 00H, '.', 00H, '%', 00H, 'd', 00H, ')', 00H, 00H, 00H ; `string' CONST ENDS ; COMDAT ??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@ CONST SEGMENT ??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@ DB 0c7H DB '0', 0fcH, '0', 0bfH, '0n0', 085H, 'Q', 0b9H, '[L0', 00H, 'N', 0f4H DB 081H, 'W0j0D0', 00H, 00H ; `string' CONST ENDS ; COMDAT ??_C@_1DM@DIPCKLML@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAI?$AA_?$AAX?$AAn?$PP?$KJ?$AA0?$PP?$LD?$PP?$PM@ CONST SEGMENT ??_C@_1DM@DIPCKLML@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAI?$AA_?$AAX?$AAn?$PP?$KJ?$AA0?$PP?$LD?$PP?$PM@ DB 'E' DB 00H, 'q', 00H, 'u', 00H, 'a', 00H, 'l', 00H, 's', 00H, '_', 00H DB 'I', 00H, '_', 00H, 'X', 00H, 'n0', 0a9H, '_0^', 0b3H, '0', 0fcH DB '0', 0c9H, '0L0', 01fH, 'g', 085H, '_', 01aH, 090H, 08aH, '0g0' DB 'o0j0D0(', 00H, '%', 00H, 'd', 00H, ')', 00H, 00H, 00H ; `string' CONST ENDS ; COMDAT ??_C@_1CG@ECJOMMLD@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAI?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ CONST SEGMENT ??_C@_1CG@ECJOMMLD@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAI?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ DB 'E' DB 00H, 'q', 00H, 'u', 00H, 'a', 00H, 'l', 00H, 's', 00H, '_', 00H DB 'I', 00H, '_', 00H, 'X', 00H, ' ', 00H, '(', 00H, '%', 00H, 'd' DB 00H, '.', 00H, '%', 00H, 'd', 00H, ')', 00H, 00H, 00H ; `string' CONST ENDS ; COMDAT ??_C@_1EC@NPMCAPKO@?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ@ CONST SEGMENT ??_C@_1EC@NPMCAPKO@?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ@ DB 'F' DB 00H, 'r', 00H, 'o', 00H, 'm', 00H, 'B', 00H, 'y', 00H, 't', 00H DB 'e', 00H, 'A', 00H, 'r', 00H, 'r', 00H, 'a', 00H, 'y', 00H, 'n' DB '0', 0a9H, '_0^', 0b3H, '0', 0fcH, '0', 0c9H, '0L0', 01fH, 'g', 085H DB '_', 01aH, 090H, 08aH, '0g0o0j0D0(', 00H, '%', 00H, 'd', 00H, ')' DB 00H, 00H, 00H ; `string' CONST ENDS ; Function compile flags: /Odt ; COMDAT __JustMyCode_Default _TEXT SEGMENT __JustMyCode_Default PROC ; COMDAT push ebp mov ebp, esp pop ebp ret 0 __JustMyCode_Default ENDP _TEXT ENDS ; Function compile flags: /Odtp /RTCsu /ZI ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.sint\palmtree.math.core.sint\test_op_equals.c ; COMDAT _TEST_Equals_X_X _TEXT SEGMENT tv152 = -272 ; size = 4 tv142 = -272 ; size = 4 tv92 = -272 ; size = 4 tv74 = -272 ; size = 4 _v_result$ = -72 ; size = 4 _u_result$ = -60 ; size = 4 _result$ = -48 ; size = 4 _actual_w$ = -36 ; size = 4 _v$ = -24 ; size = 4 _u$ = -12 ; size = 4 __$ArrayPad$ = -4 ; size = 4 _env$ = 8 ; size = 4 _ep$ = 12 ; size = 4 _no$ = 16 ; size = 4 _u_buf$ = 20 ; size = 4 _u_buf_size$ = 24 ; size = 4 _v_buf$ = 28 ; size = 4 _v_buf_size$ = 32 ; size = 4 _desired_w$ = 36 ; size = 4 _TEST_Equals_X_X PROC ; COMDAT ; 120 : { push ebp mov ebp, esp sub esp, 272 ; 00000110H push ebx push esi push edi lea edi, DWORD PTR [ebp-272] mov ecx, 68 ; 00000044H mov eax, -858993460 ; ccccccccH rep stosd mov eax, DWORD PTR ___security_cookie xor eax, ebp mov DWORD PTR __$ArrayPad$[ebp], eax mov ecx, OFFSET __2415E362_test_op_equals@c call @__CheckForDebuggerJustMyCode@4 ; 121 : PMC_HANDLE_SINT u; ; 122 : PMC_HANDLE_SINT v; ; 123 : __int32 actual_w; ; 124 : PMC_STATUS_CODE result; ; 125 : PMC_STATUS_CODE u_result; ; 126 : PMC_STATUS_CODE v_result; ; 127 : TEST_Assert(env, FormatTestLabel(L"Equals_X_X (%d.%d)", no, 1), (u_result = ep->FromByteArray(u_buf, u_buf_size, &u)) == PMC_STATUS_OK, FormatTestMesssage(L"FromByteArrayの復帰コードが期待通りではない(%d)", u_result)); mov esi, esp lea eax, DWORD PTR _u$[ebp] push eax mov ecx, DWORD PTR _u_buf_size$[ebp] push ecx mov edx, DWORD PTR _u_buf$[ebp] push edx mov eax, DWORD PTR _ep$[ebp] mov ecx, DWORD PTR [eax+304] call ecx cmp esi, esp call __RTC_CheckEsp mov DWORD PTR _u_result$[ebp], eax cmp DWORD PTR _u_result$[ebp], 0 jne SHORT $LN5@TEST_Equal mov DWORD PTR tv74[ebp], 1 jmp SHORT $LN6@TEST_Equal $LN5@TEST_Equal: mov DWORD PTR tv74[ebp], 0 $LN6@TEST_Equal: mov edx, DWORD PTR _u_result$[ebp] push edx push OFFSET ??_C@_1EC@NPMCAPKO@?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ@ call _FormatTestMesssage add esp, 8 push eax mov eax, DWORD PTR tv74[ebp] push eax push 1 mov ecx, DWORD PTR _no$[ebp] push ecx push OFFSET ??_C@_1CG@LMNANGKJ@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ call _FormatTestLabel add esp, 12 ; 0000000cH push eax mov edx, DWORD PTR _env$[ebp] push edx call _TEST_Assert add esp, 16 ; 00000010H ; 128 : TEST_Assert(env, FormatTestLabel(L"Equals_X_X (%d.%d)", no, 2), (v_result = ep->FromByteArray(v_buf, v_buf_size, &v)) == PMC_STATUS_OK, FormatTestMesssage(L"FromByteArrayの復帰コードが期待通りではない(%d)", v_result)); mov esi, esp lea eax, DWORD PTR _v$[ebp] push eax mov ecx, DWORD PTR _v_buf_size$[ebp] push ecx mov edx, DWORD PTR _v_buf$[ebp] push edx mov eax, DWORD PTR _ep$[ebp] mov ecx, DWORD PTR [eax+304] call ecx cmp esi, esp call __RTC_CheckEsp mov DWORD PTR _v_result$[ebp], eax cmp DWORD PTR _v_result$[ebp], 0 jne SHORT $LN7@TEST_Equal mov DWORD PTR tv92[ebp], 1 jmp SHORT $LN8@TEST_Equal $LN7@TEST_Equal: mov DWORD PTR tv92[ebp], 0 $LN8@TEST_Equal: mov edx, DWORD PTR _v_result$[ebp] push edx push OFFSET ??_C@_1EC@NPMCAPKO@?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ@ call _FormatTestMesssage add esp, 8 push eax mov eax, DWORD PTR tv92[ebp] push eax push 2 mov ecx, DWORD PTR _no$[ebp] push ecx push OFFSET ??_C@_1CG@LMNANGKJ@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ call _FormatTestLabel add esp, 12 ; 0000000cH push eax mov edx, DWORD PTR _env$[ebp] push edx call _TEST_Assert add esp, 16 ; 00000010H ; 129 : TEST_Assert(env, FormatTestLabel(L"Equals_X_X (%d.%d)", no, 3), (result = ep->Equals_X_X(u, v, &actual_w)) == PMC_STATUS_OK, FormatTestMesssage(L"Equals_X_Xの復帰コードが期待通りではない(%d)", result)); mov esi, esp lea eax, DWORD PTR _actual_w$[ebp] push eax mov ecx, DWORD PTR _v$[ebp] push ecx mov edx, DWORD PTR _u$[ebp] push edx mov eax, DWORD PTR _ep$[ebp] mov ecx, DWORD PTR [eax+496] call ecx cmp esi, esp call __RTC_CheckEsp mov DWORD PTR _result$[ebp], eax cmp DWORD PTR _result$[ebp], 0 jne SHORT $LN9@TEST_Equal mov DWORD PTR tv142[ebp], 1 jmp SHORT $LN10@TEST_Equal $LN9@TEST_Equal: mov DWORD PTR tv142[ebp], 0 $LN10@TEST_Equal: mov edx, DWORD PTR _result$[ebp] push edx push OFFSET ??_C@_1DM@NGGGJAGM@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAX?$AAn?$PP?$KJ?$AA0?$PP?$LD?$PP?$PM@ call _FormatTestMesssage add esp, 8 push eax mov eax, DWORD PTR tv142[ebp] push eax push 3 mov ecx, DWORD PTR _no$[ebp] push ecx push OFFSET ??_C@_1CG@LMNANGKJ@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ call _FormatTestLabel add esp, 12 ; 0000000cH push eax mov edx, DWORD PTR _env$[ebp] push edx call _TEST_Assert add esp, 16 ; 00000010H ; 130 : TEST_Assert(env, FormatTestLabel(L"Equals_X_X (%d.%d)", no, 4), actual_w == desired_w, L"データの内容が一致しない"); mov eax, DWORD PTR _actual_w$[ebp] cmp eax, DWORD PTR _desired_w$[ebp] jne SHORT $LN11@TEST_Equal mov DWORD PTR tv152[ebp], 1 jmp SHORT $LN12@TEST_Equal $LN11@TEST_Equal: mov DWORD PTR tv152[ebp], 0 $LN12@TEST_Equal: push OFFSET ??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@ mov ecx, DWORD PTR tv152[ebp] push ecx push 4 mov edx, DWORD PTR _no$[ebp] push edx push OFFSET ??_C@_1CG@LMNANGKJ@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ call _FormatTestLabel add esp, 12 ; 0000000cH push eax mov eax, DWORD PTR _env$[ebp] push eax call _TEST_Assert add esp, 16 ; 00000010H ; 131 : if (v_result == PMC_STATUS_OK) cmp DWORD PTR _v_result$[ebp], 0 jne SHORT $LN2@TEST_Equal ; 132 : ep->Dispose(v); mov esi, esp mov eax, DWORD PTR _v$[ebp] push eax mov ecx, DWORD PTR _ep$[ebp] mov edx, DWORD PTR [ecx+296] call edx cmp esi, esp call __RTC_CheckEsp $LN2@TEST_Equal: ; 133 : if (u_result == PMC_STATUS_OK) cmp DWORD PTR _u_result$[ebp], 0 jne SHORT $LN1@TEST_Equal ; 134 : ep->Dispose(u); mov esi, esp mov eax, DWORD PTR _u$[ebp] push eax mov ecx, DWORD PTR _ep$[ebp] mov edx, DWORD PTR [ecx+296] call edx cmp esi, esp call __RTC_CheckEsp $LN1@TEST_Equal: ; 135 : } push edx mov ecx, ebp push eax lea edx, DWORD PTR $LN17@TEST_Equal call @_RTC_CheckStackVars@8 pop eax pop edx pop edi pop esi pop ebx mov ecx, DWORD PTR __$ArrayPad$[ebp] xor ecx, ebp call @__security_check_cookie@4 add esp, 272 ; 00000110H cmp ebp, esp call __RTC_CheckEsp mov esp, ebp pop ebp ret 0 npad 1 $LN17@TEST_Equal: DD 3 DD $LN16@TEST_Equal $LN16@TEST_Equal: DD -12 ; fffffff4H DD 4 DD $LN13@TEST_Equal DD -24 ; ffffffe8H DD 4 DD $LN14@TEST_Equal DD -36 ; ffffffdcH DD 4 DD $LN15@TEST_Equal $LN15@TEST_Equal: DB 97 ; 00000061H DB 99 ; 00000063H DB 116 ; 00000074H DB 117 ; 00000075H DB 97 ; 00000061H DB 108 ; 0000006cH DB 95 ; 0000005fH DB 119 ; 00000077H DB 0 $LN14@TEST_Equal: DB 118 ; 00000076H DB 0 $LN13@TEST_Equal: DB 117 ; 00000075H DB 0 _TEST_Equals_X_X ENDP _TEXT ENDS ; Function compile flags: /Odtp /RTCsu /ZI ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.sint\palmtree.math.core.sint\test_op_equals.c ; COMDAT _TEST_Equals_X_UX _TEXT SEGMENT tv152 = -272 ; size = 4 tv142 = -272 ; size = 4 tv92 = -272 ; size = 4 tv74 = -272 ; size = 4 _v_result$ = -72 ; size = 4 _u_result$ = -60 ; size = 4 _result$ = -48 ; size = 4 _actual_w$ = -36 ; size = 4 _v$ = -24 ; size = 4 _u$ = -12 ; size = 4 __$ArrayPad$ = -4 ; size = 4 _env$ = 8 ; size = 4 _ep$ = 12 ; size = 4 _no$ = 16 ; size = 4 _u_buf$ = 20 ; size = 4 _u_buf_size$ = 24 ; size = 4 _v_buf$ = 28 ; size = 4 _v_buf_size$ = 32 ; size = 4 _desired_w$ = 36 ; size = 4 _TEST_Equals_X_UX PROC ; COMDAT ; 102 : { push ebp mov ebp, esp sub esp, 272 ; 00000110H push ebx push esi push edi lea edi, DWORD PTR [ebp-272] mov ecx, 68 ; 00000044H mov eax, -858993460 ; ccccccccH rep stosd mov eax, DWORD PTR ___security_cookie xor eax, ebp mov DWORD PTR __$ArrayPad$[ebp], eax mov ecx, OFFSET __2415E362_test_op_equals@c call @__CheckForDebuggerJustMyCode@4 ; 103 : PMC_HANDLE_SINT u; ; 104 : PMC_HANDLE_UINT v; ; 105 : __int32 actual_w; ; 106 : PMC_STATUS_CODE result; ; 107 : PMC_STATUS_CODE u_result; ; 108 : PMC_STATUS_CODE v_result; ; 109 : TEST_Assert(env, FormatTestLabel(L"Equals_X_UX (%d.%d)", no, 1), (u_result = ep->FromByteArray(u_buf, u_buf_size, &u)) == PMC_STATUS_OK, FormatTestMesssage(L"FromByteArrayの復帰コードが期待通りではない(%d)", u_result)); mov esi, esp lea eax, DWORD PTR _u$[ebp] push eax mov ecx, DWORD PTR _u_buf_size$[ebp] push ecx mov edx, DWORD PTR _u_buf$[ebp] push edx mov eax, DWORD PTR _ep$[ebp] mov ecx, DWORD PTR [eax+304] call ecx cmp esi, esp call __RTC_CheckEsp mov DWORD PTR _u_result$[ebp], eax cmp DWORD PTR _u_result$[ebp], 0 jne SHORT $LN5@TEST_Equal mov DWORD PTR tv74[ebp], 1 jmp SHORT $LN6@TEST_Equal $LN5@TEST_Equal: mov DWORD PTR tv74[ebp], 0 $LN6@TEST_Equal: mov edx, DWORD PTR _u_result$[ebp] push edx push OFFSET ??_C@_1EC@NPMCAPKO@?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ@ call _FormatTestMesssage add esp, 8 push eax mov eax, DWORD PTR tv74[ebp] push eax push 1 mov ecx, DWORD PTR _no$[ebp] push ecx push OFFSET ??_C@_1CI@NLHEPFBK@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAU?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd@ call _FormatTestLabel add esp, 12 ; 0000000cH push eax mov edx, DWORD PTR _env$[ebp] push edx call _TEST_Assert add esp, 16 ; 00000010H ; 110 : TEST_Assert(env, FormatTestLabel(L"Equals_X_UX (%d.%d)", no, 2), (v_result = ep->UINT_ENTRY_POINTS.FromByteArray(v_buf, v_buf_size, &v)) == PMC_STATUS_OK, FormatTestMesssage(L"FromByteArrayの復帰コードが期待通りではない(%d)", v_result)); mov esi, esp lea eax, DWORD PTR _v$[ebp] push eax mov ecx, DWORD PTR _v_buf_size$[ebp] push ecx mov edx, DWORD PTR _v_buf$[ebp] push edx mov eax, DWORD PTR _ep$[ebp] mov ecx, DWORD PTR [eax+24] call ecx cmp esi, esp call __RTC_CheckEsp mov DWORD PTR _v_result$[ebp], eax cmp DWORD PTR _v_result$[ebp], 0 jne SHORT $LN7@TEST_Equal mov DWORD PTR tv92[ebp], 1 jmp SHORT $LN8@TEST_Equal $LN7@TEST_Equal: mov DWORD PTR tv92[ebp], 0 $LN8@TEST_Equal: mov edx, DWORD PTR _v_result$[ebp] push edx push OFFSET ??_C@_1EC@NPMCAPKO@?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ@ call _FormatTestMesssage add esp, 8 push eax mov eax, DWORD PTR tv92[ebp] push eax push 2 mov ecx, DWORD PTR _no$[ebp] push ecx push OFFSET ??_C@_1CI@NLHEPFBK@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAU?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd@ call _FormatTestLabel add esp, 12 ; 0000000cH push eax mov edx, DWORD PTR _env$[ebp] push edx call _TEST_Assert add esp, 16 ; 00000010H ; 111 : TEST_Assert(env, FormatTestLabel(L"Equals_X_UX (%d.%d)", no, 3), (result = ep->Equals_X_UX(u, v, &actual_w)) == PMC_STATUS_OK, FormatTestMesssage(L"Equals_X_UXの復帰コードが期待通りではない(%d)", result)); mov esi, esp lea eax, DWORD PTR _actual_w$[ebp] push eax mov ecx, DWORD PTR _v$[ebp] push ecx mov edx, DWORD PTR _u$[ebp] push edx mov eax, DWORD PTR _ep$[ebp] mov ecx, DWORD PTR [eax+492] call ecx cmp esi, esp call __RTC_CheckEsp mov DWORD PTR _result$[ebp], eax cmp DWORD PTR _result$[ebp], 0 jne SHORT $LN9@TEST_Equal mov DWORD PTR tv142[ebp], 1 jmp SHORT $LN10@TEST_Equal $LN9@TEST_Equal: mov DWORD PTR tv142[ebp], 0 $LN10@TEST_Equal: mov edx, DWORD PTR _result$[ebp] push edx push OFFSET ??_C@_1DO@HDBPOJFD@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAU?$AAX?$AAn?$PP?$KJ?$AA0?$PP?$LD@ call _FormatTestMesssage add esp, 8 push eax mov eax, DWORD PTR tv142[ebp] push eax push 3 mov ecx, DWORD PTR _no$[ebp] push ecx push OFFSET ??_C@_1CI@NLHEPFBK@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAU?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd@ call _FormatTestLabel add esp, 12 ; 0000000cH push eax mov edx, DWORD PTR _env$[ebp] push edx call _TEST_Assert add esp, 16 ; 00000010H ; 112 : TEST_Assert(env, FormatTestLabel(L"Equals_X_UX (%d.%d)", no, 4), actual_w == desired_w, L"データの内容が一致しない"); mov eax, DWORD PTR _actual_w$[ebp] cmp eax, DWORD PTR _desired_w$[ebp] jne SHORT $LN11@TEST_Equal mov DWORD PTR tv152[ebp], 1 jmp SHORT $LN12@TEST_Equal $LN11@TEST_Equal: mov DWORD PTR tv152[ebp], 0 $LN12@TEST_Equal: push OFFSET ??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@ mov ecx, DWORD PTR tv152[ebp] push ecx push 4 mov edx, DWORD PTR _no$[ebp] push edx push OFFSET ??_C@_1CI@NLHEPFBK@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAU?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd@ call _FormatTestLabel add esp, 12 ; 0000000cH push eax mov eax, DWORD PTR _env$[ebp] push eax call _TEST_Assert add esp, 16 ; 00000010H ; 113 : if (v_result == PMC_STATUS_OK) cmp DWORD PTR _v_result$[ebp], 0 jne SHORT $LN2@TEST_Equal ; 114 : ep->UINT_ENTRY_POINTS.Dispose(v); mov esi, esp mov eax, DWORD PTR _v$[ebp] push eax mov ecx, DWORD PTR _ep$[ebp] mov edx, DWORD PTR [ecx+16] call edx cmp esi, esp call __RTC_CheckEsp $LN2@TEST_Equal: ; 115 : if (u_result == PMC_STATUS_OK) cmp DWORD PTR _u_result$[ebp], 0 jne SHORT $LN1@TEST_Equal ; 116 : ep->Dispose(u); mov esi, esp mov eax, DWORD PTR _u$[ebp] push eax mov ecx, DWORD PTR _ep$[ebp] mov edx, DWORD PTR [ecx+296] call edx cmp esi, esp call __RTC_CheckEsp $LN1@TEST_Equal: ; 117 : } push edx mov ecx, ebp push eax lea edx, DWORD PTR $LN17@TEST_Equal call @_RTC_CheckStackVars@8 pop eax pop edx pop edi pop esi pop ebx mov ecx, DWORD PTR __$ArrayPad$[ebp] xor ecx, ebp call @__security_check_cookie@4 add esp, 272 ; 00000110H cmp ebp, esp call __RTC_CheckEsp mov esp, ebp pop ebp ret 0 npad 3 $LN17@TEST_Equal: DD 3 DD $LN16@TEST_Equal $LN16@TEST_Equal: DD -12 ; fffffff4H DD 4 DD $LN13@TEST_Equal DD -24 ; ffffffe8H DD 4 DD $LN14@TEST_Equal DD -36 ; ffffffdcH DD 4 DD $LN15@TEST_Equal $LN15@TEST_Equal: DB 97 ; 00000061H DB 99 ; 00000063H DB 116 ; 00000074H DB 117 ; 00000075H DB 97 ; 00000061H DB 108 ; 0000006cH DB 95 ; 0000005fH DB 119 ; 00000077H DB 0 $LN14@TEST_Equal: DB 118 ; 00000076H DB 0 $LN13@TEST_Equal: DB 117 ; 00000075H DB 0 _TEST_Equals_X_UX ENDP _TEXT ENDS ; Function compile flags: /Odtp /RTCsu /ZI ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.sint\palmtree.math.core.sint\test_op_equals.c ; COMDAT _TEST_Equals_X_L _TEXT SEGMENT tv134 = -248 ; size = 4 tv92 = -248 ; size = 4 tv74 = -248 ; size = 4 _u_result$ = -48 ; size = 4 _result$ = -36 ; size = 4 _actual_w$ = -24 ; size = 4 _u$ = -12 ; size = 4 __$ArrayPad$ = -4 ; size = 4 _env$ = 8 ; size = 4 _ep$ = 12 ; size = 4 _no$ = 16 ; size = 4 _u_buf$ = 20 ; size = 4 _u_buf_size$ = 24 ; size = 4 _v$ = 28 ; size = 8 _desired_w$ = 36 ; size = 4 _TEST_Equals_X_L PROC ; COMDAT ; 89 : { push ebp mov ebp, esp sub esp, 248 ; 000000f8H push ebx push esi push edi lea edi, DWORD PTR [ebp-248] mov ecx, 62 ; 0000003eH mov eax, -858993460 ; ccccccccH rep stosd mov eax, DWORD PTR ___security_cookie xor eax, ebp mov DWORD PTR __$ArrayPad$[ebp], eax mov ecx, OFFSET __2415E362_test_op_equals@c call @__CheckForDebuggerJustMyCode@4 ; 90 : PMC_HANDLE_SINT u; ; 91 : __int32 actual_w; ; 92 : PMC_STATUS_CODE result; ; 93 : PMC_STATUS_CODE u_result; ; 94 : TEST_Assert(env, FormatTestLabel(L"Equals_X_L (%d.%d)", no, 1), (u_result = ep->FromByteArray(u_buf, u_buf_size, &u)) == PMC_STATUS_OK, FormatTestMesssage(L"FromByteArrayの復帰コードが期待通りではない(%d)", u_result)); mov esi, esp lea eax, DWORD PTR _u$[ebp] push eax mov ecx, DWORD PTR _u_buf_size$[ebp] push ecx mov edx, DWORD PTR _u_buf$[ebp] push edx mov eax, DWORD PTR _ep$[ebp] mov ecx, DWORD PTR [eax+304] call ecx cmp esi, esp call __RTC_CheckEsp mov DWORD PTR _u_result$[ebp], eax cmp DWORD PTR _u_result$[ebp], 0 jne SHORT $LN4@TEST_Equal mov DWORD PTR tv74[ebp], 1 jmp SHORT $LN5@TEST_Equal $LN4@TEST_Equal: mov DWORD PTR tv74[ebp], 0 $LN5@TEST_Equal: mov edx, DWORD PTR _u_result$[ebp] push edx push OFFSET ??_C@_1EC@NPMCAPKO@?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ@ call _FormatTestMesssage add esp, 8 push eax mov eax, DWORD PTR tv74[ebp] push eax push 1 mov ecx, DWORD PTR _no$[ebp] push ecx push OFFSET ??_C@_1CG@BCPLJGNF@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAL?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ call _FormatTestLabel add esp, 12 ; 0000000cH push eax mov edx, DWORD PTR _env$[ebp] push edx call _TEST_Assert add esp, 16 ; 00000010H ; 95 : TEST_Assert(env, FormatTestLabel(L"Equals_X_L (%d.%d)", no, 2), (result = ep->Equals_X_L(u, v, &actual_w)) == PMC_STATUS_OK, FormatTestMesssage(L"Equals_X_Lの復帰コードが期待通りではない(%d)", result)); mov esi, esp lea eax, DWORD PTR _actual_w$[ebp] push eax mov ecx, DWORD PTR _v$[ebp+4] push ecx mov edx, DWORD PTR _v$[ebp] push edx mov eax, DWORD PTR _u$[ebp] push eax mov ecx, DWORD PTR _ep$[ebp] mov edx, DWORD PTR [ecx+488] call edx cmp esi, esp call __RTC_CheckEsp mov DWORD PTR _result$[ebp], eax cmp DWORD PTR _result$[ebp], 0 jne SHORT $LN6@TEST_Equal mov DWORD PTR tv92[ebp], 1 jmp SHORT $LN7@TEST_Equal $LN6@TEST_Equal: mov DWORD PTR tv92[ebp], 0 $LN7@TEST_Equal: mov eax, DWORD PTR _result$[ebp] push eax push OFFSET ??_C@_1DM@CMCFOAHJ@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAL?$AAn?$PP?$KJ?$AA0?$PP?$LD?$PP?$PM@ call _FormatTestMesssage add esp, 8 push eax mov ecx, DWORD PTR tv92[ebp] push ecx push 2 mov edx, DWORD PTR _no$[ebp] push edx push OFFSET ??_C@_1CG@BCPLJGNF@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAL?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ call _FormatTestLabel add esp, 12 ; 0000000cH push eax mov eax, DWORD PTR _env$[ebp] push eax call _TEST_Assert add esp, 16 ; 00000010H ; 96 : TEST_Assert(env, FormatTestLabel(L"Equals_X_L (%d.%d)", no, 3), actual_w == desired_w, L"データの内容が一致しない"); mov eax, DWORD PTR _actual_w$[ebp] cmp eax, DWORD PTR _desired_w$[ebp] jne SHORT $LN8@TEST_Equal mov DWORD PTR tv134[ebp], 1 jmp SHORT $LN9@TEST_Equal $LN8@TEST_Equal: mov DWORD PTR tv134[ebp], 0 $LN9@TEST_Equal: push OFFSET ??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@ mov ecx, DWORD PTR tv134[ebp] push ecx push 3 mov edx, DWORD PTR _no$[ebp] push edx push OFFSET ??_C@_1CG@BCPLJGNF@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAL?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ call _FormatTestLabel add esp, 12 ; 0000000cH push eax mov eax, DWORD PTR _env$[ebp] push eax call _TEST_Assert add esp, 16 ; 00000010H ; 97 : if (u_result == PMC_STATUS_OK) cmp DWORD PTR _u_result$[ebp], 0 jne SHORT $LN1@TEST_Equal ; 98 : ep->Dispose(u); mov esi, esp mov eax, DWORD PTR _u$[ebp] push eax mov ecx, DWORD PTR _ep$[ebp] mov edx, DWORD PTR [ecx+296] call edx cmp esi, esp call __RTC_CheckEsp $LN1@TEST_Equal: ; 99 : } push edx mov ecx, ebp push eax lea edx, DWORD PTR $LN13@TEST_Equal call @_RTC_CheckStackVars@8 pop eax pop edx pop edi pop esi pop ebx mov ecx, DWORD PTR __$ArrayPad$[ebp] xor ecx, ebp call @__security_check_cookie@4 add esp, 248 ; 000000f8H cmp ebp, esp call __RTC_CheckEsp mov esp, ebp pop ebp ret 0 npad 3 $LN13@TEST_Equal: DD 2 DD $LN12@TEST_Equal $LN12@TEST_Equal: DD -12 ; fffffff4H DD 4 DD $LN10@TEST_Equal DD -24 ; ffffffe8H DD 4 DD $LN11@TEST_Equal $LN11@TEST_Equal: DB 97 ; 00000061H DB 99 ; 00000063H DB 116 ; 00000074H DB 117 ; 00000075H DB 97 ; 00000061H DB 108 ; 0000006cH DB 95 ; 0000005fH DB 119 ; 00000077H DB 0 $LN10@TEST_Equal: DB 117 ; 00000075H DB 0 _TEST_Equals_X_L ENDP _TEXT ENDS ; Function compile flags: /Odtp /RTCsu /ZI ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.sint\palmtree.math.core.sint\test_op_equals.c ; COMDAT _TEST_Equals_X_I _TEXT SEGMENT tv134 = -248 ; size = 4 tv92 = -248 ; size = 4 tv74 = -248 ; size = 4 _u_result$ = -48 ; size = 4 _result$ = -36 ; size = 4 _actual_w$ = -24 ; size = 4 _u$ = -12 ; size = 4 __$ArrayPad$ = -4 ; size = 4 _env$ = 8 ; size = 4 _ep$ = 12 ; size = 4 _no$ = 16 ; size = 4 _u_buf$ = 20 ; size = 4 _u_buf_size$ = 24 ; size = 4 _v$ = 28 ; size = 4 _desired_w$ = 32 ; size = 4 _TEST_Equals_X_I PROC ; COMDAT ; 76 : { push ebp mov ebp, esp sub esp, 248 ; 000000f8H push ebx push esi push edi lea edi, DWORD PTR [ebp-248] mov ecx, 62 ; 0000003eH mov eax, -858993460 ; ccccccccH rep stosd mov eax, DWORD PTR ___security_cookie xor eax, ebp mov DWORD PTR __$ArrayPad$[ebp], eax mov ecx, OFFSET __2415E362_test_op_equals@c call @__CheckForDebuggerJustMyCode@4 ; 77 : PMC_HANDLE_SINT u; ; 78 : __int32 actual_w; ; 79 : PMC_STATUS_CODE result; ; 80 : PMC_STATUS_CODE u_result; ; 81 : TEST_Assert(env, FormatTestLabel(L"Equals_X_I (%d.%d)", no, 1), (u_result = ep->FromByteArray(u_buf, u_buf_size, &u)) == PMC_STATUS_OK, FormatTestMesssage(L"FromByteArrayの復帰コードが期待通りではない(%d)", u_result)); mov esi, esp lea eax, DWORD PTR _u$[ebp] push eax mov ecx, DWORD PTR _u_buf_size$[ebp] push ecx mov edx, DWORD PTR _u_buf$[ebp] push edx mov eax, DWORD PTR _ep$[ebp] mov ecx, DWORD PTR [eax+304] call ecx cmp esi, esp call __RTC_CheckEsp mov DWORD PTR _u_result$[ebp], eax cmp DWORD PTR _u_result$[ebp], 0 jne SHORT $LN4@TEST_Equal mov DWORD PTR tv74[ebp], 1 jmp SHORT $LN5@TEST_Equal $LN4@TEST_Equal: mov DWORD PTR tv74[ebp], 0 $LN5@TEST_Equal: mov edx, DWORD PTR _u_result$[ebp] push edx push OFFSET ??_C@_1EC@NPMCAPKO@?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ@ call _FormatTestMesssage add esp, 8 push eax mov eax, DWORD PTR tv74[ebp] push eax push 1 mov ecx, DWORD PTR _no$[ebp] push ecx push OFFSET ??_C@_1CG@DJHBEGMK@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAI?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ call _FormatTestLabel add esp, 12 ; 0000000cH push eax mov edx, DWORD PTR _env$[ebp] push edx call _TEST_Assert add esp, 16 ; 00000010H ; 82 : TEST_Assert(env, FormatTestLabel(L"Equals_X_I (%d.%d)", no, 2), (result = ep->Equals_X_I(u, v, &actual_w)) == PMC_STATUS_OK, FormatTestMesssage(L"Equals_X_Iの復帰コードが期待通りではない(%d)", result)); mov esi, esp lea eax, DWORD PTR _actual_w$[ebp] push eax mov ecx, DWORD PTR _v$[ebp] push ecx mov edx, DWORD PTR _u$[ebp] push edx mov eax, DWORD PTR _ep$[ebp] mov ecx, DWORD PTR [eax+484] call ecx cmp esi, esp call __RTC_CheckEsp mov DWORD PTR _result$[ebp], eax cmp DWORD PTR _result$[ebp], 0 jne SHORT $LN6@TEST_Equal mov DWORD PTR tv92[ebp], 1 jmp SHORT $LN7@TEST_Equal $LN6@TEST_Equal: mov DWORD PTR tv92[ebp], 0 $LN7@TEST_Equal: mov edx, DWORD PTR _result$[ebp] push edx push OFFSET ??_C@_1DM@GEGJHNOM@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAI?$AAn?$PP?$KJ?$AA0?$PP?$LD?$PP?$PM@ call _FormatTestMesssage add esp, 8 push eax mov eax, DWORD PTR tv92[ebp] push eax push 2 mov ecx, DWORD PTR _no$[ebp] push ecx push OFFSET ??_C@_1CG@DJHBEGMK@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAI?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ call _FormatTestLabel add esp, 12 ; 0000000cH push eax mov edx, DWORD PTR _env$[ebp] push edx call _TEST_Assert add esp, 16 ; 00000010H ; 83 : TEST_Assert(env, FormatTestLabel(L"Equals_X_I (%d.%d)", no, 3), actual_w == desired_w, L"データの内容が一致しない"); mov eax, DWORD PTR _actual_w$[ebp] cmp eax, DWORD PTR _desired_w$[ebp] jne SHORT $LN8@TEST_Equal mov DWORD PTR tv134[ebp], 1 jmp SHORT $LN9@TEST_Equal $LN8@TEST_Equal: mov DWORD PTR tv134[ebp], 0 $LN9@TEST_Equal: push OFFSET ??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@ mov ecx, DWORD PTR tv134[ebp] push ecx push 3 mov edx, DWORD PTR _no$[ebp] push edx push OFFSET ??_C@_1CG@DJHBEGMK@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAX?$AA_?$AAI?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ call _FormatTestLabel add esp, 12 ; 0000000cH push eax mov eax, DWORD PTR _env$[ebp] push eax call _TEST_Assert add esp, 16 ; 00000010H ; 84 : if (u_result == PMC_STATUS_OK) cmp DWORD PTR _u_result$[ebp], 0 jne SHORT $LN1@TEST_Equal ; 85 : ep->Dispose(u); mov esi, esp mov eax, DWORD PTR _u$[ebp] push eax mov ecx, DWORD PTR _ep$[ebp] mov edx, DWORD PTR [ecx+296] call edx cmp esi, esp call __RTC_CheckEsp $LN1@TEST_Equal: ; 86 : } push edx mov ecx, ebp push eax lea edx, DWORD PTR $LN13@TEST_Equal call @_RTC_CheckStackVars@8 pop eax pop edx pop edi pop esi pop ebx mov ecx, DWORD PTR __$ArrayPad$[ebp] xor ecx, ebp call @__security_check_cookie@4 add esp, 248 ; 000000f8H cmp ebp, esp call __RTC_CheckEsp mov esp, ebp pop ebp ret 0 npad 3 $LN13@TEST_Equal: DD 2 DD $LN12@TEST_Equal $LN12@TEST_Equal: DD -12 ; fffffff4H DD 4 DD $LN10@TEST_Equal DD -24 ; ffffffe8H DD 4 DD $LN11@TEST_Equal $LN11@TEST_Equal: DB 97 ; 00000061H DB 99 ; 00000063H DB 116 ; 00000074H DB 117 ; 00000075H DB 97 ; 00000061H DB 108 ; 0000006cH DB 95 ; 0000005fH DB 119 ; 00000077H DB 0 $LN10@TEST_Equal: DB 117 ; 00000075H DB 0 _TEST_Equals_X_I ENDP _TEXT ENDS ; Function compile flags: /Odtp /RTCsu /ZI ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.sint\palmtree.math.core.sint\test_op_equals.c ; COMDAT _TEST_Equals_UX_X _TEXT SEGMENT tv152 = -272 ; size = 4 tv142 = -272 ; size = 4 tv92 = -272 ; size = 4 tv74 = -272 ; size = 4 _v_result$ = -72 ; size = 4 _u_result$ = -60 ; size = 4 _result$ = -48 ; size = 4 _actual_w$ = -36 ; size = 4 _v$ = -24 ; size = 4 _u$ = -12 ; size = 4 __$ArrayPad$ = -4 ; size = 4 _env$ = 8 ; size = 4 _ep$ = 12 ; size = 4 _no$ = 16 ; size = 4 _u_buf$ = 20 ; size = 4 _u_buf_size$ = 24 ; size = 4 _v_buf$ = 28 ; size = 4 _v_buf_size$ = 32 ; size = 4 _desired_w$ = 36 ; size = 4 _TEST_Equals_UX_X PROC ; COMDAT ; 58 : { push ebp mov ebp, esp sub esp, 272 ; 00000110H push ebx push esi push edi lea edi, DWORD PTR [ebp-272] mov ecx, 68 ; 00000044H mov eax, -858993460 ; ccccccccH rep stosd mov eax, DWORD PTR ___security_cookie xor eax, ebp mov DWORD PTR __$ArrayPad$[ebp], eax mov ecx, OFFSET __2415E362_test_op_equals@c call @__CheckForDebuggerJustMyCode@4 ; 59 : PMC_HANDLE_UINT u; ; 60 : PMC_HANDLE_SINT v; ; 61 : __int32 actual_w; ; 62 : PMC_STATUS_CODE result; ; 63 : PMC_STATUS_CODE u_result; ; 64 : PMC_STATUS_CODE v_result; ; 65 : TEST_Assert(env, FormatTestLabel(L"Equals_UX_X (%d.%d)", no, 1), (u_result = ep->UINT_ENTRY_POINTS.FromByteArray(u_buf, u_buf_size, &u)) == PMC_STATUS_OK, FormatTestMesssage(L"FromByteArrayの復帰コードが期待通りではない(%d)", u_result)); mov esi, esp lea eax, DWORD PTR _u$[ebp] push eax mov ecx, DWORD PTR _u_buf_size$[ebp] push ecx mov edx, DWORD PTR _u_buf$[ebp] push edx mov eax, DWORD PTR _ep$[ebp] mov ecx, DWORD PTR [eax+24] call ecx cmp esi, esp call __RTC_CheckEsp mov DWORD PTR _u_result$[ebp], eax cmp DWORD PTR _u_result$[ebp], 0 jne SHORT $LN5@TEST_Equal mov DWORD PTR tv74[ebp], 1 jmp SHORT $LN6@TEST_Equal $LN5@TEST_Equal: mov DWORD PTR tv74[ebp], 0 $LN6@TEST_Equal: mov edx, DWORD PTR _u_result$[ebp] push edx push OFFSET ??_C@_1EC@NPMCAPKO@?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ@ call _FormatTestMesssage add esp, 8 push eax mov eax, DWORD PTR tv74[ebp] push eax push 1 mov ecx, DWORD PTR _no$[ebp] push ecx push OFFSET ??_C@_1CI@OFNPDABI@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAU?$AAX?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd@ call _FormatTestLabel add esp, 12 ; 0000000cH push eax mov edx, DWORD PTR _env$[ebp] push edx call _TEST_Assert add esp, 16 ; 00000010H ; 66 : TEST_Assert(env, FormatTestLabel(L"Equals_UX_X (%d.%d)", no, 2), (v_result = ep->FromByteArray(v_buf, v_buf_size, &v)) == PMC_STATUS_OK, FormatTestMesssage(L"FromByteArrayの復帰コードが期待通りではない(%d)", v_result)); mov esi, esp lea eax, DWORD PTR _v$[ebp] push eax mov ecx, DWORD PTR _v_buf_size$[ebp] push ecx mov edx, DWORD PTR _v_buf$[ebp] push edx mov eax, DWORD PTR _ep$[ebp] mov ecx, DWORD PTR [eax+304] call ecx cmp esi, esp call __RTC_CheckEsp mov DWORD PTR _v_result$[ebp], eax cmp DWORD PTR _v_result$[ebp], 0 jne SHORT $LN7@TEST_Equal mov DWORD PTR tv92[ebp], 1 jmp SHORT $LN8@TEST_Equal $LN7@TEST_Equal: mov DWORD PTR tv92[ebp], 0 $LN8@TEST_Equal: mov edx, DWORD PTR _v_result$[ebp] push edx push OFFSET ??_C@_1EC@NPMCAPKO@?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ@ call _FormatTestMesssage add esp, 8 push eax mov eax, DWORD PTR tv92[ebp] push eax push 2 mov ecx, DWORD PTR _no$[ebp] push ecx push OFFSET ??_C@_1CI@OFNPDABI@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAU?$AAX?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd@ call _FormatTestLabel add esp, 12 ; 0000000cH push eax mov edx, DWORD PTR _env$[ebp] push edx call _TEST_Assert add esp, 16 ; 00000010H ; 67 : TEST_Assert(env, FormatTestLabel(L"Equals_UX_X (%d.%d)", no, 3), (result = ep->Equals_UX_X(u, v, &actual_w)) == PMC_STATUS_OK, FormatTestMesssage(L"Equals_UX_Xの復帰コードが期待通りではない(%d)", result)); mov esi, esp lea eax, DWORD PTR _actual_w$[ebp] push eax mov ecx, DWORD PTR _v$[ebp] push ecx mov edx, DWORD PTR _u$[ebp] push edx mov eax, DWORD PTR _ep$[ebp] mov ecx, DWORD PTR [eax+480] call ecx cmp esi, esp call __RTC_CheckEsp mov DWORD PTR _result$[ebp], eax cmp DWORD PTR _result$[ebp], 0 jne SHORT $LN9@TEST_Equal mov DWORD PTR tv142[ebp], 1 jmp SHORT $LN10@TEST_Equal $LN9@TEST_Equal: mov DWORD PTR tv142[ebp], 0 $LN10@TEST_Equal: mov edx, DWORD PTR _result$[ebp] push edx push OFFSET ??_C@_1DO@PEPKKHHD@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAU?$AAX?$AA_?$AAX?$AAn?$PP?$KJ?$AA0?$PP?$LD@ call _FormatTestMesssage add esp, 8 push eax mov eax, DWORD PTR tv142[ebp] push eax push 3 mov ecx, DWORD PTR _no$[ebp] push ecx push OFFSET ??_C@_1CI@OFNPDABI@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAU?$AAX?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd@ call _FormatTestLabel add esp, 12 ; 0000000cH push eax mov edx, DWORD PTR _env$[ebp] push edx call _TEST_Assert add esp, 16 ; 00000010H ; 68 : TEST_Assert(env, FormatTestLabel(L"Equals_UX_X (%d.%d)", no, 4), actual_w == desired_w, L"データの内容が一致しない"); mov eax, DWORD PTR _actual_w$[ebp] cmp eax, DWORD PTR _desired_w$[ebp] jne SHORT $LN11@TEST_Equal mov DWORD PTR tv152[ebp], 1 jmp SHORT $LN12@TEST_Equal $LN11@TEST_Equal: mov DWORD PTR tv152[ebp], 0 $LN12@TEST_Equal: push OFFSET ??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@ mov ecx, DWORD PTR tv152[ebp] push ecx push 4 mov edx, DWORD PTR _no$[ebp] push edx push OFFSET ??_C@_1CI@OFNPDABI@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAU?$AAX?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd@ call _FormatTestLabel add esp, 12 ; 0000000cH push eax mov eax, DWORD PTR _env$[ebp] push eax call _TEST_Assert add esp, 16 ; 00000010H ; 69 : if (v_result == PMC_STATUS_OK) cmp DWORD PTR _v_result$[ebp], 0 jne SHORT $LN2@TEST_Equal ; 70 : ep->Dispose(v); mov esi, esp mov eax, DWORD PTR _v$[ebp] push eax mov ecx, DWORD PTR _ep$[ebp] mov edx, DWORD PTR [ecx+296] call edx cmp esi, esp call __RTC_CheckEsp $LN2@TEST_Equal: ; 71 : if (u_result == PMC_STATUS_OK) cmp DWORD PTR _u_result$[ebp], 0 jne SHORT $LN1@TEST_Equal ; 72 : ep->UINT_ENTRY_POINTS.Dispose(u); mov esi, esp mov eax, DWORD PTR _u$[ebp] push eax mov ecx, DWORD PTR _ep$[ebp] mov edx, DWORD PTR [ecx+16] call edx cmp esi, esp call __RTC_CheckEsp $LN1@TEST_Equal: ; 73 : } push edx mov ecx, ebp push eax lea edx, DWORD PTR $LN17@TEST_Equal call @_RTC_CheckStackVars@8 pop eax pop edx pop edi pop esi pop ebx mov ecx, DWORD PTR __$ArrayPad$[ebp] xor ecx, ebp call @__security_check_cookie@4 add esp, 272 ; 00000110H cmp ebp, esp call __RTC_CheckEsp mov esp, ebp pop ebp ret 0 npad 3 $LN17@TEST_Equal: DD 3 DD $LN16@TEST_Equal $LN16@TEST_Equal: DD -12 ; fffffff4H DD 4 DD $LN13@TEST_Equal DD -24 ; ffffffe8H DD 4 DD $LN14@TEST_Equal DD -36 ; ffffffdcH DD 4 DD $LN15@TEST_Equal $LN15@TEST_Equal: DB 97 ; 00000061H DB 99 ; 00000063H DB 116 ; 00000074H DB 117 ; 00000075H DB 97 ; 00000061H DB 108 ; 0000006cH DB 95 ; 0000005fH DB 119 ; 00000077H DB 0 $LN14@TEST_Equal: DB 118 ; 00000076H DB 0 $LN13@TEST_Equal: DB 117 ; 00000075H DB 0 _TEST_Equals_UX_X ENDP _TEXT ENDS ; Function compile flags: /Odtp /RTCsu /ZI ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.sint\palmtree.math.core.sint\test_op_equals.c ; COMDAT _TEST_Equals_L_X _TEXT SEGMENT tv134 = -248 ; size = 4 tv92 = -248 ; size = 4 tv74 = -248 ; size = 4 _v_result$ = -48 ; size = 4 _result$ = -36 ; size = 4 _actual_w$ = -24 ; size = 4 _v$ = -12 ; size = 4 __$ArrayPad$ = -4 ; size = 4 _env$ = 8 ; size = 4 _ep$ = 12 ; size = 4 _no$ = 16 ; size = 4 _u$ = 20 ; size = 8 _v_buf$ = 28 ; size = 4 _v_buf_size$ = 32 ; size = 4 _desired_w$ = 36 ; size = 4 _TEST_Equals_L_X PROC ; COMDAT ; 45 : { push ebp mov ebp, esp sub esp, 248 ; 000000f8H push ebx push esi push edi lea edi, DWORD PTR [ebp-248] mov ecx, 62 ; 0000003eH mov eax, -858993460 ; ccccccccH rep stosd mov eax, DWORD PTR ___security_cookie xor eax, ebp mov DWORD PTR __$ArrayPad$[ebp], eax mov ecx, OFFSET __2415E362_test_op_equals@c call @__CheckForDebuggerJustMyCode@4 ; 46 : PMC_HANDLE_SINT v; ; 47 : __int32 actual_w; ; 48 : PMC_STATUS_CODE result; ; 49 : PMC_STATUS_CODE v_result; ; 50 : TEST_Assert(env, FormatTestLabel(L"Equals_L_X (%d.%d)", no, 1), (v_result = ep->FromByteArray(v_buf, v_buf_size, &v)) == PMC_STATUS_OK, FormatTestMesssage(L"FromByteArrayの復帰コードが期待通りではない(%d)", v_result)); mov esi, esp lea eax, DWORD PTR _v$[ebp] push eax mov ecx, DWORD PTR _v_buf_size$[ebp] push ecx mov edx, DWORD PTR _v_buf$[ebp] push edx mov eax, DWORD PTR _ep$[ebp] mov ecx, DWORD PTR [eax+304] call ecx cmp esi, esp call __RTC_CheckEsp mov DWORD PTR _v_result$[ebp], eax cmp DWORD PTR _v_result$[ebp], 0 jne SHORT $LN4@TEST_Equal mov DWORD PTR tv74[ebp], 1 jmp SHORT $LN5@TEST_Equal $LN4@TEST_Equal: mov DWORD PTR tv74[ebp], 0 $LN5@TEST_Equal: mov edx, DWORD PTR _v_result$[ebp] push edx push OFFSET ??_C@_1EC@NPMCAPKO@?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ@ call _FormatTestMesssage add esp, 8 push eax mov eax, DWORD PTR tv74[ebp] push eax push 1 mov ecx, DWORD PTR _no$[ebp] push ecx push OFFSET ??_C@_1CG@KKLNDHML@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAL?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ call _FormatTestLabel add esp, 12 ; 0000000cH push eax mov edx, DWORD PTR _env$[ebp] push edx call _TEST_Assert add esp, 16 ; 00000010H ; 51 : TEST_Assert(env, FormatTestLabel(L"Equals_L_X (%d.%d)", no, 2), (result = ep->Equals_L_X(u, v, &actual_w)) == PMC_STATUS_OK, FormatTestMesssage(L"Equals_L_Xの復帰コードが期待通りではない(%d)", result)); mov esi, esp lea eax, DWORD PTR _actual_w$[ebp] push eax mov ecx, DWORD PTR _v$[ebp] push ecx mov edx, DWORD PTR _u$[ebp+4] push edx mov eax, DWORD PTR _u$[ebp] push eax mov ecx, DWORD PTR _ep$[ebp] mov edx, DWORD PTR [ecx+476] call edx cmp esi, esp call __RTC_CheckEsp mov DWORD PTR _result$[ebp], eax cmp DWORD PTR _result$[ebp], 0 jne SHORT $LN6@TEST_Equal mov DWORD PTR tv92[ebp], 1 jmp SHORT $LN7@TEST_Equal $LN6@TEST_Equal: mov DWORD PTR tv92[ebp], 0 $LN7@TEST_Equal: mov eax, DWORD PTR _result$[ebp] push eax push OFFSET ??_C@_1DM@GDGMFIFF@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAL?$AA_?$AAX?$AAn?$PP?$KJ?$AA0?$PP?$LD?$PP?$PM@ call _FormatTestMesssage add esp, 8 push eax mov ecx, DWORD PTR tv92[ebp] push ecx push 2 mov edx, DWORD PTR _no$[ebp] push edx push OFFSET ??_C@_1CG@KKLNDHML@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAL?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ call _FormatTestLabel add esp, 12 ; 0000000cH push eax mov eax, DWORD PTR _env$[ebp] push eax call _TEST_Assert add esp, 16 ; 00000010H ; 52 : TEST_Assert(env, FormatTestLabel(L"Equals_I_X (%d.%d)", no, 3), actual_w == desired_w, L"データの内容が一致しない"); mov eax, DWORD PTR _actual_w$[ebp] cmp eax, DWORD PTR _desired_w$[ebp] jne SHORT $LN8@TEST_Equal mov DWORD PTR tv134[ebp], 1 jmp SHORT $LN9@TEST_Equal $LN8@TEST_Equal: mov DWORD PTR tv134[ebp], 0 $LN9@TEST_Equal: push OFFSET ??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@ mov ecx, DWORD PTR tv134[ebp] push ecx push 3 mov edx, DWORD PTR _no$[ebp] push edx push OFFSET ??_C@_1CG@ECJOMMLD@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAI?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ call _FormatTestLabel add esp, 12 ; 0000000cH push eax mov eax, DWORD PTR _env$[ebp] push eax call _TEST_Assert add esp, 16 ; 00000010H ; 53 : if (v_result == PMC_STATUS_OK) cmp DWORD PTR _v_result$[ebp], 0 jne SHORT $LN1@TEST_Equal ; 54 : ep->Dispose(v); mov esi, esp mov eax, DWORD PTR _v$[ebp] push eax mov ecx, DWORD PTR _ep$[ebp] mov edx, DWORD PTR [ecx+296] call edx cmp esi, esp call __RTC_CheckEsp $LN1@TEST_Equal: ; 55 : } push edx mov ecx, ebp push eax lea edx, DWORD PTR $LN13@TEST_Equal call @_RTC_CheckStackVars@8 pop eax pop edx pop edi pop esi pop ebx mov ecx, DWORD PTR __$ArrayPad$[ebp] xor ecx, ebp call @__security_check_cookie@4 add esp, 248 ; 000000f8H cmp ebp, esp call __RTC_CheckEsp mov esp, ebp pop ebp ret 0 npad 3 $LN13@TEST_Equal: DD 2 DD $LN12@TEST_Equal $LN12@TEST_Equal: DD -12 ; fffffff4H DD 4 DD $LN10@TEST_Equal DD -24 ; ffffffe8H DD 4 DD $LN11@TEST_Equal $LN11@TEST_Equal: DB 97 ; 00000061H DB 99 ; 00000063H DB 116 ; 00000074H DB 117 ; 00000075H DB 97 ; 00000061H DB 108 ; 0000006cH DB 95 ; 0000005fH DB 119 ; 00000077H DB 0 $LN10@TEST_Equal: DB 118 ; 00000076H DB 0 _TEST_Equals_L_X ENDP _TEXT ENDS ; Function compile flags: /Odtp /RTCsu /ZI ; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.sint\palmtree.math.core.sint\test_op_equals.c ; COMDAT _TEST_Equals_I_X _TEXT SEGMENT tv134 = -248 ; size = 4 tv92 = -248 ; size = 4 tv74 = -248 ; size = 4 _v_result$ = -48 ; size = 4 _result$ = -36 ; size = 4 _actual_w$ = -24 ; size = 4 _v$ = -12 ; size = 4 __$ArrayPad$ = -4 ; size = 4 _env$ = 8 ; size = 4 _ep$ = 12 ; size = 4 _no$ = 16 ; size = 4 _u$ = 20 ; size = 4 _v_buf$ = 24 ; size = 4 _v_buf_size$ = 28 ; size = 4 _desired_w$ = 32 ; size = 4 _TEST_Equals_I_X PROC ; COMDAT ; 32 : { push ebp mov ebp, esp sub esp, 248 ; 000000f8H push ebx push esi push edi lea edi, DWORD PTR [ebp-248] mov ecx, 62 ; 0000003eH mov eax, -858993460 ; ccccccccH rep stosd mov eax, DWORD PTR ___security_cookie xor eax, ebp mov DWORD PTR __$ArrayPad$[ebp], eax mov ecx, OFFSET __2415E362_test_op_equals@c call @__CheckForDebuggerJustMyCode@4 ; 33 : PMC_HANDLE_SINT v; ; 34 : __int32 actual_w; ; 35 : PMC_STATUS_CODE result; ; 36 : PMC_STATUS_CODE v_result; ; 37 : TEST_Assert(env, FormatTestLabel(L"Equals_I_X (%d.%d)", no, 1), (v_result = ep->FromByteArray(v_buf, v_buf_size, &v)) == PMC_STATUS_OK, FormatTestMesssage(L"FromByteArrayの復帰コードが期待通りではない(%d)", v_result)); mov esi, esp lea eax, DWORD PTR _v$[ebp] push eax mov ecx, DWORD PTR _v_buf_size$[ebp] push ecx mov edx, DWORD PTR _v_buf$[ebp] push edx mov eax, DWORD PTR _ep$[ebp] mov ecx, DWORD PTR [eax+304] call ecx cmp esi, esp call __RTC_CheckEsp mov DWORD PTR _v_result$[ebp], eax cmp DWORD PTR _v_result$[ebp], 0 jne SHORT $LN4@TEST_Equal mov DWORD PTR tv74[ebp], 1 jmp SHORT $LN5@TEST_Equal $LN4@TEST_Equal: mov DWORD PTR tv74[ebp], 0 $LN5@TEST_Equal: mov edx, DWORD PTR _v_result$[ebp] push edx push OFFSET ??_C@_1EC@NPMCAPKO@?$AAF?$AAr?$AAo?$AAm?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy?$AAn?$PP?$KJ@ call _FormatTestMesssage add esp, 8 push eax mov eax, DWORD PTR tv74[ebp] push eax push 1 mov ecx, DWORD PTR _no$[ebp] push ecx push OFFSET ??_C@_1CG@ECJOMMLD@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAI?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ call _FormatTestLabel add esp, 12 ; 0000000cH push eax mov edx, DWORD PTR _env$[ebp] push edx call _TEST_Assert add esp, 16 ; 00000010H ; 38 : TEST_Assert(env, FormatTestLabel(L"Equals_I_X (%d.%d)", no, 2), (result = ep->Equals_I_X(u, v, &actual_w)) == PMC_STATUS_OK, FormatTestMesssage(L"Equals_I_Xの復帰コードが期待通りではない(%d)", result)); mov esi, esp lea eax, DWORD PTR _actual_w$[ebp] push eax mov ecx, DWORD PTR _v$[ebp] push ecx mov edx, DWORD PTR _u$[ebp] push edx mov eax, DWORD PTR _ep$[ebp] mov ecx, DWORD PTR [eax+472] call ecx cmp esi, esp call __RTC_CheckEsp mov DWORD PTR _result$[ebp], eax cmp DWORD PTR _result$[ebp], 0 jne SHORT $LN6@TEST_Equal mov DWORD PTR tv92[ebp], 1 jmp SHORT $LN7@TEST_Equal $LN6@TEST_Equal: mov DWORD PTR tv92[ebp], 0 $LN7@TEST_Equal: mov edx, DWORD PTR _result$[ebp] push edx push OFFSET ??_C@_1DM@DIPCKLML@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAI?$AA_?$AAX?$AAn?$PP?$KJ?$AA0?$PP?$LD?$PP?$PM@ call _FormatTestMesssage add esp, 8 push eax mov eax, DWORD PTR tv92[ebp] push eax push 2 mov ecx, DWORD PTR _no$[ebp] push ecx push OFFSET ??_C@_1CG@ECJOMMLD@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAI?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ call _FormatTestLabel add esp, 12 ; 0000000cH push eax mov edx, DWORD PTR _env$[ebp] push edx call _TEST_Assert add esp, 16 ; 00000010H ; 39 : TEST_Assert(env, FormatTestLabel(L"Equals_I_X (%d.%d)", no, 3), actual_w == desired_w, L"データの内容が一致しない"); mov eax, DWORD PTR _actual_w$[ebp] cmp eax, DWORD PTR _desired_w$[ebp] jne SHORT $LN8@TEST_Equal mov DWORD PTR tv134[ebp], 1 jmp SHORT $LN9@TEST_Equal $LN8@TEST_Equal: mov DWORD PTR tv134[ebp], 0 $LN9@TEST_Equal: push OFFSET ??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@ mov ecx, DWORD PTR tv134[ebp] push ecx push 3 mov edx, DWORD PTR _no$[ebp] push edx push OFFSET ??_C@_1CG@ECJOMMLD@?$AAE?$AAq?$AAu?$AAa?$AAl?$AAs?$AA_?$AAI?$AA_?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4@ call _FormatTestLabel add esp, 12 ; 0000000cH push eax mov eax, DWORD PTR _env$[ebp] push eax call _TEST_Assert add esp, 16 ; 00000010H ; 40 : if (v_result == PMC_STATUS_OK) cmp DWORD PTR _v_result$[ebp], 0 jne SHORT $LN1@TEST_Equal ; 41 : ep->Dispose(v); mov esi, esp mov eax, DWORD PTR _v$[ebp] push eax mov ecx, DWORD PTR _ep$[ebp] mov edx, DWORD PTR [ecx+296] call edx cmp esi, esp call __RTC_CheckEsp $LN1@TEST_Equal: ; 42 : } push edx mov ecx, ebp push eax lea edx, DWORD PTR $LN13@TEST_Equal call @_RTC_CheckStackVars@8 pop eax pop edx pop edi pop esi pop ebx mov ecx, DWORD PTR __$ArrayPad$[ebp] xor ecx, ebp call @__security_check_cookie@4 add esp, 248 ; 000000f8H cmp ebp, esp call __RTC_CheckEsp mov esp, ebp pop ebp ret 0 npad 3 $LN13@TEST_Equal: DD 2 DD $LN12@TEST_Equal $LN12@TEST_Equal: DD -12 ; fffffff4H DD 4 DD $LN10@TEST_Equal DD -24 ; ffffffe8H DD 4 DD $LN11@TEST_Equal $LN11@TEST_Equal: DB 97 ; 00000061H DB 99 ; 00000063H DB 116 ; 00000074H DB 117 ; 00000075H DB 97 ; 00000061H DB 108 ; 0000006cH DB 95 ; 0000005fH DB 119 ; 00000077H DB 0 $LN10@TEST_Equal: DB 118 ; 00000076H DB 0 _TEST_Equals_I_X ENDP _TEXT ENDS END
src/mods/reveal_crate_reshroud.asm
mvdhout1992/ts-patches
33
90861
<filename>src/mods/reveal_crate_reshroud.asm %include "macros/patch.inc" ; Picking up a second "map reveal" crate normally unshrouds the map - this fixes it @CLEAR 0x00458104, 0x90, 0x00458109
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/pack13_pkg.ads
best08618/asylo
7
4175
<reponame>best08618/asylo<gh_stars>1-10 generic Size : Positive; package Pack13_Pkg is type Object is private; private type Bit is range 0 .. 1; for Bit'size use 1; type Object is array (1 .. Size) of Bit; pragma Pack (Object); end Pack13_Pkg;
programs/oeis/228/A228871.asm
neoneye/loda
22
18415
; A228871: Odd numbers producing 3 out-of-order odd numbers in the Collatz (3x+1) iteration. ; 3,227,14563,932067,59652323,3817748707,244335917283,15637498706147,1000799917193443,64051194700380387,4099276460824344803,262353693492758067427,16790636383536516315363,1074600728546337044183267,68774446626965570827729123 mov $1,64 pow $1,$0 div $1,63 mul $1,224 add $1,3 mov $0,$1
FindReplaceText-Helper Adobe Photoshop CC 2017/PSTestDocumentsSetup.applescript
ErikTollefsrud/FindReplaceText-Helper
0
614
<reponame>ErikTollefsrud/FindReplaceText-Helper use AppleScript version "2.4" -- Yosemite (10.10) or later use scripting additions property testFileName1 : "FindReplaceTestDoc1" property testFileName2 : "FindReplaceTestDoc2" property saveFolder : missing value -- Set save path (it's the path to the folder this script is located at) tell application "Finder" set saveFolder to container of (path to me) as alias end tell -- Make Photoshop document with two text layers property textForDoc1Layer1 : "Testing 1, 2, 3" property textForDoc1Layer2 : "Testing 4, 5, 6" tell application "Adobe Photoshop CC 2017" make new document with properties {name:testFileName1} make new art layer at current document with properties {name:"Text Layer 1", kind:text layer} make new art layer at current document with properties {name:"Text Layer 2", kind:text layer} tell text object of art layer 1 of current document set {contents, size, stroke color} to {textForDoc1Layer1, 20.0, {class:RGB hex color, hex value:"913b8e"}} end tell tell text object of art layer 2 of current document set {contents, size, stroke color, position} to {textForDoc1Layer2, 25.0, {class:RGB hex color, hex value:"339966"}, {3, 4}} end tell save current document in file ((saveFolder & testFileName1) as string) as Photoshop format close current document end tell -- Make Photoshop document with two text layers property textForDoc2Layer1 : "Testing 1, 2, 3" property textForDoc2Layer2 : "Testing 4, 5, 6" tell application "Adobe Photoshop CC 2017" make new document with properties {name:testFileName2} make new art layer at current document with properties {name:"Text Layer 1", kind:text layer} make new art layer at current document with properties {name:"Text Layer 2", kind:text layer} tell text object of art layer 1 of current document set {contents, size, stroke color} to {textForDoc2Layer1, 20.0, {class:RGB hex color, hex value:"8b475d"}} end tell tell text object of art layer 2 of current document set {contents, size, stroke color, position} to {textForDoc2Layer2, 25.0, {class:RGB hex color, hex value:"8fbc8f"}, {4, 3}} end tell save current document in file ((saveFolder & testFileName2) as string) as Photoshop format close current document end tell
oeis/206/A206912.asm
neoneye/loda-programs
11
98766
<gh_stars>10-100 ; A206912: Position of log(n+1) when the partial sums of the harmonic series are jointly ranked with the set {log(k+1)}; complement of A206911. ; 1,3,4,6,7,9,10,12,14,15,17,18,20,21,23,25,26,28,29,31,32,34,35,37,39,40,42,43,45,46,48,50,51,53,54,56,57,59,60,62,64,65,67,68,70,71,73,75,76,78,79,81,82,84,85,87,89,90,92,93,95,96,98,99,101,103,104 mov $4,$0 mul $0,2 pow $0,2 mov $2,$0 lpb $0 mov $0,$2 add $3,1 div $0,$3 sub $0,$3 sub $2,$4 add $2,1 lpe mov $0,$3 add $0,1
main/pdata.asm
zlatkok/swospp
12
29909
<reponame>zlatkok/swospp [list -] %include "swos.inc" %include "pdata.inc" %include "version.inc" [list +] bits 32 ; additional externs extern int2str extern LoadSWPPMenu extern WriteYULetters extern FixGetTextSize extern OpenReplayFile extern CloseReplayFile extern MyHilPtrIncrement extern MyHilPtrAdd extern PrintSmallNumber extern PushMenu, PopMenu extern SelectMenuMusic %ifdef DEBUG extern EndLogFile %endif ; patch specific data section .data newMessage: db "Sensible World Of Soccer V2.0 ", 13, 10 db "SWOS++ v" db verStr db 13, 10, "$" swosppTitle: %ifdef SENSI_DAYS db "SENSIBLE DAYS", 0 %else db "SWOS++", 0 %endif ; patch-specific code section .text extern replayStatus, EndProgram, SwitchToPrevVideoMode extern ShutDownNetwork, qAllocFinish ; Hook ALT-F1 fast exit, as well as normal exit from menu. HookTermination: WriteToLog "Termination handler invoked." call SwitchToPrevVideoMode xor eax, eax jmp EndProgram ; We are overwriting unused invisible entry in main menu, so have to show it explicitly. MakeSWOSPPVisible: mov word [currentTeamNumber], -1 SWOSMainMenuAfterDraw: mov dword [D0], 4 ; 4 is our entry number calla CalcMenuEntryAddress mov esi, [A0] mov word [esi + 4], 0 retn FixFindFiles: cmp byte [esi + 1], 'C' jz .accept cmp byte [esi + 1], 'R' jz .accept jmpa FindFiles + 0x102 .accept: jmpa FindFiles + 0xd6 FixGetFilenameAndExtension: cmp dword [D1], 'LIH.' jz .accept cmp dword [D1], 'LPR.' jz .accept jmpa GetFilenameAndExtension + 0x136 .accept: jmpa GetFilenameAndExtension + 0x158 FixSelectFileToSaveDialog: cmp dword [D1], 'LIH.' jz .accept cmp dword [D1], 'LPR.' jz .accept jmpa SelectFileToSaveDialog + 0x199 .accept: jmpa SelectFileToSaveDialog + 0x154 AddReplayDesc: cmp dword [D1], 'CAT.' jz .jump_back mov dword [A0], aHigh cmp dword [D1], 'LPR.' jnz .jump_back mov dword [A0], aReplay .jump_back: jmpa SelFilesBeforeDrawCommon + 0x13a ; reset control variables to zero, in case setup.dat contains some values extern VerifyJoysticks ResetControlVars: xor eax, eax mov [g_joy1XValue], eax mov [g_joy2XValue], eax mov [g_joy1Status], eax mov [setupDatBuffer], ax %ifndef SENSI_DAYS mov al, [pl2Keyboard] test al, al ; if true, both players are on the keyboard jnz .pl2_kbd %endif call VerifyJoysticks ; this will prevent controls blocking if there is currently no joystick attached WriteToLog "g_joyKbdWord = %hd, after VerifyJoysticks()", dword [g_joyKbdWord] retn .pl2_kbd: mov word [g_joyKbdWord], 4 ; just in case user changed config through install.exe retn ; if shirt number is out of normal range, add 9000 to it SetPlayerNumber: test ax, ax jz .increase cmp ax, 16 ja .increase .return: add word [D0], ax retn .increase: add ax, 9000 jmp short .return ; We will execute inside DrawSprites loop, and check sprite number that's being drawn. ; See if it's over 9000!!!! It means it's player number that's greater than 16. ; ; in: ; ax - sprite number ; esi -> Sprite structure ; DrawPlayerNumber: cmp ax, 9000 ja .custom_draw .return: mov dword [D0], eax or ax, ax retn .custom_draw: sub ax, 9000 + 1187 cmp ax, 255 ; clamp it to byte, that field in file is a byte ja .skip_sprite push byte 1 mov dx, word [esi + 32] ; do not subtract center x/y, as PrintSmallNumber will do centering of its own sub dx, [cameraX] ; x - camera x mov cx, word [esi + 36] sub cx, [cameraY] ; y - camera y sub cx, word [esi + 40] ; subtract z movsx edx, dx movsx ecx, cx movzx eax, ax ; number to draw inc ecx call PrintSmallNumber .skip_sprite: or al, -1 ; force sign flag so loop skips to next sprite retn SubsDrawPlayerNumber: mov esi, [benchTeam] mov esi, [esi + 20] ; player sprites table movzx eax, word [D7] shl eax, 2 mov esi, [esi + eax] mov ax, [esi + 102] ; cards test ax, ax jz .no_cards pop eax ; discard return address jmpa DrawSubstitutesMenuEntry + 0x5de ; don't draw player number .no_cards: add dword [D1], 3 ; add 3 pixels more between faces and names movzx eax, byte [D5] cmp eax, byte 16 jbe .return call int2str ; if it's our number, convert it the usual way mov [A0], eax ; A0 -> string for printing .return: mov word [D3], 2 retn ; Fix drawing of little player numbers when editing tactics. ; ; in: ; D0 - sprite index ; D1 - x coordinate ; D2 - y coordinate ; EditTacticsDrawPlayerNumber: movzx eax, word [D0] cmp eax, 161 ; number 0 jz .custom_draw cmp word [D0], 173 jb .out .custom_draw: push byte 0 movzx eax, word [D0] ; OK so we gotta deal with high player number sub ax, 161 ; number to draw = start of little numbers - 1 movsx edx, word [D1] movsx ecx, word [D2] call PrintSmallNumber retn .out: jmpa DrawSpriteCentered FixPlayerBooking: cbw test al, al jz .increase cmp al, 16 ja .increase .return: mov [D1], ax retn .increase: add ax, 9000 jmp short .return HookSaveCoordinatesForHighlights: mov ax, [goToSubsTimer] ; without this, cutout is too sharp test ax, ax jnz .its_ok mov ax, [inSubstitutesMenu] test ax, ax jnz .cancel .its_ok: mov eax, [currentHilPtr] mov [A1], eax retn .cancel: pop eax retn %ifndef SENSI_DAYS ; HookMenuLoop ; ; This part is crucial for whole network part to work properly. We will execute each ; frame before MenuProc, and it might get skipped depending on network activity. ; extern NetworkOnIdle, CheckIfJoystickDisconnected HookMenuLoop: call CheckIfJoystickDisconnected call NetworkOnIdle test eax, eax jz .skip_menu_proc calla ReadTimerDelta jmpa DrawMenu .skip_menu_proc: pop eax retn HookInputText: push dword [A0] push dword [A6] call NetworkOnIdle pop dword [A6] pop dword [A0] test eax, eax jnz .continue_input push byte 1 ; cancel input completely pop eax mov [D0], eax or eax, eax pop ebx retn .continue_input: calla GetKey calla FilterKeys retn ; CheckInputDisabledTimer ; ; Patch CheckControls to add support for temporary disabling input in menus, ; and also to have an in-menu input received from the other player. ; extern BroadcastControls, GetControlsFromNetwork, pl2Keyboard declareGlobal disabledInputCycles, 1 declareGlobal lastFireState, 1 CheckInputDisabledTimer: mov al, [disabledInputCycles] test al, al jz .go_on cmp al, -1 ; -1 signaling that controls are (possibly) coming from other player jz .redirect_input dec byte [disabledInputCycles] .no_key: mov word [lastKey], 0 mov word [keyCount], 0 mov word [finalControlsStatus], -1 mov byte [convertedKey], 0 mov word [fire], 0 mov word [shortFire], 0 pop eax ; skip entire function retn .redirect_input: call GetControlsFromNetwork cmp eax, -1 jz .get_real_key mov ecx, eax shr ecx, 16 ; ecx = long fire in high word and eax, 0xffff test al, 0x80 jz .no_change_in_fire_state xor byte [lastFireState], -1 .no_change_in_fire_state: and al, ~0x80 test al, al jnz .process_key calla GetKey ; to enable alt-f1 jmp .no_key .process_key: mov [g_joy1Status], ax mov byte [Joy1SetStatus], 0xc3 ; prevent it from writing real values to joy1Status call .go_on ; call GetKey so alt-f1 can end the program pop ebx push dword [g_joyKbdWord] mov al, [pl2Keyboard] ; if 2nd player on keyboard is on, cbw ; CheckControls will be patched mov [g_joyKbdWord], ax ; prevent joy1Status getting overwritten in any case mov word [controlsHeldTimer], 2000 ; prevent too fast commands getting rejected push ecx call ebx pop ecx pop dword [g_joyKbdWord] mov byte [Joy1SetStatus], 0x66 mov al, byte [lastFireState] cbw mov [fire], ax movzx eax, byte [g_joy1Status] shr eax, 5 and eax, 1 neg eax mov [shortFire], ax ; we will get short fire each time it's issued mov [longFireFlag], cx retn .get_real_key: call .go_on pop ebx call ebx ; let CheckControls execute in full xor eax, eax ; al = controls byte cmp word [finalControlsStatus], -1 ; make sure we don't flood jz .check_short_fire mov al, [controlWord] ; send real controls for player1, keyboard or joystick cmp word [g_joyKbdWord], 1 jz .check_short_fire mov al, [g_joy1Status] .check_short_fire: and al, ~0x20 cmp byte [shortFire], 0 jz .check_long_fire or al, 0x20 ; short fire is generated periodically .check_long_fire: mov bl, [fire] cmp bl, [lastFireState] jz .test_controls or al, 0x80 ; signal long fire state change mov [lastFireState], bl ; use previously unused bit 7 to signal it .test_controls: test al, al jz .no_key movzx edx, word [longFireFlag] call BroadcastControls retn .go_on: calla GetKey mov ax, [lastKey] .out: retn ; HookMainMenuSetup ; ; Set initial menu SWOS shows in A6. ; extern MainMenuSelect HookMainMenuSetup: call MainMenuSelect mov [A6], eax retn %endif ; HookSetBenchPlayersNumbers ; ; in: ; al - bench player ordinal in lineup (12-16) ; esi -> player (file) + negative offset of header size ; ; Don't reset bench player's shirt number if it's a high number (> 16, or zero) ; HookSetBenchPlayersNumbers: mov bl, [esi + PlayerFile.shirtNumber + TEAM_FILE_HEADER_SIZE] test bl, bl jz .skip cmp bl, 16 jg .skip mov [esi + PlayerFile.shirtNumber + TEAM_FILE_HEADER_SIZE], al retn .skip: pop eax retn ; HookBenchPlayerSwap ; ; in: ; esi -> player 1 (file) - header ; A1 -> player 2 (file) - header ; ; Prevent shirt number swapping in case any of players has high (custom) shirt ; number. If none of them does, allow standard behaviour to happen. ; HookBenchPlayerSwap: mov al, [esi + PlayerFile.shirtNumber + TEAM_FILE_HEADER_SIZE] cmp al, 16 jg .skip test al, al jz .skip mov esi, [A1] mov bl, [esi + PlayerFile.shirtNumber + TEAM_FILE_HEADER_SIZE] cmp bl, 16 jg .skip test bl, bl jz .skip mov [D0], al retn .skip: pop eax add eax, 0x21 jmp eax ; .ptdata name is mandatory section .ptdata data ; must be present global PatchStart PatchStart: ; -------------------------------------- ; user modifiable part ; infiltrate starting message PatchOffset Initialization + 0x1c, newMessage ; patch in entry in main menu for our menu StartRecord SWOS_MainMenu + 0x9e dw 85 ; x dw 20 ; y dw 150 ; width dw 16 ; height dw 1 ; type 1 - invisible item, will be corrected in menu init dw 2 ; type 2 - positions db -1 ; left - nothing db -1 ; right - nothing db -1 ; up - nothing db 5 ; down - goto "FRIENDLY" dw 4 ; type 4 - background color dw 14 ; green dw 8 ; type 8 - string dw 16 ; string flags dd swosppTitle dw 13 ; type 13 - on select function dd LoadSWPPMenu dw 0 ; type 0 - end of menu entry EndRecord ; patch "EDIT TACTICS" and "FRIENDLY" entries up entry number PatchByte SWOS_MainMenu + 0x22, 4 PatchByte SWOS_MainMenu + 0xce, 4 ; set SWOS++ entry to default in main menu PatchByte SWOS_MainMenu + 0xc, 4 ; patch main menu init routine and make our SWOS++ entry visible StartRecord SWOSMainMenuInit calla MakeSWOSPPVisible nop nop EndRecord ; patch main menu after draw to keep SWOS++ entry visible PatchOffset SWOS_MainMenu + 4, SWOSMainMenuAfterDraw ; patch DrawMenuText to add support for Serbian letters StartRecord DrawMenuText + 0xb7 calla WriteYULetters EndRecord ; fix GetTextSize so it could count 'dj' correctly StartRecord GetTextSize + 0x81 calla FixGetTextSize EndRecord ; hook game start StartRecord GameLoop + 0x1c8 calla OpenReplayFile nop nop EndRecord ; hook game end StartRecord GameLoop + 0x64c xor eax, eax ; signal call from patched code calla CloseReplayFile, ebx EndRecord ; hook incrementing hil pointer so we can save it to file when overflows StartRecord IncrementHilBufferPointer jmpa MyHilPtrIncrement EndRecord ; hook incrementing hil pointer while replaying StartRecord ValidateHilPointerAdd jmpa MyHilPtrAdd EndRecord ; patch stoopid FindFiles not to reject *.rpl files StartRecord FindFiles + 0xce jmpa FixFindFiles EndRecord ; GetFilenameAndExtension must also be patched to allow new extensions StartRecord GetFilenameAndExtension + 0x14c jmpa FixGetFilenameAndExtension EndRecord ; patch SelectFileToSaveDialog to show *.rpl files StartRecord SelectFileToSaveDialog + 0x148 jmpa FixSelectFileToSaveDialog EndRecord ; patch in description for replay files StartRecord SelFilesBeforeDrawCommon + 0x124 jmpa AddReplayDesc EndRecord ; hook after reading setup.dat to reset control variables StartRecord Initialization + 0x4d calla ResetControlVars times 2 nop EndRecord ; draw player numbers StartRecord DrawControlledPlayerNumbers + 0x184 calla SetPlayerNumber, ebx ; ax needs to hold shirt number EndRecord ; hook DrawSprites to draw player numbers above 16 and zero StartRecord DrawSprites + 0x65 calla DrawPlayerNumber, ebx nop nop EndRecord ; fix substitutes menu to draw big player numbers correctly StartRecord DrawSubstitutesMenuEntry + 0x570 calla SubsDrawPlayerNumber times 2 nop EndRecord ; push/pop A4 is unnecessary StartRecord DrawLittlePlayersAndBall + 0x323 calla EditTacticsDrawPlayerNumber times 4 nop EndRecord FillRecord DrawLittlePlayersAndBall + 0x32e, 6, 0x90 ; expand menu entries and move player names and positions by 4 pixels in ; substitutes menu to allow bigger shirt numbers PatchByte DrawSubstitutesMenuEntry + 0x731, 15 ; move name PatchByte DrawSubstitutesMenuEntry + 0x829, 122 ; move position PatchByte DrawSubstitutesMenuEntry + 0x38, 132 ; entry length PatchByte DrawSubstitutesMenuEntry + 0x168, 130 ; entry solid background ; prevent SWOS from reseting bench players numbers to 12..16, but only for high numbered players StartRecord SetBenchPlayersNumbers + 0x40 calla HookSetBenchPlayersNumbers, ebx nop nop EndRecord ; player sprite number setting is also done while booking StartRecord BookPlayer + 0x165 calla FixPlayerBooking, ebx EndRecord ; move card sprites a little bit PatchByte DrawSubstitutesMenuEntry + 0x687, 12 ; hook program end to close log file and some other things StartRecord SetPrevVideoModeEndProgram calla HookTermination EndRecord %ifdef DEBUG ; write int1 before call to SWOS to allow symbol loading ;StartRecord DumpTimerVariables + 0x81 ; int 1 ;EndRecord %endif ; always set graphics to VGA to enforce consistency PatchByte Initialization + 0x5e, 0xeb ; fix overwrite goal with bench scene bug ; (also causes corruption of replay files) FillRecord BenchCheckControls + 0x78f, 5, 0x90 ; reject save coordinates requests while in substitutes menu StartRecord SaveCoordinatesForHighlights calla HookSaveCoordinatesForHighlights times 3 nop EndRecord ; hook main keys check in game to allow new keyboard commands extern HookMainKeysCheck StartRecord MainKeysCheck calla HookMainKeysCheck nop EndRecord ; hook flipping to implement fast replays extern CheckForFastReplay StartRecord Flip calla CheckForFastReplay nop EndRecord %ifndef SENSI_DAYS ; hook menu loop to implement OnIdle() for network StartRecord MenuProc calla HookMenuLoop times 3 nop EndRecord ; hook InputText loop to allow OnIdle() to run while entering text StartRecord InputText + 0x78 calla HookInputText times 3 nop EndRecord %endif ; return whatever dest pointer reached when length ran out, + 1 FillRecord swos_libc_strncpy_ + 0x1d, 5, 0x90 %ifndef SENSI_DAYS ; allow input to be disabled for a while, so user doesn't instantly exit modal menu StartRecord CheckControls calla CheckInputDisabledTimer times 4 nop EndRecord %endif ; fix upper half of edx getting dirty in ClearBackground StartRecord ClearBackground + 0x3e mov edx, 384 ; overwrites next instruction size prefix and all fits perfectly EndRecord ; record all open menus to the stack, so we can return to arbitrary one StartRecord ShowMenu + 0x34 calla PushMenu nop nop EndRecord ; hook menu exit too and delete them from stack StartRecord ShowMenu + 0x66 calla PopMenu nop nop EndRecord ; hook saving of menu to return to after the game extern HookMenuSaveAfterTheGame StartRecord SWOS + 0x179 calla HookMenuSaveAfterTheGame nop nop EndRecord ; fix InputText to limit text properly when we start with buffer already filled more than limit PatchByte InputText + 0x25d, 0x83 %ifndef SENSI_DAYS StartRecord InitMainMenuStuff + 0x114 calla HookMainMenuSetup times 3 nop EndRecord %endif ; kill this bastard PatchByte SetDefaultOptions, 0xc3 ; make DoUnchainSpriteInMenus use entire D1 (and not just lo word with hi word undefined) StartRecord DoUnchainSpriteInMenus nop EndRecord ; fix game length bug on PC version PatchByte UpdateTime + 0xfa, 70 ; fix conversion of shirt numbers greater than 127 PatchWord MakePlayerNameSprite + 5, 0x00b4 ; hook player swap so bench players retain their custom shirt numbers StartRecord PlayMatchMenuSwapPlayers + 0x100 calla HookBenchPlayerSwap nop EndRecord extern ReadGamePort2 StartRecord SWOS_ReadGamePort + 0x10 jmpa ReadGamePort2 EndRecord ; patch reading of joystick keys which is done directly in Joy1SetStatus and Joy2SetStatus extern ReadJoystickButtons StartRecord Joy1SetStatus + 0x3b calla ReadJoystickButtons EndRecord StartRecord Joy2SetStatus + 0x3b calla ReadJoystickButtons EndRecord %ifdef SENSI_DAYS ; prefer swos.xmi over menu.xmi StartRecord InitMenuMusic + 0xa calla SelectMenuMusic times 3 nop EndRecord %endif %ifdef DEBUG ; don't waste time on opening animations in debug version PatchByte Initialization + 0x19, 1 %endif ; -------------------------------------- ; do not edit lines below ; patch data must be terminated with address -1 db 0 dd -1 ; this symbol must exist and be at the end global PatchSize PatchSize: dd $ - PatchStart
bb-runtimes/arm/stm32/stm32f401/svd/i-stm32-rcc.ads
JCGobbi/Nucleo-STM32G474RE
0
7256
<filename>bb-runtimes/arm/stm32/stm32f401/svd/i-stm32-rcc.ads -- -- Copyright (C) 2020, AdaCore -- -- This spec has been automatically generated from STM32F401.svd pragma Ada_2012; pragma Style_Checks (Off); with System; package Interfaces.STM32.RCC is pragma Preelaborate; pragma No_Elaboration_Code_All; --------------- -- Registers -- --------------- subtype CR_HSION_Field is Interfaces.STM32.Bit; subtype CR_HSIRDY_Field is Interfaces.STM32.Bit; subtype CR_HSITRIM_Field is Interfaces.STM32.UInt5; subtype CR_HSICAL_Field is Interfaces.STM32.Byte; subtype CR_HSEON_Field is Interfaces.STM32.Bit; subtype CR_HSERDY_Field is Interfaces.STM32.Bit; subtype CR_HSEBYP_Field is Interfaces.STM32.Bit; subtype CR_CSSON_Field is Interfaces.STM32.Bit; subtype CR_PLLON_Field is Interfaces.STM32.Bit; subtype CR_PLLRDY_Field is Interfaces.STM32.Bit; subtype CR_PLLI2SON_Field is Interfaces.STM32.Bit; subtype CR_PLLI2SRDY_Field is Interfaces.STM32.Bit; -- clock control register type CR_Register is record -- Internal high-speed clock enable HSION : CR_HSION_Field := 16#1#; -- Read-only. Internal high-speed clock ready flag HSIRDY : CR_HSIRDY_Field := 16#1#; -- unspecified Reserved_2_2 : Interfaces.STM32.Bit := 16#0#; -- Internal high-speed clock trimming HSITRIM : CR_HSITRIM_Field := 16#10#; -- Read-only. Internal high-speed clock calibration HSICAL : CR_HSICAL_Field := 16#0#; -- HSE clock enable HSEON : CR_HSEON_Field := 16#0#; -- Read-only. HSE clock ready flag HSERDY : CR_HSERDY_Field := 16#0#; -- HSE clock bypass HSEBYP : CR_HSEBYP_Field := 16#0#; -- Clock security system enable CSSON : CR_CSSON_Field := 16#0#; -- unspecified Reserved_20_23 : Interfaces.STM32.UInt4 := 16#0#; -- Main PLL (PLL) enable PLLON : CR_PLLON_Field := 16#0#; -- Read-only. Main PLL (PLL) clock ready flag PLLRDY : CR_PLLRDY_Field := 16#0#; -- PLLI2S enable PLLI2SON : CR_PLLI2SON_Field := 16#0#; -- Read-only. PLLI2S clock ready flag PLLI2SRDY : CR_PLLI2SRDY_Field := 16#0#; -- unspecified Reserved_28_31 : Interfaces.STM32.UInt4 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for CR_Register use record HSION at 0 range 0 .. 0; HSIRDY at 0 range 1 .. 1; Reserved_2_2 at 0 range 2 .. 2; HSITRIM at 0 range 3 .. 7; HSICAL at 0 range 8 .. 15; HSEON at 0 range 16 .. 16; HSERDY at 0 range 17 .. 17; HSEBYP at 0 range 18 .. 18; CSSON at 0 range 19 .. 19; Reserved_20_23 at 0 range 20 .. 23; PLLON at 0 range 24 .. 24; PLLRDY at 0 range 25 .. 25; PLLI2SON at 0 range 26 .. 26; PLLI2SRDY at 0 range 27 .. 27; Reserved_28_31 at 0 range 28 .. 31; end record; subtype PLLCFGR_PLLM_Field is Interfaces.STM32.UInt6; subtype PLLCFGR_PLLN_Field is Interfaces.STM32.UInt9; subtype PLLCFGR_PLLP_Field is Interfaces.STM32.UInt2; subtype PLLCFGR_PLLSRC_Field is Interfaces.STM32.Bit; subtype PLLCFGR_PLLQ_Field is Interfaces.STM32.UInt4; -- PLL configuration register type PLLCFGR_Register is record -- Division factor for the main PLL (PLL) and audio PLL (PLLI2S) input -- clock PLLM : PLLCFGR_PLLM_Field := 16#10#; -- Main PLL (PLL) multiplication factor for VCO PLLN : PLLCFGR_PLLN_Field := 16#C0#; -- unspecified Reserved_15_15 : Interfaces.STM32.Bit := 16#0#; -- Main PLL (PLL) division factor for main system clock PLLP : PLLCFGR_PLLP_Field := 16#0#; -- unspecified Reserved_18_21 : Interfaces.STM32.UInt4 := 16#0#; -- Main PLL(PLL) and audio PLL (PLLI2S) entry clock source PLLSRC : PLLCFGR_PLLSRC_Field := 16#0#; -- unspecified Reserved_23_23 : Interfaces.STM32.Bit := 16#0#; -- Main PLL (PLL) division factor for USB OTG FS, SDIO and random number -- generator clocks PLLQ : PLLCFGR_PLLQ_Field := 16#4#; -- unspecified Reserved_28_31 : Interfaces.STM32.UInt4 := 16#2#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PLLCFGR_Register use record PLLM at 0 range 0 .. 5; PLLN at 0 range 6 .. 14; Reserved_15_15 at 0 range 15 .. 15; PLLP at 0 range 16 .. 17; Reserved_18_21 at 0 range 18 .. 21; PLLSRC at 0 range 22 .. 22; Reserved_23_23 at 0 range 23 .. 23; PLLQ at 0 range 24 .. 27; Reserved_28_31 at 0 range 28 .. 31; end record; subtype CFGR_SW_Field is Interfaces.STM32.UInt2; subtype CFGR_SWS_Field is Interfaces.STM32.UInt2; subtype CFGR_HPRE_Field is Interfaces.STM32.UInt4; -- CFGR_PPRE array element subtype CFGR_PPRE_Element is Interfaces.STM32.UInt3; -- CFGR_PPRE array type CFGR_PPRE_Field_Array is array (1 .. 2) of CFGR_PPRE_Element with Component_Size => 3, Size => 6; -- Type definition for CFGR_PPRE type CFGR_PPRE_Field (As_Array : Boolean := False) is record case As_Array is when False => -- PPRE as a value Val : Interfaces.STM32.UInt6; when True => -- PPRE as an array Arr : CFGR_PPRE_Field_Array; end case; end record with Unchecked_Union, Size => 6; for CFGR_PPRE_Field use record Val at 0 range 0 .. 5; Arr at 0 range 0 .. 5; end record; subtype CFGR_RTCPRE_Field is Interfaces.STM32.UInt5; subtype CFGR_MCO1_Field is Interfaces.STM32.UInt2; subtype CFGR_I2SSRC_Field is Interfaces.STM32.Bit; subtype CFGR_MCO1PRE_Field is Interfaces.STM32.UInt3; subtype CFGR_MCO2PRE_Field is Interfaces.STM32.UInt3; subtype CFGR_MCO2_Field is Interfaces.STM32.UInt2; -- clock configuration register type CFGR_Register is record -- System clock switch SW : CFGR_SW_Field := 16#0#; -- Read-only. System clock switch status SWS : CFGR_SWS_Field := 16#0#; -- AHB prescaler HPRE : CFGR_HPRE_Field := 16#0#; -- unspecified Reserved_8_9 : Interfaces.STM32.UInt2 := 16#0#; -- APB Low speed prescaler (APB1) PPRE : CFGR_PPRE_Field := (As_Array => False, Val => 16#0#); -- HSE division factor for RTC clock RTCPRE : CFGR_RTCPRE_Field := 16#0#; -- Microcontroller clock output 1 MCO1 : CFGR_MCO1_Field := 16#0#; -- I2S clock selection I2SSRC : CFGR_I2SSRC_Field := 16#0#; -- MCO1 prescaler MCO1PRE : CFGR_MCO1PRE_Field := 16#0#; -- MCO2 prescaler MCO2PRE : CFGR_MCO2PRE_Field := 16#0#; -- Microcontroller clock output 2 MCO2 : CFGR_MCO2_Field := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for CFGR_Register use record SW at 0 range 0 .. 1; SWS at 0 range 2 .. 3; HPRE at 0 range 4 .. 7; Reserved_8_9 at 0 range 8 .. 9; PPRE at 0 range 10 .. 15; RTCPRE at 0 range 16 .. 20; MCO1 at 0 range 21 .. 22; I2SSRC at 0 range 23 .. 23; MCO1PRE at 0 range 24 .. 26; MCO2PRE at 0 range 27 .. 29; MCO2 at 0 range 30 .. 31; end record; subtype CIR_LSIRDYF_Field is Interfaces.STM32.Bit; subtype CIR_LSERDYF_Field is Interfaces.STM32.Bit; subtype CIR_HSIRDYF_Field is Interfaces.STM32.Bit; subtype CIR_HSERDYF_Field is Interfaces.STM32.Bit; subtype CIR_PLLRDYF_Field is Interfaces.STM32.Bit; subtype CIR_PLLI2SRDYF_Field is Interfaces.STM32.Bit; subtype CIR_CSSF_Field is Interfaces.STM32.Bit; subtype CIR_LSIRDYIE_Field is Interfaces.STM32.Bit; subtype CIR_LSERDYIE_Field is Interfaces.STM32.Bit; subtype CIR_HSIRDYIE_Field is Interfaces.STM32.Bit; subtype CIR_HSERDYIE_Field is Interfaces.STM32.Bit; subtype CIR_PLLRDYIE_Field is Interfaces.STM32.Bit; subtype CIR_PLLI2SRDYIE_Field is Interfaces.STM32.Bit; subtype CIR_LSIRDYC_Field is Interfaces.STM32.Bit; subtype CIR_LSERDYC_Field is Interfaces.STM32.Bit; subtype CIR_HSIRDYC_Field is Interfaces.STM32.Bit; subtype CIR_HSERDYC_Field is Interfaces.STM32.Bit; subtype CIR_PLLRDYC_Field is Interfaces.STM32.Bit; subtype CIR_PLLI2SRDYC_Field is Interfaces.STM32.Bit; subtype CIR_CSSC_Field is Interfaces.STM32.Bit; -- clock interrupt register type CIR_Register is record -- Read-only. LSI ready interrupt flag LSIRDYF : CIR_LSIRDYF_Field := 16#0#; -- Read-only. LSE ready interrupt flag LSERDYF : CIR_LSERDYF_Field := 16#0#; -- Read-only. HSI ready interrupt flag HSIRDYF : CIR_HSIRDYF_Field := 16#0#; -- Read-only. HSE ready interrupt flag HSERDYF : CIR_HSERDYF_Field := 16#0#; -- Read-only. Main PLL (PLL) ready interrupt flag PLLRDYF : CIR_PLLRDYF_Field := 16#0#; -- Read-only. PLLI2S ready interrupt flag PLLI2SRDYF : CIR_PLLI2SRDYF_Field := 16#0#; -- unspecified Reserved_6_6 : Interfaces.STM32.Bit := 16#0#; -- Read-only. Clock security system interrupt flag CSSF : CIR_CSSF_Field := 16#0#; -- LSI ready interrupt enable LSIRDYIE : CIR_LSIRDYIE_Field := 16#0#; -- LSE ready interrupt enable LSERDYIE : CIR_LSERDYIE_Field := 16#0#; -- HSI ready interrupt enable HSIRDYIE : CIR_HSIRDYIE_Field := 16#0#; -- HSE ready interrupt enable HSERDYIE : CIR_HSERDYIE_Field := 16#0#; -- Main PLL (PLL) ready interrupt enable PLLRDYIE : CIR_PLLRDYIE_Field := 16#0#; -- PLLI2S ready interrupt enable PLLI2SRDYIE : CIR_PLLI2SRDYIE_Field := 16#0#; -- unspecified Reserved_14_15 : Interfaces.STM32.UInt2 := 16#0#; -- Write-only. LSI ready interrupt clear LSIRDYC : CIR_LSIRDYC_Field := 16#0#; -- Write-only. LSE ready interrupt clear LSERDYC : CIR_LSERDYC_Field := 16#0#; -- Write-only. HSI ready interrupt clear HSIRDYC : CIR_HSIRDYC_Field := 16#0#; -- Write-only. HSE ready interrupt clear HSERDYC : CIR_HSERDYC_Field := 16#0#; -- Write-only. Main PLL(PLL) ready interrupt clear PLLRDYC : CIR_PLLRDYC_Field := 16#0#; -- Write-only. PLLI2S ready interrupt clear PLLI2SRDYC : CIR_PLLI2SRDYC_Field := 16#0#; -- unspecified Reserved_22_22 : Interfaces.STM32.Bit := 16#0#; -- Write-only. Clock security system interrupt clear CSSC : CIR_CSSC_Field := 16#0#; -- unspecified Reserved_24_31 : Interfaces.STM32.Byte := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for CIR_Register use record LSIRDYF at 0 range 0 .. 0; LSERDYF at 0 range 1 .. 1; HSIRDYF at 0 range 2 .. 2; HSERDYF at 0 range 3 .. 3; PLLRDYF at 0 range 4 .. 4; PLLI2SRDYF at 0 range 5 .. 5; Reserved_6_6 at 0 range 6 .. 6; CSSF at 0 range 7 .. 7; LSIRDYIE at 0 range 8 .. 8; LSERDYIE at 0 range 9 .. 9; HSIRDYIE at 0 range 10 .. 10; HSERDYIE at 0 range 11 .. 11; PLLRDYIE at 0 range 12 .. 12; PLLI2SRDYIE at 0 range 13 .. 13; Reserved_14_15 at 0 range 14 .. 15; LSIRDYC at 0 range 16 .. 16; LSERDYC at 0 range 17 .. 17; HSIRDYC at 0 range 18 .. 18; HSERDYC at 0 range 19 .. 19; PLLRDYC at 0 range 20 .. 20; PLLI2SRDYC at 0 range 21 .. 21; Reserved_22_22 at 0 range 22 .. 22; CSSC at 0 range 23 .. 23; Reserved_24_31 at 0 range 24 .. 31; end record; subtype AHB1RSTR_GPIOARST_Field is Interfaces.STM32.Bit; subtype AHB1RSTR_GPIOBRST_Field is Interfaces.STM32.Bit; subtype AHB1RSTR_GPIOCRST_Field is Interfaces.STM32.Bit; subtype AHB1RSTR_GPIODRST_Field is Interfaces.STM32.Bit; subtype AHB1RSTR_GPIOERST_Field is Interfaces.STM32.Bit; subtype AHB1RSTR_GPIOHRST_Field is Interfaces.STM32.Bit; subtype AHB1RSTR_CRCRST_Field is Interfaces.STM32.Bit; subtype AHB1RSTR_DMA1RST_Field is Interfaces.STM32.Bit; subtype AHB1RSTR_DMA2RST_Field is Interfaces.STM32.Bit; -- AHB1 peripheral reset register type AHB1RSTR_Register is record -- IO port A reset GPIOARST : AHB1RSTR_GPIOARST_Field := 16#0#; -- IO port B reset GPIOBRST : AHB1RSTR_GPIOBRST_Field := 16#0#; -- IO port C reset GPIOCRST : AHB1RSTR_GPIOCRST_Field := 16#0#; -- IO port D reset GPIODRST : AHB1RSTR_GPIODRST_Field := 16#0#; -- IO port E reset GPIOERST : AHB1RSTR_GPIOERST_Field := 16#0#; -- unspecified Reserved_5_6 : Interfaces.STM32.UInt2 := 16#0#; -- IO port H reset GPIOHRST : AHB1RSTR_GPIOHRST_Field := 16#0#; -- unspecified Reserved_8_11 : Interfaces.STM32.UInt4 := 16#0#; -- CRC reset CRCRST : AHB1RSTR_CRCRST_Field := 16#0#; -- unspecified Reserved_13_20 : Interfaces.STM32.Byte := 16#0#; -- DMA2 reset DMA1RST : AHB1RSTR_DMA1RST_Field := 16#0#; -- DMA2 reset DMA2RST : AHB1RSTR_DMA2RST_Field := 16#0#; -- unspecified Reserved_23_31 : Interfaces.STM32.UInt9 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for AHB1RSTR_Register use record GPIOARST at 0 range 0 .. 0; GPIOBRST at 0 range 1 .. 1; GPIOCRST at 0 range 2 .. 2; GPIODRST at 0 range 3 .. 3; GPIOERST at 0 range 4 .. 4; Reserved_5_6 at 0 range 5 .. 6; GPIOHRST at 0 range 7 .. 7; Reserved_8_11 at 0 range 8 .. 11; CRCRST at 0 range 12 .. 12; Reserved_13_20 at 0 range 13 .. 20; DMA1RST at 0 range 21 .. 21; DMA2RST at 0 range 22 .. 22; Reserved_23_31 at 0 range 23 .. 31; end record; subtype AHB2RSTR_OTGFSRST_Field is Interfaces.STM32.Bit; -- AHB2 peripheral reset register type AHB2RSTR_Register is record -- unspecified Reserved_0_6 : Interfaces.STM32.UInt7 := 16#0#; -- USB OTG FS module reset OTGFSRST : AHB2RSTR_OTGFSRST_Field := 16#0#; -- unspecified Reserved_8_31 : Interfaces.STM32.UInt24 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for AHB2RSTR_Register use record Reserved_0_6 at 0 range 0 .. 6; OTGFSRST at 0 range 7 .. 7; Reserved_8_31 at 0 range 8 .. 31; end record; subtype APB1RSTR_TIM2RST_Field is Interfaces.STM32.Bit; subtype APB1RSTR_TIM3RST_Field is Interfaces.STM32.Bit; subtype APB1RSTR_TIM4RST_Field is Interfaces.STM32.Bit; subtype APB1RSTR_TIM5RST_Field is Interfaces.STM32.Bit; subtype APB1RSTR_WWDGRST_Field is Interfaces.STM32.Bit; subtype APB1RSTR_SPI2RST_Field is Interfaces.STM32.Bit; subtype APB1RSTR_SPI3RST_Field is Interfaces.STM32.Bit; subtype APB1RSTR_UART2RST_Field is Interfaces.STM32.Bit; subtype APB1RSTR_I2C1RST_Field is Interfaces.STM32.Bit; subtype APB1RSTR_I2C2RST_Field is Interfaces.STM32.Bit; subtype APB1RSTR_I2C3RST_Field is Interfaces.STM32.Bit; subtype APB1RSTR_PWRRST_Field is Interfaces.STM32.Bit; -- APB1 peripheral reset register type APB1RSTR_Register is record -- TIM2 reset TIM2RST : APB1RSTR_TIM2RST_Field := 16#0#; -- TIM3 reset TIM3RST : APB1RSTR_TIM3RST_Field := 16#0#; -- TIM4 reset TIM4RST : APB1RSTR_TIM4RST_Field := 16#0#; -- TIM5 reset TIM5RST : APB1RSTR_TIM5RST_Field := 16#0#; -- unspecified Reserved_4_10 : Interfaces.STM32.UInt7 := 16#0#; -- Window watchdog reset WWDGRST : APB1RSTR_WWDGRST_Field := 16#0#; -- unspecified Reserved_12_13 : Interfaces.STM32.UInt2 := 16#0#; -- SPI 2 reset SPI2RST : APB1RSTR_SPI2RST_Field := 16#0#; -- SPI 3 reset SPI3RST : APB1RSTR_SPI3RST_Field := 16#0#; -- unspecified Reserved_16_16 : Interfaces.STM32.Bit := 16#0#; -- USART 2 reset UART2RST : APB1RSTR_UART2RST_Field := 16#0#; -- unspecified Reserved_18_20 : Interfaces.STM32.UInt3 := 16#0#; -- I2C 1 reset I2C1RST : APB1RSTR_I2C1RST_Field := 16#0#; -- I2C 2 reset I2C2RST : APB1RSTR_I2C2RST_Field := 16#0#; -- I2C3 reset I2C3RST : APB1RSTR_I2C3RST_Field := 16#0#; -- unspecified Reserved_24_27 : Interfaces.STM32.UInt4 := 16#0#; -- Power interface reset PWRRST : APB1RSTR_PWRRST_Field := 16#0#; -- unspecified Reserved_29_31 : Interfaces.STM32.UInt3 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for APB1RSTR_Register use record TIM2RST at 0 range 0 .. 0; TIM3RST at 0 range 1 .. 1; TIM4RST at 0 range 2 .. 2; TIM5RST at 0 range 3 .. 3; Reserved_4_10 at 0 range 4 .. 10; WWDGRST at 0 range 11 .. 11; Reserved_12_13 at 0 range 12 .. 13; SPI2RST at 0 range 14 .. 14; SPI3RST at 0 range 15 .. 15; Reserved_16_16 at 0 range 16 .. 16; UART2RST at 0 range 17 .. 17; Reserved_18_20 at 0 range 18 .. 20; I2C1RST at 0 range 21 .. 21; I2C2RST at 0 range 22 .. 22; I2C3RST at 0 range 23 .. 23; Reserved_24_27 at 0 range 24 .. 27; PWRRST at 0 range 28 .. 28; Reserved_29_31 at 0 range 29 .. 31; end record; subtype APB2RSTR_TIM1RST_Field is Interfaces.STM32.Bit; subtype APB2RSTR_USART1RST_Field is Interfaces.STM32.Bit; subtype APB2RSTR_USART6RST_Field is Interfaces.STM32.Bit; subtype APB2RSTR_ADCRST_Field is Interfaces.STM32.Bit; subtype APB2RSTR_SDIORST_Field is Interfaces.STM32.Bit; subtype APB2RSTR_SPI1RST_Field is Interfaces.STM32.Bit; subtype APB2RSTR_SYSCFGRST_Field is Interfaces.STM32.Bit; subtype APB2RSTR_TIM9RST_Field is Interfaces.STM32.Bit; subtype APB2RSTR_TIM10RST_Field is Interfaces.STM32.Bit; subtype APB2RSTR_TIM11RST_Field is Interfaces.STM32.Bit; -- APB2 peripheral reset register type APB2RSTR_Register is record -- TIM1 reset TIM1RST : APB2RSTR_TIM1RST_Field := 16#0#; -- unspecified Reserved_1_3 : Interfaces.STM32.UInt3 := 16#0#; -- USART1 reset USART1RST : APB2RSTR_USART1RST_Field := 16#0#; -- USART6 reset USART6RST : APB2RSTR_USART6RST_Field := 16#0#; -- unspecified Reserved_6_7 : Interfaces.STM32.UInt2 := 16#0#; -- ADC interface reset (common to all ADCs) ADCRST : APB2RSTR_ADCRST_Field := 16#0#; -- unspecified Reserved_9_10 : Interfaces.STM32.UInt2 := 16#0#; -- SDIO reset SDIORST : APB2RSTR_SDIORST_Field := 16#0#; -- SPI 1 reset SPI1RST : APB2RSTR_SPI1RST_Field := 16#0#; -- unspecified Reserved_13_13 : Interfaces.STM32.Bit := 16#0#; -- System configuration controller reset SYSCFGRST : APB2RSTR_SYSCFGRST_Field := 16#0#; -- unspecified Reserved_15_15 : Interfaces.STM32.Bit := 16#0#; -- TIM9 reset TIM9RST : APB2RSTR_TIM9RST_Field := 16#0#; -- TIM10 reset TIM10RST : APB2RSTR_TIM10RST_Field := 16#0#; -- TIM11 reset TIM11RST : APB2RSTR_TIM11RST_Field := 16#0#; -- unspecified Reserved_19_31 : Interfaces.STM32.UInt13 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for APB2RSTR_Register use record TIM1RST at 0 range 0 .. 0; Reserved_1_3 at 0 range 1 .. 3; USART1RST at 0 range 4 .. 4; USART6RST at 0 range 5 .. 5; Reserved_6_7 at 0 range 6 .. 7; ADCRST at 0 range 8 .. 8; Reserved_9_10 at 0 range 9 .. 10; SDIORST at 0 range 11 .. 11; SPI1RST at 0 range 12 .. 12; Reserved_13_13 at 0 range 13 .. 13; SYSCFGRST at 0 range 14 .. 14; Reserved_15_15 at 0 range 15 .. 15; TIM9RST at 0 range 16 .. 16; TIM10RST at 0 range 17 .. 17; TIM11RST at 0 range 18 .. 18; Reserved_19_31 at 0 range 19 .. 31; end record; subtype AHB1ENR_GPIOAEN_Field is Interfaces.STM32.Bit; subtype AHB1ENR_GPIOBEN_Field is Interfaces.STM32.Bit; subtype AHB1ENR_GPIOCEN_Field is Interfaces.STM32.Bit; subtype AHB1ENR_GPIODEN_Field is Interfaces.STM32.Bit; subtype AHB1ENR_GPIOEEN_Field is Interfaces.STM32.Bit; subtype AHB1ENR_GPIOHEN_Field is Interfaces.STM32.Bit; subtype AHB1ENR_CRCEN_Field is Interfaces.STM32.Bit; subtype AHB1ENR_DMA1EN_Field is Interfaces.STM32.Bit; subtype AHB1ENR_DMA2EN_Field is Interfaces.STM32.Bit; -- AHB1 peripheral clock register type AHB1ENR_Register is record -- IO port A clock enable GPIOAEN : AHB1ENR_GPIOAEN_Field := 16#0#; -- IO port B clock enable GPIOBEN : AHB1ENR_GPIOBEN_Field := 16#0#; -- IO port C clock enable GPIOCEN : AHB1ENR_GPIOCEN_Field := 16#0#; -- IO port D clock enable GPIODEN : AHB1ENR_GPIODEN_Field := 16#0#; -- IO port E clock enable GPIOEEN : AHB1ENR_GPIOEEN_Field := 16#0#; -- unspecified Reserved_5_6 : Interfaces.STM32.UInt2 := 16#0#; -- IO port H clock enable GPIOHEN : AHB1ENR_GPIOHEN_Field := 16#0#; -- unspecified Reserved_8_11 : Interfaces.STM32.UInt4 := 16#0#; -- CRC clock enable CRCEN : AHB1ENR_CRCEN_Field := 16#0#; -- unspecified Reserved_13_20 : Interfaces.STM32.Byte := 16#80#; -- DMA1 clock enable DMA1EN : AHB1ENR_DMA1EN_Field := 16#0#; -- DMA2 clock enable DMA2EN : AHB1ENR_DMA2EN_Field := 16#0#; -- unspecified Reserved_23_31 : Interfaces.STM32.UInt9 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for AHB1ENR_Register use record GPIOAEN at 0 range 0 .. 0; GPIOBEN at 0 range 1 .. 1; GPIOCEN at 0 range 2 .. 2; GPIODEN at 0 range 3 .. 3; GPIOEEN at 0 range 4 .. 4; Reserved_5_6 at 0 range 5 .. 6; GPIOHEN at 0 range 7 .. 7; Reserved_8_11 at 0 range 8 .. 11; CRCEN at 0 range 12 .. 12; Reserved_13_20 at 0 range 13 .. 20; DMA1EN at 0 range 21 .. 21; DMA2EN at 0 range 22 .. 22; Reserved_23_31 at 0 range 23 .. 31; end record; subtype AHB2ENR_OTGFSEN_Field is Interfaces.STM32.Bit; -- AHB2 peripheral clock enable register type AHB2ENR_Register is record -- unspecified Reserved_0_6 : Interfaces.STM32.UInt7 := 16#0#; -- USB OTG FS clock enable OTGFSEN : AHB2ENR_OTGFSEN_Field := 16#0#; -- unspecified Reserved_8_31 : Interfaces.STM32.UInt24 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for AHB2ENR_Register use record Reserved_0_6 at 0 range 0 .. 6; OTGFSEN at 0 range 7 .. 7; Reserved_8_31 at 0 range 8 .. 31; end record; subtype APB1ENR_TIM2EN_Field is Interfaces.STM32.Bit; subtype APB1ENR_TIM3EN_Field is Interfaces.STM32.Bit; subtype APB1ENR_TIM4EN_Field is Interfaces.STM32.Bit; subtype APB1ENR_TIM5EN_Field is Interfaces.STM32.Bit; subtype APB1ENR_WWDGEN_Field is Interfaces.STM32.Bit; subtype APB1ENR_SPI2EN_Field is Interfaces.STM32.Bit; subtype APB1ENR_SPI3EN_Field is Interfaces.STM32.Bit; subtype APB1ENR_USART2EN_Field is Interfaces.STM32.Bit; subtype APB1ENR_I2C1EN_Field is Interfaces.STM32.Bit; subtype APB1ENR_I2C2EN_Field is Interfaces.STM32.Bit; subtype APB1ENR_I2C3EN_Field is Interfaces.STM32.Bit; subtype APB1ENR_PWREN_Field is Interfaces.STM32.Bit; -- APB1 peripheral clock enable register type APB1ENR_Register is record -- TIM2 clock enable TIM2EN : APB1ENR_TIM2EN_Field := 16#0#; -- TIM3 clock enable TIM3EN : APB1ENR_TIM3EN_Field := 16#0#; -- TIM4 clock enable TIM4EN : APB1ENR_TIM4EN_Field := 16#0#; -- TIM5 clock enable TIM5EN : APB1ENR_TIM5EN_Field := 16#0#; -- unspecified Reserved_4_10 : Interfaces.STM32.UInt7 := 16#0#; -- Window watchdog clock enable WWDGEN : APB1ENR_WWDGEN_Field := 16#0#; -- unspecified Reserved_12_13 : Interfaces.STM32.UInt2 := 16#0#; -- SPI2 clock enable SPI2EN : APB1ENR_SPI2EN_Field := 16#0#; -- SPI3 clock enable SPI3EN : APB1ENR_SPI3EN_Field := 16#0#; -- unspecified Reserved_16_16 : Interfaces.STM32.Bit := 16#0#; -- USART 2 clock enable USART2EN : APB1ENR_USART2EN_Field := 16#0#; -- unspecified Reserved_18_20 : Interfaces.STM32.UInt3 := 16#0#; -- I2C1 clock enable I2C1EN : APB1ENR_I2C1EN_Field := 16#0#; -- I2C2 clock enable I2C2EN : APB1ENR_I2C2EN_Field := 16#0#; -- I2C3 clock enable I2C3EN : APB1ENR_I2C3EN_Field := 16#0#; -- unspecified Reserved_24_27 : Interfaces.STM32.UInt4 := 16#0#; -- Power interface clock enable PWREN : APB1ENR_PWREN_Field := 16#0#; -- unspecified Reserved_29_31 : Interfaces.STM32.UInt3 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for APB1ENR_Register use record TIM2EN at 0 range 0 .. 0; TIM3EN at 0 range 1 .. 1; TIM4EN at 0 range 2 .. 2; TIM5EN at 0 range 3 .. 3; Reserved_4_10 at 0 range 4 .. 10; WWDGEN at 0 range 11 .. 11; Reserved_12_13 at 0 range 12 .. 13; SPI2EN at 0 range 14 .. 14; SPI3EN at 0 range 15 .. 15; Reserved_16_16 at 0 range 16 .. 16; USART2EN at 0 range 17 .. 17; Reserved_18_20 at 0 range 18 .. 20; I2C1EN at 0 range 21 .. 21; I2C2EN at 0 range 22 .. 22; I2C3EN at 0 range 23 .. 23; Reserved_24_27 at 0 range 24 .. 27; PWREN at 0 range 28 .. 28; Reserved_29_31 at 0 range 29 .. 31; end record; subtype APB2ENR_TIM1EN_Field is Interfaces.STM32.Bit; subtype APB2ENR_USART1EN_Field is Interfaces.STM32.Bit; subtype APB2ENR_USART6EN_Field is Interfaces.STM32.Bit; subtype APB2ENR_ADC1EN_Field is Interfaces.STM32.Bit; subtype APB2ENR_SDIOEN_Field is Interfaces.STM32.Bit; subtype APB2ENR_SPI1EN_Field is Interfaces.STM32.Bit; subtype APB2ENR_SYSCFGEN_Field is Interfaces.STM32.Bit; subtype APB2ENR_TIM9EN_Field is Interfaces.STM32.Bit; subtype APB2ENR_TIM10EN_Field is Interfaces.STM32.Bit; subtype APB2ENR_TIM11EN_Field is Interfaces.STM32.Bit; -- APB2 peripheral clock enable register type APB2ENR_Register is record -- TIM1 clock enable TIM1EN : APB2ENR_TIM1EN_Field := 16#0#; -- unspecified Reserved_1_3 : Interfaces.STM32.UInt3 := 16#0#; -- USART1 clock enable USART1EN : APB2ENR_USART1EN_Field := 16#0#; -- USART6 clock enable USART6EN : APB2ENR_USART6EN_Field := 16#0#; -- unspecified Reserved_6_7 : Interfaces.STM32.UInt2 := 16#0#; -- ADC1 clock enable ADC1EN : APB2ENR_ADC1EN_Field := 16#0#; -- unspecified Reserved_9_10 : Interfaces.STM32.UInt2 := 16#0#; -- SDIO clock enable SDIOEN : APB2ENR_SDIOEN_Field := 16#0#; -- SPI1 clock enable SPI1EN : APB2ENR_SPI1EN_Field := 16#0#; -- unspecified Reserved_13_13 : Interfaces.STM32.Bit := 16#0#; -- System configuration controller clock enable SYSCFGEN : APB2ENR_SYSCFGEN_Field := 16#0#; -- unspecified Reserved_15_15 : Interfaces.STM32.Bit := 16#0#; -- TIM9 clock enable TIM9EN : APB2ENR_TIM9EN_Field := 16#0#; -- TIM10 clock enable TIM10EN : APB2ENR_TIM10EN_Field := 16#0#; -- TIM11 clock enable TIM11EN : APB2ENR_TIM11EN_Field := 16#0#; -- unspecified Reserved_19_31 : Interfaces.STM32.UInt13 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for APB2ENR_Register use record TIM1EN at 0 range 0 .. 0; Reserved_1_3 at 0 range 1 .. 3; USART1EN at 0 range 4 .. 4; USART6EN at 0 range 5 .. 5; Reserved_6_7 at 0 range 6 .. 7; ADC1EN at 0 range 8 .. 8; Reserved_9_10 at 0 range 9 .. 10; SDIOEN at 0 range 11 .. 11; SPI1EN at 0 range 12 .. 12; Reserved_13_13 at 0 range 13 .. 13; SYSCFGEN at 0 range 14 .. 14; Reserved_15_15 at 0 range 15 .. 15; TIM9EN at 0 range 16 .. 16; TIM10EN at 0 range 17 .. 17; TIM11EN at 0 range 18 .. 18; Reserved_19_31 at 0 range 19 .. 31; end record; subtype AHB1LPENR_GPIOALPEN_Field is Interfaces.STM32.Bit; subtype AHB1LPENR_GPIOBLPEN_Field is Interfaces.STM32.Bit; subtype AHB1LPENR_GPIOCLPEN_Field is Interfaces.STM32.Bit; subtype AHB1LPENR_GPIODLPEN_Field is Interfaces.STM32.Bit; subtype AHB1LPENR_GPIOELPEN_Field is Interfaces.STM32.Bit; subtype AHB1LPENR_GPIOHLPEN_Field is Interfaces.STM32.Bit; subtype AHB1LPENR_CRCLPEN_Field is Interfaces.STM32.Bit; subtype AHB1LPENR_FLITFLPEN_Field is Interfaces.STM32.Bit; subtype AHB1LPENR_SRAM1LPEN_Field is Interfaces.STM32.Bit; subtype AHB1LPENR_DMA1LPEN_Field is Interfaces.STM32.Bit; subtype AHB1LPENR_DMA2LPEN_Field is Interfaces.STM32.Bit; -- AHB1 peripheral clock enable in low power mode register type AHB1LPENR_Register is record -- IO port A clock enable during sleep mode GPIOALPEN : AHB1LPENR_GPIOALPEN_Field := 16#1#; -- IO port B clock enable during Sleep mode GPIOBLPEN : AHB1LPENR_GPIOBLPEN_Field := 16#1#; -- IO port C clock enable during Sleep mode GPIOCLPEN : AHB1LPENR_GPIOCLPEN_Field := 16#1#; -- IO port D clock enable during Sleep mode GPIODLPEN : AHB1LPENR_GPIODLPEN_Field := 16#1#; -- IO port E clock enable during Sleep mode GPIOELPEN : AHB1LPENR_GPIOELPEN_Field := 16#1#; -- unspecified Reserved_5_6 : Interfaces.STM32.UInt2 := 16#3#; -- IO port H clock enable during Sleep mode GPIOHLPEN : AHB1LPENR_GPIOHLPEN_Field := 16#1#; -- unspecified Reserved_8_11 : Interfaces.STM32.UInt4 := 16#1#; -- CRC clock enable during Sleep mode CRCLPEN : AHB1LPENR_CRCLPEN_Field := 16#1#; -- unspecified Reserved_13_14 : Interfaces.STM32.UInt2 := 16#0#; -- Flash interface clock enable during Sleep mode FLITFLPEN : AHB1LPENR_FLITFLPEN_Field := 16#1#; -- SRAM 1interface clock enable during Sleep mode SRAM1LPEN : AHB1LPENR_SRAM1LPEN_Field := 16#1#; -- unspecified Reserved_17_20 : Interfaces.STM32.UInt4 := 16#3#; -- DMA1 clock enable during Sleep mode DMA1LPEN : AHB1LPENR_DMA1LPEN_Field := 16#1#; -- DMA2 clock enable during Sleep mode DMA2LPEN : AHB1LPENR_DMA2LPEN_Field := 16#1#; -- unspecified Reserved_23_31 : Interfaces.STM32.UInt9 := 16#FC#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for AHB1LPENR_Register use record GPIOALPEN at 0 range 0 .. 0; GPIOBLPEN at 0 range 1 .. 1; GPIOCLPEN at 0 range 2 .. 2; GPIODLPEN at 0 range 3 .. 3; GPIOELPEN at 0 range 4 .. 4; Reserved_5_6 at 0 range 5 .. 6; GPIOHLPEN at 0 range 7 .. 7; Reserved_8_11 at 0 range 8 .. 11; CRCLPEN at 0 range 12 .. 12; Reserved_13_14 at 0 range 13 .. 14; FLITFLPEN at 0 range 15 .. 15; SRAM1LPEN at 0 range 16 .. 16; Reserved_17_20 at 0 range 17 .. 20; DMA1LPEN at 0 range 21 .. 21; DMA2LPEN at 0 range 22 .. 22; Reserved_23_31 at 0 range 23 .. 31; end record; subtype AHB2LPENR_OTGFSLPEN_Field is Interfaces.STM32.Bit; -- AHB2 peripheral clock enable in low power mode register type AHB2LPENR_Register is record -- unspecified Reserved_0_6 : Interfaces.STM32.UInt7 := 16#71#; -- USB OTG FS clock enable during Sleep mode OTGFSLPEN : AHB2LPENR_OTGFSLPEN_Field := 16#1#; -- unspecified Reserved_8_31 : Interfaces.STM32.UInt24 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for AHB2LPENR_Register use record Reserved_0_6 at 0 range 0 .. 6; OTGFSLPEN at 0 range 7 .. 7; Reserved_8_31 at 0 range 8 .. 31; end record; subtype APB1LPENR_TIM2LPEN_Field is Interfaces.STM32.Bit; subtype APB1LPENR_TIM3LPEN_Field is Interfaces.STM32.Bit; subtype APB1LPENR_TIM4LPEN_Field is Interfaces.STM32.Bit; subtype APB1LPENR_TIM5LPEN_Field is Interfaces.STM32.Bit; subtype APB1LPENR_WWDGLPEN_Field is Interfaces.STM32.Bit; subtype APB1LPENR_SPI2LPEN_Field is Interfaces.STM32.Bit; subtype APB1LPENR_SPI3LPEN_Field is Interfaces.STM32.Bit; subtype APB1LPENR_USART2LPEN_Field is Interfaces.STM32.Bit; subtype APB1LPENR_I2C1LPEN_Field is Interfaces.STM32.Bit; subtype APB1LPENR_I2C2LPEN_Field is Interfaces.STM32.Bit; subtype APB1LPENR_I2C3LPEN_Field is Interfaces.STM32.Bit; subtype APB1LPENR_PWRLPEN_Field is Interfaces.STM32.Bit; -- APB1 peripheral clock enable in low power mode register type APB1LPENR_Register is record -- TIM2 clock enable during Sleep mode TIM2LPEN : APB1LPENR_TIM2LPEN_Field := 16#1#; -- TIM3 clock enable during Sleep mode TIM3LPEN : APB1LPENR_TIM3LPEN_Field := 16#1#; -- TIM4 clock enable during Sleep mode TIM4LPEN : APB1LPENR_TIM4LPEN_Field := 16#1#; -- TIM5 clock enable during Sleep mode TIM5LPEN : APB1LPENR_TIM5LPEN_Field := 16#1#; -- unspecified Reserved_4_10 : Interfaces.STM32.UInt7 := 16#1F#; -- Window watchdog clock enable during Sleep mode WWDGLPEN : APB1LPENR_WWDGLPEN_Field := 16#1#; -- unspecified Reserved_12_13 : Interfaces.STM32.UInt2 := 16#0#; -- SPI2 clock enable during Sleep mode SPI2LPEN : APB1LPENR_SPI2LPEN_Field := 16#1#; -- SPI3 clock enable during Sleep mode SPI3LPEN : APB1LPENR_SPI3LPEN_Field := 16#1#; -- unspecified Reserved_16_16 : Interfaces.STM32.Bit := 16#0#; -- USART2 clock enable during Sleep mode USART2LPEN : APB1LPENR_USART2LPEN_Field := 16#1#; -- unspecified Reserved_18_20 : Interfaces.STM32.UInt3 := 16#7#; -- I2C1 clock enable during Sleep mode I2C1LPEN : APB1LPENR_I2C1LPEN_Field := 16#1#; -- I2C2 clock enable during Sleep mode I2C2LPEN : APB1LPENR_I2C2LPEN_Field := 16#1#; -- I2C3 clock enable during Sleep mode I2C3LPEN : APB1LPENR_I2C3LPEN_Field := 16#1#; -- unspecified Reserved_24_27 : Interfaces.STM32.UInt4 := 16#6#; -- Power interface clock enable during Sleep mode PWRLPEN : APB1LPENR_PWRLPEN_Field := 16#1#; -- unspecified Reserved_29_31 : Interfaces.STM32.UInt3 := 16#1#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for APB1LPENR_Register use record TIM2LPEN at 0 range 0 .. 0; TIM3LPEN at 0 range 1 .. 1; TIM4LPEN at 0 range 2 .. 2; TIM5LPEN at 0 range 3 .. 3; Reserved_4_10 at 0 range 4 .. 10; WWDGLPEN at 0 range 11 .. 11; Reserved_12_13 at 0 range 12 .. 13; SPI2LPEN at 0 range 14 .. 14; SPI3LPEN at 0 range 15 .. 15; Reserved_16_16 at 0 range 16 .. 16; USART2LPEN at 0 range 17 .. 17; Reserved_18_20 at 0 range 18 .. 20; I2C1LPEN at 0 range 21 .. 21; I2C2LPEN at 0 range 22 .. 22; I2C3LPEN at 0 range 23 .. 23; Reserved_24_27 at 0 range 24 .. 27; PWRLPEN at 0 range 28 .. 28; Reserved_29_31 at 0 range 29 .. 31; end record; subtype APB2LPENR_TIM1LPEN_Field is Interfaces.STM32.Bit; subtype APB2LPENR_USART1LPEN_Field is Interfaces.STM32.Bit; subtype APB2LPENR_USART6LPEN_Field is Interfaces.STM32.Bit; subtype APB2LPENR_ADC1LPEN_Field is Interfaces.STM32.Bit; subtype APB2LPENR_SDIOLPEN_Field is Interfaces.STM32.Bit; subtype APB2LPENR_SPI1LPEN_Field is Interfaces.STM32.Bit; subtype APB2LPENR_SYSCFGLPEN_Field is Interfaces.STM32.Bit; subtype APB2LPENR_TIM9LPEN_Field is Interfaces.STM32.Bit; subtype APB2LPENR_TIM10LPEN_Field is Interfaces.STM32.Bit; subtype APB2LPENR_TIM11LPEN_Field is Interfaces.STM32.Bit; -- APB2 peripheral clock enabled in low power mode register type APB2LPENR_Register is record -- TIM1 clock enable during Sleep mode TIM1LPEN : APB2LPENR_TIM1LPEN_Field := 16#1#; -- unspecified Reserved_1_3 : Interfaces.STM32.UInt3 := 16#1#; -- USART1 clock enable during Sleep mode USART1LPEN : APB2LPENR_USART1LPEN_Field := 16#1#; -- USART6 clock enable during Sleep mode USART6LPEN : APB2LPENR_USART6LPEN_Field := 16#1#; -- unspecified Reserved_6_7 : Interfaces.STM32.UInt2 := 16#0#; -- ADC1 clock enable during Sleep mode ADC1LPEN : APB2LPENR_ADC1LPEN_Field := 16#1#; -- unspecified Reserved_9_10 : Interfaces.STM32.UInt2 := 16#3#; -- SDIO clock enable during Sleep mode SDIOLPEN : APB2LPENR_SDIOLPEN_Field := 16#1#; -- SPI 1 clock enable during Sleep mode SPI1LPEN : APB2LPENR_SPI1LPEN_Field := 16#1#; -- unspecified Reserved_13_13 : Interfaces.STM32.Bit := 16#0#; -- System configuration controller clock enable during Sleep mode SYSCFGLPEN : APB2LPENR_SYSCFGLPEN_Field := 16#1#; -- unspecified Reserved_15_15 : Interfaces.STM32.Bit := 16#0#; -- TIM9 clock enable during sleep mode TIM9LPEN : APB2LPENR_TIM9LPEN_Field := 16#1#; -- TIM10 clock enable during Sleep mode TIM10LPEN : APB2LPENR_TIM10LPEN_Field := 16#1#; -- TIM11 clock enable during Sleep mode TIM11LPEN : APB2LPENR_TIM11LPEN_Field := 16#1#; -- unspecified Reserved_19_31 : Interfaces.STM32.UInt13 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for APB2LPENR_Register use record TIM1LPEN at 0 range 0 .. 0; Reserved_1_3 at 0 range 1 .. 3; USART1LPEN at 0 range 4 .. 4; USART6LPEN at 0 range 5 .. 5; Reserved_6_7 at 0 range 6 .. 7; ADC1LPEN at 0 range 8 .. 8; Reserved_9_10 at 0 range 9 .. 10; SDIOLPEN at 0 range 11 .. 11; SPI1LPEN at 0 range 12 .. 12; Reserved_13_13 at 0 range 13 .. 13; SYSCFGLPEN at 0 range 14 .. 14; Reserved_15_15 at 0 range 15 .. 15; TIM9LPEN at 0 range 16 .. 16; TIM10LPEN at 0 range 17 .. 17; TIM11LPEN at 0 range 18 .. 18; Reserved_19_31 at 0 range 19 .. 31; end record; subtype BDCR_LSEON_Field is Interfaces.STM32.Bit; subtype BDCR_LSERDY_Field is Interfaces.STM32.Bit; subtype BDCR_LSEBYP_Field is Interfaces.STM32.Bit; -- BDCR_RTCSEL array element subtype BDCR_RTCSEL_Element is Interfaces.STM32.Bit; -- BDCR_RTCSEL array type BDCR_RTCSEL_Field_Array is array (0 .. 1) of BDCR_RTCSEL_Element with Component_Size => 1, Size => 2; -- Type definition for BDCR_RTCSEL type BDCR_RTCSEL_Field (As_Array : Boolean := False) is record case As_Array is when False => -- RTCSEL as a value Val : Interfaces.STM32.UInt2; when True => -- RTCSEL as an array Arr : BDCR_RTCSEL_Field_Array; end case; end record with Unchecked_Union, Size => 2; for BDCR_RTCSEL_Field use record Val at 0 range 0 .. 1; Arr at 0 range 0 .. 1; end record; subtype BDCR_RTCEN_Field is Interfaces.STM32.Bit; subtype BDCR_BDRST_Field is Interfaces.STM32.Bit; -- Backup domain control register type BDCR_Register is record -- External low-speed oscillator enable LSEON : BDCR_LSEON_Field := 16#0#; -- Read-only. External low-speed oscillator ready LSERDY : BDCR_LSERDY_Field := 16#0#; -- External low-speed oscillator bypass LSEBYP : BDCR_LSEBYP_Field := 16#0#; -- unspecified Reserved_3_7 : Interfaces.STM32.UInt5 := 16#0#; -- RTC clock source selection RTCSEL : BDCR_RTCSEL_Field := (As_Array => False, Val => 16#0#); -- unspecified Reserved_10_14 : Interfaces.STM32.UInt5 := 16#0#; -- RTC clock enable RTCEN : BDCR_RTCEN_Field := 16#0#; -- Backup domain software reset BDRST : BDCR_BDRST_Field := 16#0#; -- unspecified Reserved_17_31 : Interfaces.STM32.UInt15 := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for BDCR_Register use record LSEON at 0 range 0 .. 0; LSERDY at 0 range 1 .. 1; LSEBYP at 0 range 2 .. 2; Reserved_3_7 at 0 range 3 .. 7; RTCSEL at 0 range 8 .. 9; Reserved_10_14 at 0 range 10 .. 14; RTCEN at 0 range 15 .. 15; BDRST at 0 range 16 .. 16; Reserved_17_31 at 0 range 17 .. 31; end record; subtype CSR_LSION_Field is Interfaces.STM32.Bit; subtype CSR_LSIRDY_Field is Interfaces.STM32.Bit; subtype CSR_RMVF_Field is Interfaces.STM32.Bit; subtype CSR_BORRSTF_Field is Interfaces.STM32.Bit; subtype CSR_PADRSTF_Field is Interfaces.STM32.Bit; subtype CSR_PORRSTF_Field is Interfaces.STM32.Bit; subtype CSR_SFTRSTF_Field is Interfaces.STM32.Bit; subtype CSR_WDGRSTF_Field is Interfaces.STM32.Bit; subtype CSR_WWDGRSTF_Field is Interfaces.STM32.Bit; subtype CSR_LPWRRSTF_Field is Interfaces.STM32.Bit; -- clock control & status register type CSR_Register is record -- Internal low-speed oscillator enable LSION : CSR_LSION_Field := 16#0#; -- Read-only. Internal low-speed oscillator ready LSIRDY : CSR_LSIRDY_Field := 16#0#; -- unspecified Reserved_2_23 : Interfaces.STM32.UInt22 := 16#0#; -- Remove reset flag RMVF : CSR_RMVF_Field := 16#0#; -- BOR reset flag BORRSTF : CSR_BORRSTF_Field := 16#1#; -- PIN reset flag PADRSTF : CSR_PADRSTF_Field := 16#1#; -- POR/PDR reset flag PORRSTF : CSR_PORRSTF_Field := 16#1#; -- Software reset flag SFTRSTF : CSR_SFTRSTF_Field := 16#0#; -- Independent watchdog reset flag WDGRSTF : CSR_WDGRSTF_Field := 16#0#; -- Window watchdog reset flag WWDGRSTF : CSR_WWDGRSTF_Field := 16#0#; -- Low-power reset flag LPWRRSTF : CSR_LPWRRSTF_Field := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for CSR_Register use record LSION at 0 range 0 .. 0; LSIRDY at 0 range 1 .. 1; Reserved_2_23 at 0 range 2 .. 23; RMVF at 0 range 24 .. 24; BORRSTF at 0 range 25 .. 25; PADRSTF at 0 range 26 .. 26; PORRSTF at 0 range 27 .. 27; SFTRSTF at 0 range 28 .. 28; WDGRSTF at 0 range 29 .. 29; WWDGRSTF at 0 range 30 .. 30; LPWRRSTF at 0 range 31 .. 31; end record; subtype SSCGR_MODPER_Field is Interfaces.STM32.UInt13; subtype SSCGR_INCSTEP_Field is Interfaces.STM32.UInt15; subtype SSCGR_SPREADSEL_Field is Interfaces.STM32.Bit; subtype SSCGR_SSCGEN_Field is Interfaces.STM32.Bit; -- spread spectrum clock generation register type SSCGR_Register is record -- Modulation period MODPER : SSCGR_MODPER_Field := 16#0#; -- Incrementation step INCSTEP : SSCGR_INCSTEP_Field := 16#0#; -- unspecified Reserved_28_29 : Interfaces.STM32.UInt2 := 16#0#; -- Spread Select SPREADSEL : SSCGR_SPREADSEL_Field := 16#0#; -- Spread spectrum modulation enable SSCGEN : SSCGR_SSCGEN_Field := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SSCGR_Register use record MODPER at 0 range 0 .. 12; INCSTEP at 0 range 13 .. 27; Reserved_28_29 at 0 range 28 .. 29; SPREADSEL at 0 range 30 .. 30; SSCGEN at 0 range 31 .. 31; end record; subtype PLLI2SCFGR_PLLI2SNx_Field is Interfaces.STM32.UInt9; subtype PLLI2SCFGR_PLLI2SRx_Field is Interfaces.STM32.UInt3; -- PLLI2S configuration register type PLLI2SCFGR_Register is record -- unspecified Reserved_0_5 : Interfaces.STM32.UInt6 := 16#0#; -- PLLI2S multiplication factor for VCO PLLI2SNx : PLLI2SCFGR_PLLI2SNx_Field := 16#C0#; -- unspecified Reserved_15_27 : Interfaces.STM32.UInt13 := 16#0#; -- PLLI2S division factor for I2S clocks PLLI2SRx : PLLI2SCFGR_PLLI2SRx_Field := 16#2#; -- unspecified Reserved_31_31 : Interfaces.STM32.Bit := 16#0#; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PLLI2SCFGR_Register use record Reserved_0_5 at 0 range 0 .. 5; PLLI2SNx at 0 range 6 .. 14; Reserved_15_27 at 0 range 15 .. 27; PLLI2SRx at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- Reset and clock control type RCC_Peripheral is record -- clock control register CR : aliased CR_Register; -- PLL configuration register PLLCFGR : aliased PLLCFGR_Register; -- clock configuration register CFGR : aliased CFGR_Register; -- clock interrupt register CIR : aliased CIR_Register; -- AHB1 peripheral reset register AHB1RSTR : aliased AHB1RSTR_Register; -- AHB2 peripheral reset register AHB2RSTR : aliased AHB2RSTR_Register; -- APB1 peripheral reset register APB1RSTR : aliased APB1RSTR_Register; -- APB2 peripheral reset register APB2RSTR : aliased APB2RSTR_Register; -- AHB1 peripheral clock register AHB1ENR : aliased AHB1ENR_Register; -- AHB2 peripheral clock enable register AHB2ENR : aliased AHB2ENR_Register; -- APB1 peripheral clock enable register APB1ENR : aliased APB1ENR_Register; -- APB2 peripheral clock enable register APB2ENR : aliased APB2ENR_Register; -- AHB1 peripheral clock enable in low power mode register AHB1LPENR : aliased AHB1LPENR_Register; -- AHB2 peripheral clock enable in low power mode register AHB2LPENR : aliased AHB2LPENR_Register; -- APB1 peripheral clock enable in low power mode register APB1LPENR : aliased APB1LPENR_Register; -- APB2 peripheral clock enabled in low power mode register APB2LPENR : aliased APB2LPENR_Register; -- Backup domain control register BDCR : aliased BDCR_Register; -- clock control & status register CSR : aliased CSR_Register; -- spread spectrum clock generation register SSCGR : aliased SSCGR_Register; -- PLLI2S configuration register PLLI2SCFGR : aliased PLLI2SCFGR_Register; end record with Volatile; for RCC_Peripheral use record CR at 16#0# range 0 .. 31; PLLCFGR at 16#4# range 0 .. 31; CFGR at 16#8# range 0 .. 31; CIR at 16#C# range 0 .. 31; AHB1RSTR at 16#10# range 0 .. 31; AHB2RSTR at 16#14# range 0 .. 31; APB1RSTR at 16#20# range 0 .. 31; APB2RSTR at 16#24# range 0 .. 31; AHB1ENR at 16#30# range 0 .. 31; AHB2ENR at 16#34# range 0 .. 31; APB1ENR at 16#40# range 0 .. 31; APB2ENR at 16#44# range 0 .. 31; AHB1LPENR at 16#50# range 0 .. 31; AHB2LPENR at 16#54# range 0 .. 31; APB1LPENR at 16#60# range 0 .. 31; APB2LPENR at 16#64# range 0 .. 31; BDCR at 16#70# range 0 .. 31; CSR at 16#74# range 0 .. 31; SSCGR at 16#80# range 0 .. 31; PLLI2SCFGR at 16#84# range 0 .. 31; end record; -- Reset and clock control RCC_Periph : aliased RCC_Peripheral with Import, Address => RCC_Base; end Interfaces.STM32.RCC;
2ndSemester/Operating Systems/Lab2/Lab2.asm
xairaven/kpi_labs
0
82789
title Lab2.asm .model SMALL text segment assume CS:text, DS:data begin: mov AX, data mov DS, AX mov AH, 09h mov DX, offset mesg int 21h mov AH, 4Ch mov Al, 0 int 21h text ends data segment mesg db "NACHINAEM ! $" data ends end begin
src/classify.agda
ice1k/cedille
0
11469
<reponame>ice1k/cedille import cedille-options open import general-util module classify (options : cedille-options.options) {mF : Set → Set} ⦃ mFm : monad mF ⦄ (write-to-log : string → mF ⊤) where open import cedille-types open import constants open import conversion open import ctxt open import datatype-util open import elab-util options open import free-vars open import meta-vars options {mF} ⦃ mFm ⦄ open import rename open import resugar open import rewriting open import spans options {mF} ⦃ mFm ⦄ open import subst open import syntax-util open import type-util open import to-string options open import untyped-spans options {mF} ⦃ mFm ⦄ span-error-t : Set span-error-t = (string × 𝕃 tagged-val) {-# TERMINATING #-} check-term : ctxt → ex-tm → (T? : maybe type) → spanM (check-ret T? term) check-type : ctxt → ex-tp → (k? : maybe kind) → spanM (check-ret k? type) check-kind : ctxt → ex-kd → spanM kind check-tpkd : ctxt → ex-tk → spanM tpkd check-args : ctxt → ex-args → params → spanM args check-let : ctxt → ex-def → erased? → posinfo → posinfo → spanM (ctxt × var × tagged-val × (∀ {ed : exprd} → ⟦ ed ⟧ → ⟦ ed ⟧) × (term → term)) check-mu : ctxt → posinfo → posinfo → var → ex-tm → maybe ex-tp → posinfo → ex-cases → posinfo → (T? : maybe type) → spanM (check-ret T? term) check-sigma : ctxt → posinfo → maybe ex-tm → ex-tm → maybe ex-tp → posinfo → ex-cases → posinfo → (T? : maybe type) → spanM (check-ret T? term) get-datatype-info-from-head-type : ctxt → var → 𝕃 tmtp → spanM (span-error-t ⊎ datatype-info) check-sigma-evidence : ctxt → maybe ex-tm → var → 𝕃 tmtp → spanM (span-error-t ⊎ (term × (term → term) × datatype-info)) check-cases : ctxt → ex-cases → (Dₓ : var) → (ctrs : trie type) → renamectxt → (ctr-ps : args) → (drop-as : ℕ) → type → (ctxt → term → type → term) → (ctxt → type → kind → type) → spanM (cases × err-m) check-case : ctxt → ex-case → (earlier : stringset) → (Dₓ : var) → (ctrs : trie (type × params × 𝕃 tmtp)) → renamectxt → (ctr-ps : args) → (drop-as : ℕ) → type → (ctxt → term → type → term) → (ctxt → type → kind → type) → spanM (case × trie (type × params × 𝕃 tmtp)) check-refinement : ctxt → type → kind → spanM (type × 𝕃 tagged-val × err-m) synth-tmtp' : ∀ {b X} → ctxt → if b then ex-tm else ex-tp → (if b then term else type → if b then type else kind → spanM X) → spanM X synth-tmtp' {tt} Γ t f = check-term Γ t nothing >>= uncurry f synth-tmtp' {ff} Γ T f = check-type Γ T nothing >>= uncurry f check-tmtp' : ∀ {b X} → ctxt → if b then ex-tm else ex-tp → if b then type else kind → (if b then term else type → spanM X) → spanM X check-tmtp' {tt} Γ t T f = check-term Γ t (just T) >>= f check-tmtp' {ff} Γ T k f = check-type Γ T (just k) >>= f check-tpkd' : ∀ {b X} → ctxt → if b then ex-kd else ex-tk → (if b then kind else tpkd → spanM X) → spanM X check-tpkd' {tt} Γ k f = check-kind Γ k >>= f check-tpkd' {ff} Γ k f = check-tpkd Γ k >>= f lambda-bound-conv? : ctxt → var → tpkd → tpkd → 𝕃 tagged-val → 𝕃 tagged-val × err-m lambda-bound-conv? Γ x tk tk' ts with conv-tpkd Γ tk tk' ...| tt = ts , nothing ...| ff = (to-string-tag-tk "declared classifier" Γ tk' :: to-string-tag-tk "expected classifier" Γ tk :: ts) , just "The classifier given for a λ-bound variable is not the one we expected" id' = id hnf-of : ∀ {X : Set} {ed} → ctxt → ⟦ ed ⟧ → (⟦ ed ⟧ → X) → X hnf-of Γ t f = f (hnf Γ unfold-head-elab t) -- "⊢" = "\vdash" or "\|-" -- "⇒" = "\r=" -- "⇐" = "\l=" infixr 2 hnf-of id' check-tpkd' check-tmtp' synth-tmtp' syntax synth-tmtp' Γ t (λ t~ → f) = Γ ⊢ t ↝ t~ ⇒ f syntax check-tmtp' Γ t T f = Γ ⊢ t ⇐ T ↝ f syntax check-tpkd' Γ k f = Γ ⊢ k ↝ f syntax id' (λ x → f) = x / f -- Supposed to look like a horizontal bar (as in typing rules) syntax hnf-of Γ t f = Γ ⊢ t =β= f -- t [-]t' check-term Γ (ExApp t e t') Tₑ? = check-term-spine Γ (ExApp t e t') (proto-maybe Tₑ?) tt on-fail return-when (Hole (term-start-pos t)) (TpHole (term-start-pos t)) >>=m (uncurry return-when ∘ check-term-spine-elim Γ) where open import type-inf options {mF} check-term check-type -- t ·T check-term Γ (ExAppTp tₕ Tₐ) Tₑ? = -- "Γ ⊢ tₕ ↝ tₕ~ ⇒ Tₕ~ /" desugars to "synth-tmtp' Γ tₕ λ tₕ~ Tₕ~ →" Γ ⊢ tₕ ↝ tₕ~ ⇒ Tₕ~ / Γ ⊢ Tₕ~ =β= λ where (TpAbs tt x (Tkk kₐ) Tᵣ) → Γ ⊢ Tₐ ⇐ kₐ ↝ Tₐ~ / let Tᵣ = [ Γ - Tₐ~ / x ] Tᵣ in [- AppTp-span tt (term-start-pos tₕ) (type-end-pos Tₐ) (maybe-to-checking Tₑ?) (head-type Γ Tₕ~ :: type-data Γ Tᵣ :: expected-type-if Γ Tₑ?) (check-for-type-mismatch-if Γ "synthesized" Tₑ? Tᵣ) -] return-when (AppTp tₕ~ Tₐ~) Tᵣ Tₕ'~ → untyped-type Γ Tₐ >>= λ Tₐ~ → [- AppTp-span tt (term-start-pos tₕ) (type-end-pos Tₐ) (maybe-to-checking Tₑ?) (head-type Γ Tₕ'~ :: arg-type Γ Tₐ~ :: expected-type-if Γ Tₑ?) (unless (is-hole Tₕ'~) ("The type synthesized from the head does not allow it to be applied" ^ " to a type argument")) -] return-when (AppTp tₕ~ Tₐ~) (TpHole (term-start-pos tₕ)) -- β[<t?>][{t?'}] check-term Γ (ExBeta pi t? t?') Tₑ? = maybe-map (λ {(PosTm t _) → untyped-term Γ t}) t? >>=? λ t?~ → maybe-map (λ {(PosTm t _) → untyped-term Γ t}) t?' >>=? λ t?'~ → let t'~ = maybe-else' t?'~ id-term id e-t~ = maybe-else' Tₑ? (maybe-else' t?~ (inj₁ ([] , "When synthesizing, specify what equality to prove with β<...>")) (λ t → inj₂ (t , nothing))) λ Tₑ → Γ ⊢ Tₑ =β= λ where (TpEq t₁ t₂) → if conv-term Γ t₁ t₂ then maybe-else' (t?~ >>= λ t~ → check-for-type-mismatch Γ "computed" (TpEq t~ t~) (TpEq t₁ t₂) >>= λ e → just (e , t~)) (inj₂ (t₁ , just t₂)) (uncurry λ e t~ → inj₁ ([ type-data Γ (TpEq t~ t~) ] , e)) else inj₁ ([] , "The two terms in the equation are not β-equal") Tₕ → inj₁ ([] , "The expected type is not an equation") e? = either-else' e-t~ (map-snd just) λ _ → [] , nothing fₓ = fresh-var Γ "x" t~T~ = either-else' e-t~ (λ _ → Hole pi , TpEq (Hole pi) (Hole pi)) $ uncurry λ t₁ → maybe-else (Beta t₁ t'~ , TpEq t₁ t₁) λ t₂ → (Beta t₁ t'~) , TpEq t₁ t₂ in [- uncurry (λ tvs → Beta-span pi (term-end-pos (ExBeta pi t? t?')) (maybe-to-checking Tₑ?) (expected-type-if Γ Tₑ? ++ tvs)) e? -] uncurry return-when t~T~ -- χ [T?] - t check-term Γ (ExChi pi T? t) Tₑ? = (maybe-else' T? (check-term Γ t nothing) λ T → Γ ⊢ T ⇐ KdStar ↝ T~ / Γ ⊢ t ⇐ T~ ↝ t~ / return2 t~ T~ ) >>= uncurry λ t~ T~ → [- Chi-span Γ pi (just T~) t (maybe-to-checking Tₑ?) (type-data Γ T~ :: expected-type-if Γ Tₑ?) (check-for-type-mismatch-if Γ (maybe-else' T? "synthesized" (const "computed")) Tₑ? T~) -] return-when t~ T~ -- δ [T?] - t check-term Γ (ExDelta pi T? t) Tₑ? = Γ ⊢ t ↝ t~ ⇒ Tcontra / maybe-else' T? (return (maybe-else' Tₑ? (TpAbs Erased "X" (Tkk KdStar) (TpVar "X")) id)) (λ T → Γ ⊢ T ⇐ KdStar ↝ return) >>= λ T~' → let b = Γ ⊢ Tcontra =β= λ {(TpEq t₁ t₂) → when (inconv Γ t₁ t₂) (t₁ , t₂); _ → nothing} b? = unless (conv-type Γ Tcontra (TpEq tt-term ff-term)) triv >> b in [- Delta-span pi t (maybe-to-checking Tₑ?) (to-string-tag "the contradiction" Γ Tcontra :: type-data Γ T~' :: expected-type-if Γ Tₑ?) (maybe-not b >> just "We could not find a contradiction in the synthesized type of the subterm") -] return-when (Delta b? T~' t~) T~' -- ε[lr][-?] t check-term Γ (ExEpsilon pi lr -? t) Tₑ? = let hnf-from = if -? then hanf Γ tt else hnf Γ unfold-head update-eq : term → term → type update-eq = λ t₁ t₂ → uncurry TpEq $ maybe-else' lr (hnf-from t₁ , hnf-from t₂) λ lr → if lr then (t₁ , hnf-from t₂) else (hnf-from t₁ , t₂) in case-ret {m = Tₑ?} (Γ ⊢ t ↝ t~ ⇒ T~ / Γ ⊢ T~ =β= λ where (TpEq t₁ t₂) → let Tᵣ = update-eq t₁ t₂ in [- Epsilon-span pi lr -? t (maybe-to-checking Tₑ?) [ type-data Γ Tᵣ ] nothing -] return2 t~ Tᵣ Tₕ → [- Epsilon-span pi lr -? t (maybe-to-checking Tₑ?) [ to-string-tag "synthesized type" Γ Tₕ ] (unless (is-hole Tₕ) "The synthesized type of the body is not an equation") -] return2 t~ Tₕ) λ Tₑ → Γ ⊢ Tₑ =β= λ where (TpEq t₁ t₂) → [- Epsilon-span pi lr -? t (maybe-to-checking Tₑ?) [ expected-type Γ (TpEq t₁ t₂) ] nothing -] Γ ⊢ t ⇐ update-eq t₁ t₂ ↝ return Tₕ → [- Epsilon-span pi lr -? t (maybe-to-checking Tₑ?) [ expected-type Γ Tₕ ] (unless (is-hole Tₕ) "The expected type is not an equation") -] untyped-term Γ t -- ● check-term Γ (ExHole pi) Tₑ? = [- hole-span Γ pi Tₑ? (maybe-to-checking Tₑ?) [] -] return-when (Hole pi) (TpHole pi) -- [ t₁ , t₂ [@ Tₘ,?] ] check-term Γ (ExIotaPair pi t₁ t₂ Tₘ? pi') Tₑ? = maybe-else' {B = spanM (err-m × 𝕃 tagged-val × term × term × term × type)} Tₑ? (maybe-else' Tₘ? (untyped-term Γ t₁ >>= λ t₁~ → untyped-term Γ t₂ >>= λ t₂~ → return (just "Iota pairs require a specified type when synthesizing" , [] , t₁~ , t₁~ , t₂~ , TpHole pi)) λ {(ExGuide pi'' x T₂) → Γ ⊢ t₁ ↝ t₁~ ⇒ T₁~ / (Γ , pi'' - x :` Tkt T₁~) ⊢ T₂ ⇐ KdStar ↝ T₂~ / Γ ⊢ t₂ ⇐ [ Γ - t₁~ / (pi'' % x) ] T₂~ ↝ t₂~ / let T₂~ = [ Γ - Var x / (pi'' % x) ] T₂~ bd = binder-data Γ pi'' x (Tkt T₁~) ff nothing (type-start-pos T₂) (type-end-pos T₂) in [- Var-span Γ pi'' x checking [ type-data Γ T₁~ ] nothing -] return (nothing , (type-data Γ (TpIota x T₁~ T₂~) :: [ bd ]) , IotaPair t₁~ t₂~ x T₂~ , t₁~ , t₂~ , TpIota x T₁~ T₂~)}) (λ Tₑ → Γ ⊢ Tₑ =β= λ where (TpIota x T₁ T₂) → Γ ⊢ t₁ ⇐ T₁ ↝ t₁~ / maybe-else' Tₘ? (Γ ⊢ t₂ ⇐ [ Γ - t₁~ / x ] T₂ ↝ t₂~ / return (nothing , (type-data Γ (TpIota x T₁ T₂) :: [ expected-type Γ Tₑ ]) , IotaPair t₁~ t₂~ x T₂ , t₁~ , t₂~ , TpIota x T₁ T₂)) λ {(ExGuide pi'' x' Tₘ) → (Γ , pi'' - x' :` Tkt T₁) ⊢ Tₘ ⇐ KdStar ↝ Tₘ~ / let Tₘ~ = [ Γ - Var x' / (pi'' % x') ] Tₘ~ T₂ = [ Γ - Var x' / x ] T₂ Tₛ = TpIota x' T₁ Tₘ~ in Γ ⊢ t₂ ⇐ [ Γ - t₁~ / x' ] Tₘ~ ↝ t₂~ / [- Var-span Γ pi'' x checking [ type-data Γ T₁ ] nothing -] return (check-for-type-mismatch Γ "computed" Tₘ~ T₂ , (type-data Γ Tₛ :: expected-type Γ (TpIota x' T₁ T₂) :: [ binder-data Γ pi'' x' (Tkt T₁) ff nothing (type-start-pos Tₘ) (type-end-pos Tₘ) ]) , IotaPair t₁~ t₂~ x' Tₘ~ , t₁~ , t₂~ , Tₛ)} Tₕ → untyped-term Γ t₁ >>= λ t₁~ → untyped-term Γ t₂ >>= λ t₂~ → return (unless (is-hole Tₕ) "The expected type is not an iota-type" , [ expected-type Γ Tₕ ] , t₁~ , t₁~ , t₂~ , Tₕ)) >>= λ where (err? , tvs , t~ , t₁~ , t₂~ , T~) → let conv-e = "The two components of the iota-pair are not convertible (as required)" conv-e? = unless (conv-term Γ t₁~ t₂~) conv-e conv-tvs = maybe-else' conv-e? [] λ _ → to-string-tag "hnf of the first component" Γ (hnf Γ unfold-head t₁~) :: [ to-string-tag "hnf of the second component" Γ (hnf Γ unfold-head t₂~) ] in [- IotaPair-span pi pi' (maybe-to-checking Tₑ?) (conv-tvs ++ tvs) (conv-e? ||-maybe err?) -] return-when t~ T~ -- t.(1 / 2) check-term Γ (ExIotaProj t n pi) Tₑ? = Γ ⊢ t ↝ t~ ⇒ T~ / let n? = case n of λ {"1" → just ι1; "2" → just ι2; _ → nothing} in maybe-else' n? ([- IotaProj-span t pi (maybe-to-checking Tₑ?) (expected-type-if Γ Tₑ?) (just "Iota-projections must use .1 or .2 only") -] return-when t~ (TpHole pi)) λ n → Γ ⊢ T~ =β= λ where (TpIota x T₁ T₂) → let Tᵣ = if n iff ι1 then T₁ else ([ Γ - t~ / x ] T₂) in [- IotaProj-span t pi (maybe-to-checking Tₑ?) (type-data Γ Tᵣ :: expected-type-if Γ Tₑ?) (check-for-type-mismatch-if Γ "synthesized" Tₑ? Tᵣ) -] return-when (IotaProj t~ n) Tᵣ Tₕ~ → [- IotaProj-span t pi (maybe-to-checking Tₑ?) (head-type Γ Tₕ~ :: expected-type-if Γ Tₑ?) (unless (is-hole Tₕ~) "The synthesized type of the head is not an iota-type") -] return-when (IotaProj t~ n) (TpHole pi) -- λ/Λ x [: T?]. t check-term Γ (ExLam pi e pi' x tk? t) Tₑ? = [- punctuation-span "Lambda" pi (posinfo-plus pi 1) -] let erase-err : (exp act : erased?) → tpkd → term → err-m × 𝕃 tagged-val erase-err = λ where Erased NotErased tk t → just ("The expected type is a ∀-abstraction (implicit input), " ^ "but the term is a λ-abstraction (explicit input)") , [] NotErased Erased tk t → just ("The expected type is a Π-abstraction (explicit input), " ^ "but the term is a Λ-abstraction (implicit input)") , [] Erased Erased tk t → maybe-else (nothing , []) (λ e-tv → just (fst e-tv) , [ snd e-tv ]) (trie-lookup (free-vars (erase t)) x >> just ("The Λ-bound variable occurs free in the erasure of the body" , erasure Γ t)) NotErased NotErased (Tkk _) t → just "λ-terms must bind a term, not a type (use Λ instead)" , [] NotErased NotErased (Tkt _) t → nothing , [] in case-ret {m = Tₑ?} (maybe-else' tk? (untyped-term (Γ , pi' - x :` Tkt (TpHole pi')) t >>= λ t~ → [- Lam-span Γ synthesizing pi pi' e x (Tkt (TpHole pi')) t [] (just ("We are not checking this abstraction against a type, " ^ "so a classifier must be given for the bound variable " ^ x)) -] return2 (Lam e x nothing (rename-var Γ (pi' % x) x t~)) (TpHole pi')) λ tk → Γ ⊢ tk ↝ tk~ / (Γ , pi' - x :` tk~) ⊢ t ↝ t~ ⇒ T~ / let T~ = rename-var Γ (pi' % x) x T~ t~ = rename-var Γ (pi' % x) x t~ Tᵣ = TpAbs e x tk~ T~ in [- var-span e (Γ , pi' - x :` tk~) pi' x checking tk~ nothing -] [- uncurry (λ tvs → Lam-span Γ synthesizing pi pi' e x tk~ t (type-data Γ Tᵣ :: tvs)) (twist-× (erase-err e e tk~ t~)) -] return2 (Lam e x (just tk~) t~) Tᵣ) λ Tₑ → Γ ⊢ Tₑ =β= λ where (TpAbs e' x' tk T) → maybe-map (check-tpkd Γ) tk? >>=? tk~? / let tk~ = maybe-else' tk~? tk id in --maybe-else' tk? (return tk) (λ tk → Γ ⊢ tk ↝ return) >>= tk~ / (Γ , pi' - x :` tk~) ⊢ t ⇐ rename-var Γ x' (pi' % x) T ↝ t~ / let xₙ = if x =string ignored-var && is-free-in x' T then x' else x t~ = rename-var Γ (pi' % x) xₙ t~ T = rename-var Γ x' xₙ T Tₛ = TpAbs e xₙ tk~ T Tₑ = TpAbs e' xₙ tk T vₑ = check-for-tpkd-mismatch-if Γ "computed" tk~? tk in [- var-span e (Γ , pi' - x :` tk~) pi' x (maybe-to-checking tk?) tk~ nothing -] [- uncurry (λ err tvs → Lam-span Γ checking pi pi' e x tk~ t (type-data Γ Tₛ :: expected-type Γ Tₑ :: tvs) (err ||-maybe vₑ)) (erase-err e' e tk~ t~) -] return (Lam e xₙ (just tk~) t~) Tₕ → maybe-else' tk? (return (Tkt (TpHole pi'))) (check-tpkd Γ) >>= tk~ / untyped-term (Γ , pi' - x :` tk~) t >>= t~ / [- Lam-span Γ checking pi pi' e x (Tkt (TpHole pi')) t [ expected-type Γ Tₕ ] (just "The expected type is not a ∀- or a Π-type") -] return (Lam e x (unless (is-hole -tk' tk~) tk~) (rename-var Γ (pi' % x) x t~)) -- [d] - t check-term Γ (ExLet pi e? d t) Tₑ? = check-let Γ d e? (term-start-pos t) (term-end-pos t) >>= λ where (Γ' , x , tv , σ , f) → case-ret-body {m = Tₑ?} (check-term Γ' t Tₑ?) λ t~ T~ → [- punctuation-span "Parens (let)" pi (term-end-pos t) -] [- Let-span e? pi (term-end-pos t) (maybe-to-checking Tₑ?) (maybe-else' Tₑ? (type-data Γ T~) (expected-type Γ) :: [ tv ]) (when (e? && is-free-in x (erase t~)) (unqual-local x ^ "occurs free in the body of the term")) -] return-when (f t~) (σ T~) -- open/close x - t check-term Γ (ExOpen pi o pi' x t) Tₑ? = let Γ? = ctxt-clarify-def Γ o x e? = maybe-not Γ? >> just (x ^ " does not have a definition that can be " ^ (if o then "opened" else "closed")) in [- Var-span Γ pi' x (maybe-to-checking Tₑ?) [ not-for-navigation ] nothing -] [- Open-span o pi x t (maybe-to-checking Tₑ?) (expected-type-if Γ Tₑ?) e? -] check-term (maybe-else' Γ? Γ id) t Tₑ? -- (t) check-term Γ (ExParens pi t pi') Tₑ? = [- punctuation-span "Parens (term)" pi pi' -] check-term Γ t Tₑ? -- φ t₌ - t₁ {t₂} check-term Γ (ExPhi pi t₌ t₁ t₂ pi') Tₑ? = case-ret-body {m = Tₑ?} (check-term Γ t₁ Tₑ?) λ t₁~ T~ → untyped-term Γ t₂ >>= λ t₂~ → Γ ⊢ t₌ ⇐ TpEq t₁~ t₂~ ↝ t₌~ / [- Phi-span pi pi' (maybe-to-checking Tₑ?) [ maybe-else' Tₑ? (type-data Γ T~) (expected-type Γ)] nothing -] return-when (Phi t₌~ t₁~ t₂~) T~ -- ρ[+]<ns> t₌ [@ Tₘ?] - t check-term Γ (ExRho pi ρ+ <ns> t₌ Tₘ? t) Tₑ? = Γ ⊢ t₌ ↝ t₌~ ⇒ T₌ / Γ ⊢ T₌ =β= λ where (TpEq t₁ t₂) → let tₗ = if isJust Tₑ? then t₁ else t₂ tᵣ = if isJust Tₑ? then t₂ else t₁ tvs = λ T~ Tᵣ → to-string-tag "equation" Γ (TpEq t₁ t₂) :: maybe-else' Tₑ? (to-string-tag "type of second subterm" Γ T~) (expected-type Γ) :: [ to-string-tag "rewritten type" Γ Tᵣ ] in maybe-else' Tₘ? (elim-pair (optNums-to-stringset <ns>) λ ns ns-e? → let x = fresh-var Γ "x" Γ' = ctxt-var-decl x Γ T-f = λ T → rewrite-type T Γ' ρ+ ns (just t₌~) tₗ x 0 Tᵣ-f = fst ∘ T-f nn-f = snd ∘ T-f Tₚ-f = map-fst (post-rewrite Γ' x t₌~ tᵣ) ∘ T-f in maybe-else' Tₑ? (Γ ⊢ t ↝ t~ ⇒ T~ / return2 t~ T~) (λ Tₑ → Γ ⊢ t ⇐ fst (Tₚ-f Tₑ) ↝ t~ / return2 t~ Tₑ) >>=c λ t~ T~ → elim-pair (Tₚ-f T~) λ Tₚ nn → [- Rho-span pi t₌ t (maybe-to-checking Tₑ?) ρ+ (inj₁ (fst nn)) (tvs T~ Tₚ) (ns-e? (snd nn)) -] return-when (Rho t₌~ x (erase (Tᵣ-f T~)) t~) Tₚ) λ where (ExGuide pi' x Tₘ) → [- Var-span Γ pi' x untyped [] nothing -] let Γ' = Γ , pi' - x :` Tkt (TpHole pi') in untyped-type Γ' Tₘ >>= λ Tₘ~ → let Tₘ~ = [ Γ' - Var x / (pi' % x) ] Tₘ~ T' = [ Γ' - tₗ / x ] Tₘ~ T'' = post-rewrite Γ' x t₌~ tᵣ (rewrite-at Γ' x (just t₌~) tt T' Tₘ~) check-str = if isJust Tₑ? then "computed" else "synthesized" in maybe-else' Tₑ? (check-term Γ t nothing) (λ Tₑ → Γ ⊢ t ⇐ T'' ↝ t~ / return2 t~ Tₑ) >>=c λ t~ T~ → [- Rho-span pi t₌ t (maybe-to-checking Tₑ?) ρ+ (inj₂ x) (tvs T~ T'') (check-for-type-mismatch Γ check-str T' T~) -] return-when (Rho t₌~ x Tₘ~ t~) T'' Tₕ → Γ ⊢ t ↝ t~ ⇒ λ T~ → [- Rho-span pi t₌ t (maybe-to-checking Tₑ?) ρ+ (inj₁ 1) (to-string-tag "type of first subterm" Γ Tₕ :: [ to-string-tag "type of second subterm" Γ T~ ]) (unless (is-hole Tₕ) "We could not synthesize an equation from the first subterm") -] return-when t~ T~ -- ς t check-term Γ (ExVarSigma pi t) Tₑ? = case-ret (Γ ⊢ t ↝ t~ ⇒ T / Γ ⊢ T =β= λ where (TpEq t₁ t₂) → [- VarSigma-span pi t synthesizing [ type-data Γ (TpEq t₂ t₁) ] nothing -] return2 (VarSigma t~) (TpEq t₂ t₁) Tₕ → [- VarSigma-span pi t synthesizing [ type-data Γ Tₕ ] (unless (is-hole Tₕ) "The synthesized type of the body is not an equation") -] return2 (VarSigma t~) Tₕ) λ Tₑ → Γ ⊢ Tₑ =β= λ where (TpEq t₁ t₂) → Γ ⊢ t ⇐ TpEq t₂ t₁ ↝ t~ / [- VarSigma-span pi t checking [ expected-type Γ (TpEq t₁ t₂) ] nothing -] return (VarSigma t~) Tₕ → [- VarSigma-span pi t checking [ expected-type Γ Tₕ ] (unless (is-hole Tₕ) "The expected type is not an equation") -] untyped-term Γ t -- θ t ts check-term Γ (ExTheta pi θ t ts) Tₑ? = case-ret {m = Tₑ?} ([- Theta-span Γ pi θ t ts synthesizing [] (just "Theta-terms can only be used when checking (and we are synthesizing here)") -] return2 (Hole pi) (TpHole pi)) λ Tₑ → Γ ⊢ t ↝ t~ ⇒ T / let x = case hnf Γ unfold-head t~ of λ {(Var x) → x; _ → "x"} x' = fresh-var Γ x in Γ ⊢ T =β= λ where (TpAbs me x (Tkk kd) tp) → (case θ of λ where (AbstractVars vs) → either-else' (wrap-vars vs Tₑ) (return2 (TpHole pi) ∘ just) λ Tₘ → return2 Tₘ nothing Abstract → return2 (TpLam x' (Tkt T) (rename-var Γ x x' Tₑ)) nothing AbstractEq → return2 (TpLam x' (Tkt T) (TpAbs Erased ignored-var (Tkt (TpEq t~ (Var x'))) (rename-var Γ x x' Tₑ))) nothing) >>=c λ Tₘ e₁ → check-refinement Γ Tₘ kd >>=c λ Tₘ → uncurry λ tvs e₂ → let tp' = [ Γ - Tₘ / x ] tp in check-lterms ts (AppTp t~ Tₘ) tp' >>=c λ t~ T~ → let e₃ = check-for-type-mismatch Γ "synthesized" T~ Tₑ t~ = case θ of λ {AbstractEq → AppEr t~ (Beta (erase t~) id-term); _ → t~} in [- Theta-span Γ pi θ t ts checking (type-data Γ T~ :: expected-type Γ Tₑ :: tvs) (e₁ ||-maybe (e₂ ||-maybe e₃)) -] return t~ Tₕ → [- Theta-span Γ pi θ t ts checking (head-type Γ Tₕ :: expected-type Γ Tₑ :: []) (unless (is-hole Tₕ) "The synthesized type of the head is not a type-forall") -] return (Hole pi) where check-lterms : 𝕃 lterm → term → type → spanM (term × type) check-lterms [] tm tp = return2 tm tp check-lterms (Lterm me t :: ts) tm tp = Γ ⊢ tp =β= λ where (TpAbs me' x (Tkt T) T') → Γ ⊢ t ⇐ T ↝ t~ / (if me iff me' then return triv else spanM-add (Theta-span Γ pi θ t [] checking [] (just "Mismatched erasure of theta arg"))) >> check-lterms ts (if me then AppEr tm t~ else App tm t~) ([ Γ - t~ / x ] T') Tₕ → (if is-hole Tₕ then id else [- Theta-span Γ pi θ t [] checking [ expected-type Γ Tₕ ] (just "The expected type is not an arrow type") -]_) (untyped-term Γ t >>= λ t~ → check-lterms ts (if me then AppEr tm t~ else App tm t~) Tₕ) var-not-in-scope : var → string var-not-in-scope x = "We could not compute a motive from the given term because " ^ "the abstracted variable " ^ x ^ " is not in scope" wrap-var : var → type → string ⊎ type wrap-var x T = let x' = fresh-var Γ x in maybe-else' (ctxt-lookup-tpkd-var Γ x) (inj₁ (var-not-in-scope x)) λ {(qx , as , tk) → inj₂ (TpLam x' tk (rename-var Γ qx x' T))} wrap-vars : 𝕃 var → type → var ⊎ type wrap-vars [] T = inj₂ T wrap-vars (x :: xs) T = wrap-vars xs T >>= wrap-var x motive : var → var → type → type → theta → term → type motive x x' T T' Abstract t = TpLam x' (Tkt T') (rename-var Γ x x' T) motive x x' T T' AbstractEq t = TpLam x' (Tkt T') (TpAbs Erased ignored-var (Tkt (TpEq t (Var x'))) (rename-var Γ x x' T)) motive x x' T T' (AbstractVars vs) t = T -- Shouldn't happen -- μ(' / rec.) t [@ Tₘ?] {ms...} check-term Γ (ExMu pi1 pi2 x t Tₘ? pi' ms pi'') Tₑ? = check-mu Γ pi1 pi2 x t Tₘ? pi' ms pi'' Tₑ? check-term Γ (ExSigma pi t? t Tₘ? pi' ms pi'') Tₑ? = check-sigma Γ pi t? t Tₘ? pi' ms pi'' Tₑ? -- x check-term Γ (ExVar pi x) Tₑ? = maybe-else' (ctxt-lookup-term-var Γ x) ([- Var-span Γ pi x (maybe-to-checking Tₑ?) (expected-type-if Γ Tₑ?) (just "Missing a type for a term variable") -] return-when (Var x) (TpHole pi)) λ {(qx , as , T) → [- Var-span Γ pi x (maybe-to-checking Tₑ?) (type-data Γ T :: expected-type-if Γ Tₑ?) (check-for-type-mismatch-if Γ "computed" Tₑ? T) -] return-when (apps-term (Var qx) as) T} -- ∀/Π x : tk. T check-type Γ (ExTpAbs pi e pi' x tk T) kₑ? = Γ ⊢ tk ↝ tk~ / (Γ , pi' - x :` tk~) ⊢ T ⇐ KdStar ↝ T~ / let T~ = rename-var Γ (pi' % x) x T~ in [- punctuation-span "Forall" pi (posinfo-plus pi 1) -] [- var-span ff (Γ , pi' - x :` tk~) pi' x checking tk~ nothing -] [- TpQuant-span Γ e pi pi' x tk~ T (maybe-to-checking kₑ?) (kind-data Γ KdStar :: expected-kind-if Γ kₑ?) (check-for-kind-mismatch-if Γ "computed" kₑ? KdStar) -] return-when (TpAbs e x tk~ T~) KdStar -- ι x : T₁. T₂ check-type Γ (ExTpIota pi pi' x T₁ T₂) kₑ? = Γ ⊢ T₁ ⇐ KdStar ↝ T₁~ / (Γ , pi' - x :` Tkt T₁~) ⊢ T₂ ⇐ KdStar ↝ T₂~ / let T₂~ = rename-var Γ (pi' % x) x T₂~ in [- punctuation-span "Iota" pi (posinfo-plus pi 1) -] [- Var-span (Γ , pi' - x :` Tkt T₁~) pi' x checking [ type-data Γ T₁~ ] nothing -] [- Iota-span Γ pi pi' x T₁~ T₂ (maybe-to-checking kₑ?) (kind-data Γ KdStar :: expected-kind-if Γ kₑ?) (check-for-kind-mismatch-if Γ "computed" kₑ? KdStar) -] return-when (TpIota x T₁~ T₂~) KdStar -- {^ T ^} (generated by theta) check-type Γ (ExTpNoSpans T pi) kₑ? = check-type Γ T kₑ? >>=spand return -- [d] - T check-type Γ (ExTpLet pi d T) kₑ? = check-let Γ d ff (type-start-pos T) (type-end-pos T) >>= λ where (Γ' , x , tv , σ , f) → case-ret-body {m = kₑ?} (check-type Γ' T kₑ?) λ T~ k~ → [- punctuation-span "Parens (let)" pi (type-end-pos T) -] [- TpLet-span pi (type-end-pos T) (maybe-to-checking kₑ?) (maybe-else' kₑ? (kind-data Γ k~) (expected-kind Γ) :: [ tv ]) -] return-when (σ T~) (σ k~) -- T · T' check-type Γ (ExTpApp T T') kₑ? = Γ ⊢ T ↝ T~ ⇒ kₕ / Γ ⊢ kₕ =β= λ where (KdAbs x (Tkk dom) cod) → Γ ⊢ T' ⇐ dom ↝ T'~ / let cod' = [ Γ - T'~ / x ] cod in [- TpApp-span (type-start-pos T) (type-end-pos T') (maybe-to-checking kₑ?) (kind-data Γ cod' :: expected-kind-if Γ kₑ?) (check-for-kind-mismatch-if Γ "synthesized" kₑ? cod') -] return-when (TpAppTp T~ T'~) cod' kₕ' → untyped-type Γ T' >>= T'~ / [- TpApp-span (type-start-pos T) (type-end-pos T') (maybe-to-checking kₑ?) (head-kind Γ kₕ' :: expected-kind-if Γ kₑ?) (unless (is-hole kₕ') $ "The synthesized kind of the head does not allow it to be applied" ^ " to a type argument") -] return-when (TpAppTp T~ T'~) (KdHole (type-start-pos T)) -- T t check-type Γ (ExTpAppt T t) kₑ? = Γ ⊢ T ↝ T~ ⇒ kₕ / Γ ⊢ kₕ =β= λ where (KdAbs x (Tkt dom) cod) → Γ ⊢ t ⇐ dom ↝ t~ / let cod' = [ Γ - t~ / x ] cod in [- TpAppt-span (type-start-pos T) (term-end-pos t) (maybe-to-checking kₑ?) (kind-data Γ cod' :: expected-kind-if Γ kₑ?) (check-for-kind-mismatch-if Γ "synthesized" kₑ? cod') -] return-when (TpAppTm T~ t~) cod' kₕ' → untyped-term Γ t >>= t~ / [- TpAppt-span (type-start-pos T) (term-end-pos t) (maybe-to-checking kₑ?) (head-kind Γ kₕ' :: expected-kind-if Γ kₑ?) (unless (is-hole kₕ') $ "The synthesized kind of the head does not allow it to be applied" ^ " to a term argument") -] return-when (TpAppTm T~ t~) (KdHole (type-start-pos T)) -- T ➔/➾ T' check-type Γ (ExTpArrow T e T') kₑ? = Γ ⊢ T ⇐ KdStar ↝ T~ / Γ ⊢ T' ⇐ KdStar ↝ T'~ / [- TpArrow-span T T' (maybe-to-checking kₑ?) (kind-data Γ KdStar :: expected-kind-if Γ kₑ?) (check-for-kind-mismatch-if Γ "computed" kₑ? KdStar) -] return-when (TpAbs e ignored-var (Tkt T~) T'~) KdStar -- { t₁ ≃ t₂ } check-type Γ (ExTpEq pi t₁ t₂ pi') kₑ? = untyped-term Γ t₁ >>= t₁~ / untyped-term Γ t₂ >>= t₂~ / [- punctuation-span "Parens (equation)" pi pi' -] [- TpEq-span pi pi' (maybe-to-checking kₑ?) (kind-data Γ KdStar :: expected-kind-if Γ kₑ?) (check-for-kind-mismatch-if Γ "computed" kₑ? KdStar) -] return-when (TpEq t₁~ t₂~) KdStar -- ● check-type Γ (ExTpHole pi) kₑ? = [- tp-hole-span Γ pi kₑ? (maybe-to-checking kₑ?) [] -] return-when (TpHole pi) (KdHole pi) -- λ x : tk. T check-type Γ (ExTpLam pi pi' x tk T) kₑ? = [- punctuation-span "Lambda (type)" pi (posinfo-plus pi 1) -] Γ ⊢ tk ↝ tk~ / case-ret ((Γ , pi' - x :` tk~) ⊢ T ↝ T~ ⇒ k / let kₛ = KdAbs x tk~ (rename-var Γ (pi' % x) x k) in [- var-span ff (Γ , pi' - x :` tk~) pi' x checking tk~ nothing -] [- TpLambda-span Γ pi pi' x tk~ T synthesizing [ kind-data Γ kₛ ] nothing -] return2 (TpLam x tk~ (rename-var Γ (pi' % x) x T~)) kₛ) λ kₑ → (Γ ⊢ kₑ =β= λ where (KdAbs x' tk' k) → (Γ , pi' - x :` tk~) ⊢ T ⇐ (rename-var Γ x' (pi' % x) k) ↝ T~ / let xₙ = if x =string ignored-var && is-free-in x' k then x' else x in return (xₙ , rename-var Γ (pi' % x) xₙ T~ , lambda-bound-conv? Γ x tk' tk~ []) kₕ → (Γ , pi' - x :` tk~) ⊢ T ↝ T~ ⇒ _ / return (x , rename-var Γ (pi' % x) x T~ , [] , unless (is-hole kₕ) "The expected kind is not an arrow- or Pi-kind") ) >>= λ where (xₙ , T~ , tvs , e?) → [- var-span ff (Γ , pi' - x :` tk~) pi' x checking tk~ nothing -] [- TpLambda-span Γ pi pi' x tk~ T checking (expected-kind Γ kₑ :: tvs) e? -] return (TpLam xₙ tk~ T~) -- (T) check-type Γ (ExTpParens pi T pi') kₑ? = [- punctuation-span "Parens (type)" pi pi' -] check-type Γ T kₑ? -- x check-type Γ (ExTpVar pi x) kₑ? = maybe-else' (ctxt-lookup-type-var Γ x) ([- TpVar-span Γ pi x (maybe-to-checking kₑ?) (expected-kind-if Γ kₑ?) (just "Undefined type variable") -] return-when (TpVar x) (KdHole pi)) λ where (qx , as , k) → [- TpVar-span Γ pi x (maybe-to-checking kₑ?) (expected-kind-if Γ kₑ? ++ [ kind-data Γ k ]) (check-for-kind-mismatch-if Γ "computed" kₑ? k) -] return-when (apps-type (TpVar qx) as) k -- Π x : tk. k check-kind Γ (ExKdAbs pi pi' x tk k) = Γ ⊢ tk ↝ tk~ / Γ , pi' - x :` tk~ ⊢ k ↝ k~ / [- KdAbs-span Γ pi pi' x tk~ k checking nothing -] [- var-span ff Γ pi' x checking tk~ nothing -] [- punctuation-span "Pi (kind)" pi (posinfo-plus pi 1) -] return (KdAbs x tk~ (rename-var Γ (pi' % x) x k~)) -- tk ➔ k check-kind Γ (ExKdArrow tk k) = Γ ⊢ tk ↝ tk~ / Γ ⊢ k ↝ k~ / [- KdArrow-span tk k checking nothing -] return (KdAbs ignored-var tk~ k~) -- ● check-kind Γ (ExKdHole pi) = [- kd-hole-span pi checking -] return (KdHole pi) -- (k) check-kind Γ (ExKdParens pi k pi') = [- punctuation-span "Parens (kind)" pi pi' -] check-kind Γ k -- ★ check-kind Γ (ExKdStar pi) = [- Star-span pi checking nothing -] return KdStar -- κ as... check-kind Γ (ExKdVar pi κ as) = case ctxt-lookup-kind-var-def Γ κ of λ where nothing → [- KdVar-span Γ (pi , κ) (args-end-pos (posinfo-plus-str pi κ) as) [] checking [] (just "Undefined kind variable") -] return (KdHole pi) (just (ps , k)) → check-args Γ as ps >>= λ as~ → [- KdVar-span Γ (pi , κ) (args-end-pos (posinfo-plus-str pi κ) as) ps checking (params-data Γ ps) (when (length as < length ps) ("Needed " ^ ℕ-to-string (length ps ∸ length as) ^ " further argument(s)")) -] return (fst (subst-params-args' Γ ps as~ k)) check-tpkd Γ (ExTkt T) = Tkt <$> check-type Γ T (just KdStar) check-tpkd Γ (ExTkk k) = Tkk <$> check-kind Γ k check-args Γ (ExTmArg me t :: as) (Param me' x (Tkt T) :: ps) = Γ ⊢ t ⇐ T ↝ t~ / let e-s = mk-span "Argument" (term-start-pos t) (term-end-pos t) [ expected-type Γ T ] (just "Mismatched argument erasure") e-m = λ r → if me iff me' then return {F = spanM} r else ([- e-s -] return {F = spanM} r) in check-args Γ as (subst-params Γ t~ x ps) >>= λ as~ → e-m ((if me then inj₂ (inj₁ t~) else inj₁ t~) :: as~) check-args Γ (ExTpArg T :: as) (Param _ x (Tkk k) :: ps) = Γ ⊢ T ⇐ k ↝ T~ / check-args Γ as (subst-params Γ T~ x ps) >>= λ as~ → return (inj₂ (inj₂ T~) :: as~) check-args Γ (ExTmArg me t :: as) (Param _ x (Tkk k) :: ps) = [- mk-span "Argument" (term-start-pos t) (term-end-pos t) [ expected-kind Γ k ] (just "Expected a type argument") -] return [] check-args Γ (ExTpArg T :: as) (Param me x (Tkt T') :: ps) = [- mk-span "Argument" (type-start-pos T) (type-end-pos T) [ expected-type Γ T' ] (just ("Expected a" ^ (if me then "n erased" else "") ^ " term argument")) -] return [] check-args Γ (a :: as) [] = let range = case a of λ {(ExTmArg me t) → term-start-pos t , term-end-pos t; (ExTpArg T) → type-start-pos T , type-end-pos T} in check-args Γ as [] >>= λ as~ → [- mk-span "Argument" (fst range) (snd range) [] (just "Too many arguments given") -] return [] check-args Γ [] _ = return [] check-erased-margs : ctxt → posinfo → posinfo → term → maybe type → spanM ⊤ check-erased-margs Γ pi pi' t T? = let psₑ = foldr (λ {(Param me x tk) psₑ → if me then x :: psₑ else psₑ}) [] (ctxt.ps Γ) fvs = free-vars (erase t) e = list-any (stringset-contains fvs) psₑ in if e then spanM-add (erased-marg-span Γ pi pi' T?) else spanMok check-let Γ (ExDefTerm pi x (just Tₑ) t) e? fm to = Γ ⊢ Tₑ ⇐ KdStar ↝ Tₑ~ / Γ ⊢ t ⇐ Tₑ~ ↝ t~ / elim-pair (compileFail-in Γ t~) λ tvs e → [- Var-span (Γ , pi - x :` Tkt Tₑ~) pi x checking (type-data Γ Tₑ~ :: tvs) e -] return (ctxt-term-def pi localScope opacity-open x (just t~) Tₑ~ Γ , pi % x , binder-data Γ pi x (Tkt Tₑ~) e? (just t~) fm to , (λ {ed} T' → [ Γ - t~ / (pi % x) ] T') , (λ t' → LetTm (e? || ~ is-free-in (pi % x) (erase t')) x nothing t~ ([ Γ - Var x / (pi % x) ] t'))) check-let Γ (ExDefTerm pi x nothing t) e? fm to = Γ ⊢ t ↝ t~ ⇒ Tₛ~ / elim-pair (compileFail-in Γ t~) λ tvs e → let Γ' = ctxt-term-def pi localScope opacity-open x (just t~) Tₛ~ Γ in [- Var-span Γ' pi x synthesizing (type-data Γ Tₛ~ :: tvs) e -] return (Γ' , pi % x , binder-data Γ pi x (Tkt Tₛ~) e? (just t~) fm to , (λ {ed} T' → [ Γ - t~ / (pi % x) ] T') , (λ t' → LetTm (e? || ~ is-free-in (pi % x) (erase t')) x nothing t~ ([ Γ - Var x / (pi % x) ] t'))) check-let Γ (ExDefType pi x k T) e? fm to = Γ ⊢ k ↝ k~ / Γ ⊢ T ⇐ k~ ↝ T~ / [- TpVar-span (Γ , pi - x :` Tkk k~) pi x checking [ kind-data Γ k~ ] nothing -] return (ctxt-type-def pi localScope opacity-open x (just T~) k~ Γ , pi % x , binder-data Γ pi x (Tkk k~) e? (just T~) fm to , (λ {ed} T' → [ Γ - T~ / (pi % x) ] T') , (λ t' → LetTp x k~ T~ ([ Γ - TpVar x / (pi % x) ] t'))) check-case Γ (ExCase pi x cas t) es Dₓ cs ρₒ as dps Tₘ cast-tm cast-tp = [- pattern-span pi x cas -] maybe-else' (trie-lookup (ctxt.qual Γ) x >>= uncurry λ x' _ → trie-lookup cs x' >>= λ T → just (x' , T)) (let e = maybe-else' (trie-lookup es x) ("This is not a constructor of " ^ unqual-local (unqual-all (ctxt.qual Γ) Dₓ)) λ _ → "This case is unreachable" in [- pattern-ctr-span Γ pi x [] [] (just e) -] return2 (Case x [] (Hole pi) []) cs) λ where (x' , Tₕ , ps , is) → decl-args Γ cas ps empty-trie ρₒ [] (const spanMok) >>= λ where (Γ' , cas' , e , σ , ρ , tvs , sm) → let rs = tmtps-to-args' Γ' σ (drop dps is) Tₘ' = TpAppTm (apps-type Tₘ rs) (app-caseArgs (cast-tm Γ') (cast-tp Γ') (recompose-apps as (Var x')) (zip cas cas')) Tₘ' = hnf Γ' unfold-no-defs Tₘ' in Γ' ⊢ t ⇐ Tₘ' ↝ t~ / sm t~ >> [- pattern-clause-span pi t (reverse tvs) -] [- pattern-ctr-span Γ' pi x cas' [] e -] return2 (Case x' (subst-case-args cas' Γ ρₒ) (subst-renamectxt Γ ρ t~) (args-to-tmtps (as ++ (subst-renamectxt Γ ρ -arg_ <$> rs)))) (trie-remove cs x') where subst-case-args : case-args → ctxt → renamectxt → case-args subst-case-args [] Γ ρ = [] subst-case-args (CaseArg e x tk? :: cs) Γ ρ = CaseArg e x (subst-renamectxt Γ ρ -tk_ <$> tk?) :: subst-case-args cs (ctxt-var-decl x Γ) (renamectxt-insert ρ x x) free-in-term : var → term → err-m free-in-term x t = when (is-free-in x (erase t)) "Erased argument occurs free in the body of the term" tmtp-to-arg' : ctxt → trie (Σi exprd ⟦_⟧) → tmtp → arg tmtp-to-arg' = λ Γ σ → either-else (Arg ∘ substs Γ σ) (ArgTp ∘ substs Γ σ) tmtps-to-args' : ctxt → trie (Σi exprd ⟦_⟧) → 𝕃 tmtp → args tmtps-to-args' = λ Γ σ → tmtp-to-arg' Γ σ <$>_ app-caseArgs : (term → type → term) → (type → kind → type) → term → 𝕃 (ex-case-arg × case-arg) → term app-caseArgs tf Tf = foldl λ where (ExCaseArg _ pi x , CaseArg me _ tk?) t → elim-pair (me , tk?) λ where tt (just (Tkt T)) → AppEr t (tf (Var (pi % x)) T) tt (just (Tkk k)) → AppTp t (Tf (TpVar (pi % x)) k) ff (just (Tkt T)) → App t (tf (Var (pi % x)) T) _ _ → t spos = term-start-pos t epos = term-end-pos t add-case-arg : ∀ {X Y} → ctxt → var → var → case-arg → spanM (X × case-args × Y) → spanM (X × case-args × Y) add-case-arg Γ x xₙ ca m = m >>=c λ X → return2 X ∘ map-fst λ cas → ca :: subst-case-args cas Γ (renamectxt-single x xₙ) decl-args : ctxt → ex-case-args → params → trie (Σi exprd ⟦_⟧) → renamectxt → 𝕃 tagged-val → (term → spanM ⊤) → spanM (ctxt × case-args × err-m × trie (Σi exprd ⟦_⟧) × renamectxt × 𝕃 tagged-val × (term → spanM ⊤)) decl-args Γ (ExCaseArg ExCaseArgTp pi x :: as) (Param me x' (Tkt T) :: ps) σ ρ xs sm = let T' = substs Γ σ T Γ' = ctxt-var-decl-loc pi x Γ xₙ = if x =string ignored-var then x' else x in add-case-arg Γ' (pi % x) xₙ (CaseArg tt xₙ (just (Tkt T'))) $ decl-args Γ' as ps (trie-insert σ x' (, TpVar (pi % x))) (renamectxt-insert ρ (pi % x) xₙ) (binder-data Γ' pi x (Tkt T') Erased nothing spos epos :: xs) λ t → [- TpVar-span Γ' pi x checking [ expected-type Γ T' ] (just ("This type argument should be a" ^ (if me then "n erased term" else " term"))) -] sm t decl-args Γ (ExCaseArg ExCaseArgTp pi x :: as) (Param _ x' (Tkk k) :: ps) σ ρ xs sm = let k' = substs Γ σ k Γ' = ctxt-type-decl pi x k' Γ xₙ = if x =string ignored-var then x' else x in add-case-arg Γ' (pi % x) xₙ (CaseArg tt xₙ (just (Tkk k'))) $ decl-args Γ' as ps (trie-insert σ x' (, TpVar (pi % x))) (renamectxt-insert ρ (pi % x) xₙ) (binder-data Γ' pi x (Tkk k') Erased nothing spos epos :: xs) λ t → [- TpVar-span Γ' pi x checking [ kind-data Γ k' ] (free-in-term x t) -] sm t decl-args Γ (ExCaseArg me pi x :: as) (Param me' x' (Tkt T) :: ps) σ ρ xs sm = let T' = substs Γ σ T e₁ = when (ex-case-arg-erased me xor me') "Mismatched erasure of term argument" e₂ = λ t → ifMaybe (ex-case-arg-erased me) $ free-in-term x t Γ' = Γ , pi - x :` (Tkt T') xₙ = if x =string ignored-var then x' else x in (add-case-arg Γ' (pi % x) xₙ (CaseArg me' xₙ (just (Tkt T'))) $ decl-args Γ' as ps (trie-insert σ x' (, Var (pi % x))) (renamectxt-insert ρ (pi % x) xₙ) (binder-data Γ' pi x (Tkt T') (ex-case-arg-erased me) nothing spos epos :: xs) λ t → [- Var-span Γ' pi x checking [ type-data Γ T' ] (e₁ ||-maybe e₂ t) -] sm t) decl-args Γ (ExCaseArg me pi x :: as) (Param me' x' (Tkk k) :: ps) σ ρ xs sm = let k' = substs Γ σ k Γ' = ctxt-var-decl-loc pi x Γ xₙ = if x =string ignored-var then x' else x in add-case-arg Γ' (pi % x) xₙ (CaseArg tt xₙ (just (Tkk k'))) $ decl-args Γ' as ps (trie-insert σ x' (, Var (pi % x))) (renamectxt-insert ρ (pi % x) xₙ) (binder-data Γ' pi x (Tkk k') (ex-case-arg-erased me) nothing spos epos :: xs) λ t → [- Var-span Γ' pi x checking [ expected-kind Γ k' ] (just "This term argument should be a type") -] sm t decl-args Γ [] [] σ ρ xs sm = return (Γ , [] , nothing , σ , ρ , xs , sm) decl-args Γ as [] σ ρ xs sm = return (Γ , [] , just (ℕ-to-string (length as) ^ " too many arguments supplied") , σ , ρ , xs , sm) decl-args Γ [] ps σ ρ xs sm = return (Γ , params-to-case-args (substs-params Γ σ ps) , just (ℕ-to-string (length ps) ^ " more arguments expected") , σ , ρ , xs , sm) check-cases Γ ms Dₓ cs ρ as dps Tₘ cast-tm cast-tp = foldr {B = stringset → trie (type × params × 𝕃 tmtp) → spanM (cases × trie (type × params × 𝕃 tmtp))} (λ m x es cs' → check-case Γ m es Dₓ cs' ρ as dps Tₘ cast-tm cast-tp >>=c λ m~ cs → x (stringset-insert es (ex-case-ctr m)) cs >>=c λ ms~ → return2 (m~ :: ms~)) (λ es → return2 []) ms empty-stringset (trie-map (decompose-ctr-type Γ) cs) >>=c λ ms~ missing-cases → let xs = map (map-snd snd) $ trie-mappings missing-cases csf = uncurry₂ λ Tₕ ps as → rope-to-string $ strRun Γ $ strVar (unqual-all (ctxt.qual Γ) Tₕ) >>str args-to-string (params-to-args ps) e = "Missing patterns: " ^ 𝕃-to-string csf ", " xs in return2 ms~ (unless (iszero (length xs)) e) check-refinement Γ Tₘ kₘ s = check-type (qualified-ctxt Γ) (resugar Tₘ) (just kₘ) empty-spans >>= uncurry λ Tₘ' s' → return $ (λ x → x , s) $ Tₘ' , [ to-string-tag "computed motive" Γ Tₘ ] , (when (spans-have-error s') "We could not compute a well-kinded motive") get-datatype-info-from-head-type Γ X as = return $ maybe-else' (data-lookup Γ X as) (inj₁ $ "The head type of the subterm is not a datatype" , [ head-type Γ (TpVar X) ]) (λ μ → inj₂ μ) check-sigma-evidence Γ tₑ? X as = maybe-else' tₑ? (get-datatype-info-from-head-type Γ X as >>=s λ d → return $ inj₂ (sigma-build-evidence X d , id , d)) (λ tₑ → Γ ⊢ tₑ ↝ tₑ~ ⇒ T / let ev-err = inj₁ $ ("The synthesized type of the evidence does not prove " ^ unqual-local (unqual-all (ctxt.qual Γ) X) ^ " is a datatype") , [ to-string-tag "evidence type" Γ T ] in case decompose-tpapps (hnf Γ unfold-head-elab T) of λ where (TpVar X' , as') → case reverse as' of λ where (Ttp T :: as') → return $ if ~ conv-type Γ T (TpVar X) then ev-err else maybe-else ev-err (λ {d@(mk-data-info X Xₒ asₚ asᵢ mps kᵢ k cs csₚₛ eds gds) → inj₂ (tₑ~ , (App $ recompose-apps (asₚ ++ tmtps-to-args Erased asᵢ) $ Var $ data-to/ X) , d)}) -- AS: it looks like we are reversing as' twice, so not reversing at all? (data-lookup-mu Γ X X' $ reverse as' ++ as) -- TODO: Make sure "X" isn't a _defined_ type, but a _declared_ one! -- This way we avoid the possibility that "as" has arguments -- to parameters in it, but only to indices. -- Also TODO: Make sure that parameters are equal in above conversion check! _ → return ev-err _ → return ev-err ) ctxt-mu-decls : ctxt → term → indices → type → datatype-info → posinfo → posinfo → posinfo → var → (cases → spanM ⊤) × ctxt × 𝕃 tagged-val × renamectxt × (ctxt → term → type → term) × (ctxt → type → kind → type) ctxt-mu-decls Γ t is Tₘ (mk-data-info X Xₒ asₚ asᵢ ps kᵢ k cs csₚₛ eds gds) pi₁ pi₂ pi₃ x = let X' = mu-Type/ x xₘᵤ = mu-isType/ x qXₘᵤ = data-Is/ X qXₜₒ = data-to/ X qX' = pi₁ % X' qxₘᵤ = pi₁ % xₘᵤ qx = pi₁ % x Tₘᵤ = TpAppTp (flip apps-type asₚ $ TpVar qXₘᵤ) $ TpVar qX' Γ' = ctxt-term-def pi₁ localScope opacity-open xₘᵤ nothing Tₘᵤ $ ctxt-datatype-decl X qx asₚ $ ctxt-type-decl pi₁ X' k Γ freshₓ = fresh-var (add-indices-to-ctxt is Γ') (maybe-else "x" id (is-var (Ttm t))) Tₓ = hnf Γ' unfold-no-defs (indices-to-alls is $ TpAbs ff freshₓ (Tkt $ indices-to-tpapps is $ TpVar qX') $ TpAppTm (indices-to-tpapps is Tₘ) $ Phi (Beta (Var freshₓ) (Var freshₓ)) (App (indices-to-apps is $ AppEr (AppTp (flip apps-term asₚ $ Var qXₜₒ) $ TpVar qX') $ Var qxₘᵤ) $ Var freshₓ) (Var freshₓ)) Γ'' = ctxt-term-decl pi₁ x Tₓ Γ' e₂? = unless (X =string Xₒ) "Abstract datatypes can only be pattern matched by σ" e₃ = λ x → just $ x ^ " occurs free in the erasure of the body (not allowed)" cs-fvs = stringset-contains ∘' free-vars-cases ∘' erase-cases e₃ₓ? = λ cs x → ifMaybe (cs-fvs cs x) $ e₃ x e₃? = λ cs → e₃ₓ? cs (mu-isType/ x) ||-maybe e₃ₓ? cs (mu-Type/ x) in (λ cs → [- var-span NotErased Γ'' pi₁ x checking (Tkt Tₓ) (e₂? ||-maybe e₃? cs) -] spanMok) , Γ'' , (binder-data Γ'' pi₁ X' (Tkk k) Erased nothing pi₂ pi₃ :: binder-data Γ'' pi₁ xₘᵤ (Tkt Tₘᵤ) Erased nothing pi₂ pi₃ :: binder-data Γ'' pi₁ x (Tkt Tₓ) NotErased nothing pi₂ pi₃ :: to-string-tag X' Γ'' k :: to-string-tag xₘᵤ Γ'' Tₘᵤ :: to-string-tag x Γ'' Tₓ :: []) , renamectxt-insert* empty-renamectxt ((qX' , X') :: (qxₘᵤ , xₘᵤ) :: (qx , x) :: []) , let cg = qX' , recompose-tpapps (args-to-tmtps asₚ) (TpVar qx) , AppEr (AppTp (recompose-apps asₚ (Var qXₜₒ)) (TpVar qX')) (Var qxₘᵤ) in flip (mk-ctr-fmap-η? ff ∘ ctxt-datatype-undef qX') cg , flip (mk-ctr-fmapₖ-η? ff ∘ ctxt-datatype-undef qX') cg check-mu Γ pi pi' x t Tₘ? pi'' cs pi''' Tₑ? = check-term Γ t nothing >>=c λ t~ T → let no-motive-err = just "A motive is required when synthesizing" no-motive = return (nothing , [] , no-motive-err) in case decompose-tpapps (hnf Γ unfold-head-elab T) of λ where (TpVar X , as) → get-datatype-info-from-head-type Γ X as on-fail (uncurry λ e tvs → spanM-add (Mu-span Γ pi pi''' nothing (maybe-to-checking Tₑ?) (expected-type-if Γ Tₑ? ++ tvs) $ just e) >> return-when {m = Tₑ?} (Hole pi) (TpHole pi)) >>=s λ where (d @ (mk-data-info Xₒ _ asₚ asᵢ ps kᵢ k cs' csₚₛ eds gds)) → let Rₓ = mu-Type/ x; qRₓ = pi' % Rₓ Γₘ = data-highlight (ctxt-type-decl pi' Rₓ k Γ) qRₓ ρₘ = subst Γₘ (recompose-tpapps (args-to-tmtps asₚ) (TpVar Xₒ)) qRₓ ρₘ' = subst Γₘ (TpVar Rₓ) qRₓ eₘ = λ Tₘ → when (negₒ (extract-pos (positivity.type+ qRₓ Γₘ (hnf-ctr Γₘ qRₓ Tₘ)))) (Rₓ ^ " occurs negatively in the motive") in maybe-map (λ Tₘ → check-type Γₘ Tₘ (just kᵢ)) Tₘ? >>=? λ Tₘ?' → let is = kind-to-indices Γ kᵢ eₘ = Tₘ?' >>= eₘ ret-tp = λ ps as t → maybe-else' Tₘ?' Tₑ? (λ Tₘ → just $ hnf Γ unfold-head-elab (TpAppTm (apps-type (ρₘ Tₘ) $ tmtps-to-args NotErased (drop (length ps) as)) t)) in (maybe-else' Tₘ?' (return Tₑ? on-fail no-motive >>=m λ Tₑ → let Tₘ = refine-motive Γ is (asᵢ ++ [ Ttm t~ ]) Tₑ in check-refinement Γ Tₘ kᵢ >>=c λ Tₘ → return2 (just Tₘ)) λ Tₘ → return (just Tₘ , [] , nothing)) >>=c λ Tₘ → uncurry λ tvs₁ e₁ → let Tₘ = maybe-else' Tₘ (TpHole pi) id is = drop-last 1 is reduce-cs = map λ {(Ctr x T) → Ctr x $ hnf Γ unfold-no-defs T} fcs = λ y → inst-ctrs Γ ps asₚ (map-snd (rename-var {TYPE} Γ Xₒ y) <$> cs') cs' = reduce-cs $ fcs (mu-Type/ (pi' % x)) in case (ctxt-mu-decls Γ t~ is Tₘ d pi' pi'' pi''' x) of λ where (sm , Γ' , bds , ρ , cast-tm , cast-tp) → let cs'' = foldl (λ {(Ctr x T) σ → trie-insert σ x T}) empty-trie cs' drop-ps = 0 scrutinee = t~ Tᵣ = ret-tp ps (args-to-tmtps asₚ ++ asᵢ) scrutinee in check-cases Γ' cs Xₒ cs'' ρ asₚ drop-ps Tₘ cast-tm cast-tp >>=c λ cs~ e₂ → let e₃ = maybe-else' Tᵣ (just "A motive is required when synthesizing") (check-for-type-mismatch-if Γ "synthesized" Tₑ?) in [- Mu-span Γ pi pi''' Tₘ?' (maybe-to-checking Tₑ?) (expected-type-if Γ Tₑ? ++ maybe-else' Tᵣ [] (λ Tᵣ → [ type-data Γ Tᵣ ]) ++ tvs₁ ++ bds) (e₁ ||-maybe (e₂ ||-maybe (e₃ ||-maybe eₘ))) -] sm cs~ >> return-when {m = Tₑ?} (subst-renamectxt Γ ρ (Mu x t~ (just (ρₘ' Tₘ)) d cs~)) (maybe-else' Tᵣ (TpHole pi) id) (Tₕ , as) → [- Mu-span Γ pi pi''' nothing (maybe-to-checking Tₑ?) [ head-type Γ Tₕ ] (just "The head type of the subterm is not a datatype") -] return-when {m = Tₑ?} (Hole pi) (TpHole pi) check-sigma Γ pi t? t Tₘ? pi'' cs pi''' Tₑ? = check-term Γ t nothing >>=c λ t~ T → let no-motive-err = just "A motive is required when synthesizing" no-motive = return (nothing , [] , no-motive-err) in case decompose-tpapps (hnf Γ unfold-head-elab T) of λ where (TpVar X , as) → check-sigma-evidence Γ t? X as on-fail (uncurry λ e tvs → spanM-add (Sigma-span Γ pi pi''' nothing (maybe-to-checking Tₑ?) (expected-type-if Γ Tₑ? ++ tvs) $ just e) >> return-when {m = Tₑ?} (Hole pi) (TpHole pi)) >>=s λ where (tₑ~ , cast , d @ (mk-data-info Xₒ _ asₚ asᵢ ps kᵢ k cs' csₚₛ eds gds)) → maybe-map (λ Tₘ → check-type Γ Tₘ (just kᵢ)) Tₘ? >>=? λ Tₘ?' → let is = kind-to-indices Γ kᵢ ret-tp = λ ps as t → maybe-else' Tₘ?' Tₑ? (λ Tₘ → just $ hnf Γ unfold-head-elab (TpAppTm (apps-type Tₘ $ tmtps-to-args NotErased (drop (length ps) as)) t)) in (maybe-else' Tₘ?' (return Tₑ? on-fail no-motive >>=m λ Tₑ → let Tₘ = refine-motive Γ is (asᵢ ++ [ Ttm t~ ]) Tₑ in check-refinement Γ Tₘ kᵢ >>=c λ Tₘ → return2 (just Tₘ)) λ Tₘ → return (just Tₘ , [] , nothing)) >>=c λ Tₘ → uncurry λ tvs₁ e₁ → let Tₘ = maybe-else' Tₘ (TpHole pi) id reduce-cs = map λ {(Ctr x T) → Ctr x $ hnf Γ unfold-no-defs T} fcs = λ y → inst-ctrs Γ ps asₚ (map-snd (rename-var {TYPE} Γ Xₒ y) <$> cs') cs' = reduce-cs $ if Xₒ =string X then csₚₛ else fcs X in let sm = const spanMok ρ = empty-renamectxt cast-tm = (λ Γ t T → t) cast-tp = (λ Γ T k → T) cs'' = foldl (λ {(Ctr x T) σ → trie-insert σ x T}) empty-trie cs' drop-ps = maybe-else 0 length (when (Xₒ =string X) ps) scrutinee = cast t~ Tᵣ = ret-tp ps (args-to-tmtps asₚ ++ asᵢ) scrutinee in check-cases Γ cs Xₒ cs'' ρ asₚ drop-ps Tₘ cast-tm cast-tp >>=c λ cs~ e₂ → let e₃ = maybe-else' Tᵣ (just "A motive is required when synthesizing") (check-for-type-mismatch-if Γ "synthesized" Tₑ?) in [- Sigma-span Γ pi pi''' Tₘ?' (maybe-to-checking Tₑ?) (expected-type-if Γ Tₑ? ++ maybe-else' Tᵣ [] (λ Tᵣ → [ type-data Γ Tᵣ ]) ++ tvs₁) (e₁ ||-maybe (e₂ ||-maybe e₃)) -] sm cs~ >> return-when {m = Tₑ?} (subst-renamectxt Γ ρ (Sigma (just tₑ~) t~ (just Tₘ) d cs~)) (maybe-else' Tᵣ (TpHole pi) id) (Tₕ , as) → [- Sigma-span Γ pi pi''' nothing (maybe-to-checking Tₑ?) [ head-type Γ Tₕ ] (just "The head type of the subterm is not a datatype") -] return-when {m = Tₑ?} (Hole pi) (TpHole pi)
tools/SPARK2005/examples/erfRiemann/tutorial-steps/01-noSPARK/riemann.ads
michalkonecny/polypaver
1
3725
<filename>tools/SPARK2005/examples/erfRiemann/tutorial-steps/01-noSPARK/riemann.ads package Riemann is -- An approximation of the function erf(x)*pi/2, which is equal -- to the integral \int_0^x(e^(-t^2))dt. This integral does not -- have a closed algebraic solution. This function uses a simple -- Riemann sum to approximate the integral. -- -- The parameter n determines the number of segments to be used in the -- partition of equal size. There are 2^n segments. function erf_Riemann(x : Float; n : Integer) return Float; end Riemann;
src/asm/pre.asm
GeekJoystick/mmagedit
9
241995
<reponame>GeekJoystick/mmagedit ifdef USEBASE INCLUDE "inc-base.asm" else INCNES "base.nes" endif ; ignore the base while generating the patch. CLEARPATCH ; macros SEEK EQU SEEKABS SKIP EQU SKIPREL MACRO SUPPRESS ENUM $ ENDM ENDSUPPRESS EQU ENDE MACRO SKIPTO pos if ($ >= 0) SKIP pos - $ ; just to be safe. if ($ != pos) ERROR "failed to skipto." endif endif ENDM FROM EQU SKIPTO MACRO BANK bank SEEK (bank * $4000) + $10 ENDM IFDEF UNITILE PLACE_OBJECTS=1 ENDIF
libpal/intel_64bit_systemv_nasm/rdmsr.asm
mars-research/pal
26
168110
bits 64 default rel section .text global pal_execute_rdmsr pal_execute_rdmsr : mov rcx, rdi rdmsr shl rdx, 32 or rax, rdx ret
RecursiveTypes/Subtyping/Axiomatic/Incorrect.agda
nad/codata
1
15273
<filename>RecursiveTypes/Subtyping/Axiomatic/Incorrect.agda ------------------------------------------------------------------------ -- Incorrect coinductive axiomatisation of subtyping ------------------------------------------------------------------------ -- This module shows that if we remove transitivity from -- RecursiveTypes.Subtyping.Axiomatic.Coinductive._≤_, and take the -- transitive closure of the resulting relation, then we get a weaker -- (less defined) relation than the one we started with. module RecursiveTypes.Subtyping.Axiomatic.Incorrect where open import Codata.Musical.Notation open import Data.Fin using (Fin; zero; suc) open import Function using (id; _$_) open import Data.Nat using (ℕ; zero; suc; z≤n; s≤s; ≤′-refl) renaming (_≤_ to _≤ℕ_) open import Data.Nat.Induction open import Data.Nat.Properties using (≤-step; ≤⇒≤′) open import Data.Product as Prod open import Relation.Binary.PropositionalEquality open import Relation.Nullary open import RecursiveTypes.Syntax hiding (_≲_) open import RecursiveTypes.Substitution using (_[0≔_]; unfold[μ_⟶_]) open import RecursiveTypes.Subtyping.Semantic.Coinductive as Sem using (_≤Coind_; ⊥; ⊤; _⟶_) ------------------------------------------------------------------------ -- The alternative "subtyping" relation infixr 10 _⟶_ infix 4 _≤_ _≤′_ infixr 2 _≤⟨_⟩_ infix 2 _∎ -- A definition which does not include a transitivity constructor. data _≤′_ {n} : Ty n → Ty n → Set where ⊥ : ∀ {τ} → ⊥ ≤′ τ ⊤ : ∀ {σ} → σ ≤′ ⊤ _⟶_ : ∀ {σ₁ σ₂ τ₁ τ₂} (τ₁≤′σ₁ : ∞ (τ₁ ≤′ σ₁)) (σ₂≤′τ₂ : ∞ (σ₂ ≤′ τ₂)) → σ₁ ⟶ σ₂ ≤′ τ₁ ⟶ τ₂ unfold : ∀ {τ₁ τ₂} → μ τ₁ ⟶ τ₂ ≤′ unfold[μ τ₁ ⟶ τ₂ ] fold : ∀ {τ₁ τ₂} → unfold[μ τ₁ ⟶ τ₂ ] ≤′ μ τ₁ ⟶ τ₂ _∎ : ∀ τ → τ ≤′ τ -- The transitive closure of this relation. data _≤_ {n} : Ty n → Ty n → Set where include : ∀ {σ τ} (σ≤τ : σ ≤′ τ) → σ ≤ τ _≤⟨_⟩_ : ∀ τ₁ {τ₂ τ₃} (τ₁≤τ₂ : τ₁ ≤ τ₂) (τ₂≤τ₃ : τ₂ ≤ τ₃) → τ₁ ≤ τ₃ ------------------------------------------------------------------------ -- Some types used in counterexamples below σ : Ty zero σ = μ ⊤ ⟶ var zero τ : Ty zero τ = μ ⊥ ⟶ var zero σ≤τ : σ ≤Coind τ σ≤τ = ♯ ⊥ ⟶ ♯ σ≤τ ------------------------------------------------------------------------ -- Soundness and incompleteness of _≤′_ sound′ : ∀ {n} {σ τ : Ty n} → σ ≤′ τ → σ ≤Coind τ sound′ ⊥ = ⊥ sound′ ⊤ = ⊤ sound′ (τ₁≤σ₁ ⟶ σ₂≤τ₂) = ♯ sound′ (♭ τ₁≤σ₁) ⟶ ♯ sound′ (♭ σ₂≤τ₂) sound′ unfold = Sem.unfold sound′ fold = Sem.fold sound′ (τ ∎) = Sem.refl∞ _ incomplete′ : ¬ (∀ {n} {σ τ : Ty n} → σ ≤Coind τ → σ ≤′ τ) incomplete′ hyp with hyp {σ = σ} {τ = τ} σ≤τ ... | () ------------------------------------------------------------------------ -- Soundness of _≤_ sound : ∀ {n} {σ τ : Ty n} → σ ≤ τ → σ ≤Coind τ sound (τ₁ ≤⟨ τ₁≤τ₂ ⟩ τ₂≤τ₃) = Sem.trans (sound τ₁≤τ₂) (sound τ₂≤τ₃) sound (include σ≤τ) = sound′ σ≤τ ------------------------------------------------------------------------ -- An alternative definition of the transitive closure of _≤′_ infixr 5 _∷_ infix 4 _≲_ data _≲_ {n} : Ty n → Ty n → Set where [_] : ∀ {σ τ} (σ≤τ : σ ≤′ τ) → σ ≲ τ _∷_ : ∀ {τ₁ τ₂ τ₃} (τ₁≤τ₂ : τ₁ ≤′ τ₂) (τ₂≲τ₃ : τ₂ ≲ τ₃) → τ₁ ≲ τ₃ -- This definition is transitive. _++_ : ∀ {n} {τ₁ τ₂ τ₃ : Ty n} → τ₁ ≲ τ₂ → τ₂ ≲ τ₃ → τ₁ ≲ τ₃ [ τ₁≤τ₂ ] ++ τ₂≤τ₃ = τ₁≤τ₂ ∷ τ₂≤τ₃ (τ₁≤τ₂ ∷ τ₂≤τ₃) ++ τ₃≤τ₄ = τ₁≤τ₂ ∷ (τ₂≤τ₃ ++ τ₃≤τ₄) -- Hence it is complete with respect to the one above. ≲-complete : ∀ {n} {σ τ : Ty n} → σ ≤ τ → σ ≲ τ ≲-complete (include σ≤τ) = [ σ≤τ ] ≲-complete (τ₁ ≤⟨ τ₁≤τ₂ ⟩ τ₂≤τ₃) = ≲-complete τ₁≤τ₂ ++ ≲-complete τ₂≤τ₃ -- It is also sound. ≲-sound : ∀ {n} {σ τ : Ty n} → σ ≲ τ → σ ≤ τ ≲-sound [ σ≤τ ] = include σ≤τ ≲-sound (τ₁≤τ₂ ∷ τ₂≲τ₃) = _ ≤⟨ include τ₁≤τ₂ ⟩ ≲-sound τ₂≲τ₃ -- The number of uses of transitivity in the proof. length : ∀ {n} {σ τ : Ty n} → σ ≲ τ → ℕ length [ σ≤τ ] = 0 length (τ₁≤τ₂ ∷ τ₂≲τ₃) = suc (length τ₂≲τ₃) ------------------------------------------------------------------------ -- Given proofs of certain statements one can extract shorter or -- equally long proofs for related statements mutual codomain-⟶μ : ∀ {n} {σ₁ σ₂ : Ty n} {τ₁ τ₂} → (σ₁⟶σ₂≲μτ₁⟶τ₂ : σ₁ ⟶ σ₂ ≲ μ τ₁ ⟶ τ₂) → ∃ λ (σ₂≲τ₂′ : σ₂ ≲ τ₂ [0≔ μ τ₁ ⟶ τ₂ ]) → length σ₂≲τ₂′ ≤ℕ length σ₁⟶σ₂≲μτ₁⟶τ₂ codomain-⟶μ [ fold ] = ([ _ ∎ ] , z≤n) codomain-⟶μ (τ₁≤′σ₁ ⟶ σ₂≤′τ₂ ∷ τ₂≲τ₃) = Prod.map (_∷_ (♭ σ₂≤′τ₂)) s≤s (codomain-⟶μ τ₂≲τ₃) codomain-⟶μ (fold ∷ τ₂≲τ₃) = Prod.map id ≤-step (codomain-μμ τ₂≲τ₃) codomain-⟶μ ((._ ∎) ∷ τ₂≲τ₃) = Prod.map id ≤-step (codomain-⟶μ τ₂≲τ₃) codomain-⟶μ (⊤ ∷ τ₂≲τ₃) with sound (≲-sound τ₂≲τ₃) ... | () codomain-μμ : ∀ {n} {σ₁ σ₂ τ₁ τ₂ : Ty (suc n)} → (μσ₁⟶σ₂≲μτ₁⟶τ₂ : μ σ₁ ⟶ σ₂ ≲ μ τ₁ ⟶ τ₂) → ∃ λ (σ₂′≲τ₂′ : σ₂ [0≔ μ σ₁ ⟶ σ₂ ] ≲ τ₂ [0≔ μ τ₁ ⟶ τ₂ ]) → length σ₂′≲τ₂′ ≤ℕ length μσ₁⟶σ₂≲μτ₁⟶τ₂ codomain-μμ [ ._ ∎ ] = ([ _ ∎ ] , z≤n) codomain-μμ (unfold ∷ τ₂≲τ₃) = Prod.map id ≤-step (codomain-⟶μ τ₂≲τ₃) codomain-μμ ((._ ∎) ∷ τ₂≲τ₃) = Prod.map id ≤-step (codomain-μμ τ₂≲τ₃) codomain-μμ (⊤ ∷ τ₂≲τ₃) with sound (≲-sound τ₂≲τ₃) ... | () ------------------------------------------------------------------------ -- Incompleteness of _≤_ incomplete : ¬ (∀ {n} {σ τ : Ty n} → σ ≤Coind τ → σ ≤ τ) incomplete hyp = σ≴τ $ ≲-complete $ hyp σ≤τ where σ≴τ : ¬ σ ≲ τ σ≴τ σ≲τ = <′-rec Pred ≴ _ σ≲τ refl where Pred : ℕ → Set Pred n = (σ≲τ : σ ≲ τ) → length σ≲τ ≢ n ≴ : ∀ n → <′-Rec Pred n → Pred n ≴ n rec [ () ] _ ≴ ._ rec ((._ ∎) ∷ τ₂≲τ₃) refl = rec _ ≤′-refl τ₂≲τ₃ refl ≴ ._ rec (unfold ∷ τ₂≲τ₃) refl with codomain-⟶μ τ₂≲τ₃ ... | (τ₂≲τ₃′ , not-longer) = rec _ (≤⇒≤′ $ s≤s not-longer) τ₂≲τ₃′ refl ≴ n rec (⊤ ∷ τ₂≲τ₃) _ with sound (≲-sound τ₂≲τ₃) ... | ()
alloy4fun_models/trashltl/models/11/EkaLQCSo8DyREZ5j8.als
Kaixi26/org.alloytools.alloy
0
1772
open main pred idEkaLQCSo8DyREZ5j8_prop12 { all f : File | eventually f in Trash implies always f in Trash } pred __repair { idEkaLQCSo8DyREZ5j8_prop12 } check __repair { idEkaLQCSo8DyREZ5j8_prop12 <=> prop12o }
software/obsolete/new-rom/stream.asm
Noah1989/micro-21
1
247292
<filename>software/obsolete/new-rom/stream.asm<gh_stars>1-10 public stream_IX_seek_BCDE public stream_IX_get_byte_A public stream_IX_put_byte_A public stream_IX_read_block_DE_len_BC public stream_IX_read_block_DE_len_BC_bytewise public stream_IX_write_block_DE_len_BC public stream_IX_write_block_DE_len_BC_bytewise public stream_IX_skip_bytes_BC include "stream.inc" stream_IX_get_byte_A: LD L, (IX+stream_get_byte_A) LD H, (IX+stream_get_byte_A+1) JP (HL) stream_IX_put_byte_A: LD L, (IX+stream_put_byte_A) LD H, (IX+stream_put_byte_A+1) JP (HL) stream_IX_read_block_DE_len_BC: LD L, (IX+stream_read_block_DE_len_BC) LD H, (IX+stream_read_block_DE_len_BC+1) JP (HL) stream_IX_write_block_DE_len_BC: LD L, (IX+stream_write_block_DE_len_BC) LD H, (IX+stream_write_block_DE_len_BC+1) JP (HL) stream_IX_skip_bytes_BC: LD L, (IX+stream_skip_bytes_BC) LD H, (IX+stream_skip_bytes_BC+1) JP (HL) stream_IX_seek_BCDE: LD L, (IX+stream_seek_BCDE) LD H, (IX+stream_seek_BCDE+1) JP (HL) stream_IX_read_block_DE_len_BC_bytewise: PUSH BC PUSH DE CALL stream_IX_get_byte_A POP DE POP BC LD (DE), A INC DE DEC BC LD A, B OR A, C JR NZ, stream_IX_read_block_DE_len_BC_bytewise RET stream_IX_write_block_DE_len_BC_bytewise: LD A, (DE) INC DE PUSH BC PUSH DE CALL stream_IX_put_byte_A POP DE POP BC DEC BC LD A, B OR A, C JR NZ, stream_IX_write_block_DE_len_BC_bytewise RET
Engine/WLE_Decode.asm
gbcompo21/ReboundGB
2
10440
<filename>Engine/WLE_Decode.asm DecodeWLE: ; Walle Length Encoding decoder ld c,0 DecodeWLELoop: ld a,[hl+] ld b,a and $c0 jr z,.literal cp $40 jr z,.repeat cp $80 jr z,.increment .copy ld a,b inc b ret z and $3f inc a ld b,a ld a,[hl+] push hl ld l,a ld a,e scf sbc l ld l,a ld a,d sbc 0 ld h,a call _CopyRAMSmall pop hl jr DecodeWLELoop .literal ld a,b and $1f bit 5,b ld b,a jr nz,.longl inc b call _CopyRAMSmall jr DecodeWLELoop .longl push bc ld a,[hl+] ld c,a inc bc call _CopyRAM pop bc jr DecodeWLELoop .repeat call .repeatIncrementCommon .loopr ld [de],a inc de dec b jr nz,.loopr jr DecodeWLELoop .increment call .repeatIncrementCommon .loopi ld [de],a inc de inc a dec b jr nz,.loopi ld c,a jr DecodeWLELoop .repeatIncrementCommon bit 5,b jr z,.nonewr ld c,[hl] inc hl .nonewr ld a,b and $1f inc a ld b,a ld a,c ret
courses/spark_for_ada_programmers/labs/answers/160_interfacing/counter.adb
AdaCore/training_material
15
10777
<filename>courses/spark_for_ada_programmers/labs/answers/160_interfacing/counter.adb with System.Storage_Elements; package body Counter with SPARK_Mode is procedure Bump_And_Monitor (Alarm : out Boolean) is Calc : Integer; begin Calc := Port; Alarm := Limit < Calc; end Bump_And_Monitor; end Counter;
ArmPkg/Library/ArmLib/Arm/ArmV7ArchTimerSupport.asm
KaoTuz/edk2-stable202108
9
84582
//------------------------------------------------------------------------------ // // Copyright (c) 2011, ARM Limited. All rights reserved. // // SPDX-License-Identifier: BSD-2-Clause-Patent // //------------------------------------------------------------------------------ INCLUDE AsmMacroExport.inc PRESERVE8 RVCT_ASM_EXPORT ArmReadCntFrq mrc p15, 0, r0, c14, c0, 0 ; Read CNTFRQ bx lr RVCT_ASM_EXPORT ArmWriteCntFrq mcr p15, 0, r0, c14, c0, 0 ; Write to CNTFRQ bx lr RVCT_ASM_EXPORT ArmReadCntPct mrrc p15, 0, r0, r1, c14 ; Read CNTPT (Physical counter register) bx lr RVCT_ASM_EXPORT ArmReadCntkCtl mrc p15, 0, r0, c14, c1, 0 ; Read CNTK_CTL (Timer PL1 Control Register) bx lr RVCT_ASM_EXPORT ArmWriteCntkCtl mcr p15, 0, r0, c14, c1, 0 ; Write to CNTK_CTL (Timer PL1 Control Register) bx lr RVCT_ASM_EXPORT ArmReadCntpTval mrc p15, 0, r0, c14, c2, 0 ; Read CNTP_TVAL (PL1 physical timer value register) bx lr RVCT_ASM_EXPORT ArmWriteCntpTval mcr p15, 0, r0, c14, c2, 0 ; Write to CNTP_TVAL (PL1 physical timer value register) bx lr RVCT_ASM_EXPORT ArmReadCntpCtl mrc p15, 0, r0, c14, c2, 1 ; Read CNTP_CTL (PL1 Physical Timer Control Register) bx lr RVCT_ASM_EXPORT ArmWriteCntpCtl mcr p15, 0, r0, c14, c2, 1 ; Write to CNTP_CTL (PL1 Physical Timer Control Register) bx lr RVCT_ASM_EXPORT ArmReadCntvTval mrc p15, 0, r0, c14, c3, 0 ; Read CNTV_TVAL (Virtual Timer Value register) bx lr RVCT_ASM_EXPORT ArmWriteCntvTval mcr p15, 0, r0, c14, c3, 0 ; Write to CNTV_TVAL (Virtual Timer Value register) bx lr RVCT_ASM_EXPORT ArmReadCntvCtl mrc p15, 0, r0, c14, c3, 1 ; Read CNTV_CTL (Virtual Timer Control Register) bx lr RVCT_ASM_EXPORT ArmWriteCntvCtl mcr p15, 0, r0, c14, c3, 1 ; Write to CNTV_CTL (Virtual Timer Control Register) bx lr RVCT_ASM_EXPORT ArmReadCntvCt mrrc p15, 1, r0, r1, c14 ; Read CNTVCT (Virtual Count Register) bx lr RVCT_ASM_EXPORT ArmReadCntpCval mrrc p15, 2, r0, r1, c14 ; Read CNTP_CTVAL (Physical Timer Compare Value Register) bx lr RVCT_ASM_EXPORT ArmWriteCntpCval mcrr p15, 2, r0, r1, c14 ; Write to CNTP_CTVAL (Physical Timer Compare Value Register) bx lr RVCT_ASM_EXPORT ArmReadCntvCval mrrc p15, 3, r0, r1, c14 ; Read CNTV_CTVAL (Virtual Timer Compare Value Register) bx lr RVCT_ASM_EXPORT ArmWriteCntvCval mcrr p15, 3, r0, r1, c14 ; write to CNTV_CTVAL (Virtual Timer Compare Value Register) bx lr RVCT_ASM_EXPORT ArmReadCntvOff mrrc p15, 4, r0, r1, c14 ; Read CNTVOFF (virtual Offset register) bx lr RVCT_ASM_EXPORT ArmWriteCntvOff mcrr p15, 4, r0, r1, c14 ; Write to CNTVOFF (Virtual Offset register) bx lr END
drivers/forward_ad-dynamics.adb
sciencylab/lagrangian-solver
0
14527
with Numerics, Ada.Text_IO, Forward_AD.Integrator; use Numerics, Ada.Text_IO, Forward_AD.Integrator; procedure Forward_AD.Dynamics is use Real_IO, Int_IO; -- Set Up Parameters ----------------- N : constant Nat := 2; Control : Control_Type (N => N); ------------------------------- --- Set up Hamiltonian ----- function Hamiltonian (X : in Real_Array; N : in Nat) return AD_Type is H : AD_Type := Zero (X'Length); Q : AD_Vector := Var (X (1 .. N), 2 * N, 1); P : AD_Vector := Var (X (N + 1 .. 2 * N), 2 * N, N + 1); Z : AD_Type; begin for I in 1 .. N loop H := H + 0.5 * P (I) ** 2; end loop; for I in 1 .. N - 1 loop Z := Q (I + 1) - Q (I); H := H + 0.5 * (Z ** 2); end loop; return H; end Hamiltonian; ------------------------------- -- Initial Conditions ---- Var : Variable := (N2 => 2 * N, X => 40.0 * Rand (2 * N), T => 0.0); X : Real_Array renames Var.X; T : Real renames Var.T; ------------------------------- begin -- Put (T, Fore => 3, Exp => 0, Aft => 3); Put (" "); -- Put (Control.Dt); Put (" "); -- Put (Val (Hamiltonian (X, N))); New_Line; for Iter in 1 .. 4 loop for Iter2 in 1 .. 1000 loop Update (Hamiltonian'Access, Var, Control); end loop; -- Put (T, Fore => 3, Exp => 0, Aft => 3); Put (" "); -- Put (Control.Dt); Put (" "); -- Put (Val (Hamiltonian (X, N))); New_Line; end loop; null; -- Put_Line ("--------------------------------"); -- for K in X'Range loop -- Put (X (K), Exp => 0, Aft => 3); New_Line; -- end loop; end Forward_AD.Dynamics;
msx/tools/xmodem.retired/sio.asm
zoggins/yellow-msx-series-for-rc2014
19
86588
<reponame>zoggins/yellow-msx-series-for-rc2014<gh_stars>10-100 SIO_RCBBYT: LD HL, SIO_RCVBUF ; SET HL TO DI ; AVOID COLLISION WITH INT HANDLER LD A, (HL) ; GET COUNT DEC A ; DECREMENT COUNT LD (HL), A ; SAVE UPDATED COUNT CP 0 ; BUFFER LOW THRESHOLD JR NZ, SIO_IN1 ; IF NOT, BYPASS SETTING RTS LD A, 5 ; RTS IS IN WR5 OUT (CMD_CH), A ; ADDRESS WR5 LD A, SIO_RTSON ; VALUE TO SET RTS OUT (CMD_CH), A ; DO IT LD A, 255 LD (SIO_RTS), A SIO_IN1: INC HL INC HL INC HL ; HL NOW HAS ADR OF TAIL PTR PUSH HL ; SAVE ADR OF TAIL PTR LD A, (HL) ; DEREFERENCE HL INC HL LD H, (HL) LD L, A ; HL IS NOW ACTUAL TAIL PTR LD C, (HL) ; C := CHAR TO BE RETURNED INC HL ; BUMP TAIL PTR POP DE ; RECOVER ADR OF TAIL PTR LD A, L ; GET LOW BYTE OF TAIL PTR SUB SIO_BUFSZ+2 ; SUBTRACT SIZE OF BUFFER AND POINTER CP E ; IF EQUAL TO START, TAIL PTR IS PAST BUF END JR NZ, SIO_IN2 ; IF NOT, BYPASS LD H, D ; SET HL TO LD L, E ; ... TAIL PTR ADR INC HL ; BUMP PAST TAIL PTR INC HL ; ... SO HL NOW HAS ADR OF ACTUAL BUFFER START SIO_IN2: EX DE, HL ; DE := TAIL PTR VAL, HL := ADR OF TAIL PTR LD (HL), E ; SAVE UPDATED TAIL PTR INC HL LD (HL), D EI ; INTERRUPTS OK AGAIN LD A, C ; MOVE CHAR TO RETURN TO A OR A RET
Sets/CantorBijection/Order.agda
Smaug123/agdaproofs
4
1645
<reponame>Smaug123/agdaproofs<gh_stars>1-10 {-# OPTIONS --safe --warning=error --without-K #-} open import LogicalFormulae open import Functions.Definition open import Numbers.Naturals.Semiring open import Numbers.Naturals.Order open import Numbers.Naturals.Order.WellFounded open import Semirings.Definition open import Orders.Total.Definition open import Orders.Partial.Definition open import Orders.WellFounded.Definition open import Orders.WellFounded.Induction module Sets.CantorBijection.Order where order : Rel (ℕ && ℕ) order (a ,, b) (c ,, d) = ((a +N b) <N (c +N d)) || (((a +N b) ≡ (c +N d)) && (b <N d)) totalOrder : TotalOrder (ℕ && ℕ) PartialOrder._<_ (TotalOrder.order totalOrder) = order PartialOrder.irreflexive (TotalOrder.order totalOrder) {fst ,, snd} (inl x) = exFalso (TotalOrder.irreflexive ℕTotalOrder x) PartialOrder.irreflexive (TotalOrder.order totalOrder) {fst ,, snd} (inr (_ ,, p)) = exFalso (TotalOrder.irreflexive ℕTotalOrder p) PartialOrder.<Transitive (TotalOrder.order totalOrder) {x1 ,, x2} {y1 ,, y2} {z1 ,, z2} (inl pr1) (inl pr2) = inl (TotalOrder.<Transitive ℕTotalOrder pr1 pr2) PartialOrder.<Transitive (TotalOrder.order totalOrder) {x1 ,, x2} {y1 ,, y2} {z1 ,, z2} (inl pr1) (inr (f1 ,, f2)) = inl (identityOfIndiscernablesRight _<N_ pr1 f1) PartialOrder.<Transitive (TotalOrder.order totalOrder) {x1 ,, x2} {y1 ,, y2} {z1 ,, z2} (inr (f1 ,, f2)) (inl x) = inl (identityOfIndiscernablesLeft _<N_ x (equalityCommutative f1)) PartialOrder.<Transitive (TotalOrder.order totalOrder) {x1 ,, x2} {y1 ,, y2} {z1 ,, z2} (inr (f1 ,, f2)) (inr (fst ,, snd)) = inr (transitivity f1 fst ,, TotalOrder.<Transitive ℕTotalOrder f2 snd) TotalOrder.totality totalOrder (a ,, b) (c ,, d) with TotalOrder.totality ℕTotalOrder (a +N b) (c +N d) TotalOrder.totality totalOrder (a ,, b) (c ,, d) | inl (inl x) = inl (inl (inl x)) TotalOrder.totality totalOrder (a ,, b) (c ,, d) | inl (inr x) = inl (inr (inl x)) TotalOrder.totality totalOrder (a ,, b) (c ,, d) | inr eq with TotalOrder.totality ℕTotalOrder b d TotalOrder.totality totalOrder (a ,, b) (c ,, d) | inr eq | inl (inl x) = inl (inl (inr (eq ,, x))) TotalOrder.totality totalOrder (a ,, b) (c ,, d) | inr eq | inl (inr x) = inl (inr (inr (equalityCommutative eq ,, x))) TotalOrder.totality totalOrder (a ,, b) (c ,, .b) | inr eq | inr refl rewrite canSubtractFromEqualityRight {a} {b} {c} eq = inr refl leastElement : {y : ℕ && ℕ} → order y (0 ,, 0) → False leastElement {zero ,, b} (inl ()) leastElement {zero ,, b} (inr ()) leastElement {succ a ,, b} (inl ()) leastElement {succ a ,, b} (inr ()) mustDescend : (a b t : ℕ) → order (a ,, b) (t ,, zero) → a +N b <N t mustDescend a b zero ord = exFalso (leastElement ord) mustDescend a b (succ t) (inl x) rewrite Semiring.sumZeroRight ℕSemiring t = x orderWellfounded : WellFounded order orderWellfounded (a ,, b) = access (go b a) where g0 : (c : ℕ) (y : ℕ && ℕ) → order y (c ,, 0) → Accessible order y -- We want to induct on the second entry of x here, so we decompose so as to put that first. g : (x : ℕ) → ((y : ℕ) → y <N x → (b : ℕ) (z : ℕ && ℕ) → order z (b ,, y) → Accessible order z) → (c : ℕ) (y : ℕ && ℕ) → order y (c ,, x) → Accessible order y g0 = rec <NWellfounded (λ z → (x : ℕ && ℕ) (x₁ : order x (z ,, zero)) → Accessible order x) f where p : (a b : ℕ) → a ≡ b → (a ,, zero) ≡ (b ,, zero) p a .a refl = refl f : (x : ℕ) (x₁ : (x₂ : ℕ) (x₃ : x₂ <N x) (x₄ : ℕ && ℕ) (x₅ : order x₄ (x₂ ,, zero)) → Accessible order x₄) (x₂ : ℕ && ℕ) (x₃ : order x₂ (x ,, zero)) → Accessible order x₂ f zero pr y ord = exFalso (leastElement ord) f (succ m) pr (fst ,, snd) (inl pr2) = h snd fst pr2 where go : (x : ℕ) (x₁ : (x₂ : ℕ) (x₃ : x₂ <N x) (x₄ : ℕ) (x₅ : x₄ +N x₂ <N succ (m +N zero)) → Accessible order (x₄ ,, x₂)) (x₂ : ℕ) (x₃ : x₂ +N x <N succ (m +N zero)) → Accessible order (x₂ ,, x) go bound pr2 toProve bounded with TotalOrder.totality ℕTotalOrder (toProve +N bound) (m +N 0) ... | inl (inl bl) = pr m (le 0 refl) (toProve ,, bound) (inl bl) ... | inl (inr bl) = exFalso (noIntegersBetweenXAndSuccX (m +N 0) bl bounded) go zero pr2 toProve _ | inr bl rewrite Semiring.sumZeroRight ℕSemiring m | Semiring.sumZeroRight ℕSemiring toProve = access λ i i<z → pr m (le 0 refl) i (inl (mustDescend (_&&_.fst i) (_&&_.snd i) (m +N zero) (identityOfIndiscernablesLeft order (identityOfIndiscernablesRight order i<z (p toProve (m +N 0) (transitivity bl (equalityCommutative (Semiring.sumZeroRight ℕSemiring m))))) refl))) go (succ bound) pr2 toProve _ | inr bl = access desc where desc : (i : ℕ && ℕ) → (order i (toProve ,, succ bound)) → Accessible order i desc (i1 ,, i2) (inl ord) = pr m (le zero refl) (i1 ,, i2) (inl (identityOfIndiscernablesRight _<N_ ord bl)) desc (i1 ,, i2) (inr (ord1 ,, ord2)) = pr2 i2 ord2 i1 (le 0 (applyEquality succ (transitivity ord1 bl))) h : (a : ℕ) (b : ℕ) (pr2 : b +N a <N succ m +N 0) → Accessible order (b ,, a) h = rec <NWellfounded (λ z → (x2 : ℕ) (x1 : x2 +N z <N succ (m +N zero)) → Accessible order (x2 ,, z)) go g zero _ = g0 g (succ x) pr zero (y1 ,, y2) (inl pr1) with TotalOrder.totality ℕTotalOrder (y1 +N y2) x g (succ x) pr zero (y1 ,, y2) (inl pr1) | inl (inl y1+y2<x) = pr x (le 0 refl) zero (y1 ,, y2) (inl y1+y2<x) g (succ x) pr zero (y1 ,, y2) (inl pr1) | inl (inr x<y1+y2) = exFalso (noIntegersBetweenXAndSuccX x x<y1+y2 pr1) g (succ x) pr zero (y1 ,, y2) (inl pr1) | inr y1+y2=x = access (λ y y<zs → pr x (le 0 refl) zero y (ans y y<zs)) where ans : (y : ℕ && ℕ) → order y (y1 ,, y2) → (_&&_.fst y +N _&&_.snd y <N x) || ((_&&_.fst y +N _&&_.snd y ≡ x) && (_&&_.snd y <N x)) ans (fst ,, snd) (inl x) rewrite y1+y2=x = inl x ans (zero ,, snd) (inr (a1 ,, a2)) rewrite y1+y2=x | a1 = exFalso (bad x y1 y2 y1+y2=x a2) where bad : (x y1 y2 : ℕ) → y1 +N y2 ≡ x → x <N y2 → False bad x zero y2 y1+y2=x x<y2 = TotalOrder.irreflexive ℕTotalOrder (identityOfIndiscernablesRight _<N_ x<y2 y1+y2=x) bad x (succ y1) y2 y1+y2=x x<y2 rewrite equalityCommutative y1+y2=x = TotalOrder.irreflexive ℕTotalOrder (TotalOrder.<Transitive ℕTotalOrder x<y2 (identityOfIndiscernablesRight _<N_ (addingIncreases y2 y1) (Semiring.commutative ℕSemiring y2 (succ y1)))) ans (succ fst ,, snd) (inr (a1 ,, a2)) rewrite y1+y2=x = inr (a1 ,, le fst a1) g (succ x) pr zero (zero ,, y2) (inr (fst ,, snd)) = exFalso (TotalOrder.irreflexive ℕTotalOrder (identityOfIndiscernablesLeft _<N_ snd fst)) g (succ x) pr zero (succ y1 ,, y2) (inr (fst ,, snd)) = pr y2 snd (succ (succ y1)) (succ y1 ,, y2) (inl (le 0 refl)) g (succ x) pr (succ c) y (inl z) = pr x (le 0 refl) (succ (succ c)) y (inl (identityOfIndiscernablesRight _<N_ z (applyEquality succ (transitivity (Semiring.commutative ℕSemiring c (succ x)) (applyEquality succ (Semiring.commutative ℕSemiring x c)))))) g (succ x) pr (succ c) y (inr (fst ,, snd)) with TotalOrder.totality ℕTotalOrder (_&&_.snd y) x ... | inl (inl bl) = pr x (le 0 refl) (succ (succ c)) y (inr (transitivity fst (applyEquality succ (transitivity (Semiring.commutative ℕSemiring c (succ x)) (applyEquality succ (Semiring.commutative ℕSemiring x c)))) ,, bl)) ... | inl (inr bl) = exFalso (noIntegersBetweenXAndSuccX x bl snd) g (succ x) pr (succ c) (y1 ,, .x) (inr (fst ,, _)) | inr refl with canSubtractFromEqualityRight {y1} {x} {succ (succ c)} (transitivity fst (applyEquality succ (transitivity (Semiring.commutative ℕSemiring c (succ x)) (applyEquality succ (Semiring.commutative ℕSemiring x c))))) g (succ x) pr (succ c) (.(succ (succ c)) ,, .x) (inr (_ ,, _)) | inr refl | refl = pr x (le 0 refl) (succ (succ (succ c))) (succ (succ c) ,, x) (inl (le 0 refl)) go : (a : ℕ) → (b : ℕ) → (y : ℕ && ℕ) → order y (b ,, a) → Accessible order y go = rec <NWellfounded (λ (a : ℕ) → (b : ℕ) → (y : ℕ && ℕ) → order y (b ,, a) → Accessible order y) g
oeis/028/A028399.asm
neoneye/loda-programs
11
164054
<gh_stars>10-100 ; A028399: a(n) = 2^n - 4. ; 0,4,12,28,60,124,252,508,1020,2044,4092,8188,16380,32764,65532,131068,262140,524284,1048572,2097148,4194300,8388604,16777212,33554428,67108860,134217724,268435452,536870908,1073741820,2147483644,4294967292,8589934588,17179869180,34359738364,68719476732,137438953468,274877906940,549755813884,1099511627772,2199023255548,4398046511100,8796093022204,17592186044412,35184372088828,70368744177660,140737488355324,281474976710652,562949953421308,1125899906842620,2251799813685244,4503599627370492 mov $1,2 pow $1,$0 sub $1,1 mul $1,4 mov $0,$1
programs/oeis/065/A065883.asm
karttu/loda
0
160168
; A065883: Remove factors of 4 from n (i.e., write n in base 4, drop final zeros, then rewrite in decimal). ; 1,2,3,1,5,6,7,2,9,10,11,3,13,14,15,1,17,18,19,5,21,22,23,6,25,26,27,7,29,30,31,2,33,34,35,9,37,38,39,10,41,42,43,11,45,46,47,3,49,50,51,13,53,54,55,14,57,58,59,15,61,62,63,1,65,66,67,17,69,70,71,18,73,74,75,19,77,78,79,5,81,82,83,21,85,86,87,22,89,90,91,23,93,94,95,6,97,98,99,25,101,102,103,26,105,106,107,27,109,110,111,7,113,114,115,29,117,118,119,30,121,122,123,31,125,126,127,2,129,130,131,33,133,134,135,34,137,138,139,35,141,142,143,9,145,146,147,37,149,150,151,38,153,154,155,39,157,158,159,10,161,162,163,41,165,166,167,42,169,170,171,43,173,174,175,11,177,178,179,45,181,182,183,46,185,186,187,47,189,190,191,3,193,194,195,49,197,198,199,50,201,202,203,51,205,206,207,13,209,210,211,53,213,214,215,54,217,218,219,55,221,222,223,14,225,226,227,57,229,230,231,58,233,234,235,59,237,238,239,15,241,242,243,61,245,246,247,62,249,250 lpb $0,1 mov $2,$0 add $0,1 pow $0,2 mul $2,4 add $2,3 mod $0,$2 sub $0,1 lpe add $0,14 mov $1,$0 sub $1,13
lib/types/GroupSet.agda
UlrikBuchholtz/HoTT-Agda
1
11166
<filename>lib/types/GroupSet.agda {-# OPTIONS --without-K #-} open import lib.Basics open import lib.NType2 open import lib.types.Pi open import lib.types.Group {- The definition of G-sets. Thanks to <NAME>. -} module lib.types.GroupSet {i} where -- The right group action with respect to the group [grp]. record GsetStructure (grp : Group i) {j} (El : Type j) (_ : is-set El) : Type (lmax i j) where constructor gset-structure private module G = Group grp module GS = GroupStructure G.group-struct field act : El → G.El → El unit-r : ∀ x → act x GS.ident == x assoc : ∀ x g₁ g₂ → act (act x g₁) g₂ == act x (GS.comp g₁ g₂) -- The definition of a G-set. A set [El] equipped with -- a right group action with respect to [grp]. record Gset (grp : Group i) j : Type (lsucc (lmax i j)) where constructor gset field El : Type j El-level : is-set El gset-struct : GsetStructure grp El El-level open GsetStructure gset-struct public El-is-set = El-level -- A helper function to establish equivalence between two G-sets. -- Many data are just props and this function do the coversion for them -- for you. You only need to show the non-trivial parts. module _ {grp : Group i} {j} {El : Type j} {El-level : is-set El} where private module G = Group grp module GS = GroupStructure G.group-struct open GsetStructure private gset-structure=' : ∀ {gss₁ gss₂ : GsetStructure grp El El-level} → (act= : act gss₁ == act gss₂) → unit-r gss₁ == unit-r gss₂ [ (λ act → ∀ x → act x GS.ident == x) ↓ act= ] → assoc gss₁ == assoc gss₂ [ (λ act → ∀ x g₁ g₂ → act (act x g₁) g₂ == act x (GS.comp g₁ g₂)) ↓ act= ] → gss₁ == gss₂ gset-structure=' {gset-structure _ _ _} {gset-structure ._ ._ ._} idp idp idp = idp gset-structure= : ∀ {gss₁ gss₂ : GsetStructure grp El El-level} → (∀ x g → act gss₁ x g == act gss₂ x g) → gss₁ == gss₂ gset-structure= act= = gset-structure=' (λ= λ x → λ= λ g → act= x g) (prop-has-all-paths-↓ (Π-level λ _ → El-level _ _)) (prop-has-all-paths-↓ (Π-level λ _ → Π-level λ _ → Π-level λ _ → El-level _ _)) module _ {grp : Group i} {j : ULevel} where private module G = Group grp module GS = GroupStructure G.group-struct open Gset {grp} {j} private gset='' : ∀ {gs₁ gs₂ : Gset grp j} → (El= : El gs₁ == El gs₂) → (El-level : El-level gs₁ == El-level gs₂ [ is-set ↓ El= ]) → gset-struct gs₁ == gset-struct gs₂ [ uncurry (GsetStructure grp) ↓ pair= El= El-level ] → gs₁ == gs₂ gset='' {gset _ _ _} {gset ._ ._ ._} idp idp idp = idp gset=' : ∀ {gs₁ gs₂ : Gset grp j} → (El= : El gs₁ == El gs₂) → (El-level : El-level gs₁ == El-level gs₂ [ is-set ↓ El= ]) → (∀ {x₁} {x₂} (p : x₁ == x₂ [ idf _ ↓ El= ]) g → act gs₁ x₁ g == act gs₂ x₂ g [ idf _ ↓ El= ]) → gs₁ == gs₂ gset=' {gset _ _ _} {gset ._ ._ _} idp idp act= = gset='' idp idp (gset-structure= λ x g → act= idp g) gset= : ∀ {gs₁ gs₂ : Gset grp j} → (El≃ : El gs₁ ≃ El gs₂) → (∀ {x₁} {x₂} → –> El≃ x₁ == x₂ → ∀ g → –> El≃ (act gs₁ x₁ g) == act gs₂ x₂ g) → gs₁ == gs₂ gset= El≃ act= = gset=' (ua El≃) (prop-has-all-paths-↓ is-set-is-prop) (λ x= g → ↓-idf-ua-in El≃ $ act= (↓-idf-ua-out El≃ x=) g) -- The Gset homomorphism. record GsetHom {grp : Group i} {j} (gset₁ gset₂ : Gset grp j) : Type (lmax i j) where constructor gset-hom open Gset field f : El gset₁ → El gset₂ pres-act : ∀ g x → f (act gset₁ x g) == act gset₂ (f x) g private gset-hom=' : ∀ {grp : Group i} {j} {gset₁ gset₂ : Gset grp j} {gsh₁ gsh₂ : GsetHom gset₁ gset₂} → (f= : GsetHom.f gsh₁ == GsetHom.f gsh₂) → (GsetHom.pres-act gsh₁ == GsetHom.pres-act gsh₂ [ (λ f → ∀ g x → f (Gset.act gset₁ x g) == Gset.act gset₂ (f x) g) ↓ f= ] ) → gsh₁ == gsh₂ gset-hom=' idp idp = idp gset-hom= : ∀ {grp : Group i} {j} {gset₁ gset₂ : Gset grp j} {gsh₁ gsh₂ : GsetHom gset₁ gset₂} → (∀ x → GsetHom.f gsh₁ x == GsetHom.f gsh₂ x) → gsh₁ == gsh₂ gset-hom= {gset₂ = gset₂} f= = gset-hom=' (λ= f=) (prop-has-all-paths-↓ $ Π-level λ _ → Π-level λ _ → Gset.El-level gset₂ _ _)
problems/025/a025.adb
melwyncarlo/ProjectEuler
0
9684
<reponame>melwyncarlo/ProjectEuler with Ada.Strings.Fixed; with Ada.Integer_Text_IO; with Ada.Numerics.Long_Elementary_Functions; -- Copyright 2021 <NAME> procedure A025 is use Ada.Strings.Fixed; use Ada.Integer_Text_IO; use Ada.Numerics.Long_Elementary_Functions; Fibonacci_Val : array (Integer range 1 .. 3) of String (1 .. 1000) := (others => 1000 * "0"); Summand_1, Summand_2 : String (1 .. 10); Val_1_Length : Integer := 3; Val_2_Length : Integer := 2; Summation : Long_Integer; I, J, Str_Length, Val_0_Length, Temp_Index, Temp_Len : Integer; begin Fibonacci_Val (1) (998) := '1'; Fibonacci_Val (1) (999) := '4'; Fibonacci_Val (1) (1000) := '4'; Fibonacci_Val (2) (999) := '8'; Fibonacci_Val (2) (1000) := '9'; Fibonacci_Val (3) (999) := '5'; Fibonacci_Val (3) (1000) := '5'; I := 12; while Fibonacci_Val (1) (1) = '0' loop Fibonacci_Val (3) := Fibonacci_Val (2); Fibonacci_Val (2) := Fibonacci_Val (1); if Val_2_Length > Val_1_Length then Str_Length := Val_2_Length; else Str_Length := Val_1_Length; end if; Str_Length := Integer (Float'Floor (Float (Str_Length - 1) / 10.0) + 1.0) * 10; Val_0_Length := 0; J := 1; while J < Str_Length loop Summand_1 := Fibonacci_Val (2) (992 - J .. 1001 - J); Summand_2 := Fibonacci_Val (3) (992 - J .. 1001 - J); Summation := Long_Integer'Value (Summand_1) + Long_Integer'Value (Summand_2) + ((Character'Pos (Fibonacci_Val (1) (1001 - J)) - Character'Pos ('0')) * Boolean'Pos (J /= 1)); Temp_Len := Integer (Long_Float'Floor (Log (Long_Float (Summation), 10.0))) + 1; Temp_Index := 991 - J; if Temp_Index = 0 then Temp_Index := 1; Move (Source => Trim (Long_Integer'Image (Summation), Ada.Strings.Both), Target => Fibonacci_Val (1) (Temp_Index .. Temp_Index + 9), Justify => Ada.Strings.Right, Pad => '0'); else Move (Source => Trim (Long_Integer'Image (Summation), Ada.Strings.Both), Target => Fibonacci_Val (1) (Temp_Index .. Temp_Index + 10), Justify => Ada.Strings.Right, Pad => '0'); end if; if J = (Str_Length - 9) then Val_0_Length := J + Temp_Len - 1; end if; J := J + 10; end loop; Val_2_Length := Val_1_Length; Val_1_Length := Val_0_Length; I := I + 1; end loop; Put (I, Width => 0); end A025;
oeis/309/A309391.asm
neoneye/loda-programs
11
102263
<filename>oeis/309/A309391.asm ; A309391: a(n) = gcd(n, A064169(n-2)) for n > 2. ; Submitted by <NAME> ; 3,1,5,1,7,1,1,1,11,1,13,1,1,1,17,1,19,1,1,1,23,1,5,1,1,1,29,1,31,1,1,1,1,1,37,1,1,1,41,1,43,1,1,1,47,1,7,1,1,1,53,1,1,1,1,1,59,1,61,1,1,1,1,1,67,1,1,1,71,1,73,1,1,1,1,1,79,1,1,1,83,1,1,1,1,11,89,1,1,1,1,1,1,1,97,1,1,1,101,1 add $0,1 mov $1,$0 add $0,2 seq $1,1008 ; Numerators of harmonic numbers H(n) = Sum_{i=1..n} 1/i. gcd $0,$1
PSW TO REGISTER.asm
vkmanojk/Simulation-8051
1
103226
ORG 0H MOV R0, #95 MOV R7, #20H MOV A, R0 DIVISION: MOV B, #16 DIV AB MOV @R7,B JZ DIVISION END
programs/oeis/157/A157953.asm
karttu/loda
1
166301
<filename>programs/oeis/157/A157953.asm ; A157953: a(n) = 81n^2 - n. ; 80,322,726,1292,2020,2910,3962,5176,6552,8090,9790,11652,13676,15862,18210,20720,23392,26226,29222,32380,35700,39182,42826,46632,50600,54730,59022,63476,68092,72870,77810,82912,88176,93602,99190,104940,110852,116926,123162,129560,136120,142842,149726,156772,163980,171350,178882,186576,194432,202450,210630,218972,227476,236142,244970,253960,263112,272426,281902,291540,301340,311302,321426,331712,342160,352770,363542,374476,385572,396830,408250,419832,431576,443482,455550,467780,480172,492726,505442,518320,531360,544562,557926,571452,585140,598990,613002,627176,641512,656010,670670,685492,700476,715622,730930,746400,762032,777826,793782,809900,826180,842622,859226,875992,892920,910010,927262,944676,962252,979990,997890,1015952,1034176,1052562,1071110,1089820,1108692,1127726,1146922,1166280,1185800,1205482,1225326,1245332,1265500,1285830,1306322,1326976,1347792,1368770,1389910,1411212,1432676,1454302,1476090,1498040,1520152,1542426,1564862,1587460,1610220,1633142,1656226,1679472,1702880,1726450,1750182,1774076,1798132,1822350,1846730,1871272,1895976,1920842,1945870,1971060,1996412,2021926,2047602,2073440,2099440,2125602,2151926,2178412,2205060,2231870,2258842,2285976,2313272,2340730,2368350,2396132,2424076,2452182,2480450,2508880,2537472,2566226,2595142,2624220,2653460,2682862,2712426,2742152,2772040,2802090,2832302,2862676,2893212,2923910,2954770,2985792,3016976,3048322,3079830,3111500,3143332,3175326,3207482,3239800,3272280,3304922,3337726,3370692,3403820,3437110,3470562,3504176,3537952,3571890,3605990,3640252,3674676,3709262,3744010,3778920,3813992,3849226,3884622,3920180,3955900,3991782,4027826,4064032,4100400,4136930,4173622,4210476,4247492,4284670,4322010,4359512,4397176,4435002,4472990,4511140,4549452,4587926,4626562,4665360,4704320,4743442,4782726,4822172,4861780,4901550,4941482,4981576,5021832,5062250 mov $1,9 mov $2,$0 add $2,1 mul $1,$2 pow $1,2 sub $1,$2
Type/Cubical/Equiv.agda
Lolirofle/stuff-in-agda
6
6179
{-# OPTIONS --cubical #-} module Type.Cubical.Equiv where import Lvl open import Type.Cubical open import Type.Cubical.Path.Equality import Type.Equiv as Type open import Type private variable ℓ₁ ℓ₂ : Lvl.Level -- `Type.Equiv._≍_` specialized to Path. _≍_ : (A : Type{ℓ₁}) → (B : Type{ℓ₂}) → Type A ≍ B = A Type.≍ B {-# BUILTIN EQUIV _≍_ #-} instance [≍]-reflexivity = \{ℓ} → Type.[≍]-reflexivity {ℓ} ⦃ Path-equiv ⦄ instance [≍]-symmetry = \{ℓ} → Type.[≍]-symmetry {ℓ} ⦃ Path-equiv ⦄ instance [≍]-transitivity = \{ℓ} → Type.[≍]-transitivity {ℓ} ⦃ Path-equiv ⦄ ⦃ Path-congruence₁ ⦄ instance [≍]-equivalence = \{ℓ} → Type.[≍]-equivalence {ℓ} ⦃ Path-equiv ⦄ ⦃ Path-congruence₁ ⦄
boards/native/src/native-filesystem.adb
morbos/Ada_Drivers_Library
2
7443
with Ada.Directories; with Ada.Unchecked_Deallocation; package body Native.Filesystem is -- ??? There are a bunch of 'Unrestricted_Access here because the -- HAL.Filesystem API embeds implicit references to filesystems. It -- woudl be good to make these references explicit at some point to -- avoid kludges. function "+" (S : Ada.Strings.Unbounded.Unbounded_String) return String renames Ada.Strings.Unbounded.To_String; function "+" (S : String) return Ada.Strings.Unbounded.Unbounded_String renames Ada.Strings.Unbounded.To_Unbounded_String; procedure Destroy is new Ada.Unchecked_Deallocation (Native_File_Handle, Native_File_Handle_Ref); procedure Destroy is new Ada.Unchecked_Deallocation (Native_Directory_Handle, Native_Directory_Handle_Ref); function "<" (Left, Right : Directory_Data_Entry) return Boolean is (Ada.Strings.Unbounded."<" (Left.Name, Right.Name)); package Directory_Data_Sorting is new Directory_Data_Vectors.Generic_Sorting; -- Most of the time, standard operations give us no reliable way to -- determine specifically what triggered a failure, so use the following -- error code as a "generic" one. Generic_Error : constant Status_Kind := Input_Output_Error; function Absolute_Path (This : Native_FS_Driver; Relative_Path : Pathname) return Pathname is (if Relative_Path = "" then +This.Root_Dir else Join (+This.Root_Dir, Relative_Path, True)); ---------------- -- Get_Handle -- ---------------- function Get_Handle (FS : in out Native_FS_Driver) return Native_File_Handle_Ref is Result : Native_File_Handle_Ref := FS.Free_File_Handles; begin if Result = null then Result := new Native_File_Handle' (FS => FS'Unrestricted_Access, others => <>); else FS.Free_File_Handles := Result.Next; end if; return Result; end Get_Handle; ---------------- -- Get_Handle -- ---------------- function Get_Handle (FS : in out Native_FS_Driver) return Native_Directory_Handle_Ref is Result : Native_Directory_Handle_Ref := FS.Free_Dir_Handles; begin if Result = null then Result := new Native_Directory_Handle' (FS => FS'Unrestricted_Access, others => <>); else FS.Free_Dir_Handles := Result.Next; end if; return Result; end Get_Handle; --------------------- -- Add_Free_Handle -- --------------------- procedure Add_Free_Handle (FS : in out Native_FS_Driver; Handle : in out Native_File_Handle_Ref) is begin Handle.Next := FS.Free_File_Handles; FS.Free_File_Handles := Handle; Handle := null; end Add_Free_Handle; --------------------- -- Add_Free_Handle -- --------------------- procedure Add_Free_Handle (FS : in out Native_FS_Driver; Handle : in out Native_Directory_Handle_Ref) is begin Handle.Next := FS.Free_Dir_Handles; FS.Free_Dir_Handles := Handle; Handle := null; end Add_Free_Handle; ------------- -- Destroy -- ------------- procedure Destroy (This : in out Native_FS_Driver_Ref) is procedure Destroy is new Ada.Unchecked_Deallocation (Native_FS_Driver, Native_FS_Driver_Ref); begin -- Free all handles while This.Free_File_Handles /= null loop declare H : constant Native_File_Handle_Ref := This.Free_File_Handles.Next; begin Destroy (This.Free_File_Handles); This.Free_File_Handles := H; end; end loop; while This.Free_Dir_Handles /= null loop declare H : constant Native_Directory_Handle_Ref := This.Free_Dir_Handles.Next; begin Destroy (This.Free_Dir_Handles); This.Free_Dir_Handles := H; end; end loop; Destroy (This); end Destroy; ------------ -- Create -- ------------ function Create (FS : out Native_FS_Driver; Root_Dir : Pathname) return Status_Kind is begin declare use type Ada.Directories.File_Kind; begin if Ada.Directories.Kind (Root_Dir) /= Ada.Directories.Directory then return Invalid_Argument; end if; exception when Ada.Directories.Name_Error => return Invalid_Argument; end; FS.Root_Dir := Ada.Strings.Unbounded.To_Unbounded_String (Root_Dir); return Status_Ok; end Create; ----------------- -- Create_Node -- ----------------- overriding function Create_Node (This : in out Native_FS_Driver; Path : Pathname; Kind : File_Kind) return Status_Kind is Abs_Path : constant Pathname := Absolute_Path (This, Path); begin case Kind is when Regular_File => declare File : Byte_IO.File_Type; begin begin Byte_IO.Create (File, Byte_IO.Out_File, Abs_Path); exception when Byte_IO.Status_Error | Byte_IO.Name_Error | Byte_IO.Use_Error => return Generic_Error; end; Byte_IO.Close (File); end; when Directory => begin Ada.Directories.Create_Directory (Abs_Path); exception when Ada.Directories.Name_Error | Ada.Directories.Use_Error => return Generic_Error; end; end case; return Status_Ok; end Create_Node; ---------------------- -- Create_Directory -- ---------------------- overriding function Create_Directory (This : in out Native_FS_Driver; Path : Pathname) return Status_Kind is begin return This.Create_Node (Absolute_Path (This, Path), Directory); end Create_Directory; ------------ -- Unlink -- ------------ overriding function Unlink (This : in out Native_FS_Driver; Path : Pathname) return Status_Kind is begin Ada.Directories.Delete_File (Absolute_Path (This, Path)); return Status_Ok; exception when Ada.Directories.Name_Error | Ada.Directories.Use_Error => return Generic_Error; end Unlink; ---------------------- -- Remove_Directory -- ---------------------- overriding function Remove_Directory (This : in out Native_FS_Driver; Path : Pathname) return Status_Kind is begin Ada.Directories.Delete_Directory (Absolute_Path (This, Path)); return Status_Ok; exception when Ada.Directories.Name_Error | Ada.Directories.Use_Error => return Generic_Error; end Remove_Directory; ------------ -- Rename -- ------------ overriding function Rename (This : in out Native_FS_Driver; Old_Path : Pathname; New_Path : Pathname) return Status_Kind is Old_Abs_Path : constant Pathname := Absolute_Path (This, Old_Path); New_Abs_Path : constant Pathname := Absolute_Path (This, New_Path); begin Ada.Directories.Rename (Old_Abs_Path, New_Abs_Path); return Status_Ok; exception when Ada.Directories.Name_Error | Ada.Directories.Use_Error => return Generic_Error; end Rename; ------------------- -- Truncate_File -- ------------------- overriding function Truncate_File (This : in out Native_FS_Driver; Path : Pathname; Length : IO_Count) return Status_Kind is pragma Unreferenced (This, Path, Length); begin -- ??? Implement this. This is not done at the moment as there seems to -- be no other way using standard Ada packages than do delete the file -- and re-create it. return Generic_Error; end Truncate_File; ---------- -- Open -- ---------- overriding function Open (This : in out Native_FS_Driver; Path : Pathname; Mode : File_Mode; Handle : out Any_File_Handle) return Status_Kind is Result : Native_File_Handle_Ref := This.Get_Handle; begin begin Byte_IO.Open (File => Result.File, Mode => (case Mode is when Read_Only => Byte_IO.In_File, when Write_Only => Byte_IO.Out_File, when Read_Write => Byte_IO.Inout_File), Name => Absolute_Path (This, Path)); exception when Byte_IO.Status_Error | Byte_IO.Name_Error | Byte_IO.Use_Error => Destroy (Result); return Generic_Error; end; Handle := Result.all'Access; return Status_Ok; end Open; -------------------- -- Open_Directory -- -------------------- overriding function Open_Directory (This : in out Native_FS_Driver; Path : Pathname; Handle : out Any_Directory_Handle) return Status_Kind is use Ada.Strings.Unbounded; Result : Native_Directory_Handle_Ref := This.Get_Handle; Search : Ada.Directories.Search_Type; begin begin Ada.Directories.Start_Search (Search, Absolute_Path (This, Path), ""); exception when Ada.Directories.Name_Error | Ada.Directories.Use_Error => This.Add_Free_Handle (Result); return Generic_Error; end; Result.Full_Name := +Path; while Ada.Directories.More_Entries (Search) loop declare use type Ada.Directories.File_Kind; E : Ada.Directories.Directory_Entry_Type; Kind : Ada.Directories.File_Kind; Name : Unbounded_String; begin Ada.Directories.Get_Next_Entry (Search, E); Kind := Ada.Directories.Kind (E); Name := +Ada.Directories.Simple_Name (E); -- HAL.Filesystem does not support special files, so just ignores -- them. As for current and parent directories entries, skip them -- for now as this makes tree traversal cumbersome to write. if Kind /= Ada.Directories.Special_File and then +Name /= "." and then +Name /= ".." then Result.Data.Append ((Kind => (case Kind is when Ada.Directories.Ordinary_File => Regular_File, when Ada.Directories.Directory => Directory, when others => raise Program_Error), Name => Name)); end if; end; end loop; Ada.Directories.End_Search (Search); -- Make sure entries are sorted so that we get determinism. This is -- convenient for testing. Directory_Data_Sorting.Sort (Result.Data); Handle := Result.all'Access; return Status_Ok; end Open_Directory; ---------- -- Read -- ---------- overriding function Read (This : in out Native_File_Handle; Data : out UInt8_Array) return Status_Kind is begin for B of Data loop Byte_IO.Read (This.File, B); end loop; return Status_Ok; exception when Byte_IO.Mode_Error | Byte_IO.End_Error | Byte_IO.Data_Error => return Generic_Error; end Read; ----------- -- Write -- ----------- overriding function Write (This : in out Native_File_Handle; Data : UInt8_Array) return Status_Kind is begin for B of Data loop Byte_IO.Write (This.File, B); end loop; return Status_Ok; exception when Byte_IO.Mode_Error | Byte_IO.Use_Error => return Generic_Error; end Write; ---------- -- Seek -- ---------- overriding function Seek (This : in out Native_File_Handle; Offset : IO_Count) return Status_Kind is begin Byte_IO.Set_Index (This.File, Byte_IO.Positive_Count (Offset + 1)); return Status_Ok; end Seek; ----------- -- Close -- ----------- overriding function Close (This : in out Native_File_Handle) return Status_Kind is This_Ref : Native_File_Handle_Ref := This'Unrestricted_Access; begin begin Byte_IO.Close (This.File); exception when Byte_IO.Status_Error => return Generic_Error; end; This_Ref.FS.Add_Free_Handle (This_Ref); return Status_Ok; end Close; ---------------- -- Read_Entry -- ---------------- overriding function Read_Entry (This : in out Native_Directory_Handle; Entry_Number : Positive; Dir_Entry : out Directory_Entry) return Status_Kind is begin if Entry_Number > This.Data.Last_Index then return No_Such_File_Or_Directory; end if; Dir_Entry := (Entry_Type => This.Data.Element (Entry_Number).Kind); return Status_Ok; end Read_Entry; ---------------- -- Entry_Name -- ---------------- overriding function Entry_Name (This : in out Native_Directory_Handle; Entry_Number : Positive) return Pathname is begin if Entry_Number > This.Data.Last_Index then return ""; end if; return +This.Data.Element (Entry_Number).Name; end Entry_Name; ----------- -- Close -- ----------- overriding function Close (This : in out Native_Directory_Handle) return Status_Kind is This_Ref : Native_Directory_Handle_Ref := This'Unrestricted_Access; begin This.Data.Clear; This_Ref.FS.Add_Free_Handle (This_Ref); return Status_Ok; end Close; ---------- -- Join -- ---------- function Join (Prefix, Suffix : Pathname; Ignore_Absolute_Suffixes : Boolean) return Pathname is use Ada.Strings.Unbounded; package String_Vectors is new Ada.Containers.Vectors (Positive, Unbounded_String); Result : Unbounded_String := +Prefix; Names : String_Vectors.Vector; begin -- First, decompose Suffix into individual names: the following pushes -- the most local directory names first, then the most global ones. For -- instance, "a/b/c" will gives: Name => ("c", "b", "a"). declare Suffix_Acc : Unbounded_String := +Suffix; begin while Length (Suffix_Acc) > 0 loop begin declare Suffix : constant String := +Suffix_Acc; Next_Suffix : constant String := Ada.Directories.Containing_Directory (Suffix); Name : constant String := Ada.Directories.Simple_Name (Suffix); begin -- The following happens when Suffix is "." (the current -- directory). exit when Suffix = Next_Suffix; Names.Append (+Name); Suffix_Acc := +Next_Suffix; end; exception when Ada.Directories.Use_Error => -- Suffix is actually an absolute path. Forget about it and -- process it as a relative one. exit when Ignore_Absolute_Suffixes; return Suffix; end; end loop; end; -- Then, compose them using Ada.Directories.Compose so we have our -- result. for Name of reverse Names loop Result := +Ada.Directories.Compose (+Result, +Name); end loop; return +Result; end Join; end Native.Filesystem;
src/autogenerated/textBank3.asm
jannone/westen
49
91459
<gh_stars>10-100 ; line: 'I need to find the other half.' ; size in bytes: 31 line_0: db #1e,#3b,#00,#82,#71,#71,#6f,#00,#8e,#84,#00,#73,#79,#82,#6f,#00 db #8e,#77,#71,#00,#84,#8e,#77,#71,#8a,#00,#77,#69,#7e,#73,#14 end_line_0: ; line: 'is not alone. But I have a plan. I know how' ; size in bytes: 44 line_1: db #2b,#79,#8c,#00,#82,#84,#8e,#00,#69,#7e,#84,#82,#71,#14,#00,#2d db #90,#8e,#00,#3b,#00,#77,#69,#92,#71,#00,#69,#00,#86,#7e,#69,#82 db #14,#00,#3b,#00,#7c,#82,#84,#95,#00,#77,#84,#95 end_line_1: ; line: 'walking into them.' ; size in bytes: 19 line_2: db #12,#95,#69,#7e,#7c,#79,#82,#75,#00,#79,#82,#8e,#84,#00,#8e,#77 db #71,#7f,#14 end_line_2: ; line: 'I need to get closer!' ; size in bytes: 22 line_3: db #15,#3b,#00,#82,#71,#71,#6f,#00,#8e,#84,#00,#75,#71,#8e,#00,#6d db #7e,#84,#8c,#71,#8a,#02 end_line_3: ; line: 'macabre was going on in this house!' ; size in bytes: 36 line_4: db #23,#7f,#69,#6d,#69,#6b,#8a,#71,#00,#95,#69,#8c,#00,#75,#84,#79 db #82,#75,#00,#84,#82,#00,#79,#82,#00,#8e,#77,#79,#8c,#00,#77,#84 db #90,#8c,#71,#02 end_line_4: ; line: 'the lemon ink in the letter!' ; size in bytes: 29 line_5: db #1c,#8e,#77,#71,#00,#7e,#71,#7f,#84,#82,#00,#79,#82,#7c,#00,#79 db #82,#00,#8e,#77,#71,#00,#7e,#71,#8e,#8e,#71,#8a,#02 end_line_5: ; line: 'I must go there at once!' ; size in bytes: 25 line_6: db #18,#3b,#00,#7f,#90,#8c,#8e,#00,#75,#84,#00,#8e,#77,#71,#8a,#71 db #00,#69,#8e,#00,#84,#82,#6d,#71,#02 end_line_6: ; line: 'I hope you find this before my family' ; size in bytes: 38 line_7: db #25,#3b,#00,#77,#84,#86,#71,#00,#9b,#84,#90,#00,#73,#79,#82,#6f db #00,#8e,#77,#79,#8c,#00,#6b,#71,#73,#84,#8a,#71,#00,#7f,#9b,#00 db #73,#69,#7f,#79,#7e,#9b end_line_7: ; line: 'Now that you have seen the house firsthand' ; size in bytes: 43 line_8: db #2a,#47,#84,#95,#00,#8e,#77,#69,#8e,#00,#9b,#84,#90,#00,#77,#69 db #92,#71,#00,#8c,#71,#71,#82,#00,#8e,#77,#71,#00,#77,#84,#90,#8c db #71,#00,#73,#79,#8a,#8c,#8e,#77,#69,#82,#6f end_line_8: ; line: 'No need to wash my hands now.' ; size in bytes: 30 line_9: db #1d,#47,#84,#00,#82,#71,#71,#6f,#00,#8e,#84,#00,#95,#69,#8c,#77 db #00,#7f,#9b,#00,#77,#69,#82,#6f,#8c,#00,#82,#84,#95,#14 end_line_9: ; line: 'I used lemon ink. You will know what to do.' ; size in bytes: 44 line_10: db #2b,#3b,#00,#90,#8c,#71,#6f,#00,#7e,#71,#7f,#84,#82,#00,#79,#82 db #7c,#14,#00,#63,#84,#90,#00,#95,#79,#7e,#7e,#00,#7c,#82,#84,#95 db #00,#95,#77,#69,#8e,#00,#8e,#84,#00,#6f,#84,#14 end_line_10: ; line: 'you might have already guessed. My family's' ; size in bytes: 44 line_11: db #2b,#9b,#84,#90,#00,#7f,#79,#75,#77,#8e,#00,#77,#69,#92,#71,#00 db #69,#7e,#8a,#71,#69,#6f,#9b,#00,#75,#90,#71,#8c,#8c,#71,#6f,#14 db #00,#44,#9b,#00,#73,#69,#7f,#79,#7e,#9b,#08,#8c end_line_11: ; line: 'I still don't know how to feel' ; size in bytes: 31 line_12: db #1e,#3b,#00,#8c,#8e,#79,#7e,#7e,#00,#6f,#84,#82,#08,#8e,#00,#7c db #82,#84,#95,#00,#77,#84,#95,#00,#8e,#84,#00,#73,#71,#71,#7e end_line_12: ; line: 'I don't feel like going now.' ; size in bytes: 29 line_13: db #1c,#3b,#00,#6f,#84,#82,#08,#8e,#00,#73,#71,#71,#7e,#00,#7e,#79 db #7c,#71,#00,#75,#84,#79,#82,#75,#00,#82,#84,#95,#14 end_line_13: ; line: 'Thank you for playing' ; size in bytes: 22 line_14: db #15,#55,#77,#69,#82,#7c,#00,#9b,#84,#90,#00,#73,#84,#8a,#00,#86 db #7e,#69,#9b,#79,#82,#75 end_line_14:
Archive/Rev2/snes/journey/src/data.asm
mupfelofen-de/SNESoIP
59
27046
.include "hdr.asm" .section ".rodata1" superfree snesfont: .incbin "res/font/font.pic" finn: .incbin "res/finn.pic" .ends
Retired/Assemblearning_Modulo.asm
UlrichBerntien/Codewars-Katas
0
14682
<filename>Retired/Assemblearning_Modulo.asm section .text global mod ; uint64_t mod(uint64_t a, uint64_t n) ; input: ; rdi - value a ; rsi - value n ; return: ; ryx - a mod n mod: mov rax,rdi xor rdx,rdx ; rdx:rax = value a, unsigned expanded div rsi ; rax = quotient, rdx = remainded mov rax,rdx ; return remainder ret
test/asset/agda-stdlib-1.0/Data/Sum/Relation/Binary/Pointwise.agda
omega12345/agda-mode
0
3455
------------------------------------------------------------------------ -- The Agda standard library -- -- Pointwise sum ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Data.Sum.Relation.Binary.Pointwise where open import Data.Product using (_,_) open import Data.Sum as Sum open import Data.Sum.Properties open import Level using (_⊔_) open import Function using (_∘_; id) open import Function.Inverse using (Inverse) open import Relation.Nullary import Relation.Nullary.Decidable as Dec open import Relation.Binary open import Relation.Binary.PropositionalEquality as P using (_≡_) ---------------------------------------------------------------------- -- Definition data Pointwise {a b c d r s} {A : Set a} {B : Set b} {C : Set c} {D : Set d} (R : REL A C r) (S : REL B D s) : REL (A ⊎ B) (C ⊎ D) (a ⊔ b ⊔ c ⊔ d ⊔ r ⊔ s) where inj₁ : ∀ {a c} → R a c → Pointwise R S (inj₁ a) (inj₁ c) inj₂ : ∀ {b d} → S b d → Pointwise R S (inj₂ b) (inj₂ d) ---------------------------------------------------------------------- -- Relational properties module _ {a₁ a₂ ℓ₁ ℓ₂} {A₁ : Set a₁} {A₂ : Set a₂} {∼₁ : Rel A₁ ℓ₁} {∼₂ : Rel A₂ ℓ₂} where drop-inj₁ : ∀ {x y} → Pointwise ∼₁ ∼₂ (inj₁ x) (inj₁ y) → ∼₁ x y drop-inj₁ (inj₁ x) = x drop-inj₂ : ∀ {x y} → Pointwise ∼₁ ∼₂ (inj₂ x) (inj₂ y) → ∼₂ x y drop-inj₂ (inj₂ x) = x ⊎-refl : Reflexive ∼₁ → Reflexive ∼₂ → Reflexive (Pointwise ∼₁ ∼₂) ⊎-refl refl₁ refl₂ {inj₁ x} = inj₁ refl₁ ⊎-refl refl₁ refl₂ {inj₂ y} = inj₂ refl₂ ⊎-symmetric : Symmetric ∼₁ → Symmetric ∼₂ → Symmetric (Pointwise ∼₁ ∼₂) ⊎-symmetric sym₁ sym₂ (inj₁ x) = inj₁ (sym₁ x) ⊎-symmetric sym₁ sym₂ (inj₂ x) = inj₂ (sym₂ x) ⊎-transitive : Transitive ∼₁ → Transitive ∼₂ → Transitive (Pointwise ∼₁ ∼₂) ⊎-transitive trans₁ trans₂ (inj₁ x) (inj₁ y) = inj₁ (trans₁ x y) ⊎-transitive trans₁ trans₂ (inj₂ x) (inj₂ y) = inj₂ (trans₂ x y) ⊎-asymmetric : Asymmetric ∼₁ → Asymmetric ∼₂ → Asymmetric (Pointwise ∼₁ ∼₂) ⊎-asymmetric asym₁ asym₂ (inj₁ x) = λ { (inj₁ y) → asym₁ x y } ⊎-asymmetric asym₁ asym₂ (inj₂ x) = λ { (inj₂ y) → asym₂ x y } ⊎-substitutive : ∀ {ℓ₃} → Substitutive ∼₁ ℓ₃ → Substitutive ∼₂ ℓ₃ → Substitutive (Pointwise ∼₁ ∼₂) ℓ₃ ⊎-substitutive subst₁ subst₂ P (inj₁ x) = subst₁ (P ∘ inj₁) x ⊎-substitutive subst₁ subst₂ P (inj₂ x) = subst₂ (P ∘ inj₂) x ⊎-decidable : Decidable ∼₁ → Decidable ∼₂ → Decidable (Pointwise ∼₁ ∼₂) ⊎-decidable _≟₁_ _≟₂_ (inj₁ x) (inj₁ y) = Dec.map′ inj₁ drop-inj₁ (x ≟₁ y) ⊎-decidable _≟₁_ _≟₂_ (inj₁ x) (inj₂ y) = no λ() ⊎-decidable _≟₁_ _≟₂_ (inj₂ x) (inj₁ y) = no λ() ⊎-decidable _≟₁_ _≟₂_ (inj₂ x) (inj₂ y) = Dec.map′ inj₂ drop-inj₂ (x ≟₂ y) module _ {a₁ a₂} {A₁ : Set a₁} {A₂ : Set a₂} {ℓ₁ ℓ₂} {∼₁ : Rel A₁ ℓ₁} {≈₁ : Rel A₁ ℓ₂} {ℓ₃ ℓ₄} {∼₂ : Rel A₂ ℓ₃} {≈₂ : Rel A₂ ℓ₄} where ⊎-reflexive : ≈₁ ⇒ ∼₁ → ≈₂ ⇒ ∼₂ → (Pointwise ≈₁ ≈₂) ⇒ (Pointwise ∼₁ ∼₂) ⊎-reflexive refl₁ refl₂ (inj₁ x) = inj₁ (refl₁ x) ⊎-reflexive refl₁ refl₂ (inj₂ x) = inj₂ (refl₂ x) ⊎-irreflexive : Irreflexive ≈₁ ∼₁ → Irreflexive ≈₂ ∼₂ → Irreflexive (Pointwise ≈₁ ≈₂) (Pointwise ∼₁ ∼₂) ⊎-irreflexive irrefl₁ irrefl₂ (inj₁ x) (inj₁ y) = irrefl₁ x y ⊎-irreflexive irrefl₁ irrefl₂ (inj₂ x) (inj₂ y) = irrefl₂ x y ⊎-antisymmetric : Antisymmetric ≈₁ ∼₁ → Antisymmetric ≈₂ ∼₂ → Antisymmetric (Pointwise ≈₁ ≈₂) (Pointwise ∼₁ ∼₂) ⊎-antisymmetric antisym₁ antisym₂ (inj₁ x) (inj₁ y) = inj₁ (antisym₁ x y) ⊎-antisymmetric antisym₁ antisym₂ (inj₂ x) (inj₂ y) = inj₂ (antisym₂ x y) ⊎-respectsˡ : ∼₁ Respectsˡ ≈₁ → ∼₂ Respectsˡ ≈₂ → (Pointwise ∼₁ ∼₂) Respectsˡ (Pointwise ≈₁ ≈₂) ⊎-respectsˡ resp₁ resp₂ (inj₁ x) (inj₁ y) = inj₁ (resp₁ x y) ⊎-respectsˡ resp₁ resp₂ (inj₂ x) (inj₂ y) = inj₂ (resp₂ x y) ⊎-respectsʳ : ∼₁ Respectsʳ ≈₁ → ∼₂ Respectsʳ ≈₂ → (Pointwise ∼₁ ∼₂) Respectsʳ (Pointwise ≈₁ ≈₂) ⊎-respectsʳ resp₁ resp₂ (inj₁ x) (inj₁ y) = inj₁ (resp₁ x y) ⊎-respectsʳ resp₁ resp₂ (inj₂ x) (inj₂ y) = inj₂ (resp₂ x y) ⊎-respects₂ : ∼₁ Respects₂ ≈₁ → ∼₂ Respects₂ ≈₂ → (Pointwise ∼₁ ∼₂) Respects₂ (Pointwise ≈₁ ≈₂) ⊎-respects₂ (r₁ , l₁) (r₂ , l₂) = ⊎-respectsʳ r₁ r₂ , ⊎-respectsˡ l₁ l₂ ---------------------------------------------------------------------- -- Structures module _ {a₁ a₂} {A₁ : Set a₁} {A₂ : Set a₂} {ℓ₁ ℓ₂} {≈₁ : Rel A₁ ℓ₁} {≈₂ : Rel A₂ ℓ₂} where ⊎-isEquivalence : IsEquivalence ≈₁ → IsEquivalence ≈₂ → IsEquivalence (Pointwise ≈₁ ≈₂) ⊎-isEquivalence eq₁ eq₂ = record { refl = ⊎-refl (refl eq₁) (refl eq₂) ; sym = ⊎-symmetric (sym eq₁) (sym eq₂) ; trans = ⊎-transitive (trans eq₁) (trans eq₂) } where open IsEquivalence ⊎-isDecEquivalence : IsDecEquivalence ≈₁ → IsDecEquivalence ≈₂ → IsDecEquivalence (Pointwise ≈₁ ≈₂) ⊎-isDecEquivalence eq₁ eq₂ = record { isEquivalence = ⊎-isEquivalence (isEquivalence eq₁) (isEquivalence eq₂) ; _≟_ = ⊎-decidable (_≟_ eq₁) (_≟_ eq₂) } where open IsDecEquivalence module _ {a₁ a₂} {A₁ : Set a₁} {A₂ : Set a₂} {ℓ₁ ℓ₂} {≈₁ : Rel A₁ ℓ₁} {∼₁ : Rel A₁ ℓ₂} {ℓ₃ ℓ₄} {≈₂ : Rel A₂ ℓ₃} {∼₂ : Rel A₂ ℓ₄} where ⊎-isPreorder : IsPreorder ≈₁ ∼₁ → IsPreorder ≈₂ ∼₂ → IsPreorder (Pointwise ≈₁ ≈₂) (Pointwise ∼₁ ∼₂) ⊎-isPreorder pre₁ pre₂ = record { isEquivalence = ⊎-isEquivalence (isEquivalence pre₁) (isEquivalence pre₂) ; reflexive = ⊎-reflexive (reflexive pre₁) (reflexive pre₂) ; trans = ⊎-transitive (trans pre₁) (trans pre₂) } where open IsPreorder ⊎-isPartialOrder : IsPartialOrder ≈₁ ∼₁ → IsPartialOrder ≈₂ ∼₂ → IsPartialOrder (Pointwise ≈₁ ≈₂) (Pointwise ∼₁ ∼₂) ⊎-isPartialOrder po₁ po₂ = record { isPreorder = ⊎-isPreorder (isPreorder po₁) (isPreorder po₂) ; antisym = ⊎-antisymmetric (antisym po₁) (antisym po₂) } where open IsPartialOrder ⊎-isStrictPartialOrder : IsStrictPartialOrder ≈₁ ∼₁ → IsStrictPartialOrder ≈₂ ∼₂ → IsStrictPartialOrder (Pointwise ≈₁ ≈₂) (Pointwise ∼₁ ∼₂) ⊎-isStrictPartialOrder spo₁ spo₂ = record { isEquivalence = ⊎-isEquivalence (isEquivalence spo₁) (isEquivalence spo₂) ; irrefl = ⊎-irreflexive (irrefl spo₁) (irrefl spo₂) ; trans = ⊎-transitive (trans spo₁) (trans spo₂) ; <-resp-≈ = ⊎-respects₂ (<-resp-≈ spo₁) (<-resp-≈ spo₂) } where open IsStrictPartialOrder ------------------------------------------------------------------------ -- Packages module _ {a b c d} where ⊎-setoid : Setoid a b → Setoid c d → Setoid _ _ ⊎-setoid s₁ s₂ = record { isEquivalence = ⊎-isEquivalence (isEquivalence s₁) (isEquivalence s₂) } where open Setoid ⊎-decSetoid : DecSetoid a b → DecSetoid c d → DecSetoid _ _ ⊎-decSetoid ds₁ ds₂ = record { isDecEquivalence = ⊎-isDecEquivalence (isDecEquivalence ds₁) (isDecEquivalence ds₂) } where open DecSetoid -- Some additional notation for combining setoids infix 4 _⊎ₛ_ _⊎ₛ_ : Setoid a b → Setoid c d → Setoid _ _ _⊎ₛ_ = ⊎-setoid module _ {a b c d e f} where ⊎-preorder : Preorder a b c → Preorder d e f → Preorder _ _ _ ⊎-preorder p₁ p₂ = record { isPreorder = ⊎-isPreorder (isPreorder p₁) (isPreorder p₂) } where open Preorder ⊎-poset : Poset a b c → Poset a b c → Poset _ _ _ ⊎-poset po₁ po₂ = record { isPartialOrder = ⊎-isPartialOrder (isPartialOrder po₁) (isPartialOrder po₂) } where open Poset ------------------------------------------------------------------------ -- The propositional equality setoid over products can be -- decomposed using Pointwise module _ {a b} {A : Set a} {B : Set b} where Pointwise-≡⇒≡ : (Pointwise _≡_ _≡_) ⇒ _≡_ {A = A ⊎ B} Pointwise-≡⇒≡ (inj₁ x) = P.cong inj₁ x Pointwise-≡⇒≡ (inj₂ x) = P.cong inj₂ x ≡⇒Pointwise-≡ : _≡_ {A = A ⊎ B} ⇒ (Pointwise _≡_ _≡_) ≡⇒Pointwise-≡ P.refl = ⊎-refl P.refl P.refl Pointwise-≡↔≡ : ∀ {a b} (A : Set a) (B : Set b) → Inverse (P.setoid A ⊎ₛ P.setoid B) (P.setoid (A ⊎ B)) Pointwise-≡↔≡ _ _ = record { to = record { _⟨$⟩_ = id; cong = Pointwise-≡⇒≡ } ; from = record { _⟨$⟩_ = id; cong = ≡⇒Pointwise-≡ } ; inverse-of = record { left-inverse-of = λ _ → ⊎-refl P.refl P.refl ; right-inverse-of = λ _ → P.refl } } ------------------------------------------------------------------------ -- DEPRECATED NAMES ------------------------------------------------------------------------ -- Please use the new names as continuing support for the old names is -- not guaranteed. -- Version 1.0 module _ {a b c d r s} {A : Set a} {B : Set b} {C : Set c} {D : Set d} {R : REL A C r} {S : REL B D s} where ₁∼₁ : ∀ {a c} → R a c → Pointwise R S (inj₁ a) (inj₁ c) ₁∼₁ = inj₁ {-# WARNING_ON_USAGE ₁∼₁ "Warning: ₁∼₁ was deprecated in v1.0. Please use inj₁ in `Data.Sum.Properties` instead." #-} ₂∼₂ : ∀ {b d} → S b d → Pointwise R S (inj₂ b) (inj₂ d) ₂∼₂ = inj₂ {-# WARNING_ON_USAGE ₂∼₂ "Warning: ₂∼₂ was deprecated in v1.0. Please use inj₂ in `Data.Sum.Properties` instead." #-} _⊎-≟_ : ∀ {a b} {A : Set a} {B : Set b} → Decidable {A = A} _≡_ → Decidable {A = B} _≡_ → Decidable {A = A ⊎ B} _≡_ (dec₁ ⊎-≟ dec₂) s₁ s₂ = Dec.map′ Pointwise-≡⇒≡ ≡⇒Pointwise-≡ (s₁ ≟ s₂) where open DecSetoid (⊎-decSetoid (P.decSetoid dec₁) (P.decSetoid dec₂)) {-# WARNING_ON_USAGE _⊎-≟_ "Warning: _⊎-≟_ was deprecated in v1.0. Please use ≡-dec in `Data.Sum.Properties` instead." #-}
sample_input/testcase3.ada
hajin-kim/PLS_TinyAda_Compiler
0
13408
procedure Test is I : INTEGER; begin I := 0; if J <= 15 then I := 0; end if; End Test;