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
programs/oeis/085/A085474.asm
karttu/loda
0
173320
<reponame>karttu/loda<gh_stars>0 ; A085474: C(2*n+4,4)-C(2*n,4). ; 1,15,69,195,425,791,1325,2059,3025,4255,5781,7635,9849,12455,15485,18971,22945,27439,32485,38115,44361,51255,58829,67115,76145,85951,96565,108019,120345,133575,147741,162875,179009,196175,214405,233731,254185,275799,298605,322635,347921,374495,402389,431635,462265,494311,527805,562779,599265,637295,676901,718115,760969,805495,851725,899691,949425,1000959,1054325,1109555,1166681,1225735,1286749,1349755,1414785,1481871,1551045,1622339,1695785,1771415,1849261,1929355,2011729,2096415,2183445,2272851,2364665,2458919,2555645,2654875,2756641,2860975,2967909,3077475,3189705,3304631,3422285,3542699,3665905,3791935,3920821,4052595,4187289,4324935,4465565,4609211,4755905,4905679,5058565,5214595,5373801,5536215,5701869,5870795,6043025,6218591,6397525,6579859,6765625,6954855,7147581,7343835,7543649,7747055,7954085,8164771,8379145,8597239,8819085,9044715,9274161,9507455,9744629,9985715,10230745,10479751,10732765,10989819,11250945,11516175,11785541,12059075,12336809,12618775,12905005,13195531,13490385,13789599,14093205,14401235,14713721,15030695,15352189,15678235,16008865,16344111,16684005,17028579,17377865,17731895,18090701,18454315,18822769,19196095,19574325,19957491,20345625,20738759,21136925,21540155,21948481,22361935,22780549,23204355,23633385,24067671,24507245,24952139,25402385,25858015,26319061,26785555,27257529,27735015,28218045,28706651,29200865,29700719,30206245,30717475,31234441,31757175,32285709,32820075,33360305,33906431,34458485,35016499,35580505,36150535,36726621,37308795,37897089,38491535,39092165,39699011,40312105,40931479,41557165,42189195,42827601,43472415,44123669,44781395,45445625,46116391,46793725,47477659,48168225,48865455,49569381,50280035,50997449,51721655,52452685,53190571,53935345,54687039,55445685,56211315,56983961,57763655,58550429,59344315,60145345,60953551,61768965,62591619,63421545,64258775,65103341,65955275,66814609,67681375,68555605,69437331,70326585,71223399,72127805,73039835,73959521,74886895,75821989,76764835,77715465,78673911,79640205,80614379,81596465,82586495 mul $0,2 mov $1,$0 lpb $0,1 add $2,$0 sub $0,1 add $1,$2 lpe mul $1,2 add $1,1
StochasticsGrammar/QueuingT.g4
Jhonnyguzz/Java-Projects
0
4408
/** * Define a grammar called Hello */ grammar QueuingT; //Composicion codigo : (head) (network_description) (footer); head : var EQ INT; var: NODES; network_description : (node_description | connection)*; node_description : DESNODO ABR_CC (node_property)* CRR_CC; node_property : property EQ VAL; connection : CONEX ABR_CC (id_con)+ CRR_CC; id_con : (ATRIDS | ATRIDE) EQ (ID | INT); footer : stime (analitics)*; stime : SIM EQ (ID | INT); analitics : 'avg_customer_system' | 'avg_customer_queue' | 'avgt_customer_system' | 'avgt_customer_queue'; property : 'id' | 'id_start' | 'id_end' | 'number_of_servers' | 'queue_distribution' | 'server_distribution'; VAL : INT | DIST | ID; /* * ---- LEXER ---- */ // Corchetes cuadrados ABR_CC : '['; CRR_CC : ']'; //Operadores: NOT : 'not'; // --- MULT : '*'; DIV : '/'; MOD : '%'; MAS : '+'; MENOS : '-'; // --- MENQ : '<'; MENIG : '<='; MAYQ : '>'; MAYIG : '>='; IGL : '=='; NIGL : '!='; // --- AND : 'and'; OR : 'or'; // --- EQ : '='; // --- COMA : ','; PYC : ';'; // Comillas CML : '\''; /* * ---- REGLAS LEXICAS Y PALABRAS RESERVADAS---- */ DIST : ('Binomial' | 'Normal' | 'Poisson' | 'Uniform'); NODES : 'nodes'; DESNODO : 'describe_node'; ATRNS : 'number_of_servers'; ATRSD : 'server_distribution'; ARTID : 'id'; CONEX : 'describe_connection'; ATRIDS : 'id_start'; ATRIDE : 'id_end'; SIM : 'simulation_time'; ANLT : 'analytics'; /** * ---- TOKENS GENERALES ---- */ ID : LETRAS+('_'?(LETRAS|INT)+)*; STR : CML ('\\' '\'' | . )*? CML; SIGINT : '-'?('0'..'9')+; INT : ('0'..'9')+; DOBL : SIGINT '.' INT?; LETRAS : ('a'..'z' | 'A'..'Z'); // Comentarios CMT_MULTI : '/*' .*? '*/' -> skip; CMT_SIMPL : '//' ~[\r\n]* -> skip; ESPACIO : ( ' '| '\t'| '\r'| '\n')+ -> channel(HIDDEN); //WS : [ \t\r\n]+ -> skip; //skip spaces, tabs, newlines
test/Fail/Erased-cubical-Module-application.agda
cagix/agda
1,989
12862
{-# OPTIONS --erased-cubical #-} -- Modules that use --cubical can be imported when --erased-cubical is -- used. import Erased-cubical-Module-application.Cubical module EC = Erased-cubical-Module-application.Cubical Set -- However, definitions from such modules can only be used in erased -- contexts. _ : {A : Set} → A → EC.∥ A ∥ _ = EC.∣_∣
oeis/111/A111917.asm
neoneye/loda-programs
11
12607
; A111917: The i-th term of the generalized Fibonacci sequence [0,k,k,2k,3k,...] is given by the formula F(i) = round( k/sqrt(5) * phi^i ) provided i >= s(k); a(n) = smallest value of k such that s(k) = n. ; Submitted by <NAME> ; 2,3,5,8,13,21,33,53,85,138,223,361,583,943,1525,2468,3993,6461,10453,16913,27365,44278 mov $1,1 mov $2,2 mov $3,2 mov $4,4 lpb $0 sub $0,1 add $2,$3 mov $3,$4 add $4,$1 mov $1,$2 div $3,$2 mov $2,$4 lpe div $2,2 mov $0,$2 add $0,1
Setoids/Lists.agda
Smaug123/agdaproofs
4
2683
<filename>Setoids/Lists.agda {-# OPTIONS --safe --warning=error --without-K #-} open import LogicalFormulae open import Lists.Lists open import Setoids.Setoids open import Functions.Definition open import Sets.EquivalenceRelations module Setoids.Lists where listEquality : {a b : _} {A : Set a} (S : Setoid {a} {b} A) → Rel {a} {b} (List A) listEquality S [] [] = True' listEquality S [] (x :: w2) = False' listEquality S (x :: w1) [] = False' listEquality S (x :: w1) (y :: w2) = (Setoid._∼_ S x y) && listEquality S w1 w2 listEqualityReflexive : {a b : _} {A : Set a} (S : Setoid {a} {b} A) (w : List A) → listEquality S w w listEqualityReflexive S [] = record {} listEqualityReflexive S (x :: w) = Equivalence.reflexive (Setoid.eq S) ,, listEqualityReflexive S w listEqualitySymmetric : {a b : _} {A : Set a} (S : Setoid {a} {b} A) {w1 w2 : List A} → listEquality S w1 w2 → listEquality S w2 w1 listEqualitySymmetric S {w1 = []} {[]} pr = record {} listEqualitySymmetric S {[]} {x :: xs} () listEqualitySymmetric S {x :: xs} {[]} () listEqualitySymmetric S {w1 = x :: w1} {y :: w2} (pr1 ,, pr2) = Equivalence.symmetric (Setoid.eq S) pr1 ,, listEqualitySymmetric S pr2 listEqualityTransitive : {a b : _} {A : Set a} (S : Setoid {a} {b} A) {w1 w2 w3 : List A} → listEquality S w1 w2 → listEquality S w2 w3 → listEquality S w1 w3 listEqualityTransitive S {w1 = []} {[]} {[]} w1=w2 w2=w3 = record {} listEqualityTransitive S {w1 = []} {[]} {x :: xs} w1=w2 () listEqualityTransitive S {w1 = []} {x :: xs} {w3} () w2=w3 listEqualityTransitive S {w1 = x :: w1} {[]} {w3} () w2=w3 listEqualityTransitive S {w1 = x :: w1} {y :: ys} {[]} w1=w2 () listEqualityTransitive S {w1 = x :: w1} {y :: w2} {z :: w3} (pr1 ,, pr2) (pr3 ,, pr4) = Equivalence.transitive (Setoid.eq S) pr1 pr3 ,, listEqualityTransitive S pr2 pr4 listEqualityRespectsMap : {a b c d : _} {A : Set a} {B : Set b} (S : Setoid {a} {c} A) (T : Setoid {b} {d} B) (f : A → B) (fWD : {x y : A} → Setoid._∼_ S x y → Setoid._∼_ T (f x) (f y)) → {w1 w2 : List A} (w1=w2 : listEquality S w1 w2) → listEquality T (map f w1) (map f w2) listEqualityRespectsMap S T f fWD {[]} {[]} w1=w2 = record {} listEqualityRespectsMap S T f fWD {[]} {x :: w2} () listEqualityRespectsMap S T f fWD {x :: w1} {[]} () listEqualityRespectsMap S T f fWD {x :: w1} {y :: w2} (x=y ,, w1=w2) = fWD x=y ,, listEqualityRespectsMap S T f fWD {w1} {w2} w1=w2 listSetoid : {a b : _} {A : Set a} (S : Setoid {a} {b} A) → Setoid (List A) Setoid._∼_ (listSetoid S) word1 word2 = listEquality S word1 word2 Equivalence.reflexive (Setoid.eq (listSetoid S)) {word} = listEqualityReflexive S word Equivalence.symmetric (Setoid.eq (listSetoid S)) pr = listEqualitySymmetric S pr Equivalence.transitive (Setoid.eq (listSetoid S)) pr1 pr2 = listEqualityTransitive S pr1 pr2 consWellDefined : {a b : _} {A : Set a} {S : Setoid {a} {b} A} (xs : List A) {x y : A} (x=y : Setoid._∼_ S x y) → Setoid._∼_ (listSetoid S) (x :: xs) (y :: xs) consWellDefined {S = S} xs x=y = x=y ,, Equivalence.reflexive (Setoid.eq (listSetoid S)) appendWellDefined : {a b : _} {A : Set a} {S : Setoid {a} {b} A} {xs ys as bs : List A} (xs=as : Setoid._∼_ (listSetoid S) xs as) → (ys=bs : Setoid._∼_ (listSetoid S) ys bs) → Setoid._∼_ (listSetoid S) (xs ++ ys) (as ++ bs) appendWellDefined {S = S} {[]} {[]} {[]} {[]} record {} record {} = record {} appendWellDefined {S = S} {[]} {[]} {[]} {x :: bs} record {} () appendWellDefined {S = S} {[]} {x :: ys} {[]} {[]} record {} ys=bs = ys=bs appendWellDefined {S = S} {[]} {x :: ys} {[]} {x₁ :: bs} record {} ys=bs = ys=bs appendWellDefined {S = S} {[]} {ys} {x :: as} {bs} () ys=bs appendWellDefined {S = S} {x :: xs} {ys} {[]} {bs} () ys=bs appendWellDefined {S = S} {x :: xs} {[]} {x₁ :: as} {[]} xs=as record {} = _&&_.fst xs=as ,, identityOfIndiscernablesRight (listEquality S) (identityOfIndiscernablesLeft (listEquality S) (_&&_.snd xs=as) (equalityCommutative (appendEmptyList xs))) (equalityCommutative (appendEmptyList as)) appendWellDefined {S = S} {x :: xs} {[]} {x₁ :: as} {x₂ :: bs} xs=as () appendWellDefined {S = S} {x :: xs} {x₂ :: ys} {x₁ :: as} {[]} xs=as () appendWellDefined {S = S} {x :: xs} {x₂ :: ys} {x₁ :: as} {x₃ :: bs} (fst ,, snd) ys=bs = fst ,, appendWellDefined snd ys=bs
programs/oeis/235/A235136.asm
neoneye/loda
22
94354
; A235136: a(n) = (2*n - 1) * a(n-2) for n>1, a(0) = a(1) = 1. ; 1,1,3,5,21,45,231,585,3465,9945,65835,208845,1514205,5221125,40883535,151412625,1267389585,4996616625,44358635475,184874815125,1729986783525,7579867420125,74389431691575,341094033905625,3496303289504025,16713607661375625,178311467764705275,885821206052908125,9807130727058790125,50491808745015763125,578620712896468617375,3080000333445961550625,36453104912477522894625,200200021673987500790625,2442358029135994033939875,13813801495505137554553125,173407420068655576409731125,1008407509171875041482378125,13005556505149168230729834375,77647378206234378194143115625,1027438963906784290227656915625,6289437634704984633725592365625,85277434004263096088895523996875,534602198949923693866675351078125,7419136758370889359733910587728125,47579595706543208754134106245953125,675141445011750931735785863483259375 mul $0,2 mov $1,1 lpb $0 sub $0,1 mul $1,$0 sub $0,3 lpe mov $0,$1
SCS3211/Excercises/Take Home/question1.asm
UdeshUK/UCSC-CS
6
240316
<reponame>UdeshUK/UCSC-CS<filename>SCS3211/Excercises/Take Home/question1.asm .text la $a0,hint li $v0,4 syscall li $v0,5 syscall addiu $t0,$v0,0 li $v0,5 syscall add $t2,$t0,$v0 sub $t3,$t0,$v0 # Print summ la $a0,sum_prefix li $v0,4 syscall addiu $a0,$t2,0 li $v0,1 syscall # Print the difference la $a0,diff_prefix li $v0,4 syscall addiu $a0,$t3,0 li $v0,1 syscall .data hint: .asciiz "Enter two numbers:\n" sum_prefix: .asciiz "Sum is = " diff_prefix: .asciiz "\nDifference is = "
src/main/ada/2019/aoc-aoc_2019-day05.adb
wooky/aoc.kt
0
14795
<gh_stars>0 package body AOC.AOC_2019.Day05 is use Intcode; function Run_Diagnostics (D : Day_05; Input : Element) return Element is Instance : Instances.Instance := D.Compiler.Instantiate; begin Instance.Inputs.Append (Input); Instance.Run; return Instance.Outputs.Last_Element; end Run_Diagnostics; procedure Init (D : in out Day_05; Root : String) is begin D.Compiler.Compile (Root & "/input/2019/day05.txt"); end Init; function Part_1 (D : Day_05) return String is begin return D.Run_Diagnostics (1)'Image; end Part_1; function Part_2 (D : Day_05) return String is begin return D.Run_Diagnostics (5)'Image; end Part_2; end AOC.AOC_2019.Day05;
library/fmGUI_ManageSecurity/fmGUI_ManageSecurity_PrivSet_Update.applescript
NYHTC/applescript-fm-helper
1
3965
<gh_stars>1-10 -- fmGUI_ManageSecurity_PrivSet_Update({}) -- <NAME>, NYHTC -- update a privilege set (* HISTORY: 1.0.1 - 2017-11-07 ( eshagdar ): open privSet via wrapper. 1.0 - 2017-08-29 ( eshagdar ): taken most logic from fmGUI_ManageSecurity_PrivSets_CustomizeALL ( TuneUp Tool ). REQUIRES: fmGUI_AppFrontMost fmGUI_CheckboxSet fmGUI_ManageSecurity_PrivSet_OpenForEdit fmGUI_ManageSecurity_PrivSet_Update_AccessLayout fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_AllTables fmGUI_ManageSecurity_PrivSet_Update_AccessScript fmGUI_ManageSecurity_PrivSet_Update_AccessValueList fmGUI_ManageSecurity_PrivSet_Update_ExtendedPrivileges fmGUI_ObjectClick_OkButton fmGUI_PopupSet fmGUI_TextFieldSet *) on run fmGUI_ManageSecurity_PrivSet_Update({}) end run -------------------- -- START OF CODE -------------------- on fmGUI_ManageSecurity_PrivSet_Update(prefs) -- version 1.0.1 set defaultPrefs to {privSetName:null, privSetDesc:null, accessRecord:null, accessLayouts:null, accessVL:null, accessScripts:null, extendedPrivList:null, allowPrinting:null, allowExporting:null, mangeExtPriv:null, allowOverride:null, disconnectIdle:null, modifyPwd:null, menuCommands:null, recordAccess:null, layoutAccess:null, vlAccess:null, scriptsAccess:null, fullAccessAccountName:null, fullAccessPassword:""} set prefs to prefs & defaultPrefs set privSetName to privSetName of prefs set fullAccessCredentials to {fullAccessAccountName:fullAccessAccountName of prefs, fullAccessPassword:fullAccessPassword of prefs} set editPrivSetWindowName to "Edit Privilege Set" set selectCommand to "contains" try fmGUI_AppFrontMost() -- open selected priv ( if needed ) tell application "System Events" tell process "FileMaker Pro Advanced" set windowName to name of window 1 end tell end tell if windowName is not editPrivSetWindowName then fmGUI_ManageSecurity_PrivSet_OpenForEdit(fullAccessCredentials & {privSetName:privSetName}) -- now check again since we should have opened the privSet tell application "System Events" tell process "FileMaker Pro Advanced" set windowName to name of window 1 end tell end tell if windowName is not editPrivSetWindowName then error "unable to open privSet '" & privSetName & "'" number -1024 end if -- ensure we're dealing with the correct PrivSet tell application "System Events" tell process "FileMaker Pro Advanced" set currentlyOpenPrivSet to value of text field 1 of window 1 end tell end tell if currentlyOpenPrivSet is not equal to privSetName then error "not editing '" & privSetName & "' privSet" number -1024 -- get object references for privSet tell application "System Events" tell process "FileMaker Pro Advanced" set descriptionTextField to text field "Description" of window 1 set allowPrintingCheckbox to checkbox "Allow printing" of window 1 set allowExportingCheckbox to checkbox "Allow exporting" of window 1 set mangeExtPrivCheckbox to checkbox "Manage extended privileges" of window 1 set allowOverrideCheckbox to checkbox "Allow user to override data validation warnings" of window 1 set disconnectIdleCheckbox to checkbox "Disconnect user from server when idle" of window 1 set modifyPwdCheckbox to checkbox "Allow user to modify their own password" of window 1 set menuPopup to pop up button "Available menu commands:" of window 1 end tell end tell -- other privileges fmGUI_TextFieldSet({objRef:descriptionTextField, objValue:privSetDesc of prefs}) fmGUI_CheckboxSet({objRef:allowPrintingCheckbox, objValue:allowPrinting of prefs}) fmGUI_CheckboxSet({objRef:allowExportingCheckbox, objValue:allowExporting of prefs}) fmGUI_CheckboxSet({objRef:mangeExtPrivCheckbox, objValue:mangeExtPriv of prefs}) fmGUI_CheckboxSet({objRef:allowOverrideCheckbox, objValue:allowOverride of prefs}) fmGUI_CheckboxSet({objRef:disconnectIdleCheckbox, objValue:disconnectIdle of prefs}) fmGUI_CheckboxSet({objRef:modifyPwdCheckbox, objValue:modifyPwd of prefs}) fmGUI_PopupSet({objRef:menuPopup, objValue:menuCommands of prefs}) -- extended privs fmGUI_ManageSecurity_PrivSet_Update_ExtendedPrivileges({extendedPrivList:extendedPrivList of prefs}) -- data access fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_AllTables({accessRecord:accessRecord of prefs, recordAccess:recordAccess of prefs}) fmGUI_ManageSecurity_PrivSet_Update_AccessLayout({accessLayout:accessLayout of prefs, layoutAccess:layoutAccess of prefs}) fmGUI_ManageSecurity_PrivSet_Update_AccessValueList({accessVL:accessVL of prefs, vlAccess:vlAccess of prefs}) fmGUI_ManageSecurity_PrivSet_Update_AccessScript({accessScript:accessScript of prefs, scriptsAccess:scriptsAccess of prefs}) -- confirm changes fmGUI_ObjectClick_OkButton({}) on error errMsg number errNum error "unable to fmGUI_ManageSecurity_PrivSet_Update - " & errMsg number errNum end try end fmGUI_ManageSecurity_PrivSet_Update -------------------- -- END OF CODE -------------------- on fmGUI_AppFrontMost() tell application "htcLib" to fmGUI_AppFrontMost() end fmGUI_AppFrontMost on fmGUI_CheckboxSet(prefs) set objRefStr to coerceToString(objRef of prefs) tell application "htcLib" to fmGUI_CheckboxSet({objRef:objRefStr} & prefs) end fmGUI_CheckboxSet on fmGUI_ManageSecurity_PrivSet_OpenForEdit(prefs) tell application "htcLib" to fmGUI_ManageSecurity_PrivSet_OpenForEdit(prefs) end fmGUI_ManageSecurity_PrivSet_OpenForEdit on fmGUI_ManageSecurity_PrivSet_Update_AccessLayout(prefs) tell application "htcLib" to fmGUI_ManageSecurity_PrivSet_Update_AccessLayout(prefs) end fmGUI_ManageSecurity_PrivSet_Update_AccessLayout on fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_AllTables(prefs) tell application "htcLib" to fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_AllTables(prefs) end fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_AllTables on fmGUI_ManageSecurity_PrivSet_Update_AccessScript(prefs) tell application "htcLib" to fmGUI_ManageSecurity_PrivSet_Update_AccessScript(prefs) end fmGUI_ManageSecurity_PrivSet_Update_AccessScript on fmGUI_ManageSecurity_PrivSet_Update_AccessValueList(prefs) tell application "htcLib" to fmGUI_ManageSecurity_PrivSet_Update_AccessValueList(prefs) end fmGUI_ManageSecurity_PrivSet_Update_AccessValueList on fmGUI_ManageSecurity_PrivSet_Update_ExtendedPrivileges(prefs) tell application "htcLib" to fmGUI_ManageSecurity_PrivSet_Update_ExtendedPrivileges(prefs) end fmGUI_ManageSecurity_PrivSet_Update_ExtendedPrivileges on fmGUI_ObjectClick_OkButton(prefs) tell application "htcLib" to fmGUI_ObjectClick_OkButton(prefs) end fmGUI_ObjectClick_OkButton on fmGUI_PopupSet(prefs) set objRefStr to coerceToString(objRef of prefs) tell application "htcLib" to fmGUI_PopupSet({objRef:objRefStr} & prefs) end fmGUI_PopupSet on fmGUI_TextFieldSet(prefs) set objRefStr to coerceToString(objRef of prefs) tell application "htcLib" to fmGUI_TextFieldSet({objRef:objRefStr} & prefs) end fmGUI_TextFieldSet on coerceToString(incomingObject) -- 2017-07-12 ( eshagdar ): bootstrap code to bring a coerceToString into this file for the sample to run ( instead of having a copy of the handler locally ). tell application "Finder" to set coercePath to (container of (container of (path to me)) as text) & "text parsing:coerceToString.applescript" set codeCoerce to read file coercePath as text tell application "htcLib" to set codeCoerce to "script codeCoerce " & return & getTextBetween({sourceTEXT:codeCoerce, beforeText:"-- START OF CODE", afterText:"-- END OF CODE"}) & return & "end script" & return & "return codeCoerce" set codeCoerce to run script codeCoerce tell codeCoerce to coerceToString(incomingObject) end coerceToString
third_party/antlr_grammars_v4/teal/Teal.g4
mikhan808/rsyntaxtextarea-antlr4-extension
2
2832
// Project: https://github.com/teal-language/tl grammar Teal; chunk : block EOF ; block : stat* retstat? ; stat : ';' # SemiStat | varlist '=' explist # AssignStat | functioncall # FuncCallStat | label # LabelStat | 'break' # BreakStat | 'goto' NAME # GotoStat | 'do' block 'end' # DoStat | 'while' exp 'do' block 'end' # WhileStat | 'repeat' block 'until' exp # RepeatStat | 'if' exp 'then' block ('elseif' exp 'then' block)* ('else' block)? 'end' # IfStat | 'for' NAME '=' exp ',' exp (',' exp)? 'do' block 'end' # ForStat | 'for' namelist 'in' explist 'do' block 'end' # ForInStat | 'function' funcname funcbody # FuncStat | 'local' 'function' NAME funcbody # LocalFuncStat | 'local' attnamelist (':' typelist)? ('=' explist)? # LocalAttrAssignStat | 'local' NAME '=' newtype # LocalNewTypeStat | 'global' 'function' NAME funcbody # GlobalFuncStat | 'global' attnamelist ':' typelist # GlobalAttrStat | 'global' attnamelist (':' typelist)? '=' explist # GlobalAttrAssignStat | 'global' NAME '=' newtype # GlobalAssignStat ; attnamelist : NAME attrib? (',' NAME attrib?)* ; attrib : '<' NAME '>' ; // we rename `type` to `typ` because of keyword `type` typ : '(' typ ')' | basetype ('|' basetype)* ; basetype : 'string' | 'boolean' | 'nil' | 'number' | '{' typ '}' | '{' typ ':' typ '}' | 'function' functiontype | NAME typeargs? ; typelist : typ (',' typ)? ; retlist : '(' typelist? '...'? ')' | typelist '...'? ; typeargs : '<' NAME (',' NAME )* '>' ; newtype : 'record' typeargs? ('{' typ '}')? (NAME '=' newtype)* (NAME ':' typ)* 'end' # RecordNewType | 'enum' str* 'end' # EnumNewType | 'functiontype' functiontype # FuncNewType ; functiontype : typeargs? '(' partypelist ')' (':' retlist)? ; partypelist : partype (',' partype)* ; partype : (NAME ':')? typ ; parnamelist : parname (',' parname)* ; parname : NAME (':' typ)? ; retstat : 'return' explist? ';'? # ReturnStat ; label : '::' NAME '::' ; funcname : NAME ('.' NAME)* (':' NAME)? ; varlist : variable (',' variable)* ; namelist : NAME (',' NAME)* ; explist : exp (',' exp)* ; exp : 'nil' | 'false' | 'true' | number | str | '...' | functiondef | prefixexp | tableconstructor | exp 'as' typ | <assoc=right> exp operatorPower exp | operatorUnary exp | exp operatorMulDivMod exp | exp operatorAddSub exp | <assoc=right> exp operatorStrcat exp | exp operatorComparison exp | NAME 'is' typ | exp operatorAnd exp | exp operatorOr exp | exp operatorBitwise exp ; prefixexp : varOrExp nameAndArgs* ; functioncall : varOrExp nameAndArgs+ ; varOrExp : variable | '(' exp ')' ; // we rename `var` to `variable` because of keyword `var` variable : (NAME | '(' exp ')' varSuffix) varSuffix* ; varSuffix : nameAndArgs* ('[' exp ']' | '.' NAME) ; nameAndArgs : (':' NAME)? args ; args : '(' explist? ')' | tableconstructor | str ; functiondef : 'function' funcbody ; funcbody : typeargs? '(' parlist? ')' (':' retlist)? block 'end' ; parlist : namelist (',' '...')? | '...' | parnamelist (',' '...' (':' typ)?)? | '...' (':' typ)? ; tableconstructor : '{' fieldlist? '}' ; fieldlist : field (fieldsep field)* fieldsep? ; field : '[' exp ']' '=' exp # BracketAssginField | NAME (':' typ)? '=' exp # AssignField | NAME '=' newtype # AssignNewTypeField | exp # ExprField ; fieldsep : ',' | ';' ; operatorOr : 'or'; operatorAnd : 'and'; operatorComparison : '<' | '>' | '<=' | '>=' | '~=' | '=='; operatorStrcat : '..'; operatorAddSub : '+' | '-'; operatorMulDivMod : '*' | '/' | '%' | '//'; operatorBitwise : '&' | '|' | '~' | '<<' | '>>'; operatorUnary : 'not' | '#' | '-' | '~'; operatorPower : '^'; number : INT | HEX | FLOAT | HEX_FLOAT ; str : NORMALSTRING | CHARSTRING | LONGSTRING ; // LEXER NAME : [a-zA-Z_][a-zA-Z_0-9]* ; NORMALSTRING : '"' ( EscapeSequence | ~('\\'|'"') )* '"' ; CHARSTRING : '\'' ( EscapeSequence | ~('\''|'\\') )* '\'' ; LONGSTRING : '[' NESTED_STR ']' ; fragment NESTED_STR : '=' NESTED_STR '=' | '[' .*? ']' ; INT : Digit+ ; HEX : '0' [xX] HexDigit+ ; FLOAT : Digit+ '.' Digit* ExponentPart? | '.' Digit+ ExponentPart? | Digit+ ExponentPart ; HEX_FLOAT : '0' [xX] HexDigit+ '.' HexDigit* HexExponentPart? | '0' [xX] '.' HexDigit+ HexExponentPart? | '0' [xX] HexDigit+ HexExponentPart ; fragment ExponentPart : [eE] [+-]? Digit+ ; fragment HexExponentPart : [pP] [+-]? Digit+ ; fragment EscapeSequence : '\\' [abfnrtvz"'\\] | '\\' '\r'? '\n' | DecimalEscape | HexEscape | UtfEscape ; fragment DecimalEscape : '\\' Digit | '\\' Digit Digit | '\\' [0-2] Digit Digit ; fragment HexEscape : '\\' 'x' HexDigit HexDigit ; fragment UtfEscape : '\\' 'u{' HexDigit+ '}' ; fragment Digit : [0-9] ; fragment HexDigit : [0-9a-fA-F] ; // define doc lexer before comment lexer COMMENT : '--[' NESTED_STR ']' -> channel(HIDDEN) ; LINE_COMMENT : '--' ( // -- | '[' '='* // --[== | '[' '='* ~('='|'['|'\r'|'\n') ~('\r'|'\n')* // --[==AA | ~('['|'\r'|'\n') ~('\r'|'\n')* // --AAA ) ('\r\n'|'\r'|'\n'|EOF) -> channel(HIDDEN) ; WS : [ \t\u000C\r\n]+ -> skip ; SHEBANG : '#' '!' ~('\n'|'\r')* -> channel(HIDDEN) ;
lib/types/Span.agda
UlrikBuchholtz/HoTT-Agda
1
14188
<filename>lib/types/Span.agda {-# OPTIONS --without-K #-} open import lib.Basics open import lib.types.Pi open import lib.types.Pointed module lib.types.Span where record Span {i j k : ULevel} : Type (lsucc (lmax (lmax i j) k)) where constructor span field A : Type i B : Type j C : Type k f : C → A g : C → B private span=-raw : ∀ {i j k} {A A' : Type i} (p : A == A') {B B' : Type j} (q : B == B') {C C' : Type k} (r : C == C') {f : C → A} {f' : C' → A'} (s : f == f' [ (λ CA → fst CA → snd CA) ↓ pair×= r p ]) {g : C → B} {g' : C' → B'} (t : g == g' [ (λ CB → fst CB → snd CB) ↓ pair×= r q ]) → (span A B C f g) == (span A' B' C' f' g') span=-raw idp idp idp idp idp = idp abstract span= : ∀ {i j k} {A A' : Type i} (p : A ≃ A') {B B' : Type j} (q : B ≃ B') {C C' : Type k} (r : C ≃ C') {f : C → A} {f' : C' → A'} (s : (a : C) → (–> p) (f a) == f' (–> r a)) {g : C → B} {g' : C' → B'} (t : (b : C) → (–> q) (g b) == g' (–> r b)) → (span A B C f g) == (span A' B' C' f' g') span= p q r {f} {f'} s {g} {g'} t = span=-raw (ua p) (ua q) (ua r) (↓-→-in (λ α → ↓-snd×-in (ua r) (ua p) (↓-idf-ua-in p ( s _ ∙ ap f' (↓-idf-ua-out r (↓-fst×-out (ua r) (ua p) α)))))) (↓-→-in (λ β → ↓-snd×-in (ua r) (ua q) (↓-idf-ua-in q ( t _ ∙ ap g' (↓-idf-ua-out r (↓-fst×-out (ua r) (ua q) β)))))) record ⊙Span {i j k : ULevel} : Type (lsucc (lmax (lmax i j) k)) where constructor ⊙span field X : Ptd i Y : Ptd j Z : Ptd k f : fst (Z ⊙→ X) g : fst (Z ⊙→ Y) ⊙span-out : ∀ {i j k} → ⊙Span {i} {j} {k} → Span {i} {j} {k} ⊙span-out (⊙span X Y Z f g) = span (fst X) (fst Y) (fst Z) (fst f) (fst g) {- Helper for path induction on pointed spans -} ⊙span-J : ∀ {i j k l} (P : ⊙Span {i} {j} {k} → Type l) → ({A : Type i} {B : Type j} {Z : Ptd k} (f : fst Z → A) (g : fst Z → B) → P (⊙span (A , f (snd Z)) (B , g (snd Z)) Z (f , idp) (g , idp))) → Π ⊙Span P ⊙span-J P t (⊙span (A , ._) (B , ._) Z (f , idp) (g , idp)) = t f g
oeis/023/A023570.asm
neoneye/loda-programs
11
245599
; A023570: Greatest exponent in prime-power factorization of p(n)-3. ; Submitted by <NAME>(s2) ; 0,0,1,2,3,1,1,4,2,1,2,1,1,3,2,2,3,1,6,2,1,2,4,1,1,2,2,3,1,1,2,7,1,3,1,2,1,5,2,1,4,1,2,1,1,2,4,2,5,1,1,2,1,3,1,2,1,2,1,1,3,1,4,2,1,1,3,1,3,1,2,2,2,1,3,2,1,1,1,1,5,1,2,1,2,3,1,1,1,2,4,2,2,3,4,3,1,1,3 seq $0,40 ; The prime numbers. trn $0,4 seq $0,51903 ; Maximal exponent in prime factorization of n.
levels/position_overrides/lvl6_4_6.asm
cppchriscpp/ld38
4
102139
<gh_stars>1-10 .repeat 16 .byte 23 .endrepeat
data/pokemon/base_stats/gastrodon_e.asm
AtmaBuster/pokeplat-gen2
6
85483
<gh_stars>1-10 db 0 ; species ID placeholder db 111, 83, 68, 39, 92, 82 ; hp atk def spd sat sdf db WATER, GROUND ; type db 75 ; catch rate db 166 ; base exp db NO_ITEM, NO_ITEM ; items db GENDER_F50 ; gender ratio db 20 ; step cycles to hatch INCBIN "gfx/pokemon/gastrodon_e/front.dimensions" db GROWTH_MEDIUM_FAST ; growth rate dn EGG_INDETERMINATE, EGG_WATER_1 ; egg groups db 70 ; happiness ; tm/hm learnset tmhm WATER_PULSE, TOXIC, HAIL, HIDDEN_POWER, ICE_BEAM, BLIZZARD, HYPER_BEAM, PROTECT, RAIN_DANCE, FRUSTRATION, EARTHQUAKE, RETURN, DIG, DOUBLE_TEAM, SLUDGE_BOMB, SANDSTORM, ROCK_TOMB, FACADE, SECRET_POWER, REST, ATTRACT, BRINE, ENDURE, GIGA_IMPACT, FLASH, STONE_EDGE, CAPTIVATE, ROCK_SLIDE, SLEEP_TALK, NATURAL_GIFT, SWAGGER, SUBSTITUTE, SURF, STRENGTH, ROCK_SMASH, WATERFALL, ANCIENTPOWER, DIVE, EARTH_POWER, ICY_WIND, MUD_SLAP, SNORE ; end
appload/compress/comp.asm
DigitalMars/optlink
28
29510
TITLE SLR-COMPRESSOR Copyright (c) SLR Systems 1990 DOSSEG INCLUDE MACROS INCLUDE SLR32 PUBLIC EOF_MSG,DO_MSG,GET_64K_SEGMENT,GET_48K_SEGMENT,SLR_MOVER,RELEASE_64K_SEGMENT,DOT PUBLIC RELEASE_48K_SEGMENT,MOVE_DSSI_TO_FINAL_HIGH_WATER,RELEASE_BLOCK PUBLIC GET_DICTSIZE2_SEGMENT,OOM_ERROR,MOVE_DSSI_TO_COMPRESS_OUTPUT,?_KEEP_QUIK_COMPRESSED .STACK .DATA SOFT EXTB ASCIZ0,ASCIZ1,TEMP_RECORD SOFT EXTW _END,_EDATA,DONT_PACK,SEED_SIZE,ASCIZ0_HANDLE,ASCIZ1_HANDLE,OUTBUF_BYTES_LEFT,PACK_BYTES_LEFT,OUTBUF_SIZE SOFT EXTW SLR_INBUF_LIMIT,INPTR,INCNT SOFT EXTD NEW_REPT_ADDR,PACK_BYTES_LEFT,INFILE_BYTES_LEFT,OUTBUF_PTR,PACK_BYTES_PTR,SLR_BYTES_LEFT SOFT EXTQ EXEPACK_STRUCTURE .CODE PASS2_TEXT SOFT EXTP COMPRESS,GET_EXEPACK_BYTES,REXE_INIT ASSUME DS:NOTHING COMPRESS_TEST PROC ; ;GET SET UP FOR DOING A COMPRESS JOB... ; ;COMP FILE_IN FILE_OUT SKIP_OFFSET NO_COMPRESS_OFFSET ; FNF: LEA SI,FNF_MSG JMP DO_MSG START: ; ;DS = PSP ;ES = PSP ;SS = STACK SEGMENT ; CLD MOV AH,30H INT21 CMP AL,2 JNC L1 MOV AX,4C01H INT21 L1: MOV DX,DGROUP MOV ES,DX ;SET UP FOR MOVING CMDLINE FROM PSP ASSUME ES:DGROUP CLI MOV SP,OFF STACK ;INIT STACK POINTER MOV SS,DX STI ASSUME SS:DGROUP ; ;ZERO OUT VARIABLES ; LEA DI,_EDATA LEA CX,_END SUB CX,DI SHR CX,1 XOR AX,AX REP STOSW ; ;COPY FILENAMES TO ASCIZ STORAGE AREAS ; MOV SI,80H ;TO DATA SEGMENT LODSB XOR AH,AH XCHG AX,CX LEA DI,ASCIZ0 CALL PARSE_NAME LEA DI,ASCIZ1 CALL PARSE_NAME MOV INPTR,SI MOV INCNT,CX CALL GET_NUMBER16 ;# OF BYTES TO SKIP (PASS STRAIGHT THRU) MOV DONT_PACK,AX CALL GET_NUMBER16 ;SEED COMPRESSOR WITH THESE, BUT DON'T OUTPUT SUB AX,DONT_PACK MOV SEED_SIZE,AX PUSH DS POP ES ;PSP IN ES PUSH SS POP DS ASSUME DS:DGROUP ; ;CALCULATE LAST PARAGRAPH ; MOV AX,SP MOV CL,4 SHR AX,CL INC AX ADD AX,DGROUP MOV BX,ES SUB BX,AX ;SIZE OF BLOCK NEG BX MOV AH,4AH INT21 LEA SI,SIGNON CALL PRINT ; ; ; ; SETT QUIKPACK_FLAG ; ;OPEN INPUT FILE ; LEA DX,ASCIZ0 MOV AX,3D00H ;R/O INT21 .EN CJ JC FNF .DS CJ MOV ASCIZ0_HANDLE,AX XCHG AX,BX XOR CX,CX XOR DX,DX MOV AX,4202H ;GET FILE LENGTH INT21 XOR CX,CX XCHG CX,DONT_PACK SUB AX,CX SBB DX,0 MOV INFILE_BYTES_LEFT.LW,AX MOV INFILE_BYTES_LEFT.HW,DX MOV NEW_REPT_ADDR.LW,AX MOV NEW_REPT_ADDR.HW,DX MOV DX,CX XOR CX,CX MOV AX,4200H ;RESET TO BEGINNING, SKIP SKIPPED BYTES INT21 ; ;OPEN OUTPUT FILE ; FIXDS FIXES CMP ASCIZ1,0 JNZ 0$ CALL MOVE_0_TO_1 0$: LEA DX,ASCIZ1 MOV AX,3D02H ;R/W INT21 JNC F_OPENED XOR CX,CX MOV AX,3C00H ;CREATE INT21 JNC F_OPENED CANT_CREATE: LEA SI,CCM JMP DO_MSG F_OPENED: MOV ASCIZ1_HANDLE,AX CALL COMPRESS ; ;CLOSE FILES ; ASSUME DS:NOTHING CALL FLUSH_OUTBUF MOV BX,ASCIZ1_HANDLE XOR CX,CX MOV AH,40H ;TRUNCATE FILE INT21 MOV AH,3EH ;CLOSE INT21 ; ; ; LEA SI,SUCCESS_MSG CALL PRINT MOV AX,4C00H INT21 COMPRESS_TEST ENDP ASSUME DS:NOTHING SLR_MOVER PROC ; ;MOVE CX BYTES TO ES:DI ;SET SLR_INBUF_LIMIT TO MAX ADDRESS ; 0$: MOV AX,PACK_BYTES_LEFT OR AX,AX JNZ 1$ PUSHM ES,DI,CX CALL GET_NEXT_BUFFER JCXZ 8$ ;END OF DATA... MOV PACK_BYTES_PTR.OFFS,SI MOV PACK_BYTES_PTR.SEGM,DS MOV PACK_BYTES_LEFT,CX SUB SLR_BYTES_LEFT.LW,CX SBB SLR_BYTES_LEFT.HW,0 MOV AX,CX POPM CX,DI,ES 1$: ; ;MOVE SMALLER OF PACK_BYTES_LEFT AND CX ; CMP AX,CX JB 2$ MOV AX,CX 2$: SUB PACK_BYTES_LEFT,AX PUSH CX MOV CX,AX LDS SI,PACK_BYTES_PTR OPTI_MOVSB POP CX MOV PACK_BYTES_PTR.OFFS,SI SUB CX,AX JNZ 0$ 3$: MOV SLR_INBUF_LIMIT,DI RET 8$: POPM CX,DI,ES JMP 3$ SLR_MOVER ENDP MOVE_DSSI_TO_FINAL_HIGH_WATER PROC MOVE_DSSI_TO_COMPRESS_OUTPUT LABEL PROC ; ; ; PUSHM ES,DI,BX BITT OUTBUF_EXISTS JZ 1$ 2$: LES DI,OUTBUF_PTR ; ;MOVE SMALLER OF CX AND BYTES-LEFT ; MOV AX,OUTBUF_BYTES_LEFT CMP AX,CX JB 3$ MOV AX,CX 3$: XCHG AX,CX MOV BX,CX OPTI_MOVSB MOV OUTBUF_PTR.OFFS,DI SUB OUTBUF_BYTES_LEFT,BX JZ 4$ 5$: XCHG AX,CX SUB CX,BX JNZ 2$ POPM BX,DI,ES RET 1$: SETT OUTBUF_EXISTS ; ;TRY TO ALLOCATE A LARGE BUFFER ; MOV DI,800H ;TRY FOR 32K 11$: MOV BX,DI MOV AH,48H INT21 JC 15$ MOV OUTBUF_PTR.SEGM,AX MOV OUTBUF_PTR.OFFS,0 SHLI DI,4 MOV OUTBUF_SIZE,DI MOV OUTBUF_BYTES_LEFT,DI JMP 2$ 15$: SHR DI,1 CMP DI,40H JA 11$ JMP OOM 4$: CALL FLUSH_OUTBUF JMP 5$ MOVE_DSSI_TO_FINAL_HIGH_WATER ENDP ASSUME DS:NOTHING GET_NEXT_BUFFER PROC ; ;GET TEMP_RECORD FILLED WITH DATA PLEASE ;RETURN DS:SI CX ; PUSHM DI,AX FIXDS 5$: ; ;NEED TO READ SOME DATA FROM FILE ; ;MOVE SMALLER OF TEMP_RECORD_SIZE AND INFILE_BYTES_LEFT ; MOV CX,TEMP_RECORD_SIZE CMP INFILE_BYTES_LEFT.HW,0 JNZ 51$ MOV AX,INFILE_BYTES_LEFT.LW CMP AX,CX JA 51$ MOV CX,AX 51$: ; ;CX IS # OF BYTES TO READ ; JCXZ 7$ LEA DX,TEMP_RECORD MOV BX,ASCIZ0_HANDLE MOV AH,3FH INT21 CMP AX,CX JNZ 9$ SUB INFILE_BYTES_LEFT.LW,AX SBB INFILE_BYTES_LEFT.HW,0 ; ;ADD IN CRC32 ; MOV SI,DX 3$: POP AX POP DI XOR DX,DX RET 7$: POPM AX,DI STC RET 9$: LEA SI,EOF_MSG JMP DO_MSG GET_NEXT_BUFFER ENDP ASSUME DS:NOTHING FLUSH_OUTBUF PROC NEAR ; ; ; PUSHM DS,DX,CX,BX,AX LDS CX,OUTBUF_PTR XOR DX,DX MOV OUTBUF_PTR.OFFS,DX MOV BX,ASCIZ1_HANDLE MOV AH,40H INT21 CMP AX,CX JNZ 8$ 9$: MOV AX,OUTBUF_SIZE MOV OUTBUF_BYTES_LEFT,AX POPM AX,BX,CX,DX,DS RET 8$: LEA SI,CWM JMP DO_MSG FLUSH_OUTBUF ENDP GET_48K_SEGMENT PROC ; ;RETURN AX= PARAGRAPH OF 64K SEGMENT ; MOV BX,1000H/4*3 JMP G64 GET_48K_SEGMENT ENDP GET_DICTSIZE2_SEGMENT LABEL PROC ; ;ROUND DICT_SIZE TO NEAREST K ; MOV AX,DICT_SIZE ADD AX,1023 AND AX,NOT 1023 SHRI AX,3 ;# OF PARAGRAPHS... XCHG AX,BX JMP G64 GET_64K_SEGMENT PROC ; ;RETURN AX= PARAGRAPH OF 64K SEGMENT ; MOV BX,1000H G64: MOV AH,48H INT21 JC 8$ RET 8$: OOM: OOM_ERROR: LEA SI,OOM_MSG JMP DO_MSG GET_64K_SEGMENT ENDP RELEASE_64K_SEGMENT PROC ; ; ; RELEASE_48K_SEGMENT LABEL PROC RELEASE_BLOCK LABEL PROC PUSH ES MOV ES,AX MOV AH,49H INT21 POP ES RET RELEASE_64K_SEGMENT ENDP MOVE_0_TO_1 PROC NEAR ; ;RE-USE FILENAME FROM INPUT ; LEA SI,ASCIZ0 LEA DI,ASCIZ1 1$: LODSB STOSB OR AL,AL JNZ 1$ RET MOVE_0_TO_1 ENDP DO_MSG: CALL PRINT ABORT: MOV AX,4C01H INT21 PRINT PROC NEAR ; ; ; MOV AX,DGROUP MOV DS,AX LODSB CBW XCHG AX,CX MOV DX,SI MOV BX,1 MOV AH,40H INT21 RET PRINT ENDP ASSUME DS:NOTHING PARSE_NAME PROC NEAR ; ;DS:SI IS SOURCE, ES:DI IS DESTINATION, CX IS BYTES LEFT ; JCXZ 9$ LODSB DEC CX CMP AL,9 JZ PARSE_NAME CMP AL,20H JZ PARSE_NAME 1$: STOSB JCXZ 5$ LODSB DEC CX CMP AL,9 JZ 5$ CMP AL,20H JNZ 1$ 5$: 9$: XOR AL,AL STOSB RET PARSE_NAME ENDP ASSUME DS:NOTHING GET_NUMBER16 PROC NEAR ; ; ; XOR DI,DI XOR BX,BX MOV CX,10 1$: CALL GETNXT JZ 9$ CMP AL,' ' JZ 1$ CMP AL,9 JZ 1$ SUB AL,30H CMP AL,CL JA GN_ERROR OR AL,AL JNZ GET_DECIMAL CALL GETNXT JZ 9$ MOV CL,8 CMP AL,'X' JZ GET_HEX CMP AL,'x' JNZ GET_OCTAL GET_HEX: MOV CL,16 G_LOOP: CALL GETNXT GET_OCTAL: SUB AL,30H CMP AL,0AH JC GET_DECIMAL SUB AL,7 CMP AL,0AH JC NUMBER_DONE CMP AL,10H ;MUST BE 0A-0F JC GET_DECIMAL CMP AL,'a'-30H-7 JC NUMBER_DONE CMP AL,'f'-30H-7 JA NUMBER_DONE SUB AL,20H GET_DECIMAL: CBW CMP AL,CL JNC NUMBER_DONE OR DI,DI JZ 5$ ;EASY IF HI-WORD IS ZERO ; ;MULT HI WORD FIRST ; XCHG AX,DI MUL CX XCHG AX,DI OR DX,DX JNZ 8$ 5$: XCHG AX,BX MUL CX ADD DI,DX JC 8$ ADD BX,AX ADC DI,0 JNC G_LOOP 8$: GN_ERROR: LEA SI,NUM_MSG CALL DO_MSG NUMBER_DONE: 9$: XCHG AX,BX MOV DX,DI RET GET_NUMBER16 ENDP ASSUME DS:NOTHING GETNXT PROC NEAR ; ; ; XOR AX,AX CMP INCNT,AX JZ 9$ MOV SI,INPTR DEC INCNT LODSB MOV INPTR,SI OR AL,AL 9$: RET GETNXT ENDP ASSUME DS:NOTHING DOT PROC ; ; ; PUSHM DS,DX,CX,BX,AX FIXDS LEA DX,DOT_DAT MOV CX,1 MOV BX,1 MOV AH,40H INT21 POPM AX,BX,CX,DX,DS RET DOT ENDP ?_KEEP_QUIK_COMPRESSED PROC NEAR ; ; ; RET ;YES, WE ALWAYS KEEP IT ?_KEEP_QUIK_COMPRESSED ENDP .DATA DOT_DAT DB '.' OOM_MSG DB LENGTH OOM_MSG-1,'Not enough memory' FNF_MSG DB LENGTH FNF_MSG-1,'File not found' NUM_MSG DB LENGTH NUM_MSG-1,'Illegal Number' CCM DB LENGTH CCM-1,"Can't create file" CWM DB LENGTH CWM-1,'Error writing file' EOF_MSG DB LENGTH EOF_MSG-1,'Unexepected EOF reading file' NODATA_MSG DB LENGTH NODATA_MSG-1,'No Data to compress' SIGNON DB LENGTH SIGNON-1,'SLR Compressor Copyright (C) SLR Systems, Inc. 1993 ',0DH,0AH, \ 'All Rights Reserved.',0DH,0AH SUCCESS_MSG DB LENGTH SUCCESS_MSG-1,'Finished',0DH,0AH END START
src/util/oli/qdos/rrtc.asm
olifink/qspread
0
18624
<gh_stars>0 ; read current time and date from real time clock section utility include win1_mac_oli include win1_keys_qdos_sms xdef ut_rrtc ;+++ ; read current time and date from real time clock ; ; Entry Exit ; d1.l time in seconds ;--- ut_rrtc subr d2/a0 moveq #sms.rrtc,d0 trap #do.sms2 subend end
Practica 03/P03_Ejercicio1/src/ejercicio1.adb
dpr1005/Tiempo-Real-Ejercicios
0
3486
<gh_stars>0 with Ada.Text_IO; use Ada.Text_IO; procedure Ejercicio1 is task Tarea1; task Tarea2; task Tarea3; task body Tarea1 is begin for I in 1..10 loop Put_Line("Soy T1"); --delay 1.0; end loop; end Tarea1; task body Tarea2 is begin for I in 1..15 loop Put_Line("Soy T2"); --delay 1.0; end loop; end Tarea2; task body Tarea3 is begin for I in 1..4 loop Put_Line("Soy T3"); --delay 1.0; end loop; end Tarea3; begin for I in 0..7 loop Put_Line("Soy P"); end loop; end Ejercicio1;
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/cd/cd2a21e.ada
best08618/asylo
7
28408
-- CD2A21E.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- OBJECTIVE: -- CHECK THAT WHEN A SIZE SPECIFICATION IS GIVEN FOR AN -- ENUMERATION TYPE, THEN SUCH A TYPE CAN -- BE PASSED AS AN ACTUAL PARAMETER TO A GENERIC PROCEDURE. -- HISTORY: -- JET 08/18/87 CREATED ORIGINAL TEST. -- DHH 04/17/89 CHANGED EXTENSION FROM '.DEP' TO '.ADA', CHANGED -- OPERATORS ON 'SIZE TESTS, AND ADDED CHECK ON -- REPRESENTATION CLAUSE. -- BCB 03/05/90 ADDED CALL TO LENGTH_CHECK TO VERIFY THAT THE SIZE -- SPECIFICATION IS OBEYED. -- LDC 10/03/90 ADDED CASES FOR >=, /=, ASSIGNMENT, QUALIFICATION, -- AND EXPLICIT CONVERSION. -- JRL 03/26/92 ELIMINATED REDUNDANT TESTING. WITH REPORT; USE REPORT; WITH LENGTH_CHECK; -- CONTAINS A CALL TO 'FAILED'. PROCEDURE CD2A21E IS TYPE BASIC_ENUM IS (ZERO, ONE, TWO); BASIC_SIZE : CONSTANT := INTEGER'SIZE / 2; FOR BASIC_ENUM'SIZE USE BASIC_SIZE; BEGIN TEST ("CD2A21E", "CHECK THAT WHEN A SIZE SPECIFICATION IS " & "GIVEN FOR AN ENUMERATION TYPE, " & "THEN SUCH A TYPE CAN BE " & "PASSED AS AN ACTUAL PARAMETER TO A GENERIC " & "PROCEDURE"); DECLARE -- TYPE DECLARATION GIVEN WITHIN GENERIC PROCEDURE. GENERIC TYPE GPARM IS (<>); PROCEDURE GENPROC (C0, C1, C2: GPARM); PROCEDURE GENPROC (C0, C1, C2: GPARM) IS SUBTYPE CHECK_TYPE IS GPARM; C3 : GPARM; CHECKVAR : CHECK_TYPE; PROCEDURE CHECK_1 IS NEW LENGTH_CHECK (CHECK_TYPE); FUNCTION IDENT (CH : CHECK_TYPE) RETURN CHECK_TYPE IS BEGIN IF EQUAL (3, 3) THEN RETURN CH; ELSE RETURN C1; END IF; END IDENT; BEGIN -- GENPROC. CHECKVAR := IDENT (C0); CHECK_1 (CHECKVAR, CHECK_TYPE'SIZE, "CHECK_TYPE"); IF CHECK_TYPE'SIZE /= IDENT_INT (BASIC_SIZE) THEN FAILED ("INCORRECT VALUE FOR CHECK_TYPE'SIZE"); END IF; IF C0'SIZE < IDENT_INT (BASIC_SIZE) THEN FAILED ("INCORRECT VALUE FOR C0'SIZE"); END IF; IF NOT ((IDENT (C1) IN C1 .. C2) AND (IDENT(C0) NOT IN IDENT (C1) .. C2)) THEN FAILED ("INCORRECT RESULTS FOR MEMBERSHIP " & "OPERATORS"); END IF; IF CHECK_TYPE'LAST /= IDENT (C2) THEN FAILED ("INCORRECT VALUE FOR CHECK_TYPE'LAST"); END IF; IF CHECK_TYPE'VAL (0) /= IDENT (C0) OR CHECK_TYPE'VAL (1) /= IDENT (C1) OR CHECK_TYPE'VAL (2) /= IDENT (C2) THEN FAILED ("INCORRECT VALUE FOR CHECK_TYPE'VAL"); END IF; IF CHECK_TYPE'PRED (C1) /= IDENT (C0) OR CHECK_TYPE'PRED (C2) /= IDENT (C1) THEN FAILED ("INCORRECT VALUE FOR CHECK_TYPE'PRED"); END IF; IF CHECK_TYPE'VALUE ("ZERO") /= IDENT (C0) OR CHECK_TYPE'VALUE ("ONE") /= IDENT (C1) OR CHECK_TYPE'VALUE ("TWO") /= IDENT (C2) THEN FAILED ("INCORRECT VALUE FOR CHECK_TYPE'VALUE"); END IF; CHECKVAR := CHECK_TYPE'VALUE ("ONE"); C3 := GPARM(CHECKVAR); IF C3 /= IDENT(C1) THEN FAILED ("INCORRECT VALUE FOR CONVERSION"); END IF; CHECK_1 (IDENT(C0), BASIC_SIZE, "CHECK_ENUM"); IF CHECK_TYPE'(C2) /= IDENT(C2) THEN FAILED ("INCORRECT VALUE FOR QUALIFICATION"); END IF; C3 := CHECK_TYPE'VALUE ("TWO"); IF C3 /= IDENT(C2) THEN FAILED ("INCORRECT VALUE FOR ASSIGNMENT"); END IF; END GENPROC; PROCEDURE NEWPROC IS NEW GENPROC (BASIC_ENUM); BEGIN NEWPROC (ZERO, ONE, TWO); END; RESULT; END CD2A21E;
Laboratory/Lab02.asm
Ping6666/Assembly-Language-Projects
4
1648
TITLE Homework02 (HW02.ASM) INCLUDE Irvine32.inc .data Val1 SBYTE 03h Val2 SBYTE 02h Val3 SBYTE 8fh Rval SDWORD ? .code main EQU start@0 main PROC movsx eax, Val1 ;eax = Val1 movsx ebx, Val2 ;ebx = Val2 movsx ecx, Val3 ;ecx = Val3 add eax, ebx ;eax = Val1 + Val2 mov ebx, eax ;ebx = Val1 + Val2 shl eax, 3 ;eax = 8*eax shl ebx, 1 ;eax = 2*eax add eax, ebx ;eax = eax + ebx = 10*(Val1 + Val2) shl ebx, 1 ;eax = 2*eax add eax, ebx ;eax = eax + ebx = 14*(Val1 + Val2) sub ecx, eax ;ecx = ecx - eax = Val3 – 14 * (Val1 + Val2) neg ecx ;ecx = -ecx = - (Val3 – 14 * (Val1 + Val2)) mov Rval, ecx ;Rval = ecx exit main ENDP END main
Kernel/Stage2.asm
Scuwr/OSDev
0
100569
;********************************************* ; Stage2.asm ; - Second Stage Bootloader ; ; Operating Systems Development Series ;********************************************* org 0x0 ; offset to 0, we will set segments later bits 16 ; we are still in real mode ; we are loaded at linear address 0x10000 jmp main ; jump to main ;*************************************************; ; Prints a string ; DS=>SI: 0 terminated string ;************************************************; Print: lodsb ; load next byte from string from SI to AL or al, al ; Does AL=0? jz PrintDone ; Yep, null terminator found-bail out mov ah, 0eh ; Nope-Print the character int 10h jmp Print ; Repeat until null terminator found PrintDone: ret ; we are done, so return ;*************************************************; ; Second Stage Loader Entry Point ;************************************************; main: cli ; clear interrupts push cs ; Insure DS=CS pop ds mov si, Msg call Print cli ; clear interrupts to prevent triple faults hlt ; hault the syst ;*************************************************; ; Data Section ;************************************************; Msg db "Preparing to load operating system...",13,10,0
applescript/ZipFilesWithPassword.applescript
jacsuper/automation
0
3681
<gh_stars>0 set display_text to "Please enter your password:" repeat considering case set init_pass to text returned of (display dialog display_text default answer "" with hidden answer) set final_pass to text returned of (display dialog "Please verify your password below." buttons {"OK"} default button 1 default answer "" with hidden answer) if (final_pass = init_pass) then exit repeat else set display_text to "Mismatching passwords, please try again" end if end considering end repeat tell application "Finder" set theItems to selection set theItem to (item 1 of theItems) as alias set itemPath to quoted form of POSIX path of theItem set fileName to name of theItem set theFolder to POSIX path of (container of theItem as alias) set zipFile to quoted form of (fileName & ".zip") do shell script "cd '" & theFolder & "'; zip -x .DS_Store -r0 -P '" & final_pass & "' " & zipFile & " ./'" & fileName & "'" end tell
programs/oeis/127/A127511.asm
neoneye/loda
22
8024
<filename>programs/oeis/127/A127511.asm<gh_stars>10-100 ; A127511: a(n) = mu(n) * 2^(n-1). ; 1,-2,-4,0,-16,32,-64,0,0,512,-1024,0,-4096,8192,16384,0,-65536,0,-262144,0,1048576,2097152,-4194304,0,0,33554432,0,0,-268435456,-536870912,-1073741824,0,4294967296,8589934592,17179869184,0,-68719476736,137438953472,274877906944,0,-1099511627776 mov $1,$0 seq $1,8683 ; Möbius (or Moebius) function mu(n). mu(1) = 1; mu(n) = (-1)^k if n is the product of k different primes; otherwise mu(n) = 0. lpb $0 sub $0,1 mul $1,2 lpe mov $0,$1
oldstuff/tigcc/PolySnd/sources/statique/VoiceState.asm
bcherry/bcherry
3
170314
<filename>oldstuff/tigcc/PolySnd/sources/statique/VoiceState.asm section ".data" xdef pSnd_VoiceState pSnd_VoiceState: move.b State_voice,d0 rts
src/common/sp-memory.ads
jquorning/septum
236
10385
<reponame>jquorning/septum<gh_stars>100-1000 with Ada.Finalization; with Ada.Unchecked_Deallocation; with Atomic.Signed; generic type T (<>) is private; type T_Access is access T; package SP.Memory with Preelaborate is -- Atomic reference counting pointer. type Arc is new Ada.Finalization.Controlled with private; type Reference_Type (Element : access T) is limited null record with Implicit_Dereference => Element; type Reference_Count is new Integer; package Atomic_Integer is new Atomic.Signed (Reference_Count); function Make (Allocated : T_Access) return Arc with Post => Is_Valid (Make'Result); function Make_Null return Arc with Post => not Is_Valid (Make_Null'Result); function Is_Valid (Self : Arc) return Boolean; function Get (Self : Arc) return Reference_Type with Pre => Is_Valid (Self); procedure Reset (Self : aliased in out Arc) with Post => not Is_Valid (Self); -- Debugging function to get number of reference counts. function Count (Self : aliased in out Arc) return Reference_Count; overriding procedure Initialize (Self : in out Arc); overriding procedure Adjust (Self : in out Arc); overriding procedure Finalize (Self : in out Arc) with Post => not Is_Valid (Self); private -- The backing type which actually tracks the reference count, as well as -- tracking the value being pointed to. type Control_Block is limited record Value : T_Access := null; Count : aliased Atomic_Integer.Instance := Atomic_Integer.Init (0); end record; type Control_Block_Access is access Control_Block; type Arc is new Ada.Finalization.Controlled with record Block : Control_Block_Access := null; end record; procedure Free is new Ada.Unchecked_Deallocation (T, T_Access); procedure Free is new Ada.Unchecked_Deallocation (Control_Block, Control_Block_Access); end SP.Memory;
oeis/031/A031370.asm
neoneye/loda-programs
11
97892
; A031370: a(n) = prime(4n-1). ; Submitted by <NAME> ; 5,17,31,47,67,83,103,127,149,167,191,211,233,257,277,307,331,353,379,401,431,449,467,499,523,563,587,607,631,653,677,709,739,761,797,823,853,877,907,937,967,991,1019,1039,1063,1093,1117,1153,1187,1217,1237,1279,1297,1319,1367,1409,1433,1453,1483,1499,1543,1567,1597,1613,1637,1669,1709,1741,1777,1801,1847,1873,1901,1933,1979,1999,2027,2063,2087,2113,2141,2179,2221,2251,2281,2309,2341,2371,2389,2417,2447,2477,2539,2557,2609,2647,2671,2689,2711,2731 mov $2,36 mul $2,$0 mul $0,4 mov $4,4 lpb $2 mov $3,$4 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 mov $1,$0 max $1,0 cmp $1,$0 mul $2,$1 sub $2,1 add $4,2 lpe mov $0,$4 add $0,1
source/strings/a-snmcma.ads
ytomino/drake
33
9169
pragma License (Unrestricted); -- implementation unit package Ada.Strings.Naked_Maps.Case_Mapping is pragma Preelaborate; function Lower_Case_Map return not null Character_Mapping_Access; function Upper_Case_Map return not null Character_Mapping_Access; end Ada.Strings.Naked_Maps.Case_Mapping;
Thesis/SIRelBigStep/DOpSem.agda
inc-lc/ilc-agda
10
2048
<filename>Thesis/SIRelBigStep/DOpSem.agda {-# OPTIONS --exact-split #-} module Thesis.SIRelBigStep.DOpSem where open import Data.Nat open import Relation.Nullary open import Relation.Binary.PropositionalEquality open import Thesis.SIRelBigStep.DLangDerive public open import Thesis.SIRelBigStep.OpSem public open import Thesis.SIRelBigStep.DSyntax public data DVal : Type → Set import Base.Denotation.Environment module D = Base.Denotation.Environment DType DVal ChΔ : ∀ (Δ : Context) → Set ChΔ Δ = D.⟦ Δ ⟧Context data DVal where bang : ∀ {τ} → Val τ → DVal τ dclosure : ∀ {Γ σ τ} → (dt : DTerm (σ • Γ) τ) → (ρ : ⟦ Γ ⟧Context) → (dρ : ChΔ Γ) → DVal (σ ⇒ τ) dnatV : ∀ (n : ℕ) → DVal nat dpairV : ∀ {σ τ} → DVal σ → DVal τ → DVal (pair σ τ) _⊕_ : ∀ {τ} → (v1 : Val τ) (dv : DVal τ) → Val τ _⊕ρ_ : ∀ {Γ} → ⟦ Γ ⟧Context → ChΔ Γ → ⟦ Γ ⟧Context ∅ ⊕ρ ∅ = ∅ (v • ρ1) ⊕ρ (dv • dρ) = v ⊕ dv • ρ1 ⊕ρ dρ v1 ⊕ bang v2 = v2 closure {Γ} t ρ ⊕ dclosure {Γ1} dt ρ₁ dρ with Γ ≟Ctx Γ1 closure {Γ} t ρ ⊕ dclosure {.Γ} dt ρ₁ dρ | yes refl = closure t (ρ ⊕ρ dρ) ... | no ¬p = closure t ρ natV n ⊕ dnatV dn = natV (n + dn) pairV v1 v2 ⊕ dpairV dv1 dv2 = pairV (v1 ⊕ dv1) (v2 ⊕ dv2) inv-Δτ-nat : ∀ τ → Δτ τ ≡ nat → τ ≡ nat inv-Δτ-nat nat refl = refl inv-Δτ-nat (τ ⇒ τ₁) () inv-Δτ-nat (pair τ τ₁) () deval-const : ∀ {τ} → Const (Δτ τ) → DVal τ deval-const {σ} c with Δτ σ | inv-Δτ-nat σ deval-const {σ} (lit n) | .nat | inv-σ with inv-σ refl deval-const {.nat} (lit n) | .nat | inv-σ | refl = dnatV n deval : ∀ {Γ τ} (sv : DSVal Γ τ) (ρ : ⟦ Γ ⟧Context) (dρ : ChΔ Γ) → DVal τ deval (dvar x) ρ dρ = D.⟦ x ⟧Var dρ deval (dabs dt) ρ dρ = dclosure dt ρ dρ deval (dcons dsv1 dsv2) ρ dρ = dpairV (deval dsv1 ρ dρ) (deval dsv2 ρ dρ) deval (dconst c) ρ dρ = deval-const c deval-primitive : ∀ {σ τ} → Primitive (σ ⇒ τ) → Val σ → DVal σ → DVal τ deval-primitive succ (natV _) (bang (natV n2)) = bang (natV (suc n2)) deval-primitive succ (natV n) (dnatV dn) = dnatV dn deval-primitive add (pairV _ _) (dpairV (dnatV da) (dnatV db)) = dnatV (da + db) deval-primitive add (pairV _ _) (bang p2) = bang (eval-primitive add p2) -- During the proof we need to know which clauses hold definitionally, and sadly we can't get a single equation here. deval-primitive add p1 @ (pairV a1 b1) dp @ (dpairV (dnatV da) (bang b2)) = bang (eval-primitive add (p1 ⊕ dp)) deval-primitive add p1 @ (pairV a1 b1) dp @ (dpairV (bang a2) db) = bang (eval-primitive add (p1 ⊕ dp)) deval-derive-const-inv : ∀ {τ Γ} (c : Const τ) (ρ : ⟦ Γ ⟧Context) dρ → deval (derive-const c) ρ dρ ≡ deval (derive-const c) ∅ ∅ deval-derive-const-inv (lit n) ρ dρ = refl data _D_⊢_↓_ {Γ} (ρ : ⟦ Γ ⟧Context) (dρ : ChΔ Γ) : ∀ {τ} → DTerm Γ τ → DVal τ → Set where dval : ∀ {τ} (sv : DSVal Γ τ) → ρ D dρ ⊢ dval sv ↓ deval sv ρ dρ dprimapp : ∀ {σ τ} (p : Primitive (σ ⇒ τ)) (sv : SVal Γ σ) dsv → ρ D dρ ⊢ dprimapp p sv dsv ↓ deval-primitive p (eval sv ρ) (deval dsv ρ dρ) dapp : ∀ {hasIdx} {n : Idx hasIdx} {Γ′ σ τ ρ′ dρ′} {dvs} {vt} {dvt} {vtv} {dvtv} {dt : DTerm (σ • Γ′) τ} {dv} → ρ D dρ ⊢ dval dvs ↓ dclosure dt ρ′ dρ′ → ρ ⊢ val vt ↓[ n ] vtv → ρ D dρ ⊢ dval dvt ↓ dvtv → (vtv • ρ′) D (dvtv • dρ′) ⊢ dt ↓ dv → ρ D dρ ⊢ dapp dvs vt dvt ↓ dv dlett : ∀ {hasIdx} {n : Idx hasIdx} {σ τ} {s : Term Γ σ} {ds} {dt : DTerm (σ • Γ) τ} {vsv dvsv dv} → ρ ⊢ s ↓[ n ] vsv → ρ D dρ ⊢ ds ↓ dvsv → (vsv • ρ) D (dvsv • dρ) ⊢ dt ↓ dv → ρ D dρ ⊢ dlett s ds dt ↓ dv bangapp : ∀ {hasIdx1 hasIdx2} {n1 : Idx hasIdx1} {n2 : Idx hasIdx2} {Γ′ σ τ ρ′} {dvs} {vt} {dvt} {vtv1 dvtv} {t : Term (σ • Γ′) τ} {v2} → ρ D dρ ⊢ dval dvs ↓ bang (closure t ρ′) → ρ ⊢ val vt ↓[ n1 ] vtv1 → ρ D dρ ⊢ dval dvt ↓ dvtv → (vtv1 ⊕ dvtv • ρ′) ⊢ t ↓[ n2 ] v2 → ρ D dρ ⊢ dapp dvs vt dvt ↓ bang v2
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_6965_319.asm
ljhsiun2/medusa
9
84213
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r13 push %r15 push %rbp push %rcx push %rdi push %rsi lea addresses_WT_ht+0x132ab, %rsi lea addresses_normal_ht+0x1cd0b, %rdi nop nop and %r13, %r13 mov $14, %rcx rep movsb nop nop nop inc %r10 lea addresses_D_ht+0x17207, %r15 nop nop nop sub %rsi, %rsi movw $0x6162, (%r15) and %rsi, %rsi lea addresses_D_ht+0x183b7, %rsi lea addresses_UC_ht+0x7fcf, %rdi nop nop nop nop nop xor %r12, %r12 mov $37, %rcx rep movsb nop nop nop dec %r10 lea addresses_UC_ht+0x1d59, %rsi lea addresses_WT_ht+0xa4f, %rdi nop nop nop add $10281, %rbp mov $95, %rcx rep movsq nop dec %r10 lea addresses_WC_ht+0x1294f, %rsi lea addresses_D_ht+0x3c5f, %rdi xor %rbp, %rbp mov $31, %rcx rep movsw nop nop nop nop and $10362, %r13 lea addresses_WC_ht+0x1713f, %rsi lea addresses_D_ht+0x4b4f, %rdi nop nop nop nop nop sub $1125, %r10 mov $56, %rcx rep movsw nop nop add $16310, %rcx pop %rsi pop %rdi pop %rcx pop %rbp pop %r15 pop %r13 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r13 push %r15 push %r9 push %rax push %rbp // Store lea addresses_US+0x1cb4f, %r12 nop nop nop add $62853, %rax movb $0x51, (%r12) nop nop add %r10, %r10 // Store lea addresses_PSE+0xb4cf, %r15 nop xor $45765, %r9 mov $0x5152535455565758, %r12 movq %r12, %xmm5 movups %xmm5, (%r15) xor $42750, %r15 // Load lea addresses_D+0x4f4f, %r12 nop nop nop nop nop dec %rbp vmovups (%r12), %ymm2 vextracti128 $0, %ymm2, %xmm2 vpextrq $1, %xmm2, %rax and $53400, %rbp // Store lea addresses_normal+0x1f94f, %r9 sub $32080, %r10 mov $0x5152535455565758, %r12 movq %r12, (%r9) nop nop nop nop xor %rbp, %rbp // Store mov $0x3ed, %r15 xor $18232, %rbp mov $0x5152535455565758, %r12 movq %r12, %xmm4 vmovups %ymm4, (%r15) nop nop nop nop and %r12, %r12 // Store lea addresses_WT+0xd42f, %rax nop nop nop and $63697, %r9 mov $0x5152535455565758, %r10 movq %r10, %xmm2 vmovups %ymm2, (%rax) nop nop nop nop dec %r9 // Faulty Load lea addresses_RW+0x17d4f, %r15 nop nop nop xor %r13, %r13 movups (%r15), %xmm5 vpextrq $1, %xmm5, %rax lea oracles, %r9 and $0xff, %rax shlq $12, %rax mov (%r9,%rax,1), %rax pop %rbp pop %rax pop %r9 pop %r15 pop %r13 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_US', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 2, 'AVXalign': True, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}} {'32': 6965} 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 */
test/interaction/TopScope.agda
cagix/agda
1,989
9216
module _ where open import Common.Bool private unused = true used = true private module Private where not-in-scope = true in-scope = used -- History: -- -- * Ulf, 2015-20-12 c823aa9a0e84816d3e36ea86e04e9f9caa536c4a -- [ deadcode ] local private things are not in scope at top-level -- but imported things should be -- The previous restriction of the top level scope (7f47d51c) was a -- bit draconian and removed not only local private definitions but -- all imported things from the scope. This is fixed by this commit. -- -- * Andreas, 2021-05-18, used as testcase for issue #4647
Mrginfo.Pidgin.Compiler/Numeric.g4
MrgInfo/Pidgin
0
4443
<reponame>MrgInfo/Pidgin<gh_stars>0 grammar Numeric; import Basic; // CHAR ASC BIN fragment Hex : Digit | 'A' // 65 110 1010 | 'B' // 66 110 1011 | 'C' // 67 110 1100 | 'D' // 68 110 1101 | 'E' // 69 110 1110 | 'F' // 70 110 1111 ; FractionSeparator : '/' ; // 47 1110 0010 DecimalPoint : '.' ; // 46 1110 0011 fragment TimeSeparator : ':' ; // 58 1110 0100 fragment TimePrefix : 'T' ; // 84 1110 0101 fragment UtcZero : 'Z' ; // 90 1110 0110 fragment BinPrefix : 'b' ; // 98 1110 0111 fragment HexPrefix : 'h' ; // 104 1110 1000 ExponentPrefix : 'e' ; // 101 1110 1001 // Semantic error can occur! fragment Date : Digit Digit Digit Digit Minus Digit Digit Minus Digit Digit ; // Semantic error can occur! fragment Time : Digit Digit TimeSeparator Digit Digit TimeSeparator Digit Digit ( UtcZero | ( Plus | Minus ) Digit Digit ( TimeSeparator Digit Digit )? )? ; // Binary sugar BinNumber : ( Plus | Minus )? BinPrefix Bit+ ; // Hexadecimal sugar HexNumber : ( Plus | Minus )? HexPrefix Hex+ ; // DateTime sugar (ISO 8601 date) DateTime : Date ( TimePrefix Time )? ; // Decimal sugar Decimal : ( Plus | Minus )? Digit* DecimalPoint Digit+ ( ExponentPrefix ( Plus | Minus )? Digit+ )? | Digit+ ExponentPrefix ( Plus | Minus )? Digit+ ; // Fraction sugar fraction : numeric FractionSeparator numeric ; numeric : BinNumber | DecNumber | HexNumber | DateTime ; composite : array | fraction | Decimal ;
bucket_7E/matreshka/patches/patch-tools_configure_configure-tests-sqlite3.adb
jrmarino/ravensource
17
14840
--- tools/configure/configure-tests-sqlite3.adb.orig 2015-05-13 12:17:27 UTC +++ tools/configure/configure-tests-sqlite3.adb @@ -87,7 +87,7 @@ package body Configure.Tests.SQLite3 is (SQLite3_Library_Options, +"""-L" & Self.Switches.Libdir - & """, ""-lsqlite3"""); + & """, ""-Lsqlite3"", ""-Wl,-rpath,@PREFIX@/lib"""); Self.Report_Status ("yes (command line)"); @@ -126,6 +126,7 @@ package body Configure.Tests.SQLite3 is Append (Opts, '"'); end loop; + Append (Opts, ", ""-Wl,-rpath,@PREFIX@/lib"""); Substitutions.Insert (SQLite3_Library_Options, Opts); Self.Report_Status (+Opts);
test/Succeed/Issue5544.agda
cagix/agda
1,989
12435
<filename>test/Succeed/Issue5544.agda postulate Typ : Set ⊢ : Typ → Set N : Typ t : ⊢ N record TopPred : Set where constructor tp field nf : Typ postulate inv-t[σ] : (T : Typ) → ⊢ T → TopPred su-I′ : TopPred → Typ su-I′ krip = let tp _ = inv-t[σ] _ t open TopPred krip in N
bin/JWASM/Samples/OS232.asm
Abd-Beltaji/ASMEMU
3
99633
<gh_stars>1-10 ;--- "Hello world" for OS/2 32bit. ;--- assemble: jwasm os232.asm ;--- link: wlink sys os2v2 file os232.obj .386 .model flat DosWrite proto syscall :DWORD, :ptr BYTE, :DWORD, :ptr DWORD DosExit proto syscall :DWORD includelib <os2386.lib> .stack 4096 .data written dd 0 string db "Hello world",13,10 .code start: invoke DosWrite, 1, addr string, sizeof string, addr written invoke DosExit, 0 END start
libsrc/_DEVELOPMENT/adt/bv_priority_queue/c/sdcc_iy/bv_priority_queue_size_fastcall.asm
meesokim/z88dk
0
164432
; size_t bv_priority_queue_size_fastcall(bv_priority_queue_t *q) SECTION code_adt_bv_priority_queue PUBLIC _bv_priority_queue_size_fastcall defc _bv_priority_queue_size = asm_bv_priority_queue_size INCLUDE "adt/bv_priority_queue/z80/asm_bv_priority_queue_size.asm"
Applications/Google-Chrome/window/count of windows/count of windows.applescript
looking-for-a-job/applescript-examples
1
4185
tell application "Google Chrome" count of windows end tell
xv6/ln.asm
suriya-1403/suriya-s-XV6
2
14323
<gh_stars>1-10 _ln: file format elf32-i386 Disassembly of section .text: 00000000 <main>: #include "stat.h" #include "user.h" int main(int argc, char *argv[]) { 0: 8d 4c 24 04 lea 0x4(%esp),%ecx 4: 83 e4 f0 and $0xfffffff0,%esp 7: ff 71 fc push -0x4(%ecx) a: 55 push %ebp b: 89 e5 mov %esp,%ebp d: 53 push %ebx e: 51 push %ecx f: 89 cb mov %ecx,%ebx if(argc != 3 && argc != 4){ 11: 83 3b 03 cmpl $0x3,(%ebx) 14: 74 1c je 32 <main+0x32> 16: 83 3b 04 cmpl $0x4,(%ebx) 19: 74 17 je 32 <main+0x32> printf(2, "Usage: ln old new\n"); 1b: 83 ec 08 sub $0x8,%esp 1e: 68 5b 08 00 00 push $0x85b 23: 6a 02 push $0x2 25: e8 7a 04 00 00 call 4a4 <printf> 2a: 83 c4 10 add $0x10,%esp exit(); 2d: e8 ce 02 00 00 call 300 <exit> // if(symlink(argv[2],argv[3]) < 0){ // printf(2,"symbolic link %s %s failed\n",argv[2],argv[3]); // exit(); // } // } else if(link(argv[1], argv[2]) < 0) 32: 8b 43 04 mov 0x4(%ebx),%eax 35: 83 c0 08 add $0x8,%eax 38: 8b 10 mov (%eax),%edx 3a: 8b 43 04 mov 0x4(%ebx),%eax 3d: 83 c0 04 add $0x4,%eax 40: 8b 00 mov (%eax),%eax 42: 83 ec 08 sub $0x8,%esp 45: 52 push %edx 46: 50 push %eax 47: e8 14 03 00 00 call 360 <link> 4c: 83 c4 10 add $0x10,%esp 4f: 85 c0 test %eax,%eax 51: 79 21 jns 74 <main+0x74> printf(2, "hard link %s %s: failed\n", argv[1], argv[2]); 53: 8b 43 04 mov 0x4(%ebx),%eax 56: 83 c0 08 add $0x8,%eax 59: 8b 10 mov (%eax),%edx 5b: 8b 43 04 mov 0x4(%ebx),%eax 5e: 83 c0 04 add $0x4,%eax 61: 8b 00 mov (%eax),%eax 63: 52 push %edx 64: 50 push %eax 65: 68 6e 08 00 00 push $0x86e 6a: 6a 02 push $0x2 6c: e8 33 04 00 00 call 4a4 <printf> 71: 83 c4 10 add $0x10,%esp exit(); 74: e8 87 02 00 00 call 300 <exit> 00000079 <stosb>: "cc"); } static inline void stosb(void *addr, int data, int cnt) { 79: 55 push %ebp 7a: 89 e5 mov %esp,%ebp 7c: 57 push %edi 7d: 53 push %ebx asm volatile("cld; rep stosb" : 7e: 8b 4d 08 mov 0x8(%ebp),%ecx 81: 8b 55 10 mov 0x10(%ebp),%edx 84: 8b 45 0c mov 0xc(%ebp),%eax 87: 89 cb mov %ecx,%ebx 89: 89 df mov %ebx,%edi 8b: 89 d1 mov %edx,%ecx 8d: fc cld 8e: f3 aa rep stos %al,%es:(%edi) 90: 89 ca mov %ecx,%edx 92: 89 fb mov %edi,%ebx 94: 89 5d 08 mov %ebx,0x8(%ebp) 97: 89 55 10 mov %edx,0x10(%ebp) "=D" (addr), "=c" (cnt) : "0" (addr), "1" (cnt), "a" (data) : "memory", "cc"); } 9a: 90 nop 9b: 5b pop %ebx 9c: 5f pop %edi 9d: 5d pop %ebp 9e: c3 ret 0000009f <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { 9f: 55 push %ebp a0: 89 e5 mov %esp,%ebp a2: 83 ec 10 sub $0x10,%esp char *os; os = s; a5: 8b 45 08 mov 0x8(%ebp),%eax a8: 89 45 fc mov %eax,-0x4(%ebp) while((*s++ = *t++) != 0) ab: 90 nop ac: 8b 55 0c mov 0xc(%ebp),%edx af: 8d 42 01 lea 0x1(%edx),%eax b2: 89 45 0c mov %eax,0xc(%ebp) b5: 8b 45 08 mov 0x8(%ebp),%eax b8: 8d 48 01 lea 0x1(%eax),%ecx bb: 89 4d 08 mov %ecx,0x8(%ebp) be: 0f b6 12 movzbl (%edx),%edx c1: 88 10 mov %dl,(%eax) c3: 0f b6 00 movzbl (%eax),%eax c6: 84 c0 test %al,%al c8: 75 e2 jne ac <strcpy+0xd> ; return os; ca: 8b 45 fc mov -0x4(%ebp),%eax } cd: c9 leave ce: c3 ret 000000cf <strcmp>: int strcmp(const char *p, const char *q) { cf: 55 push %ebp d0: 89 e5 mov %esp,%ebp while(*p && *p == *q) d2: eb 08 jmp dc <strcmp+0xd> p++, q++; d4: 83 45 08 01 addl $0x1,0x8(%ebp) d8: 83 45 0c 01 addl $0x1,0xc(%ebp) while(*p && *p == *q) dc: 8b 45 08 mov 0x8(%ebp),%eax df: 0f b6 00 movzbl (%eax),%eax e2: 84 c0 test %al,%al e4: 74 10 je f6 <strcmp+0x27> e6: 8b 45 08 mov 0x8(%ebp),%eax e9: 0f b6 10 movzbl (%eax),%edx ec: 8b 45 0c mov 0xc(%ebp),%eax ef: 0f b6 00 movzbl (%eax),%eax f2: 38 c2 cmp %al,%dl f4: 74 de je d4 <strcmp+0x5> return (uchar)*p - (uchar)*q; f6: 8b 45 08 mov 0x8(%ebp),%eax f9: 0f b6 00 movzbl (%eax),%eax fc: 0f b6 d0 movzbl %al,%edx ff: 8b 45 0c mov 0xc(%ebp),%eax 102: 0f b6 00 movzbl (%eax),%eax 105: 0f b6 c8 movzbl %al,%ecx 108: 89 d0 mov %edx,%eax 10a: 29 c8 sub %ecx,%eax } 10c: 5d pop %ebp 10d: c3 ret 0000010e <strlen>: uint strlen(char *s) { 10e: 55 push %ebp 10f: 89 e5 mov %esp,%ebp 111: 83 ec 10 sub $0x10,%esp int n; for(n = 0; s[n]; n++) 114: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) 11b: eb 04 jmp 121 <strlen+0x13> 11d: 83 45 fc 01 addl $0x1,-0x4(%ebp) 121: 8b 55 fc mov -0x4(%ebp),%edx 124: 8b 45 08 mov 0x8(%ebp),%eax 127: 01 d0 add %edx,%eax 129: 0f b6 00 movzbl (%eax),%eax 12c: 84 c0 test %al,%al 12e: 75 ed jne 11d <strlen+0xf> ; return n; 130: 8b 45 fc mov -0x4(%ebp),%eax } 133: c9 leave 134: c3 ret 00000135 <memset>: void* memset(void *dst, int c, uint n) { 135: 55 push %ebp 136: 89 e5 mov %esp,%ebp stosb(dst, c, n); 138: 8b 45 10 mov 0x10(%ebp),%eax 13b: 50 push %eax 13c: ff 75 0c push 0xc(%ebp) 13f: ff 75 08 push 0x8(%ebp) 142: e8 32 ff ff ff call 79 <stosb> 147: 83 c4 0c add $0xc,%esp return dst; 14a: 8b 45 08 mov 0x8(%ebp),%eax } 14d: c9 leave 14e: c3 ret 0000014f <strchr>: char* strchr(const char *s, char c) { 14f: 55 push %ebp 150: 89 e5 mov %esp,%ebp 152: 83 ec 04 sub $0x4,%esp 155: 8b 45 0c mov 0xc(%ebp),%eax 158: 88 45 fc mov %al,-0x4(%ebp) for(; *s; s++) 15b: eb 14 jmp 171 <strchr+0x22> if(*s == c) 15d: 8b 45 08 mov 0x8(%ebp),%eax 160: 0f b6 00 movzbl (%eax),%eax 163: 38 45 fc cmp %al,-0x4(%ebp) 166: 75 05 jne 16d <strchr+0x1e> return (char*)s; 168: 8b 45 08 mov 0x8(%ebp),%eax 16b: eb 13 jmp 180 <strchr+0x31> for(; *s; s++) 16d: 83 45 08 01 addl $0x1,0x8(%ebp) 171: 8b 45 08 mov 0x8(%ebp),%eax 174: 0f b6 00 movzbl (%eax),%eax 177: 84 c0 test %al,%al 179: 75 e2 jne 15d <strchr+0xe> return 0; 17b: b8 00 00 00 00 mov $0x0,%eax } 180: c9 leave 181: c3 ret 00000182 <gets>: char* gets(char *buf, int max) { 182: 55 push %ebp 183: 89 e5 mov %esp,%ebp 185: 83 ec 18 sub $0x18,%esp int i, cc; char c; for(i=0; i+1 < max; ){ 188: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) 18f: eb 42 jmp 1d3 <gets+0x51> cc = read(0, &c, 1); 191: 83 ec 04 sub $0x4,%esp 194: 6a 01 push $0x1 196: 8d 45 ef lea -0x11(%ebp),%eax 199: 50 push %eax 19a: 6a 00 push $0x0 19c: e8 77 01 00 00 call 318 <read> 1a1: 83 c4 10 add $0x10,%esp 1a4: 89 45 f0 mov %eax,-0x10(%ebp) if(cc < 1) 1a7: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 1ab: 7e 33 jle 1e0 <gets+0x5e> break; buf[i++] = c; 1ad: 8b 45 f4 mov -0xc(%ebp),%eax 1b0: 8d 50 01 lea 0x1(%eax),%edx 1b3: 89 55 f4 mov %edx,-0xc(%ebp) 1b6: 89 c2 mov %eax,%edx 1b8: 8b 45 08 mov 0x8(%ebp),%eax 1bb: 01 c2 add %eax,%edx 1bd: 0f b6 45 ef movzbl -0x11(%ebp),%eax 1c1: 88 02 mov %al,(%edx) if(c == '\n' || c == '\r') 1c3: 0f b6 45 ef movzbl -0x11(%ebp),%eax 1c7: 3c 0a cmp $0xa,%al 1c9: 74 16 je 1e1 <gets+0x5f> 1cb: 0f b6 45 ef movzbl -0x11(%ebp),%eax 1cf: 3c 0d cmp $0xd,%al 1d1: 74 0e je 1e1 <gets+0x5f> for(i=0; i+1 < max; ){ 1d3: 8b 45 f4 mov -0xc(%ebp),%eax 1d6: 83 c0 01 add $0x1,%eax 1d9: 39 45 0c cmp %eax,0xc(%ebp) 1dc: 7f b3 jg 191 <gets+0xf> 1de: eb 01 jmp 1e1 <gets+0x5f> break; 1e0: 90 nop break; } buf[i] = '\0'; 1e1: 8b 55 f4 mov -0xc(%ebp),%edx 1e4: 8b 45 08 mov 0x8(%ebp),%eax 1e7: 01 d0 add %edx,%eax 1e9: c6 00 00 movb $0x0,(%eax) return buf; 1ec: 8b 45 08 mov 0x8(%ebp),%eax } 1ef: c9 leave 1f0: c3 ret 000001f1 <stat>: int stat(char *n, struct stat *st) { 1f1: 55 push %ebp 1f2: 89 e5 mov %esp,%ebp 1f4: 83 ec 18 sub $0x18,%esp int fd; int r; fd = open(n, O_RDONLY); 1f7: 83 ec 08 sub $0x8,%esp 1fa: 6a 00 push $0x0 1fc: ff 75 08 push 0x8(%ebp) 1ff: e8 3c 01 00 00 call 340 <open> 204: 83 c4 10 add $0x10,%esp 207: 89 45 f4 mov %eax,-0xc(%ebp) if(fd < 0) 20a: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 20e: 79 07 jns 217 <stat+0x26> return -1; 210: b8 ff ff ff ff mov $0xffffffff,%eax 215: eb 25 jmp 23c <stat+0x4b> r = fstat(fd, st); 217: 83 ec 08 sub $0x8,%esp 21a: ff 75 0c push 0xc(%ebp) 21d: ff 75 f4 push -0xc(%ebp) 220: e8 33 01 00 00 call 358 <fstat> 225: 83 c4 10 add $0x10,%esp 228: 89 45 f0 mov %eax,-0x10(%ebp) close(fd); 22b: 83 ec 0c sub $0xc,%esp 22e: ff 75 f4 push -0xc(%ebp) 231: e8 f2 00 00 00 call 328 <close> 236: 83 c4 10 add $0x10,%esp return r; 239: 8b 45 f0 mov -0x10(%ebp),%eax } 23c: c9 leave 23d: c3 ret 0000023e <atoi>: int atoi(const char *s) { 23e: 55 push %ebp 23f: 89 e5 mov %esp,%ebp 241: 83 ec 10 sub $0x10,%esp int n; n = 0; 244: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) while('0' <= *s && *s <= '9') 24b: eb 25 jmp 272 <atoi+0x34> n = n*10 + *s++ - '0'; 24d: 8b 55 fc mov -0x4(%ebp),%edx 250: 89 d0 mov %edx,%eax 252: c1 e0 02 shl $0x2,%eax 255: 01 d0 add %edx,%eax 257: 01 c0 add %eax,%eax 259: 89 c1 mov %eax,%ecx 25b: 8b 45 08 mov 0x8(%ebp),%eax 25e: 8d 50 01 lea 0x1(%eax),%edx 261: 89 55 08 mov %edx,0x8(%ebp) 264: 0f b6 00 movzbl (%eax),%eax 267: 0f be c0 movsbl %al,%eax 26a: 01 c8 add %ecx,%eax 26c: 83 e8 30 sub $0x30,%eax 26f: 89 45 fc mov %eax,-0x4(%ebp) while('0' <= *s && *s <= '9') 272: 8b 45 08 mov 0x8(%ebp),%eax 275: 0f b6 00 movzbl (%eax),%eax 278: 3c 2f cmp $0x2f,%al 27a: 7e 0a jle 286 <atoi+0x48> 27c: 8b 45 08 mov 0x8(%ebp),%eax 27f: 0f b6 00 movzbl (%eax),%eax 282: 3c 39 cmp $0x39,%al 284: 7e c7 jle 24d <atoi+0xf> return n; 286: 8b 45 fc mov -0x4(%ebp),%eax } 289: c9 leave 28a: c3 ret 0000028b <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 28b: 55 push %ebp 28c: 89 e5 mov %esp,%ebp 28e: 83 ec 10 sub $0x10,%esp char *dst, *src; dst = vdst; 291: 8b 45 08 mov 0x8(%ebp),%eax 294: 89 45 fc mov %eax,-0x4(%ebp) src = vsrc; 297: 8b 45 0c mov 0xc(%ebp),%eax 29a: 89 45 f8 mov %eax,-0x8(%ebp) while(n-- > 0) 29d: eb 17 jmp 2b6 <memmove+0x2b> *dst++ = *src++; 29f: 8b 55 f8 mov -0x8(%ebp),%edx 2a2: 8d 42 01 lea 0x1(%edx),%eax 2a5: 89 45 f8 mov %eax,-0x8(%ebp) 2a8: 8b 45 fc mov -0x4(%ebp),%eax 2ab: 8d 48 01 lea 0x1(%eax),%ecx 2ae: 89 4d fc mov %ecx,-0x4(%ebp) 2b1: 0f b6 12 movzbl (%edx),%edx 2b4: 88 10 mov %dl,(%eax) while(n-- > 0) 2b6: 8b 45 10 mov 0x10(%ebp),%eax 2b9: 8d 50 ff lea -0x1(%eax),%edx 2bc: 89 55 10 mov %edx,0x10(%ebp) 2bf: 85 c0 test %eax,%eax 2c1: 7f dc jg 29f <memmove+0x14> return vdst; 2c3: 8b 45 08 mov 0x8(%ebp),%eax } 2c6: c9 leave 2c7: c3 ret 000002c8 <restorer>: 2c8: 83 c4 0c add $0xc,%esp 2cb: 5a pop %edx 2cc: 59 pop %ecx 2cd: 58 pop %eax 2ce: c3 ret 000002cf <signal>: "pop %ecx\n\t" "pop %eax\n\t" "ret\n\t"); int signal(int signum, void(*handler)(int)) { 2cf: 55 push %ebp 2d0: 89 e5 mov %esp,%ebp 2d2: 83 ec 08 sub $0x8,%esp signal_restorer(restorer); 2d5: 83 ec 0c sub $0xc,%esp 2d8: 68 c8 02 00 00 push $0x2c8 2dd: e8 ce 00 00 00 call 3b0 <signal_restorer> 2e2: 83 c4 10 add $0x10,%esp return signal_register(signum, handler); 2e5: 83 ec 08 sub $0x8,%esp 2e8: ff 75 0c push 0xc(%ebp) 2eb: ff 75 08 push 0x8(%ebp) 2ee: e8 b5 00 00 00 call 3a8 <signal_register> 2f3: 83 c4 10 add $0x10,%esp 2f6: c9 leave 2f7: c3 ret 000002f8 <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 2f8: b8 01 00 00 00 mov $0x1,%eax 2fd: cd 40 int $0x40 2ff: c3 ret 00000300 <exit>: SYSCALL(exit) 300: b8 02 00 00 00 mov $0x2,%eax 305: cd 40 int $0x40 307: c3 ret 00000308 <wait>: SYSCALL(wait) 308: b8 03 00 00 00 mov $0x3,%eax 30d: cd 40 int $0x40 30f: c3 ret 00000310 <pipe>: SYSCALL(pipe) 310: b8 04 00 00 00 mov $0x4,%eax 315: cd 40 int $0x40 317: c3 ret 00000318 <read>: SYSCALL(read) 318: b8 05 00 00 00 mov $0x5,%eax 31d: cd 40 int $0x40 31f: c3 ret 00000320 <write>: SYSCALL(write) 320: b8 10 00 00 00 mov $0x10,%eax 325: cd 40 int $0x40 327: c3 ret 00000328 <close>: SYSCALL(close) 328: b8 15 00 00 00 mov $0x15,%eax 32d: cd 40 int $0x40 32f: c3 ret 00000330 <kill>: SYSCALL(kill) 330: b8 06 00 00 00 mov $0x6,%eax 335: cd 40 int $0x40 337: c3 ret 00000338 <exec>: SYSCALL(exec) 338: b8 07 00 00 00 mov $0x7,%eax 33d: cd 40 int $0x40 33f: c3 ret 00000340 <open>: SYSCALL(open) 340: b8 0f 00 00 00 mov $0xf,%eax 345: cd 40 int $0x40 347: c3 ret 00000348 <mknod>: SYSCALL(mknod) 348: b8 11 00 00 00 mov $0x11,%eax 34d: cd 40 int $0x40 34f: c3 ret 00000350 <unlink>: SYSCALL(unlink) 350: b8 12 00 00 00 mov $0x12,%eax 355: cd 40 int $0x40 357: c3 ret 00000358 <fstat>: SYSCALL(fstat) 358: b8 08 00 00 00 mov $0x8,%eax 35d: cd 40 int $0x40 35f: c3 ret 00000360 <link>: SYSCALL(link) 360: b8 13 00 00 00 mov $0x13,%eax 365: cd 40 int $0x40 367: c3 ret 00000368 <mkdir>: SYSCALL(mkdir) 368: b8 14 00 00 00 mov $0x14,%eax 36d: cd 40 int $0x40 36f: c3 ret 00000370 <chdir>: SYSCALL(chdir) 370: b8 09 00 00 00 mov $0x9,%eax 375: cd 40 int $0x40 377: c3 ret 00000378 <dup>: SYSCALL(dup) 378: b8 0a 00 00 00 mov $0xa,%eax 37d: cd 40 int $0x40 37f: c3 ret 00000380 <getpid>: SYSCALL(getpid) 380: b8 0b 00 00 00 mov $0xb,%eax 385: cd 40 int $0x40 387: c3 ret 00000388 <sbrk>: SYSCALL(sbrk) 388: b8 0c 00 00 00 mov $0xc,%eax 38d: cd 40 int $0x40 38f: c3 ret 00000390 <sleep>: SYSCALL(sleep) 390: b8 0d 00 00 00 mov $0xd,%eax 395: cd 40 int $0x40 397: c3 ret 00000398 <uptime>: SYSCALL(uptime) 398: b8 0e 00 00 00 mov $0xe,%eax 39d: cd 40 int $0x40 39f: c3 ret 000003a0 <halt>: SYSCALL(halt) 3a0: b8 16 00 00 00 mov $0x16,%eax 3a5: cd 40 int $0x40 3a7: c3 ret 000003a8 <signal_register>: SYSCALL(signal_register) 3a8: b8 17 00 00 00 mov $0x17,%eax 3ad: cd 40 int $0x40 3af: c3 ret 000003b0 <signal_restorer>: SYSCALL(signal_restorer) 3b0: b8 18 00 00 00 mov $0x18,%eax 3b5: cd 40 int $0x40 3b7: c3 ret 000003b8 <mprotect>: SYSCALL(mprotect) 3b8: b8 19 00 00 00 mov $0x19,%eax 3bd: cd 40 int $0x40 3bf: c3 ret 000003c0 <cowfork>: SYSCALL(cowfork) 3c0: b8 1a 00 00 00 mov $0x1a,%eax 3c5: cd 40 int $0x40 3c7: c3 ret 000003c8 <dsbrk>: SYSCALL(dsbrk) 3c8: b8 1b 00 00 00 mov $0x1b,%eax 3cd: cd 40 int $0x40 3cf: c3 ret 000003d0 <putc>: #include "stat.h" #include "user.h" static void putc(int fd, char c) { 3d0: 55 push %ebp 3d1: 89 e5 mov %esp,%ebp 3d3: 83 ec 18 sub $0x18,%esp 3d6: 8b 45 0c mov 0xc(%ebp),%eax 3d9: 88 45 f4 mov %al,-0xc(%ebp) write(fd, &c, 1); 3dc: 83 ec 04 sub $0x4,%esp 3df: 6a 01 push $0x1 3e1: 8d 45 f4 lea -0xc(%ebp),%eax 3e4: 50 push %eax 3e5: ff 75 08 push 0x8(%ebp) 3e8: e8 33 ff ff ff call 320 <write> 3ed: 83 c4 10 add $0x10,%esp } 3f0: 90 nop 3f1: c9 leave 3f2: c3 ret 000003f3 <printint>: static void printint(int fd, int xx, int base, int sgn) { 3f3: 55 push %ebp 3f4: 89 e5 mov %esp,%ebp 3f6: 83 ec 28 sub $0x28,%esp static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; 3f9: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) if(sgn && xx < 0){ 400: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 404: 74 17 je 41d <printint+0x2a> 406: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 40a: 79 11 jns 41d <printint+0x2a> neg = 1; 40c: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp) x = -xx; 413: 8b 45 0c mov 0xc(%ebp),%eax 416: f7 d8 neg %eax 418: 89 45 ec mov %eax,-0x14(%ebp) 41b: eb 06 jmp 423 <printint+0x30> } else { x = xx; 41d: 8b 45 0c mov 0xc(%ebp),%eax 420: 89 45 ec mov %eax,-0x14(%ebp) } i = 0; 423: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) do{ buf[i++] = digits[x % base]; 42a: 8b 4d 10 mov 0x10(%ebp),%ecx 42d: 8b 45 ec mov -0x14(%ebp),%eax 430: ba 00 00 00 00 mov $0x0,%edx 435: f7 f1 div %ecx 437: 89 d1 mov %edx,%ecx 439: 8b 45 f4 mov -0xc(%ebp),%eax 43c: 8d 50 01 lea 0x1(%eax),%edx 43f: 89 55 f4 mov %edx,-0xc(%ebp) 442: 0f b6 91 90 08 00 00 movzbl 0x890(%ecx),%edx 449: 88 54 05 dc mov %dl,-0x24(%ebp,%eax,1) }while((x /= base) != 0); 44d: 8b 4d 10 mov 0x10(%ebp),%ecx 450: 8b 45 ec mov -0x14(%ebp),%eax 453: ba 00 00 00 00 mov $0x0,%edx 458: f7 f1 div %ecx 45a: 89 45 ec mov %eax,-0x14(%ebp) 45d: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 461: 75 c7 jne 42a <printint+0x37> if(neg) 463: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 467: 74 2d je 496 <printint+0xa3> buf[i++] = '-'; 469: 8b 45 f4 mov -0xc(%ebp),%eax 46c: 8d 50 01 lea 0x1(%eax),%edx 46f: 89 55 f4 mov %edx,-0xc(%ebp) 472: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1) while(--i >= 0) 477: eb 1d jmp 496 <printint+0xa3> putc(fd, buf[i]); 479: 8d 55 dc lea -0x24(%ebp),%edx 47c: 8b 45 f4 mov -0xc(%ebp),%eax 47f: 01 d0 add %edx,%eax 481: 0f b6 00 movzbl (%eax),%eax 484: 0f be c0 movsbl %al,%eax 487: 83 ec 08 sub $0x8,%esp 48a: 50 push %eax 48b: ff 75 08 push 0x8(%ebp) 48e: e8 3d ff ff ff call 3d0 <putc> 493: 83 c4 10 add $0x10,%esp while(--i >= 0) 496: 83 6d f4 01 subl $0x1,-0xc(%ebp) 49a: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 49e: 79 d9 jns 479 <printint+0x86> } 4a0: 90 nop 4a1: 90 nop 4a2: c9 leave 4a3: c3 ret 000004a4 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 4a4: 55 push %ebp 4a5: 89 e5 mov %esp,%ebp 4a7: 83 ec 28 sub $0x28,%esp char *s; int c, i, state; uint *ap; state = 0; 4aa: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) ap = (uint*)(void*)&fmt + 1; 4b1: 8d 45 0c lea 0xc(%ebp),%eax 4b4: 83 c0 04 add $0x4,%eax 4b7: 89 45 e8 mov %eax,-0x18(%ebp) for(i = 0; fmt[i]; i++){ 4ba: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) 4c1: e9 59 01 00 00 jmp 61f <printf+0x17b> c = fmt[i] & 0xff; 4c6: 8b 55 0c mov 0xc(%ebp),%edx 4c9: 8b 45 f0 mov -0x10(%ebp),%eax 4cc: 01 d0 add %edx,%eax 4ce: 0f b6 00 movzbl (%eax),%eax 4d1: 0f be c0 movsbl %al,%eax 4d4: 25 ff 00 00 00 and $0xff,%eax 4d9: 89 45 e4 mov %eax,-0x1c(%ebp) if(state == 0){ 4dc: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 4e0: 75 2c jne 50e <printf+0x6a> if(c == '%'){ 4e2: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 4e6: 75 0c jne 4f4 <printf+0x50> state = '%'; 4e8: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp) 4ef: e9 27 01 00 00 jmp 61b <printf+0x177> } else { putc(fd, c); 4f4: 8b 45 e4 mov -0x1c(%ebp),%eax 4f7: 0f be c0 movsbl %al,%eax 4fa: 83 ec 08 sub $0x8,%esp 4fd: 50 push %eax 4fe: ff 75 08 push 0x8(%ebp) 501: e8 ca fe ff ff call 3d0 <putc> 506: 83 c4 10 add $0x10,%esp 509: e9 0d 01 00 00 jmp 61b <printf+0x177> } } else if(state == '%'){ 50e: 83 7d ec 25 cmpl $0x25,-0x14(%ebp) 512: 0f 85 03 01 00 00 jne 61b <printf+0x177> if(c == 'd'){ 518: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp) 51c: 75 1e jne 53c <printf+0x98> printint(fd, *ap, 10, 1); 51e: 8b 45 e8 mov -0x18(%ebp),%eax 521: 8b 00 mov (%eax),%eax 523: 6a 01 push $0x1 525: 6a 0a push $0xa 527: 50 push %eax 528: ff 75 08 push 0x8(%ebp) 52b: e8 c3 fe ff ff call 3f3 <printint> 530: 83 c4 10 add $0x10,%esp ap++; 533: 83 45 e8 04 addl $0x4,-0x18(%ebp) 537: e9 d8 00 00 00 jmp 614 <printf+0x170> } else if(c == 'x' || c == 'p'){ 53c: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp) 540: 74 06 je 548 <printf+0xa4> 542: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp) 546: 75 1e jne 566 <printf+0xc2> printint(fd, *ap, 16, 0); 548: 8b 45 e8 mov -0x18(%ebp),%eax 54b: 8b 00 mov (%eax),%eax 54d: 6a 00 push $0x0 54f: 6a 10 push $0x10 551: 50 push %eax 552: ff 75 08 push 0x8(%ebp) 555: e8 99 fe ff ff call 3f3 <printint> 55a: 83 c4 10 add $0x10,%esp ap++; 55d: 83 45 e8 04 addl $0x4,-0x18(%ebp) 561: e9 ae 00 00 00 jmp 614 <printf+0x170> } else if(c == 's'){ 566: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp) 56a: 75 43 jne 5af <printf+0x10b> s = (char*)*ap; 56c: 8b 45 e8 mov -0x18(%ebp),%eax 56f: 8b 00 mov (%eax),%eax 571: 89 45 f4 mov %eax,-0xc(%ebp) ap++; 574: 83 45 e8 04 addl $0x4,-0x18(%ebp) if(s == 0) 578: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 57c: 75 25 jne 5a3 <printf+0xff> s = "(null)"; 57e: c7 45 f4 87 08 00 00 movl $0x887,-0xc(%ebp) while(*s != 0){ 585: eb 1c jmp 5a3 <printf+0xff> putc(fd, *s); 587: 8b 45 f4 mov -0xc(%ebp),%eax 58a: 0f b6 00 movzbl (%eax),%eax 58d: 0f be c0 movsbl %al,%eax 590: 83 ec 08 sub $0x8,%esp 593: 50 push %eax 594: ff 75 08 push 0x8(%ebp) 597: e8 34 fe ff ff call 3d0 <putc> 59c: 83 c4 10 add $0x10,%esp s++; 59f: 83 45 f4 01 addl $0x1,-0xc(%ebp) while(*s != 0){ 5a3: 8b 45 f4 mov -0xc(%ebp),%eax 5a6: 0f b6 00 movzbl (%eax),%eax 5a9: 84 c0 test %al,%al 5ab: 75 da jne 587 <printf+0xe3> 5ad: eb 65 jmp 614 <printf+0x170> } } else if(c == 'c'){ 5af: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp) 5b3: 75 1d jne 5d2 <printf+0x12e> putc(fd, *ap); 5b5: 8b 45 e8 mov -0x18(%ebp),%eax 5b8: 8b 00 mov (%eax),%eax 5ba: 0f be c0 movsbl %al,%eax 5bd: 83 ec 08 sub $0x8,%esp 5c0: 50 push %eax 5c1: ff 75 08 push 0x8(%ebp) 5c4: e8 07 fe ff ff call 3d0 <putc> 5c9: 83 c4 10 add $0x10,%esp ap++; 5cc: 83 45 e8 04 addl $0x4,-0x18(%ebp) 5d0: eb 42 jmp 614 <printf+0x170> } else if(c == '%'){ 5d2: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp) 5d6: 75 17 jne 5ef <printf+0x14b> putc(fd, c); 5d8: 8b 45 e4 mov -0x1c(%ebp),%eax 5db: 0f be c0 movsbl %al,%eax 5de: 83 ec 08 sub $0x8,%esp 5e1: 50 push %eax 5e2: ff 75 08 push 0x8(%ebp) 5e5: e8 e6 fd ff ff call 3d0 <putc> 5ea: 83 c4 10 add $0x10,%esp 5ed: eb 25 jmp 614 <printf+0x170> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 5ef: 83 ec 08 sub $0x8,%esp 5f2: 6a 25 push $0x25 5f4: ff 75 08 push 0x8(%ebp) 5f7: e8 d4 fd ff ff call 3d0 <putc> 5fc: 83 c4 10 add $0x10,%esp putc(fd, c); 5ff: 8b 45 e4 mov -0x1c(%ebp),%eax 602: 0f be c0 movsbl %al,%eax 605: 83 ec 08 sub $0x8,%esp 608: 50 push %eax 609: ff 75 08 push 0x8(%ebp) 60c: e8 bf fd ff ff call 3d0 <putc> 611: 83 c4 10 add $0x10,%esp } state = 0; 614: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) for(i = 0; fmt[i]; i++){ 61b: 83 45 f0 01 addl $0x1,-0x10(%ebp) 61f: 8b 55 0c mov 0xc(%ebp),%edx 622: 8b 45 f0 mov -0x10(%ebp),%eax 625: 01 d0 add %edx,%eax 627: 0f b6 00 movzbl (%eax),%eax 62a: 84 c0 test %al,%al 62c: 0f 85 94 fe ff ff jne 4c6 <printf+0x22> } } } 632: 90 nop 633: 90 nop 634: c9 leave 635: c3 ret 00000636 <free>: static Header base; static Header *freep; void free(void *ap) { 636: 55 push %ebp 637: 89 e5 mov %esp,%ebp 639: 83 ec 10 sub $0x10,%esp Header *bp, *p; bp = (Header*)ap - 1; 63c: 8b 45 08 mov 0x8(%ebp),%eax 63f: 83 e8 08 sub $0x8,%eax 642: 89 45 f8 mov %eax,-0x8(%ebp) for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 645: a1 ac 08 00 00 mov 0x8ac,%eax 64a: 89 45 fc mov %eax,-0x4(%ebp) 64d: eb 24 jmp 673 <free+0x3d> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 64f: 8b 45 fc mov -0x4(%ebp),%eax 652: 8b 00 mov (%eax),%eax 654: 39 45 fc cmp %eax,-0x4(%ebp) 657: 72 12 jb 66b <free+0x35> 659: 8b 45 f8 mov -0x8(%ebp),%eax 65c: 3b 45 fc cmp -0x4(%ebp),%eax 65f: 77 24 ja 685 <free+0x4f> 661: 8b 45 fc mov -0x4(%ebp),%eax 664: 8b 00 mov (%eax),%eax 666: 39 45 f8 cmp %eax,-0x8(%ebp) 669: 72 1a jb 685 <free+0x4f> for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 66b: 8b 45 fc mov -0x4(%ebp),%eax 66e: 8b 00 mov (%eax),%eax 670: 89 45 fc mov %eax,-0x4(%ebp) 673: 8b 45 f8 mov -0x8(%ebp),%eax 676: 3b 45 fc cmp -0x4(%ebp),%eax 679: 76 d4 jbe 64f <free+0x19> 67b: 8b 45 fc mov -0x4(%ebp),%eax 67e: 8b 00 mov (%eax),%eax 680: 39 45 f8 cmp %eax,-0x8(%ebp) 683: 73 ca jae 64f <free+0x19> break; if(bp + bp->s.size == p->s.ptr){ 685: 8b 45 f8 mov -0x8(%ebp),%eax 688: 8b 40 04 mov 0x4(%eax),%eax 68b: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 692: 8b 45 f8 mov -0x8(%ebp),%eax 695: 01 c2 add %eax,%edx 697: 8b 45 fc mov -0x4(%ebp),%eax 69a: 8b 00 mov (%eax),%eax 69c: 39 c2 cmp %eax,%edx 69e: 75 24 jne 6c4 <free+0x8e> bp->s.size += p->s.ptr->s.size; 6a0: 8b 45 f8 mov -0x8(%ebp),%eax 6a3: 8b 50 04 mov 0x4(%eax),%edx 6a6: 8b 45 fc mov -0x4(%ebp),%eax 6a9: 8b 00 mov (%eax),%eax 6ab: 8b 40 04 mov 0x4(%eax),%eax 6ae: 01 c2 add %eax,%edx 6b0: 8b 45 f8 mov -0x8(%ebp),%eax 6b3: 89 50 04 mov %edx,0x4(%eax) bp->s.ptr = p->s.ptr->s.ptr; 6b6: 8b 45 fc mov -0x4(%ebp),%eax 6b9: 8b 00 mov (%eax),%eax 6bb: 8b 10 mov (%eax),%edx 6bd: 8b 45 f8 mov -0x8(%ebp),%eax 6c0: 89 10 mov %edx,(%eax) 6c2: eb 0a jmp 6ce <free+0x98> } else bp->s.ptr = p->s.ptr; 6c4: 8b 45 fc mov -0x4(%ebp),%eax 6c7: 8b 10 mov (%eax),%edx 6c9: 8b 45 f8 mov -0x8(%ebp),%eax 6cc: 89 10 mov %edx,(%eax) if(p + p->s.size == bp){ 6ce: 8b 45 fc mov -0x4(%ebp),%eax 6d1: 8b 40 04 mov 0x4(%eax),%eax 6d4: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx 6db: 8b 45 fc mov -0x4(%ebp),%eax 6de: 01 d0 add %edx,%eax 6e0: 39 45 f8 cmp %eax,-0x8(%ebp) 6e3: 75 20 jne 705 <free+0xcf> p->s.size += bp->s.size; 6e5: 8b 45 fc mov -0x4(%ebp),%eax 6e8: 8b 50 04 mov 0x4(%eax),%edx 6eb: 8b 45 f8 mov -0x8(%ebp),%eax 6ee: 8b 40 04 mov 0x4(%eax),%eax 6f1: 01 c2 add %eax,%edx 6f3: 8b 45 fc mov -0x4(%ebp),%eax 6f6: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 6f9: 8b 45 f8 mov -0x8(%ebp),%eax 6fc: 8b 10 mov (%eax),%edx 6fe: 8b 45 fc mov -0x4(%ebp),%eax 701: 89 10 mov %edx,(%eax) 703: eb 08 jmp 70d <free+0xd7> } else p->s.ptr = bp; 705: 8b 45 fc mov -0x4(%ebp),%eax 708: 8b 55 f8 mov -0x8(%ebp),%edx 70b: 89 10 mov %edx,(%eax) freep = p; 70d: 8b 45 fc mov -0x4(%ebp),%eax 710: a3 ac 08 00 00 mov %eax,0x8ac } 715: 90 nop 716: c9 leave 717: c3 ret 00000718 <morecore>: static Header* morecore(uint nu) { 718: 55 push %ebp 719: 89 e5 mov %esp,%ebp 71b: 83 ec 18 sub $0x18,%esp char *p; Header *hp; if(nu < 4096) 71e: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp) 725: 77 07 ja 72e <morecore+0x16> nu = 4096; 727: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp) p = sbrk(nu * sizeof(Header)); 72e: 8b 45 08 mov 0x8(%ebp),%eax 731: c1 e0 03 shl $0x3,%eax 734: 83 ec 0c sub $0xc,%esp 737: 50 push %eax 738: e8 4b fc ff ff call 388 <sbrk> 73d: 83 c4 10 add $0x10,%esp 740: 89 45 f4 mov %eax,-0xc(%ebp) if(p == (char*)-1) 743: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp) 747: 75 07 jne 750 <morecore+0x38> return 0; 749: b8 00 00 00 00 mov $0x0,%eax 74e: eb 26 jmp 776 <morecore+0x5e> hp = (Header*)p; 750: 8b 45 f4 mov -0xc(%ebp),%eax 753: 89 45 f0 mov %eax,-0x10(%ebp) hp->s.size = nu; 756: 8b 45 f0 mov -0x10(%ebp),%eax 759: 8b 55 08 mov 0x8(%ebp),%edx 75c: 89 50 04 mov %edx,0x4(%eax) free((void*)(hp + 1)); 75f: 8b 45 f0 mov -0x10(%ebp),%eax 762: 83 c0 08 add $0x8,%eax 765: 83 ec 0c sub $0xc,%esp 768: 50 push %eax 769: e8 c8 fe ff ff call 636 <free> 76e: 83 c4 10 add $0x10,%esp return freep; 771: a1 ac 08 00 00 mov 0x8ac,%eax } 776: c9 leave 777: c3 ret 00000778 <malloc>: void* malloc(uint nbytes) { 778: 55 push %ebp 779: 89 e5 mov %esp,%ebp 77b: 83 ec 18 sub $0x18,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 77e: 8b 45 08 mov 0x8(%ebp),%eax 781: 83 c0 07 add $0x7,%eax 784: c1 e8 03 shr $0x3,%eax 787: 83 c0 01 add $0x1,%eax 78a: 89 45 ec mov %eax,-0x14(%ebp) if((prevp = freep) == 0){ 78d: a1 ac 08 00 00 mov 0x8ac,%eax 792: 89 45 f0 mov %eax,-0x10(%ebp) 795: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 799: 75 23 jne 7be <malloc+0x46> base.s.ptr = freep = prevp = &base; 79b: c7 45 f0 a4 08 00 00 movl $0x8a4,-0x10(%ebp) 7a2: 8b 45 f0 mov -0x10(%ebp),%eax 7a5: a3 ac 08 00 00 mov %eax,0x8ac 7aa: a1 ac 08 00 00 mov 0x8ac,%eax 7af: a3 a4 08 00 00 mov %eax,0x8a4 base.s.size = 0; 7b4: c7 05 a8 08 00 00 00 movl $0x0,0x8a8 7bb: 00 00 00 } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 7be: 8b 45 f0 mov -0x10(%ebp),%eax 7c1: 8b 00 mov (%eax),%eax 7c3: 89 45 f4 mov %eax,-0xc(%ebp) if(p->s.size >= nunits){ 7c6: 8b 45 f4 mov -0xc(%ebp),%eax 7c9: 8b 40 04 mov 0x4(%eax),%eax 7cc: 39 45 ec cmp %eax,-0x14(%ebp) 7cf: 77 4d ja 81e <malloc+0xa6> if(p->s.size == nunits) 7d1: 8b 45 f4 mov -0xc(%ebp),%eax 7d4: 8b 40 04 mov 0x4(%eax),%eax 7d7: 39 45 ec cmp %eax,-0x14(%ebp) 7da: 75 0c jne 7e8 <malloc+0x70> prevp->s.ptr = p->s.ptr; 7dc: 8b 45 f4 mov -0xc(%ebp),%eax 7df: 8b 10 mov (%eax),%edx 7e1: 8b 45 f0 mov -0x10(%ebp),%eax 7e4: 89 10 mov %edx,(%eax) 7e6: eb 26 jmp 80e <malloc+0x96> else { p->s.size -= nunits; 7e8: 8b 45 f4 mov -0xc(%ebp),%eax 7eb: 8b 40 04 mov 0x4(%eax),%eax 7ee: 2b 45 ec sub -0x14(%ebp),%eax 7f1: 89 c2 mov %eax,%edx 7f3: 8b 45 f4 mov -0xc(%ebp),%eax 7f6: 89 50 04 mov %edx,0x4(%eax) p += p->s.size; 7f9: 8b 45 f4 mov -0xc(%ebp),%eax 7fc: 8b 40 04 mov 0x4(%eax),%eax 7ff: c1 e0 03 shl $0x3,%eax 802: 01 45 f4 add %eax,-0xc(%ebp) p->s.size = nunits; 805: 8b 45 f4 mov -0xc(%ebp),%eax 808: 8b 55 ec mov -0x14(%ebp),%edx 80b: 89 50 04 mov %edx,0x4(%eax) } freep = prevp; 80e: 8b 45 f0 mov -0x10(%ebp),%eax 811: a3 ac 08 00 00 mov %eax,0x8ac return (void*)(p + 1); 816: 8b 45 f4 mov -0xc(%ebp),%eax 819: 83 c0 08 add $0x8,%eax 81c: eb 3b jmp 859 <malloc+0xe1> } if(p == freep) 81e: a1 ac 08 00 00 mov 0x8ac,%eax 823: 39 45 f4 cmp %eax,-0xc(%ebp) 826: 75 1e jne 846 <malloc+0xce> if((p = morecore(nunits)) == 0) 828: 83 ec 0c sub $0xc,%esp 82b: ff 75 ec push -0x14(%ebp) 82e: e8 e5 fe ff ff call 718 <morecore> 833: 83 c4 10 add $0x10,%esp 836: 89 45 f4 mov %eax,-0xc(%ebp) 839: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 83d: 75 07 jne 846 <malloc+0xce> return 0; 83f: b8 00 00 00 00 mov $0x0,%eax 844: eb 13 jmp 859 <malloc+0xe1> for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 846: 8b 45 f4 mov -0xc(%ebp),%eax 849: 89 45 f0 mov %eax,-0x10(%ebp) 84c: 8b 45 f4 mov -0xc(%ebp),%eax 84f: 8b 00 mov (%eax),%eax 851: 89 45 f4 mov %eax,-0xc(%ebp) if(p->s.size >= nunits){ 854: e9 6d ff ff ff jmp 7c6 <malloc+0x4e> } } 859: c9 leave 85a: c3 ret
multimedia/directx/dxg/d3d/dx6/rast/rampold/offsets.asm
npocmaka/Windows-Server-2003
17
27492
include offs_acp.inc RLDDIRampDriver_map equ RCTX_pRampMap RLDDIGenRasDriver_fill_params equ RCTX_pFillParams RLDDIGenRasDriver_pm equ RCTX_pSurfaceBits RLDDIGenRasDriver_zb equ RCTX_pZBits RLDDIGenRasDriver_texture equ RCTX_pTexture RLDDIGenRasFillParams_wrap_u equ FPMS_dwWrapU RLDDIGenRasFillParams_wrap_v equ FPMS_dwWrapV RLDDIGenRasFillParams_culling_ccw equ FPMS_dwCullCCW RLDDIGenRasFillParams_culling_cw equ FPMS_dwCullCW RLDDITexture_transparent equ STEX_TransparentColor RLDDITexture_u_shift equ STEX_iShiftU RLDDITexture_v_shift equ STEX_iShiftV D3DINSTRUCTION_wCount equ 02h D3DINSTRUCTION_bSize equ 01h D3DTLVERTEX_sx equ 00h D3DTLVERTEX_sy equ 04h D3DTLVERTEX_sz equ 08h D3DTLVERTEX_rhw equ 0ch D3DTLVERTEX_color equ 010h D3DTLVERTEX_specular equ 014h D3DTLVERTEX_tu equ 018h D3DTLVERTEX_tv equ 01ch D3DTRIANGLE_v1 equ 00h D3DTRIANGLE_v2 equ 02h D3DTRIANGLE_v3 equ 04h
LAB3/q2.asm
Avigdor-Kolonimus/ASM
0
178216
<gh_stars>0 DATA segment M db 'KEEP SMILING$' DATA ends sseg segment stack 'STACK' db 100h dup(?) sseg ends CODE segment assume ds:DATA,cs:CODE,ss:sseg DB 'HAVE A NICE DAY$' start: mov ax,DATA mov ds,ax push cs pop ds ;(1) lea dx,M mov ah,9 int 21h SOF: mov ah,4ch int 21h CODE ends end start
libsrc/_DEVELOPMENT/math/float/math32/lm32/c/sdcc/log.asm
Frodevan/z88dk
640
105081
SECTION code_fp_math32 PUBLIC _log EXTERN cm32_sdcc_log defc _log = cm32_sdcc_log
release/src/router/lzo/asm/i386/src_nasm/lzo1y_s2.asm
ghsecuritylab/EasyTomato
15
165160
<gh_stars>10-100 ; lzo1y_s2.asm -- lzo1y_decompress_asm_safe ; ; This file is part of the LZO real-time data compression library. ; ; Copyright (C) 2011 <NAME> ; Copyright (C) 2010 <NAME> ; Copyright (C) 2009 <NAME> ; Copyright (C) 2008 <NAME> ; Copyright (C) 2007 <NAME> ; Copyright (C) 2006 <NAME> ; Copyright (C) 2005 <NAME> ; Copyright (C) 2004 <NAME> ; Copyright (C) 2003 <NAME> ; Copyright (C) 2002 <NAME> ; Copyright (C) 2001 <NAME> ; Copyright (C) 2000 <NAME> ; Copyright (C) 1999 <NAME> ; Copyright (C) 1998 <NAME> ; Copyright (C) 1997 <NAME> ; Copyright (C) 1996 <NAME> ; All Rights Reserved. ; ; The LZO library is free software; you can redistribute it and/or ; modify it under the terms of the GNU General Public License as ; published by the Free Software Foundation; either version 2 of ; the License, or (at your option) any later version. ; ; The LZO 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 General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with the LZO library; see the file COPYING. ; If not, write to the Free Software Foundation, Inc., ; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ; ; <NAME> ; <<EMAIL>> ; http://www.oberhumer.com/opensource/lzo/ ; ; /***** DO NOT EDIT - GENERATED AUTOMATICALLY *****/ %include "asminit.def" %ifdef NAME1 globalf(NAME1(lzo1y_decompress_asm_safe)) %endif %ifdef NAME2 globalf(NAME2(lzo1y_decompress_asm_safe)) %endif %ifdef NAME1 NAME1(lzo1y_decompress_asm_safe): %endif %ifdef NAME2 NAME2(lzo1y_decompress_asm_safe): %endif db 85,87,86,83,81,82,131,236,12,252,139,116,36,40,139,124 db 36,48,189,3,0,0,0,141,70,253,3,68,36,44,137,68 db 36,4,137,248,139,84,36,52,3,2,137,4,36,49,192,49 db 219,172,60,17,118,87,44,17,60,4,115,92,141,20,7,57 db 20,36,15,130,130,2,0,0,141,20,6,57,84,36,4,15 db 130,110,2,0,0,137,193,235,110,5,255,0,0,0,141,84 db 6,18,57,84,36,4,15,130,87,2,0,0,138,30,70,8 db 219,116,230,141,68,24,18,235,31,141,180,38,0,0,0,0 db 57,116,36,4,15,130,57,2,0,0,138,6,70,60,16,115 db 127,8,192,116,215,131,192,3,141,84,7,0,57,20,36,15 db 130,37,2,0,0,141,84,6,0,57,84,36,4,15,130,16 db 2,0,0,137,193,193,232,2,33,233,139,22,131,198,4,137 db 23,131,199,4,72,117,243,243,164,138,6,70,60,16,115,64 db 141,87,3,57,20,36,15,130,238,1,0,0,193,232,2,138 db 30,141,151,255,251,255,255,141,4,152,70,41,194,59,84,36 db 48,15,130,218,1,0,0,138,2,136,7,138,66,1,136,71 db 1,138,66,2,136,71,2,1,239,233,163,0,0,0,137,246 db 60,64,114,68,137,193,193,232,2,141,87,255,33,232,138,30 db 193,233,4,141,4,152,70,41,194,73,57,232,115,76,233,181 db 0,0,0,5,255,0,0,0,141,86,3,57,84,36,4,15 db 130,126,1,0,0,138,30,70,8,219,116,231,141,76,24,33 db 49,192,235,20,141,116,38,0,60,32,15,130,200,0,0,0 db 131,224,31,116,224,141,72,2,102,139,6,141,87,255,193,232 db 2,131,198,2,41,194,57,232,114,110,59,84,36,48,15,130 db 77,1,0,0,141,4,15,57,4,36,15,130,58,1,0,0 db 137,203,193,235,2,116,17,139,2,131,194,4,137,7,131,199 db 4,75,117,243,33,233,116,9,138,2,66,136,7,71,73,117 db 247,138,70,254,33,232,15,132,196,254,255,255,141,20,7,57 db 20,36,15,130,2,1,0,0,141,20,6,57,84,36,4,15 db 130,238,0,0,0,138,14,70,136,15,71,72,117,247,138,6 db 70,233,42,255,255,255,137,246,59,84,36,48,15,130,223,0 db 0,0,141,68,15,0,57,4,36,15,130,203,0,0,0,135 db 214,243,164,137,214,235,170,129,193,255,0,0,0,141,86,3 db 57,84,36,4,15,130,169,0,0,0,138,30,70,8,219,116 db 230,141,76,11,9,235,21,144,60,16,114,44,137,193,131,224 db 8,193,224,13,131,225,7,116,225,131,193,2,102,139,6,131 db 198,2,141,151,0,192,255,255,193,232,2,116,57,41,194,233 db 38,255,255,255,141,116,38,0,141,87,2,57,20,36,114,106 db 193,232,2,138,30,141,87,255,141,4,152,70,41,194,59,84 db 36,48,114,93,138,2,136,7,138,90,1,136,95,1,131,199 db 2,233,43,255,255,255,131,249,3,15,149,192,59,60,36,119 db 57,139,84,36,40,3,84,36,44,57,214,119,38,114,29,43 db 124,36,48,139,84,36,52,137,58,247,216,131,196,12,90,89 db 91,94,95,93,195,184,1,0,0,0,235,227,184,8,0,0 db 0,235,220,184,4,0,0,0,235,213,184,5,0,0,0,235 db 206,184,6,0,0,0,235,199,144,141,180,38,0,0,0,0 %ifdef NAME1 globalf_end(NAME1(lzo1y_decompress_asm_safe)) %endif %ifdef NAME2 globalf_end(NAME2(lzo1y_decompress_asm_safe)) %endif
tests/grammars/Importer.g4
vglavnyy/grammarinator
1
5242
<gh_stars>1-10 /* * Copyright (c) 2017 <NAME>, <NAME>. * * Licensed under the BSD 3-Clause License * <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>. * This file may not be copied, modified, or distributed except * according to those terms. */ /* * This test checks whether the grammar import mechanism (using rules of a * different grammar) works, even from a different directory (via the `--lib` * CLI option). */ // TEST-PROCESS: {grammar}.g4 -o {tmpdir} --lib import // TEST-GENERATE: -p {grammar}Unparser -l {grammar}Unlexer -r start -o {tmpdir}/{grammar}%d.txt // TEST-ANTLR: {grammar}.g4 -o {tmpdir} -lib import // TEST-PARSE: -p {grammar}Parser -l {grammar}Lexer -r start {tmpdir}/{grammar}%d.txt grammar Importer; import Importee; start : importee ;
adium/ASUnitTests/CantSetWindowClosable.applescript
sin-ivan/AdiumPipeEvent
0
4471
global HandyAdiumScripts on run tell application "Adium" set c to (get closeable of window 1) try set closeable of window 1 to (not c) --should not get here set closeable of window 1 to c --restore error on error number num if num is -2700 then error end try end tell end run
source/oasis/program-elements-formal_discrete_type_definitions.ads
optikos/oasis
0
27841
<reponame>optikos/oasis<gh_stars>0 -- Copyright (c) 2019 <NAME> <<EMAIL>> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Program.Elements.Formal_Type_Definitions; with Program.Lexical_Elements; package Program.Elements.Formal_Discrete_Type_Definitions is pragma Pure (Program.Elements.Formal_Discrete_Type_Definitions); type Formal_Discrete_Type_Definition is limited interface and Program.Elements.Formal_Type_Definitions.Formal_Type_Definition; type Formal_Discrete_Type_Definition_Access is access all Formal_Discrete_Type_Definition'Class with Storage_Size => 0; type Formal_Discrete_Type_Definition_Text is limited interface; type Formal_Discrete_Type_Definition_Text_Access is access all Formal_Discrete_Type_Definition_Text'Class with Storage_Size => 0; not overriding function To_Formal_Discrete_Type_Definition_Text (Self : aliased in out Formal_Discrete_Type_Definition) return Formal_Discrete_Type_Definition_Text_Access is abstract; not overriding function Left_Bracket_Token (Self : Formal_Discrete_Type_Definition_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Box_Token (Self : Formal_Discrete_Type_Definition_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; not overriding function Right_Bracket_Token (Self : Formal_Discrete_Type_Definition_Text) return not null Program.Lexical_Elements.Lexical_Element_Access is abstract; end Program.Elements.Formal_Discrete_Type_Definitions;
source/rom10/r10_maps_drl.asm
evanbowman/Red
5
99716
<filename>source/rom10/r10_maps_drl.asm ;; generated by encode_room_layouts.py r10_room_data_drl:: ;;0.json DB $0b, $13, $13, $13, $05, $0a, $0a, $0a, $0a, $0a, $0a, $0b, $13, $13, $13, $06, $0c, $13, $13, $05, $08, $39, $39, $39, $39, $39, $39, $02, $0b, $3b, $13, $06, $0c, $13, $05, $08, $39, $39, $39, $39, $39, $38, $39, $39, $02, $0b, $13, $06, $0c, $3b, $04, $39, $39, $39, $39, $38, $39, $39, $39, $39, $39, $02, $0b, $06, $0c, $05, $08, $39, $39, $39, $39, $39, $39, $39, $39, $39, $39, $39, $06, $0e, $0a, $08, $39, $39, $38, $39, $05, $0d, $0d, $0b, $39, $39, $39, $39, $02, $0a, $39, $39, $39, $39, $39, $39, $06, $0e, $0e, $0c, $39, $39, $39, $39, $39, $39, $39, $39, $39, $39, $39, $39, $06, $0e, $0e, $0c, $39, $39, $38, $39, $38, $39, $38, $39, $39, $38, $39, $39, $02, $0a, $0a, $08, $39, $39, $39, $39, $39, $39, $39, $39, $39, $39, $39, $39, $39, $39, $39, $39, $39, $39, $38, $39, $39, $39, $0d, $0d, $0d, $0b, $39, $39, $39, $39, $39, $39, $39, $39, $39, $39, $05, $0d, $0e, $0e, $0e, $0c, $39, $39, $38, $39, $39, $39, $39, $39, $39, $05, $0e, $0e, $0e, $0e, $0e, $0e, $0b, $39, $05, $07, $39, $01, $0b, $39, $05, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $08, $39, $39, $39, $02, $0d, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $08, $39, $38, $39, $39, $39, $06, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0b, $39, $39, $39, $39, $05, $0e, $0e, $0e, $0e, $0e, ;;1.json DB $0e, $0e, $0e, $0a, $0a, $08, $11, $11, $11, $11, $11, $11, $02, $0a, $0e, $0e, $0e, $0e, $08, $11, $11, $11, $12, $12, $12, $12, $12, $12, $11, $11, $06, $0e, $0e, $0c, $11, $12, $12, $12, $13, $13, $13, $13, $13, $13, $12, $12, $06, $0e, $0e, $0c, $12, $13, $13, $13, $13, $13, $13, $13, $13, $13, $13, $13, $06, $0e, $0e, $0c, $3b, $13, $13, $13, $13, $13, $13, $13, $3b, $3b, $3b, $3b, $06, $0e, $0a, $08, $39, $3b, $3b, $3b, $3b, $3b, $13, $13, $39, $39, $39, $38, $02, $0a, $39, $39, $39, $39, $39, $39, $39, $39, $3a, $3a, $39, $39, $39, $39, $39, $39, $39, $38, $39, $39, $39, $39, $39, $39, $3a, $3a, $39, $38, $39, $39, $39, $39, $39, $39, $39, $39, $39, $39, $39, $39, $14, $14, $39, $39, $39, $38, $39, $39, $39, $39, $39, $39, $39, $39, $39, $39, $13, $13, $39, $39, $39, $39, $39, $39, $0d, $0b, $39, $39, $39, $38, $39, $39, $3a, $3a, $39, $39, $39, $39, $05, $0d, $0e, $0e, $0b, $39, $39, $39, $39, $39, $3a, $3a, $39, $39, $39, $39, $06, $0e, $0e, $0e, $0c, $39, $39, $39, $39, $39, $14, $14, $39, $38, $39, $39, $06, $0e, $0e, $0e, $0e, $0b, $39, $39, $39, $39, $13, $13, $39, $39, $05, $0d, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0b, $39, $39, $39, $39, $05, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0e, $0c, $39, $39, $39, $39, $06, $0e, $0e, $0e, $0e, $0e, r10_room_data_drl_end::
src/Project6/sample3.asm
HSU-F20-CS243/p06-starter
0
25086
<filename>src/Project6/sample3.asm<gh_stars>0 //x = R0 + R1 @R0 //[2,@R0,@,R0,0] D=M //[3,D=M,D,M,] @R1 //[2,@R1,@,R1,1] D=D+M //[3,D=D+M,D,D+M,] @x //[2,@x,@,x,16] M=D //[3,M=D,M,D,] //@x -> @16
src/Prelude/List.agda
t-more/agda-prelude
0
8913
<filename>src/Prelude/List.agda<gh_stars>0 module Prelude.List where open import Prelude.List.Base public
oeis/136/A136694.asm
neoneye/loda-programs
11
97178
<reponame>neoneye/loda-programs ; A136694: Final nonzero digit of n! in base 7. ; Submitted by <NAME> ; 1,1,2,6,3,1,6,6,6,5,1,4,6,1,2,2,4,5,6,2,5,1,1,2,6,3,1,6,3,3,6,4,2,3,4,6,6,5,1,4,6,1,6,6,5,1,4,6,1,1,1,2,6,3,1,6,6,6,5,1,4,6,1,2,2,4,5,6,2,5,1,1,2,6,3,1,6,3,3,6,4,2,3,4,6,6,5,1,4,6,1,6,6,5,1,4,6,1,2,2 seq $0,142 ; Factorial numbers: n! = 1*2*3*4*...*n (order of symmetric group S_n, number of permutations of n letters). lpb $0 gcd $0,$2 mov $2,$0 div $0,7 lpe mov $0,$2
Validation/pyFrame3DD-master/gcc-master/gcc/ada/bindo-writers.adb
djamal2727/Main-Bearing-Analytical-Model
0
19311
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- B I N D O . W R I T E R S -- -- -- -- B o d y -- -- -- -- Copyright (C) 2019-2020, Free Software Foundation, Inc. -- -- -- -- 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. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING3. If not, go to -- -- http://www.gnu.org/licenses for a complete copy of the license. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Binderr; use Binderr; with Butil; use Butil; with Debug; use Debug; with Fname; use Fname; with Opt; use Opt; with Output; use Output; with Bindo.Units; use Bindo.Units; with GNAT; use GNAT; with GNAT.Graphs; use GNAT.Graphs; with GNAT.Sets; use GNAT.Sets; package body Bindo.Writers is ----------------- -- ALI_Writers -- ----------------- package body ALI_Writers is ----------------------- -- Local subprograms -- ----------------------- procedure Write_All_Units; pragma Inline (Write_All_Units); -- Write the common form of units to standard output procedure Write_Invocation_Construct (IC_Id : Invocation_Construct_Id); pragma Inline (Write_Invocation_Construct); -- Write invocation construct IC_Id to standard output procedure Write_Invocation_Relation (IR_Id : Invocation_Relation_Id); pragma Inline (Write_Invocation_Relation); -- Write invocation relation IR_Id to standard output procedure Write_Invocation_Signature (IS_Id : Invocation_Signature_Id); pragma Inline (Write_Invocation_Signature); -- Write invocation signature IS_Id to standard output procedure Write_Statistics; pragma Inline (Write_Statistics); -- Write the statistical information of units to standard output procedure Write_Unit (U_Id : Unit_Id); pragma Inline (Write_Unit); -- Write the invocation constructs and relations of unit U_Id to -- standard output. procedure Write_Unit_Common (U_Id : Unit_Id); pragma Inline (Write_Unit_Common); -- Write the common form of unit U_Id to standard output ----------- -- Debug -- ----------- procedure pau renames Write_All_Units; pragma Unreferenced (pau); procedure pu (U_Id : Unit_Id) renames Write_Unit_Common; pragma Unreferenced (pu); ---------------------- -- Write_ALI_Tables -- ---------------------- procedure Write_ALI_Tables is begin -- Nothing to do when switch -d_A (output invocation tables) is not -- in effect. if not Debug_Flag_Underscore_AA then return; end if; Write_Str ("ALI Tables"); Write_Eol; Write_Eol; Write_Statistics; For_Each_Unit (Write_Unit'Access); Write_Str ("ALI Tables end"); Write_Eol; Write_Eol; end Write_ALI_Tables; --------------------- -- Write_All_Units -- --------------------- procedure Write_All_Units is begin For_Each_Unit (Write_Unit_Common'Access); end Write_All_Units; -------------------------------- -- Write_Invocation_Construct -- -------------------------------- procedure Write_Invocation_Construct (IC_Id : Invocation_Construct_Id) is begin pragma Assert (Present (IC_Id)); Write_Str (" invocation construct (IC_Id_"); Write_Int (Int (IC_Id)); Write_Str (")"); Write_Eol; Write_Str (" Body_Placement = "); Write_Str (Body_Placement (IC_Id)'Img); Write_Eol; Write_Str (" Kind = "); Write_Str (Kind (IC_Id)'Img); Write_Eol; Write_Str (" Spec_Placement = "); Write_Str (Spec_Placement (IC_Id)'Img); Write_Eol; Write_Invocation_Signature (Signature (IC_Id)); Write_Eol; end Write_Invocation_Construct; ------------------------------- -- Write_Invocation_Relation -- ------------------------------- procedure Write_Invocation_Relation (IR_Id : Invocation_Relation_Id) is begin pragma Assert (Present (IR_Id)); Write_Str (" invocation relation (IR_Id_"); Write_Int (Int (IR_Id)); Write_Str (")"); Write_Eol; if Present (Extra (IR_Id)) then Write_Str (" Extra = "); Write_Name (Extra (IR_Id)); else Write_Str (" Extra = none"); end if; Write_Eol; Write_Str (" Invoker"); Write_Eol; Write_Invocation_Signature (Invoker (IR_Id)); Write_Str (" Kind = "); Write_Str (Kind (IR_Id)'Img); Write_Eol; Write_Str (" Target"); Write_Eol; Write_Invocation_Signature (Target (IR_Id)); Write_Eol; end Write_Invocation_Relation; -------------------------------- -- Write_Invocation_Signature -- -------------------------------- procedure Write_Invocation_Signature (IS_Id : Invocation_Signature_Id) is begin pragma Assert (Present (IS_Id)); Write_Str (" Signature (IS_Id_"); Write_Int (Int (IS_Id)); Write_Str (")"); Write_Eol; Write_Str (" Column = "); Write_Int (Int (Column (IS_Id))); Write_Eol; Write_Str (" Line = "); Write_Int (Int (Line (IS_Id))); Write_Eol; if Present (Locations (IS_Id)) then Write_Str (" Locations = "); Write_Name (Locations (IS_Id)); else Write_Str (" Locations = none"); end if; Write_Eol; Write_Str (" Name = "); Write_Name (Name (IS_Id)); Write_Eol; Write_Str (" Scope = "); Write_Name (Scope (IS_Id)); Write_Eol; end Write_Invocation_Signature; ---------------------- -- Write_Statistics -- ---------------------- procedure Write_Statistics is begin Write_Str ("Units : "); Write_Num (Int (Number_Of_Units)); Write_Eol; Write_Str ("Units to elaborate: "); Write_Num (Int (Number_Of_Elaborable_Units)); Write_Eol; Write_Eol; end Write_Statistics; ---------------- -- Write_Unit -- ---------------- procedure Write_Unit (U_Id : Unit_Id) is pragma Assert (Present (U_Id)); U_Rec : Unit_Record renames ALI.Units.Table (U_Id); begin Write_Unit_Common (U_Id); Write_Str (" First_Invocation_Construct (IC_Id_"); Write_Int (Int (U_Rec.First_Invocation_Construct)); Write_Str (")"); Write_Eol; Write_Str (" Last_Invocation_Construct (IC_Id_"); Write_Int (Int (U_Rec.Last_Invocation_Construct)); Write_Str (")"); Write_Eol; Write_Str (" First_Invocation_Relation (IR_Id_"); Write_Int (Int (U_Rec.First_Invocation_Relation)); Write_Str (")"); Write_Eol; Write_Str (" Last_Invocation_Relation (IR_Id_"); Write_Int (Int (U_Rec.Last_Invocation_Relation)); Write_Str (")"); Write_Eol; Write_Str (" Invocation_Graph_Encoding = "); Write_Str (Invocation_Graph_Encoding (U_Id)'Img); Write_Eol; Write_Eol; For_Each_Invocation_Construct (U_Id => U_Id, Processor => Write_Invocation_Construct'Access); For_Each_Invocation_Relation (U_Id => U_Id, Processor => Write_Invocation_Relation'Access); end Write_Unit; ----------------------- -- Write_Unit_Common -- ----------------------- procedure Write_Unit_Common (U_Id : Unit_Id) is pragma Assert (Present (U_Id)); U_Rec : Unit_Record renames ALI.Units.Table (U_Id); begin Write_Str ("unit (U_Id_"); Write_Int (Int (U_Id)); Write_Str (") name = "); Write_Name (U_Rec.Uname); Write_Eol; if U_Rec.SAL_Interface then Write_Str (" SAL_Interface = True"); Write_Eol; end if; end Write_Unit_Common; end ALI_Writers; ------------------- -- Cycle_Writers -- ------------------- package body Cycle_Writers is ----------------------- -- Local subprograms -- ----------------------- procedure Write_Cycle (G : Library_Graph; Cycle : Library_Graph_Cycle_Id); pragma Inline (Write_Cycle); -- Write the path of cycle Cycle found in library graph G to standard -- output. procedure Write_Cyclic_Edge (G : Library_Graph; Edge : Library_Graph_Edge_Id); pragma Inline (Write_Cyclic_Edge); -- Write cyclic edge Edge of library graph G to standard ----------- -- Debug -- ----------- procedure palgc (G : Library_Graph) renames Write_Cycles; pragma Unreferenced (palgc); procedure plgc (G : Library_Graph; Cycle : Library_Graph_Cycle_Id) renames Write_Cycle; pragma Unreferenced (plgc); ----------------- -- Write_Cycle -- ----------------- procedure Write_Cycle (G : Library_Graph; Cycle : Library_Graph_Cycle_Id) is Edge : Library_Graph_Edge_Id; Iter : Edges_Of_Cycle_Iterator; begin pragma Assert (Present (G)); pragma Assert (Present (Cycle)); -- Nothing to do when switch -d_P (output cycle paths) is not in -- effect. if not Debug_Flag_Underscore_PP then return; end if; Write_Str ("cycle (LGC_Id_"); Write_Int (Int (Cycle)); Write_Str (")"); Write_Eol; Iter := Iterate_Edges_Of_Cycle (G, Cycle); while Has_Next (Iter) loop Next (Iter, Edge); Write_Cyclic_Edge (G, Edge); end loop; Write_Eol; end Write_Cycle; ------------------ -- Write_Cycles -- ------------------ procedure Write_Cycles (G : Library_Graph) is Cycle : Library_Graph_Cycle_Id; Iter : All_Cycle_Iterator; begin pragma Assert (Present (G)); Iter := Iterate_All_Cycles (G); while Has_Next (Iter) loop Next (Iter, Cycle); Write_Cycle (G, Cycle); end loop; end Write_Cycles; ----------------------- -- Write_Cyclic_Edge -- ----------------------- procedure Write_Cyclic_Edge (G : Library_Graph; Edge : Library_Graph_Edge_Id) is pragma Assert (Present (G)); pragma Assert (Present (Edge)); Pred : constant Library_Graph_Vertex_Id := Predecessor (G, Edge); Succ : constant Library_Graph_Vertex_Id := Successor (G, Edge); begin Indent_By (Nested_Indentation); Write_Name (Name (G, Succ)); Write_Str (" --> "); Write_Name (Name (G, Pred)); Write_Str (" "); if Is_Elaborate_All_Edge (G, Edge) then Write_Str ("Elaborate_All edge"); elsif Is_Elaborate_Body_Edge (G, Edge) then Write_Str ("Elaborate_Body edge"); elsif Is_Elaborate_Edge (G, Edge) then Write_Str ("Elaborate edge"); elsif Is_Forced_Edge (G, Edge) then Write_Str ("forced edge"); elsif Is_Invocation_Edge (G, Edge) then Write_Str ("invocation edge"); else pragma Assert (Is_With_Edge (G, Edge)); Write_Str ("with edge"); end if; Write_Eol; end Write_Cyclic_Edge; end Cycle_Writers; ------------------------ -- Dependency_Writers -- ------------------------ package body Dependency_Writers is ----------------------- -- Local subprograms -- ----------------------- procedure Write_Dependencies_Of_Vertex (G : Library_Graph; Vertex : Library_Graph_Vertex_Id); pragma Inline (Write_Dependencies_Of_Vertex); -- Write the dependencies of vertex Vertex of library graph G to -- standard output. procedure Write_Dependency_Edge (G : Library_Graph; Edge : Library_Graph_Edge_Id); pragma Inline (Write_Dependency_Edge); -- Write the dependency described by edge Edge of library graph G to -- standard output. ------------------------ -- Write_Dependencies -- ------------------------ procedure Write_Dependencies (G : Library_Graph) is Use_Formatting : constant Boolean := not Zero_Formatting; Iter : Library_Graphs.All_Vertex_Iterator; Vertex : Library_Graph_Vertex_Id; begin pragma Assert (Present (G)); -- Nothing to do when switch -e (output complete list of elaboration -- order dependencies) is not in effect. if not Elab_Dependency_Output then return; end if; if Use_Formatting then Write_Eol; Write_Line ("ELABORATION ORDER DEPENDENCIES"); Write_Eol; end if; Info_Prefix_Suppress := True; Iter := Iterate_All_Vertices (G); while Has_Next (Iter) loop Next (Iter, Vertex); Write_Dependencies_Of_Vertex (G, Vertex); end loop; Info_Prefix_Suppress := False; if Use_Formatting then Write_Eol; end if; end Write_Dependencies; ---------------------------------- -- Write_Dependencies_Of_Vertex -- ---------------------------------- procedure Write_Dependencies_Of_Vertex (G : Library_Graph; Vertex : Library_Graph_Vertex_Id) is Edge : Library_Graph_Edge_Id; Iter : Edges_To_Successors_Iterator; begin pragma Assert (Present (G)); pragma Assert (Present (Vertex)); -- Nothing to do for internal and predefined units if Is_Internal_Unit (G, Vertex) or else Is_Predefined_Unit (G, Vertex) then return; end if; Iter := Iterate_Edges_To_Successors (G, Vertex); while Has_Next (Iter) loop Next (Iter, Edge); Write_Dependency_Edge (G, Edge); end loop; end Write_Dependencies_Of_Vertex; --------------------------- -- Write_Dependency_Edge -- --------------------------- procedure Write_Dependency_Edge (G : Library_Graph; Edge : Library_Graph_Edge_Id) is pragma Assert (Present (G)); pragma Assert (Present (Edge)); Pred : constant Library_Graph_Vertex_Id := Predecessor (G, Edge); Succ : constant Library_Graph_Vertex_Id := Successor (G, Edge); begin -- Nothing to do for internal and predefined units if Is_Internal_Unit (G, Succ) or else Is_Predefined_Unit (G, Succ) then return; end if; Error_Msg_Unit_1 := Name (G, Pred); Error_Msg_Unit_2 := Name (G, Succ); Error_Msg_Output (Msg => " unit $ must be elaborated before unit $", Info => True); Error_Msg_Unit_1 := Name (G, Succ); Error_Msg_Unit_2 := Name (G, Pred); if Is_Elaborate_All_Edge (G, Edge) then Error_Msg_Output (Msg => " reason: unit $ has with clause and pragma " & "Elaborate_All for unit $", Info => True); elsif Is_Elaborate_Body_Edge (G, Edge) then Error_Msg_Output (Msg => " reason: unit $ has with clause for unit $", Info => True); elsif Is_Elaborate_Edge (G, Edge) then Error_Msg_Output (Msg => " reason: unit $ has with clause and pragma Elaborate " & "for unit $", Info => True); elsif Is_Forced_Edge (G, Edge) then Error_Msg_Output (Msg => " reason: unit $ has a dependency on unit $ forced by -f " & "switch", Info => True); elsif Is_Invocation_Edge (G, Edge) then Error_Msg_Output (Msg => " reason: unit $ invokes a construct of unit $ at " & "elaboration time", Info => True); elsif Is_Spec_Before_Body_Edge (G, Edge) then Error_Msg_Output (Msg => " reason: spec must be elaborated before body", Info => True); else pragma Assert (Is_With_Edge (G, Edge)); Error_Msg_Output (Msg => " reason: unit $ has with clause for unit $", Info => True); end if; end Write_Dependency_Edge; end Dependency_Writers; ------------------------------- -- Elaboration_Order_Writers -- ------------------------------- package body Elaboration_Order_Writers is ----------------------- -- Local subprograms -- ----------------------- procedure Write_Unit (U_Id : Unit_Id); pragma Inline (Write_Unit); -- Write unit U_Id to standard output procedure Write_Units (Order : Unit_Id_Table); pragma Inline (Write_Units); -- Write all units found in elaboration order Order to standard output ----------------------------- -- Write_Elaboration_Order -- ----------------------------- procedure Write_Elaboration_Order (Order : Unit_Id_Table) is Use_Formatting : constant Boolean := not Zero_Formatting; begin -- Nothing to do when switch -l (output chosen elaboration order) is -- not in effect. if not Elab_Order_Output then return; end if; if Use_Formatting then Write_Eol; Write_Str ("ELABORATION ORDER"); Write_Eol; end if; Write_Units (Order); if Use_Formatting then Write_Eol; end if; end Write_Elaboration_Order; ---------------- -- Write_Unit -- ---------------- procedure Write_Unit (U_Id : Unit_Id) is Use_Formatting : constant Boolean := not Zero_Formatting; begin pragma Assert (Present (U_Id)); if Use_Formatting then Write_Str (" "); end if; Write_Unit_Name (Name (U_Id)); Write_Eol; end Write_Unit; ----------------- -- Write_Units -- ----------------- procedure Write_Units (Order : Unit_Id_Table) is begin for Index in Unit_Id_Tables.First .. Unit_Id_Tables.Last (Order) loop Write_Unit (Order.Table (Index)); end loop; end Write_Units; end Elaboration_Order_Writers; --------------- -- Indent_By -- --------------- procedure Indent_By (Indent : Indentation_Level) is begin for Count in 1 .. Indent loop Write_Char (' '); end loop; end Indent_By; ------------------------------ -- Invocation_Graph_Writers -- ------------------------------ package body Invocation_Graph_Writers is ----------------------- -- Local subprograms -- ----------------------- procedure Write_Elaboration_Root (G : Invocation_Graph; Root : Invocation_Graph_Vertex_Id); pragma Inline (Write_Elaboration_Root); -- Write elaboration root Root of invocation graph G to standard output procedure Write_Elaboration_Roots (G : Invocation_Graph); pragma Inline (Write_Elaboration_Roots); -- Write all elaboration roots of invocation graph G to standard output procedure Write_Invocation_Graph_Edge (G : Invocation_Graph; Edge : Invocation_Graph_Edge_Id); pragma Inline (Write_Invocation_Graph_Edge); -- Write edge Edge of invocation graph G to standard output procedure Write_Invocation_Graph_Edges (G : Invocation_Graph; Vertex : Invocation_Graph_Vertex_Id); pragma Inline (Write_Invocation_Graph_Edges); -- Write all edges to targets of vertex Vertex of invocation graph G to -- standard output. procedure Write_Invocation_Graph_Vertex (G : Invocation_Graph; Vertex : Invocation_Graph_Vertex_Id); pragma Inline (Write_Invocation_Graph_Vertex); -- Write vertex Vertex of invocation graph G to standard output procedure Write_Invocation_Graph_Vertices (G : Invocation_Graph); pragma Inline (Write_Invocation_Graph_Vertices); -- Write all vertices of invocation graph G to standard output procedure Write_Statistics (G : Invocation_Graph); pragma Inline (Write_Statistics); -- Write the statistical information of invocation graph G to standard -- output. ----------- -- Debug -- ----------- procedure pige (G : Invocation_Graph; Edge : Invocation_Graph_Edge_Id) renames Write_Invocation_Graph_Edge; pragma Unreferenced (pige); procedure pigv (G : Invocation_Graph; Vertex : Invocation_Graph_Vertex_Id) renames Write_Invocation_Graph_Vertex; pragma Unreferenced (pigv); ---------------------------- -- Write_Elaboration_Root -- ---------------------------- procedure Write_Elaboration_Root (G : Invocation_Graph; Root : Invocation_Graph_Vertex_Id) is begin pragma Assert (Present (G)); pragma Assert (Present (Root)); Write_Str ("elaboration root (IGV_Id_"); Write_Int (Int (Root)); Write_Str (") name = "); Write_Name (Name (G, Root)); Write_Eol; end Write_Elaboration_Root; ----------------------------- -- Write_Elaboration_Roots -- ----------------------------- procedure Write_Elaboration_Roots (G : Invocation_Graph) is pragma Assert (Present (G)); Num_Of_Roots : constant Natural := Number_Of_Elaboration_Roots (G); Iter : Elaboration_Root_Iterator; Root : Invocation_Graph_Vertex_Id; begin Write_Str ("Elaboration roots: "); Write_Int (Int (Num_Of_Roots)); Write_Eol; if Num_Of_Roots > 0 then Iter := Iterate_Elaboration_Roots (G); while Has_Next (Iter) loop Next (Iter, Root); Write_Elaboration_Root (G, Root); end loop; else Write_Eol; end if; end Write_Elaboration_Roots; ---------------------------- -- Write_Invocation_Graph -- ---------------------------- procedure Write_Invocation_Graph (G : Invocation_Graph) is begin pragma Assert (Present (G)); -- Nothing to do when switch -d_I (output invocation graph) is not in -- effect. if not Debug_Flag_Underscore_II then return; end if; Write_Str ("Invocation Graph"); Write_Eol; Write_Eol; Write_Statistics (G); Write_Invocation_Graph_Vertices (G); Write_Elaboration_Roots (G); Write_Str ("Invocation Graph end"); Write_Eol; Write_Eol; end Write_Invocation_Graph; --------------------------------- -- Write_Invocation_Graph_Edge -- --------------------------------- procedure Write_Invocation_Graph_Edge (G : Invocation_Graph; Edge : Invocation_Graph_Edge_Id) is pragma Assert (Present (G)); pragma Assert (Present (Edge)); Targ : constant Invocation_Graph_Vertex_Id := Target (G, Edge); begin Write_Str (" invocation graph edge (IGE_Id_"); Write_Int (Int (Edge)); Write_Str (")"); Write_Eol; Write_Str (" Relation (IR_Id_"); Write_Int (Int (Relation (G, Edge))); Write_Str (")"); Write_Eol; Write_Str (" Target (IGV_Id_"); Write_Int (Int (Targ)); Write_Str (") name = "); Write_Name (Name (G, Targ)); Write_Eol; Write_Eol; end Write_Invocation_Graph_Edge; ---------------------------------- -- Write_Invocation_Graph_Edges -- ---------------------------------- procedure Write_Invocation_Graph_Edges (G : Invocation_Graph; Vertex : Invocation_Graph_Vertex_Id) is pragma Assert (Present (G)); pragma Assert (Present (Vertex)); Num_Of_Edges : constant Natural := Number_Of_Edges_To_Targets (G, Vertex); Edge : Invocation_Graph_Edge_Id; Iter : Invocation_Graphs.Edges_To_Targets_Iterator; begin Write_Str (" Edges to targets: "); Write_Int (Int (Num_Of_Edges)); Write_Eol; if Num_Of_Edges > 0 then Iter := Iterate_Edges_To_Targets (G, Vertex); while Has_Next (Iter) loop Next (Iter, Edge); Write_Invocation_Graph_Edge (G, Edge); end loop; else Write_Eol; end if; end Write_Invocation_Graph_Edges; ----------------------------------- -- Write_Invocation_Graph_Vertex -- ----------------------------------- procedure Write_Invocation_Graph_Vertex (G : Invocation_Graph; Vertex : Invocation_Graph_Vertex_Id) is Lib_Graph : constant Library_Graph := Get_Lib_Graph (G); B : constant Library_Graph_Vertex_Id := Body_Vertex (G, Vertex); S : constant Library_Graph_Vertex_Id := Spec_Vertex (G, Vertex); begin pragma Assert (Present (G)); pragma Assert (Present (Vertex)); Write_Str ("invocation graph vertex (IGV_Id_"); Write_Int (Int (Vertex)); Write_Str (") name = "); Write_Name (Name (G, Vertex)); Write_Eol; Write_Str (" Body_Vertex (LGV_Id_"); Write_Int (Int (B)); Write_Str (") name = "); Write_Name (Name (Lib_Graph, B)); Write_Eol; Write_Str (" Construct (IC_Id_"); Write_Int (Int (Construct (G, Vertex))); Write_Str (")"); Write_Eol; Write_Str (" Spec_Vertex (LGV_Id_"); Write_Int (Int (S)); Write_Str (") name = "); Write_Name (Name (Lib_Graph, S)); Write_Eol; Write_Invocation_Graph_Edges (G, Vertex); end Write_Invocation_Graph_Vertex; ------------------------------------- -- Write_Invocation_Graph_Vertices -- ------------------------------------- procedure Write_Invocation_Graph_Vertices (G : Invocation_Graph) is Iter : Invocation_Graphs.All_Vertex_Iterator; Vertex : Invocation_Graph_Vertex_Id; begin pragma Assert (Present (G)); Iter := Iterate_All_Vertices (G); while Has_Next (Iter) loop Next (Iter, Vertex); Write_Invocation_Graph_Vertex (G, Vertex); end loop; end Write_Invocation_Graph_Vertices; ---------------------- -- Write_Statistics -- ---------------------- procedure Write_Statistics (G : Invocation_Graph) is begin pragma Assert (Present (G)); Write_Str ("Edges : "); Write_Num (Int (Number_Of_Edges (G))); Write_Eol; Write_Str ("Roots : "); Write_Num (Int (Number_Of_Elaboration_Roots (G))); Write_Eol; Write_Str ("Vertices: "); Write_Num (Int (Number_Of_Vertices (G))); Write_Eol; Write_Eol; for Kind in Invocation_Kind'Range loop Write_Str (" "); Write_Num (Int (Invocation_Graph_Edge_Count (G, Kind))); Write_Str (" - "); Write_Str (Kind'Img); Write_Eol; end loop; Write_Eol; end Write_Statistics; end Invocation_Graph_Writers; --------------------------- -- Library_Graph_Writers -- --------------------------- package body Library_Graph_Writers is ----------------------- -- Local subprograms -- ----------------------- procedure Write_Component (G : Library_Graph; Comp : Component_Id); pragma Inline (Write_Component); -- Write component Comp of library graph G to standard output procedure Write_Component_Vertices (G : Library_Graph; Comp : Component_Id); pragma Inline (Write_Component_Vertices); -- Write all vertices of component Comp of library graph G to standard -- output. procedure Write_Components (G : Library_Graph); pragma Inline (Write_Components); -- Write all components of library graph G to standard output procedure Write_Edges_To_Successors (G : Library_Graph; Vertex : Library_Graph_Vertex_Id); pragma Inline (Write_Edges_To_Successors); -- Write all edges to successors of predecessor Vertex of library graph -- G to standard output. procedure Write_Library_Graph_Edge (G : Library_Graph; Edge : Library_Graph_Edge_Id); pragma Inline (Write_Library_Graph_Edge); -- Write edge Edge of library graph G to standard output procedure Write_Library_Graph_Vertex (G : Library_Graph; Vertex : Library_Graph_Vertex_Id); pragma Inline (Write_Library_Graph_Vertex); -- Write vertex Vertex of library graph G to standard output procedure Write_Library_Graph_Vertices (G : Library_Graph); pragma Inline (Write_Library_Graph_Vertices); -- Write all vertices of library graph G to standard output procedure Write_Statistics (G : Library_Graph); pragma Inline (Write_Statistics); -- Write the statistical information of library graph G to standard -- output. ----------- -- Debug -- ----------- procedure pc (G : Library_Graph; Comp : Component_Id) renames Write_Component; pragma Unreferenced (pc); procedure plge (G : Library_Graph; Edge : Library_Graph_Edge_Id) renames Write_Library_Graph_Edge; pragma Unreferenced (plge); procedure plgv (G : Library_Graph; Vertex : Library_Graph_Vertex_Id) renames Write_Library_Graph_Vertex; pragma Unreferenced (plgv); --------------------- -- Write_Component -- --------------------- procedure Write_Component (G : Library_Graph; Comp : Component_Id) is begin pragma Assert (Present (G)); pragma Assert (Present (Comp)); Write_Str ("component (Comp_"); Write_Int (Int (Comp)); Write_Str (")"); Write_Eol; Write_Str (" Pending_Strong_Predecessors = "); Write_Int (Int (Pending_Strong_Predecessors (G, Comp))); Write_Eol; Write_Str (" Pending_Weak_Predecessors = "); Write_Int (Int (Pending_Weak_Predecessors (G, Comp))); Write_Eol; Write_Component_Vertices (G, Comp); Write_Eol; end Write_Component; ------------------------------ -- Write_Component_Vertices -- ------------------------------ procedure Write_Component_Vertices (G : Library_Graph; Comp : Component_Id) is pragma Assert (Present (G)); pragma Assert (Present (Comp)); Num_Of_Vertices : constant Natural := Number_Of_Component_Vertices (G, Comp); Iter : Component_Vertex_Iterator; Vertex : Library_Graph_Vertex_Id; begin Write_Str (" Vertices: "); Write_Int (Int (Num_Of_Vertices)); Write_Eol; if Num_Of_Vertices > 0 then Iter := Iterate_Component_Vertices (G, Comp); while Has_Next (Iter) loop Next (Iter, Vertex); Write_Str (" library graph vertex (LGV_Id_"); Write_Int (Int (Vertex)); Write_Str (") name = "); Write_Name (Name (G, Vertex)); Write_Eol; end loop; else Write_Eol; end if; end Write_Component_Vertices; ---------------------- -- Write_Components -- ---------------------- procedure Write_Components (G : Library_Graph) is pragma Assert (Present (G)); Num_Of_Comps : constant Natural := Number_Of_Components (G); Comp : Component_Id; Iter : Component_Iterator; begin -- Nothing to do when switch -d_L (output library item graph) is not -- in effect. if not Debug_Flag_Underscore_LL then return; end if; Write_Str ("Library Graph components"); Write_Eol; Write_Eol; if Num_Of_Comps > 0 then Write_Str ("Components: "); Write_Num (Int (Num_Of_Comps)); Write_Eol; Iter := Iterate_Components (G); while Has_Next (Iter) loop Next (Iter, Comp); Write_Component (G, Comp); end loop; else Write_Eol; end if; Write_Str ("Library Graph components end"); Write_Eol; Write_Eol; end Write_Components; ------------------------------- -- Write_Edges_To_Successors -- ------------------------------- procedure Write_Edges_To_Successors (G : Library_Graph; Vertex : Library_Graph_Vertex_Id) is pragma Assert (Present (G)); pragma Assert (Present (Vertex)); Num_Of_Edges : constant Natural := Number_Of_Edges_To_Successors (G, Vertex); Edge : Library_Graph_Edge_Id; Iter : Edges_To_Successors_Iterator; begin Write_Str (" Edges to successors: "); Write_Int (Int (Num_Of_Edges)); Write_Eol; if Num_Of_Edges > 0 then Iter := Iterate_Edges_To_Successors (G, Vertex); while Has_Next (Iter) loop Next (Iter, Edge); Write_Library_Graph_Edge (G, Edge); end loop; else Write_Eol; end if; end Write_Edges_To_Successors; ------------------------- -- Write_Library_Graph -- ------------------------- procedure Write_Library_Graph (G : Library_Graph) is begin pragma Assert (Present (G)); -- Nothing to do when switch -d_L (output library item graph) is not -- in effect. if not Debug_Flag_Underscore_LL then return; end if; Write_Str ("Library Graph"); Write_Eol; Write_Eol; Write_Statistics (G); Write_Library_Graph_Vertices (G); Write_Components (G); Write_Str ("Library Graph end"); Write_Eol; Write_Eol; end Write_Library_Graph; ------------------------------ -- Write_Library_Graph_Edge -- ------------------------------ procedure Write_Library_Graph_Edge (G : Library_Graph; Edge : Library_Graph_Edge_Id) is pragma Assert (Present (G)); pragma Assert (Present (Edge)); Pred : constant Library_Graph_Vertex_Id := Predecessor (G, Edge); Succ : constant Library_Graph_Vertex_Id := Successor (G, Edge); begin Write_Str (" library graph edge (LGE_Id_"); Write_Int (Int (Edge)); Write_Str (")"); Write_Eol; Write_Str (" Kind = "); Write_Str (Kind (G, Edge)'Img); Write_Eol; Write_Str (" Predecessor (LGV_Id_"); Write_Int (Int (Pred)); Write_Str (") name = "); Write_Name (Name (G, Pred)); Write_Eol; Write_Str (" Successor (LGV_Id_"); Write_Int (Int (Succ)); Write_Str (") name = "); Write_Name (Name (G, Succ)); Write_Eol; Write_Eol; end Write_Library_Graph_Edge; -------------------------------- -- Write_Library_Graph_Vertex -- -------------------------------- procedure Write_Library_Graph_Vertex (G : Library_Graph; Vertex : Library_Graph_Vertex_Id) is pragma Assert (Present (G)); pragma Assert (Present (Vertex)); Item : constant Library_Graph_Vertex_Id := Corresponding_Item (G, Vertex); U_Id : constant Unit_Id := Unit (G, Vertex); begin Write_Str ("library graph vertex (LGV_Id_"); Write_Int (Int (Vertex)); Write_Str (") name = "); Write_Name (Name (G, Vertex)); Write_Eol; if Present (Item) then Write_Str (" Corresponding_Item (LGV_Id_"); Write_Int (Int (Item)); Write_Str (") name = "); Write_Name (Name (G, Item)); else Write_Str (" Corresponding_Item = none"); end if; Write_Eol; Write_Str (" In_Elaboration_Order = "); if In_Elaboration_Order (G, Vertex) then Write_Str ("True"); else Write_Str ("False"); end if; Write_Eol; Write_Str (" Pending_Strong_Predecessors = "); Write_Int (Int (Pending_Strong_Predecessors (G, Vertex))); Write_Eol; Write_Str (" Pending_Weak_Predecessors = "); Write_Int (Int (Pending_Weak_Predecessors (G, Vertex))); Write_Eol; Write_Str (" Component (Comp_Id_"); Write_Int (Int (Component (G, Vertex))); Write_Str (")"); Write_Eol; Write_Str (" Unit (U_Id_"); Write_Int (Int (U_Id)); Write_Str (") name = "); Write_Name (Name (U_Id)); Write_Eol; Write_Edges_To_Successors (G, Vertex); end Write_Library_Graph_Vertex; ---------------------------------- -- Write_Library_Graph_Vertices -- ---------------------------------- procedure Write_Library_Graph_Vertices (G : Library_Graph) is Iter : Library_Graphs.All_Vertex_Iterator; Vertex : Library_Graph_Vertex_Id; begin pragma Assert (Present (G)); Iter := Iterate_All_Vertices (G); while Has_Next (Iter) loop Next (Iter, Vertex); Write_Library_Graph_Vertex (G, Vertex); end loop; end Write_Library_Graph_Vertices; ---------------------- -- Write_Statistics -- ---------------------- procedure Write_Statistics (G : Library_Graph) is begin Write_Str ("Components: "); Write_Num (Int (Number_Of_Components (G))); Write_Eol; Write_Str ("Edges : "); Write_Num (Int (Number_Of_Edges (G))); Write_Eol; Write_Str ("Vertices : "); Write_Num (Int (Number_Of_Vertices (G))); Write_Eol; Write_Eol; for Kind in Library_Graph_Edge_Kind'Range loop Write_Str (" "); Write_Num (Int (Library_Graph_Edge_Count (G, Kind))); Write_Str (" - "); Write_Str (Kind'Img); Write_Eol; end loop; Write_Eol; end Write_Statistics; end Library_Graph_Writers; ------------------- -- Phase_Writers -- ------------------- package body Phase_Writers is subtype Phase_Message is String (1 .. 32); -- The following table contains the phase-specific messages for phase -- completion. End_Messages : constant array (Elaboration_Phase) of Phase_Message := (Component_Discovery => "components discovered. ", Cycle_Diagnostics => "cycle diagnosed. ", Cycle_Discovery => "cycles discovered. ", Cycle_Validation => "cycles validated. ", Elaboration_Order_Validation => "elaboration order validated. ", Invocation_Graph_Construction => "invocation graph constructed. ", Invocation_Graph_Validation => "invocation graph validated. ", Library_Graph_Augmentation => "library graph augmented. ", Library_Graph_Construction => "library graph constructed. ", Library_Graph_Elaboration => "library graph elaborated. ", Library_Graph_Validation => "library graph validated. ", Unit_Collection => "units collected. ", Unit_Elaboration => "units elaborated. "); -- The following table contains the phase-specific messages for phase -- commencement. Start_Messages : constant array (Elaboration_Phase) of Phase_Message := (Component_Discovery => "discovering components... ", Cycle_Diagnostics => "diagnosing cycle... ", Cycle_Discovery => "discovering cycles... ", Cycle_Validation => "validating cycles... ", Elaboration_Order_Validation => "validating elaboration order... ", Invocation_Graph_Construction => "constructing invocation graph...", Invocation_Graph_Validation => "validating invocation graph... ", Library_Graph_Augmentation => "augmenting library graph... ", Library_Graph_Construction => "constructing library graph... ", Library_Graph_Elaboration => "elaborating library graph... ", Library_Graph_Validation => "validating library graph... ", Unit_Collection => "collecting units... ", Unit_Elaboration => "elaborating units... "); ----------------------- -- Local subprograms -- ----------------------- procedure Write_Phase_Message (Msg : Phase_Message); pragma Inline (Write_Phase_Message); -- Write elaboration phase-related message Msg to standard output --------------- -- End_Phase -- --------------- procedure End_Phase (Phase : Elaboration_Phase) is begin Write_Phase_Message (End_Messages (Phase)); end End_Phase; ----------------- -- Start_Phase -- ----------------- procedure Start_Phase (Phase : Elaboration_Phase) is begin Write_Phase_Message (Start_Messages (Phase)); end Start_Phase; ------------------------- -- Write_Phase_Message -- ------------------------- procedure Write_Phase_Message (Msg : Phase_Message) is begin -- Nothing to do when switch -d_S (output elaboration order status) -- is not in effect. if not Debug_Flag_Underscore_SS then return; end if; Write_Str (Msg); Write_Eol; end Write_Phase_Message; end Phase_Writers; -------------------------- -- Unit_Closure_Writers -- -------------------------- package body Unit_Closure_Writers is function Hash_File_Name (Nam : File_Name_Type) return Bucket_Range_Type; pragma Inline (Hash_File_Name); -- Obtain the hash value of key Nam package File_Name_Tables is new Membership_Sets (Element_Type => File_Name_Type, "=" => "=", Hash => Hash_File_Name); use File_Name_Tables; ----------------------- -- Local subprograms -- ----------------------- procedure Write_File_Name (Nam : File_Name_Type); pragma Inline (Write_File_Name); -- Write file name Nam to standard output procedure Write_Subunit_Closure (Dep : Sdep_Id; Set : Membership_Set); pragma Inline (Write_Subunit_Closure); -- Write the subunit which corresponds to dependency Dep to standard -- output if it does not appear in set Set. procedure Write_Subunits_Closure (Set : Membership_Set); pragma Inline (Write_Subunits_Closure); -- Write all subunits to standard output if they do not appear in set -- Set. procedure Write_Unit_Closure (U_Id : Unit_Id; Set : Membership_Set); pragma Inline (Write_Unit_Closure); -- Write unit U_Id to standard output if it does not appear in set Set procedure Write_Units_Closure (Order : Unit_Id_Table; Set : Membership_Set); pragma Inline (Write_Units_Closure); -- Write all units of elaboration order Order to standard output if they -- do not appear in set Set. -------------------- -- Hash_File_Name -- -------------------- function Hash_File_Name (Nam : File_Name_Type) return Bucket_Range_Type is begin pragma Assert (Present (Nam)); return Bucket_Range_Type (abs Nam); end Hash_File_Name; --------------------- -- Write_File_Name -- --------------------- procedure Write_File_Name (Nam : File_Name_Type) is Use_Formatting : constant Boolean := not Zero_Formatting; begin pragma Assert (Present (Nam)); if Use_Formatting then Write_Str (" "); end if; Write_Line (Get_Name_String (Nam)); end Write_File_Name; --------------------------- -- Write_Subunit_Closure -- --------------------------- procedure Write_Subunit_Closure (Dep : Sdep_Id; Set : Membership_Set) is pragma Assert (Present (Dep)); pragma Assert (Present (Set)); Dep_Rec : Sdep_Record renames Sdep.Table (Dep); Source : constant File_Name_Type := Dep_Rec.Sfile; pragma Assert (Present (Source)); begin -- Nothing to do when the source file has already been written if Contains (Set, Source) then return; -- Nothing to do when the source file does not denote a non-internal -- subunit. elsif not Present (Dep_Rec.Subunit_Name) or else Is_Internal_File_Name (Source) then return; end if; -- Mark the subunit as written Insert (Set, Source); Write_File_Name (Source); end Write_Subunit_Closure; ---------------------------- -- Write_Subunits_Closure -- ---------------------------- procedure Write_Subunits_Closure (Set : Membership_Set) is begin pragma Assert (Present (Set)); for Dep in Sdep.First .. Sdep.Last loop Write_Subunit_Closure (Dep, Set); end loop; end Write_Subunits_Closure; ------------------------ -- Write_Unit_Closure -- ------------------------ procedure Write_Unit_Closure (Order : Unit_Id_Table) is Use_Formatting : constant Boolean := not Zero_Formatting; Set : Membership_Set; begin -- Nothing to do when switch -R (list sources referenced in closure) -- is not in effect. if not List_Closure then return; end if; if Use_Formatting then Write_Eol; Write_Line ("REFERENCED SOURCES"); end if; -- Use a set to avoid writing duplicate units and subunits Set := Create (Number_Of_Elaborable_Units); Write_Units_Closure (Order, Set); Write_Subunits_Closure (Set); Destroy (Set); if Use_Formatting then Write_Eol; end if; end Write_Unit_Closure; ------------------------ -- Write_Unit_Closure -- ------------------------ procedure Write_Unit_Closure (U_Id : Unit_Id; Set : Membership_Set) is pragma Assert (Present (U_Id)); pragma Assert (Present (Set)); U_Rec : Unit_Record renames ALI.Units.Table (U_Id); Source : constant File_Name_Type := U_Rec.Sfile; pragma Assert (Present (Source)); begin -- Nothing to do when the source file has already been written if Contains (Set, Source) then return; -- Nothing to do for internal source files unless switch -Ra (???) is -- in effect. elsif Is_Internal_File_Name (Source) and then not List_Closure_All then return; end if; -- Mark the source file as written Insert (Set, Source); Write_File_Name (Source); end Write_Unit_Closure; ------------------------- -- Write_Units_Closure -- ------------------------- procedure Write_Units_Closure (Order : Unit_Id_Table; Set : Membership_Set) is begin pragma Assert (Present (Set)); for Index in reverse Unit_Id_Tables.First .. Unit_Id_Tables.Last (Order) loop Write_Unit_Closure (U_Id => Order.Table (Index), Set => Set); end loop; end Write_Units_Closure; end Unit_Closure_Writers; --------------- -- Write_Num -- --------------- procedure Write_Num (Val : Int; Val_Indent : Indentation_Level := Number_Column) is function Digits_Indentation return Indentation_Level; pragma Inline (Digits_Indentation); -- Determine the level of indentation the number requires in order to -- be right-justified by Val_Indent. ------------------------ -- Digits_Indentation -- ------------------------ function Digits_Indentation return Indentation_Level is Indent : Indentation_Level; Num : Int; begin -- Treat zero as a single digit if Val = 0 then Indent := 1; else Indent := 0; Num := Val; -- Shrink the input value by dividing it until all of its digits -- are exhausted. while Num /= 0 loop Indent := Indent + 1; Num := Num / 10; end loop; end if; return Val_Indent - Indent; end Digits_Indentation; -- Start of processing for Write_Num begin Indent_By (Digits_Indentation); Write_Int (Val); end Write_Num; end Bindo.Writers;
tests/nonsmoke/functional/CompileTests/experimental_ada_tests/tests/derived_record.ads
ouankou/rose
488
16148
<filename>tests/nonsmoke/functional/CompileTests/experimental_ada_tests/tests/derived_record.ads package Derived_Record is type Tagged_Record is tagged record Component_1 : Integer; end record; type Derived_Record is new Tagged_Record with record Component_2 : Integer; end record; end Derived_Record;
data/tilesets/sinnoh_3_collision.asm
AtmaBuster/pokeplat-gen2-old
2
96414
<reponame>AtmaBuster/pokeplat-gen2-old<gh_stars>1-10 tilecoll 01, 01, 01, 01 ; 00 tilecoll WALL, WALL, WALL, WALL ; 01 tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 02 tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 03 tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 04 tilecoll WALL, WALL, WALL, FLOOR ; 05 tilecoll WALL, WALL, FLOOR, FLOOR ; 06 tilecoll WALL, WALL, FLOOR, WALL ; 07 tilecoll HOP_DOWN, HOP_DOWN, WALL, WALL ; 08 tilecoll WALL, FLOOR, WALL, FLOOR ; 09 tilecoll FLOOR, FLOOR, FLOOR, WALL ; 0a tilecoll FLOOR, WALL, FLOOR, WALL ; 0b tilecoll WALL, WALL, WALL, FLOOR ; 0c tilecoll WALL, FLOOR, WALL, WALL ; 0d tilecoll FLOOR, FLOOR, WALL, WALL ; 0e tilecoll FLOOR, WALL, WALL, WALL ; 0f tilecoll WALL, WALL, FLOOR, WALL ; 10 tilecoll WALL, FLOOR, WALL, WALL ; 11 tilecoll FLOOR, FLOOR, WALL, WALL ; 12 tilecoll FLOOR, WALL, WALL, WALL ; 13 tilecoll TALL_GRASS, TALL_GRASS, TALL_GRASS, TALL_GRASS ; 14 tilecoll WALL, WALL, WALL, WALL ; 15 tilecoll FLOOR, FLOOR, FLOOR, FLOOR ; 16 tilecoll FLOOR, FLOOR, WALL, FLOOR ; 17 tilecoll WALL, FLOOR, WALL, WALL ; 18 tilecoll FLOOR, FLOOR, WALL, WALL ; 19 tilecoll FLOOR, WALL, WALL, WALL ; 1a tilecoll FLOOR, FLOOR, FLOOR, WALL ; 1b tilecoll DOWN_WALL, FLOOR, CAVE, WALL ; 1c tilecoll WATER, WATER, WATER, WATER ; 1d tilecoll WATER, WATER, WATER, WATER ; 1e tilecoll WATER, WATER, WATER, WATER ; 1f tilecoll WALL, FLOOR, WALL, FLOOR ; 20 tilecoll WATER, WATER, WATER, WATER ; 21 tilecoll WATER, WATER, WATER, WATER ; 22 tilecoll WATER, WATER, WATER, WATER ; 23 tilecoll FLOOR, WALL, FLOOR, FLOOR ; 24 tilecoll WALL, WALL, WALL, FLOOR ; 25 tilecoll WALL, WALL, FLOOR, FLOOR ; 26 tilecoll WALL, WALL, FLOOR, WALL ; 27 tilecoll WALL, FLOOR, FLOOR, FLOOR ; 28 tilecoll WALL, FLOOR, WALL, FLOOR ; 29 tilecoll WALL, WATER, WALL, WATER ; 2a tilecoll FLOOR, WALL, FLOOR, WALL ; 2b tilecoll WALL, FLOOR, FLOOR, FLOOR ; 2c tilecoll WALL, FLOOR, WALL, WALL ; 2d tilecoll WALL, WATER, WALL, WATER ; 2e tilecoll FLOOR, WALL, WALL, WALL ; 2f tilecoll WALL, WALL, WALL, DOOR ; 30 tilecoll WALL, WALL, WALL, WALL ; 31 tilecoll WALL, WALL, WALL, WALL ; 32 tilecoll WALL, WALL, WALL, WALL ; 33 tilecoll WALL, WALL, WALL, WALL ; 34 tilecoll WALL, WALL, WALL, WALL ; 35 tilecoll WALL, WALL, DOOR, WALL ; 36 tilecoll WALL, WALL, WALL, WALL ; 37 tilecoll WALL, WALL, WALL, DOOR ; 38 tilecoll WALL, WALL, WALL, WALL ; 39 tilecoll WALL, WALL, WALL, WALL ; 3a tilecoll WARP_CARPET_UP, WARP_CARPET_UP, FLOOR, FLOOR ; 3b tilecoll FLOOR, WALL, CUT_TREE, WALL ; 3c
programs/oeis/177/A177712.asm
karttu/loda
0
93379
<gh_stars>0 ; A177712: Even numbers that have a nontrivial odd divisor. ; 6,10,12,14,18,20,22,24,26,28,30,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,130,132,134,136,138,140 mul $0,2 mov $1,$0 lpb $0,1 sub $0,1 mul $0,2 sub $0,2 add $1,2 trn $0,$1 lpe add $1,6
libsrc/_DEVELOPMENT/target/zx/driver/terminal/zx_01_output_fzx/zx_01_output_fzx_oterm_msg_pscroll.asm
jpoikela/z88dk
640
957
SECTION code_driver SECTION code_driver_terminal_output PUBLIC zx_01_output_fzx_oterm_msg_pscroll EXTERN console_01_output_char_proc_putchar_scroll zx_01_output_fzx_oterm_msg_pscroll: ; * OTERM_MSG_PSCROLL ; ; enter : hl = number of pixels to scroll ; exit : hl = actual number if pixels scrolled ; else carry set if screen clears ; can use: af, bc, de, hl ; ; Scroll the window upward at least hl pixels ld de,7 add hl,de ; round up to next char ld a,l and $f8 ld l,a push hl ; save actual number of pixels to scroll srl h rra srl h rra srl h rra ; a = number of chars to scroll call console_01_output_char_proc_putchar_scroll pop hl ; hl = actual number of pixels scrolled ret
src/main/fragment/mos6502-common/vboxx_then_la1.asm
jbrandwood/kickc
2
165938
cpx #0 bne {la1}
Transynther/x86/_processed/NONE/_xt_sm_/i7-8650U_0xd2_notsx.log_1771_1280.asm
ljhsiun2/medusa
9
101577
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r15 push %r8 push %rax push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_normal_ht+0x1acf0, %rdx nop nop nop nop nop cmp $61932, %r15 mov (%rdx), %r8d nop nop nop sub $62163, %rax lea addresses_A_ht+0x16fa0, %r8 xor %rdi, %rdi mov (%r8), %ebx nop nop nop nop nop cmp $38948, %r8 lea addresses_WC_ht+0x178a0, %rax nop nop nop nop nop and $16915, %rcx mov $0x6162636465666768, %r8 movq %r8, (%rax) nop nop nop nop nop dec %r15 lea addresses_normal_ht+0x1d560, %rdi nop nop nop dec %rax movw $0x6162, (%rdi) nop add %r8, %r8 lea addresses_WT_ht+0x4350, %rbx nop nop nop nop nop add $56954, %rcx movb (%rbx), %r8b nop nop nop add %rax, %rax lea addresses_UC_ht+0xe220, %r8 nop nop nop nop nop cmp %rax, %rax movb $0x61, (%r8) nop nop nop dec %r8 lea addresses_WT_ht+0x1e6b8, %rsi lea addresses_WT_ht+0x197a0, %rdi nop nop nop sub $28079, %rbx mov $125, %rcx rep movsl nop nop nop nop nop add %r15, %r15 lea addresses_UC_ht+0x133a0, %rcx xor %rax, %rax movb $0x61, (%rcx) dec %r15 lea addresses_A_ht+0xdba0, %rsi lea addresses_normal_ht+0x1327e, %rdi sub $45573, %r15 mov $77, %rcx rep movsl nop nop nop xor %rcx, %rcx lea addresses_normal_ht+0x19120, %rcx clflush (%rcx) nop nop nop nop nop add %rdx, %rdx movw $0x6162, (%rcx) nop nop nop nop add $55653, %rdi lea addresses_WC_ht+0x1b7a0, %rax clflush (%rax) nop nop add $4930, %rdx vmovups (%rax), %ymm3 vextracti128 $1, %ymm3, %xmm3 vpextrq $0, %xmm3, %rbx nop cmp $54731, %rcx lea addresses_WT_ht+0x1b784, %rsi lea addresses_normal_ht+0x1b1a0, %rdi nop nop cmp %r15, %r15 mov $94, %rcx rep movsw nop nop nop nop nop sub %rsi, %rsi pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rax pop %r8 pop %r15 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r14 push %r15 push %r8 push %rbp push %rdi // Store lea addresses_UC+0x47a0, %rbp clflush (%rbp) sub $5541, %r15 movb $0x51, (%rbp) nop nop cmp %rdi, %rdi // Faulty Load lea addresses_UC+0x47a0, %r14 nop nop nop xor $34099, %r13 movb (%r14), %r8b lea oracles, %rbp and $0xff, %r8 shlq $12, %r8 mov (%rbp,%r8,1), %r8 pop %rdi pop %rbp pop %r8 pop %r15 pop %r14 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': True, 'NT': False, 'congruent': 5, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': True}} {'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': True}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}} {'51': 1771} 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 */
data/pokemon/base_stats/magmar.asm
opiter09/ASM-Machina
1
242032
<filename>data/pokemon/base_stats/magmar.asm db DEX_MAGMAR ; pokedex id db 65, 95, 57, 93, 85 ; hp atk def spd spc db FIRE, FIRE ; type db 45 ; catch rate db 167 ; base exp INCBIN "gfx/pokemon/front/magmar.pic", 0, 1 ; sprite dimensions dw MagmarPicFront, MagmarPicBack db EMBER, LEER, NO_MOVE, NO_MOVE ; level 1 learnset db GROWTH_MEDIUM_FAST ; growth rate ; tm/hm learnset tmhm MEGA_PUNCH, MEGA_KICK, TOXIC, BODY_SLAM, TAKE_DOWN, \ DOUBLE_EDGE, HYPER_BEAM, SUBMISSION, COUNTER, SEISMIC_TOSS, \ RAGE, PSYCHIC_M, TELEPORT, MIMIC, DOUBLE_TEAM, \ BIDE, METRONOME, FIRE_BLAST, SKULL_BASH, REST, \ PSYWAVE, SUBSTITUTE, STRENGTH ; end db 0 ; padding
programs/fm.asm
re0ah/nameless-OS16
0
81394
;This is free and unencumbered software released into the public domain. ;Anyone is free to copy, modify, publish, use, compile, sell, or ;distribute this software, either in source code form or as a compiled ;binary, for any purpose, commercial or non-commercial, and by any ;means. ;In jurisdictions that recognize copyright laws, the author or authors ;of this software dedicate any and all copyright interest in the ;software to the public domain. We make this dedication for the benefit ;of the public at large and to the detriment of our heirs and ;successors. We intend this dedication to be an overt act of ;relinquishment in perpetuity of all present and future rights to this ;software under copyright law. ;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 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. ;For more information, please refer to <http://unlicense.org/> bits 16 %include "../source/syscall.inc" VGA_BUFFER equ 0xB800 VGA_WIDTH equ 80 VGA_HEIGHT equ 25 VGA_CHAR_SIZE equ 2 ;bytes VGA_ROW_SIZE equ VGA_CHAR_SIZE * VGA_WIDTH VGA_PAGE_SIZE equ VGA_ROW_SIZE * VGA_HEIGHT VGA_PAGE_NUM_CHARS equ VGA_WIDTH * VGA_HEIGHT ;1000 chars DISK_BUFFER equ 0x6000 WINDOWS_MARKER equ 0x0F DIR_ENTRY_SIZE equ 32 ;in bytes FAT12_ENTRY_NOT_FOUND equ 0xFFFF fm: mov bx, SYSCALL_VGA_CURSOR_DISABLE int 0x20 xor di, di mov ah, 0x03 mov al, ' ' mov cx, VGA_PAGE_NUM_CHARS rep stosw call draw_wall call output_dir call choose_file .wait_keyboard_data: hlt mov bx, SYSCALL_GET_KEYBOARD_DATA int 0x20 test al, al je .wait_keyboard_data cmp al, 0x01 ;ESC je .exit cmp al, 0xE9 jne .not_up_arrow mov di, word[item_now] test di, di je .wait_keyboard_data call unchoose_file dec word[item_now] call choose_file jmp .wait_keyboard_data .not_up_arrow: cmp al, 0xEB jne .not_down_arrow mov di, word[item_now] cmp di, word[item_num] je .wait_keyboard_data call unchoose_file inc word[item_now] call choose_file jmp .wait_keyboard_data .not_down_arrow: cmp al, 0x1C jne .if_not_enter call enter .if_not_enter: jmp .wait_keyboard_data .exit: mov bx, SYSCALL_VGA_CLEAR_SCREEN int 0x20 mov bx, SYSCALL_VGA_CURSOR_ENABLE int 0x20 xor ax, ax ;exit status retf enter: mov si, word[item_now] shl si, 5 mov di, si shl di, 2 add si, di add si, 326 mov di, FAT12_FNAME mov cx, 8 .lp_fname: mov ax, word[es:si] mov byte[ds:di], al add si, 2 inc di loop .lp_fname add si, 2 mov cx, 3 .lp_ext: mov ax, word[es:si] mov byte[ds:di], al add si, 2 inc di loop .lp_ext mov si, FAT12_FNAME mov cx, 8 mov bx, SYSCALL_EXECVE int 0x20 cmp ax, FAT12_ENTRY_NOT_FOUND je .not_found .not_found: retn choose_file: mov di, word[item_now] shl di, 5 mov si, di shl si, 2 add di, si add di, 326 mov cx, 12 .lp: mov ax, word[es:di] mov ah, 0x74 stosw loop .lp retn unchoose_file: mov di, word[item_now] shl di, 5 mov si, di shl si, 2 add di, si add di, 326 mov cx, 12 .lp: mov ax, word[es:di] mov ah, 0x07 stosw loop .lp retn output_dir: mov bx, SYSCALL_FAT12_READ_ROOT int 0x20 push ds mov ax, DISK_BUFFER mov ds, ax xor cx, cx ;num of files in directory mov ah, 0x07 xor bx, bx .lp: mov di, cx shl di, 5 mov si, di shl si, 2 add di, si add di, 326 mov si, bx mov al, byte[ds:si + 11] ;attributes cmp al, WINDOWS_MARKER je .next xor bp, bp inc cx .cp_fname: lodsb inc bp stosw cmp bp, 8 jne .cp_fname mov al, ' ' stosw xor bp, bp .cp_ext: lodsb inc bp stosw cmp bp, 3 jne .cp_ext .end_ext: add di, 160 .next: add bx, DIR_ENTRY_SIZE ;to next entry ;check last file in directory or not mov al, byte[ds:bx] test al, al jne .lp pop ds dec cx mov word[item_num], cx retn draw_wall: ;in: ;out: ax = 0x7720 ; cx = 0 ; di = 0 ;draw from left-top point box like ;->->->->--- ;| | ;/\ \/ ;| | ;--<-<-<-<-| ;draw top side wall mov ax, 0x7720 ;bg=gray, fg=gray, char=' ' mov cx, VGA_WIDTH xor di, di rep stosw ;ax -> es:di ;draw right side wall sub di, VGA_CHAR_SIZE .lp_right: add di, VGA_WIDTH * VGA_CHAR_SIZE mov word[es:di], ax cmp di, VGA_PAGE_SIZE - VGA_CHAR_SIZE jne .lp_right ;draw bottom side wall .lp_left: sub di, VGA_CHAR_SIZE mov word[es:di], ax cmp di, (VGA_HEIGHT - 1) * VGA_ROW_SIZE jne .lp_left ;draw left side wall .lp_up: sub di, VGA_CHAR_SIZE * VGA_WIDTH mov word[es:di], ax test di, di jne .lp_up retn item_now dw 0 item_num dw 0 FAT12_FNAME db "LS BIN"
llvm-gcc-4.2-2.9/gcc/ada/a-stzfix.ads
vidkidz/crossbridge
1
29878
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . S T R I N G S . W I D E _ W I D E _ F I X E D -- -- -- -- S p e c -- -- -- -- This specification is adapted from the Ada Reference Manual for use with -- -- GNAT. In accordance with the copyright of that document, you can freely -- -- copy and modify this specification, provided that if you redistribute a -- -- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ with Ada.Strings.Wide_Wide_Maps; package Ada.Strings.Wide_Wide_Fixed is pragma Preelaborate; ------------------------------------------------------------------------ -- Copy Procedure for Wide_Wide_Strings of Possibly Different Lengths -- ------------------------------------------------------------------------ procedure Move (Source : Wide_Wide_String; Target : out Wide_Wide_String; Drop : Truncation := Error; Justify : Alignment := Left; Pad : Wide_Wide_Character := Ada.Strings.Wide_Wide_Space); ------------------------ -- Search Subprograms -- ------------------------ function Index (Source : Wide_Wide_String; Pattern : Wide_Wide_String; Going : Direction := Forward; Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping := Wide_Wide_Maps.Identity) return Natural; function Index (Source : Wide_Wide_String; Pattern : Wide_Wide_String; Going : Direction := Forward; Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function) return Natural; function Index (Source : Wide_Wide_String; Set : Wide_Wide_Maps.Wide_Wide_Character_Set; Test : Membership := Inside; Going : Direction := Forward) return Natural; function Index (Source : Wide_Wide_String; Pattern : Wide_Wide_String; From : Positive; Going : Direction := Forward; Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping := Wide_Wide_Maps.Identity) return Natural; pragma Ada_05 (Index); function Index (Source : Wide_Wide_String; Pattern : Wide_Wide_String; From : Positive; Going : Direction := Forward; Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function) return Natural; pragma Ada_05 (Index); function Index (Source : Wide_Wide_String; Set : Wide_Wide_Maps.Wide_Wide_Character_Set; From : Positive; Test : Membership := Inside; Going : Direction := Forward) return Natural; pragma Ada_05 (Index); function Index_Non_Blank (Source : Wide_Wide_String; Going : Direction := Forward) return Natural; function Index_Non_Blank (Source : Wide_Wide_String; From : Positive; Going : Direction := Forward) return Natural; pragma Ada_05 (Index_Non_Blank); function Count (Source : Wide_Wide_String; Pattern : Wide_Wide_String; Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping := Wide_Wide_Maps.Identity) return Natural; function Count (Source : Wide_Wide_String; Pattern : Wide_Wide_String; Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function) return Natural; function Count (Source : Wide_Wide_String; Set : Wide_Wide_Maps.Wide_Wide_Character_Set) return Natural; procedure Find_Token (Source : Wide_Wide_String; Set : Wide_Wide_Maps.Wide_Wide_Character_Set; Test : Membership; First : out Positive; Last : out Natural); ---------------------------------------------- -- Wide_Wide_String Translation Subprograms -- ---------------------------------------------- function Translate (Source : Wide_Wide_String; Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping) return Wide_Wide_String; procedure Translate (Source : in out Wide_Wide_String; Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping); function Translate (Source : Wide_Wide_String; Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function) return Wide_Wide_String; procedure Translate (Source : in out Wide_Wide_String; Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function); ------------------------------------------------- -- Wide_Wide_String Transformation Subprograms -- ------------------------------------------------- function Replace_Slice (Source : Wide_Wide_String; Low : Positive; High : Natural; By : Wide_Wide_String) return Wide_Wide_String; procedure Replace_Slice (Source : in out Wide_Wide_String; Low : Positive; High : Natural; By : Wide_Wide_String; Drop : Truncation := Error; Justify : Alignment := Left; Pad : Wide_Wide_Character := Ada.Strings.Wide_Wide_Space); function Insert (Source : Wide_Wide_String; Before : Positive; New_Item : Wide_Wide_String) return Wide_Wide_String; procedure Insert (Source : in out Wide_Wide_String; Before : Positive; New_Item : Wide_Wide_String; Drop : Truncation := Error); function Overwrite (Source : Wide_Wide_String; Position : Positive; New_Item : Wide_Wide_String) return Wide_Wide_String; procedure Overwrite (Source : in out Wide_Wide_String; Position : Positive; New_Item : Wide_Wide_String; Drop : Truncation := Right); function Delete (Source : Wide_Wide_String; From : Positive; Through : Natural) return Wide_Wide_String; procedure Delete (Source : in out Wide_Wide_String; From : Positive; Through : Natural; Justify : Alignment := Left; Pad : Wide_Wide_Character := Ada.Strings.Wide_Wide_Space); ------------------------------------------- -- Wide_Wide_String Selector Subprograms -- ------------------------------------------- function Trim (Source : Wide_Wide_String; Side : Trim_End) return Wide_Wide_String; procedure Trim (Source : in out Wide_Wide_String; Side : Trim_End; Justify : Alignment := Left; Pad : Wide_Wide_Character := Wide_Wide_Space); function Trim (Source : Wide_Wide_String; Left : Wide_Wide_Maps.Wide_Wide_Character_Set; Right : Wide_Wide_Maps.Wide_Wide_Character_Set) return Wide_Wide_String; procedure Trim (Source : in out Wide_Wide_String; Left : Wide_Wide_Maps.Wide_Wide_Character_Set; Right : Wide_Wide_Maps.Wide_Wide_Character_Set; Justify : Alignment := Ada.Strings.Left; Pad : Wide_Wide_Character := Ada.Strings.Wide_Wide_Space); function Head (Source : Wide_Wide_String; Count : Natural; Pad : Wide_Wide_Character := Ada.Strings.Wide_Wide_Space) return Wide_Wide_String; procedure Head (Source : in out Wide_Wide_String; Count : Natural; Justify : Alignment := Left; Pad : Wide_Wide_Character := Ada.Strings.Wide_Wide_Space); function Tail (Source : Wide_Wide_String; Count : Natural; Pad : Wide_Wide_Character := Ada.Strings.Wide_Wide_Space) return Wide_Wide_String; procedure Tail (Source : in out Wide_Wide_String; Count : Natural; Justify : Alignment := Left; Pad : Wide_Wide_Character := Ada.Strings.Wide_Wide_Space); -------------------------------------------- -- Wide_Wide_String Constructor Functions -- -------------------------------------------- function "*" (Left : Natural; Right : Wide_Wide_Character) return Wide_Wide_String; function "*" (Left : Natural; Right : Wide_Wide_String) return Wide_Wide_String; end Ada.Strings.Wide_Wide_Fixed;
Transynther/x86/_processed/NC/_zr_/i7-7700_9_0x48_notsx.log_21829_1843.asm
ljhsiun2/medusa
9
177409
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r15 push %rbp push %rcx push %rdi push %rdx push %rsi lea addresses_WT_ht+0xd2f1, %rsi lea addresses_normal_ht+0x1c871, %rdi nop nop nop nop nop add $518, %rdx mov $21, %rcx rep movsl nop nop nop add $11793, %rsi lea addresses_A_ht+0x69b1, %rbp add %r15, %r15 movl $0x61626364, (%rbp) nop inc %rcx lea addresses_WT_ht+0xe3e1, %rsi nop nop nop xor $35111, %rcx mov $0x6162636465666768, %rdi movq %rdi, (%rsi) add %r10, %r10 lea addresses_A_ht+0x35b1, %rsi lea addresses_D_ht+0x1d8b1, %rdi nop xor %r11, %r11 mov $33, %rcx rep movsb nop nop nop inc %r10 lea addresses_WT_ht+0x1a1b1, %r10 sub %r15, %r15 mov $0x6162636465666768, %r11 movq %r11, (%r10) nop nop nop nop add %r10, %r10 lea addresses_WT_ht+0x75b1, %r11 nop nop nop nop nop add $45020, %rdx mov $0x6162636465666768, %rsi movq %rsi, %xmm0 movups %xmm0, (%r11) nop nop nop nop and %rcx, %rcx lea addresses_A_ht+0x15f31, %r10 nop nop nop and %rcx, %rcx vmovups (%r10), %ymm2 vextracti128 $1, %ymm2, %xmm2 vpextrq $1, %xmm2, %rsi nop nop nop nop xor $51566, %rcx lea addresses_WT_ht+0x105b1, %r11 nop nop nop cmp $26839, %rdx mov $0x6162636465666768, %rdi movq %rdi, %xmm2 movups %xmm2, (%r11) sub $24810, %rbp lea addresses_WC_ht+0x13db1, %rcx cmp $37433, %r10 mov $0x6162636465666768, %rsi movq %rsi, (%rcx) nop nop nop nop xor $25766, %rdi lea addresses_A_ht+0x1e5b1, %rdi nop nop nop xor %r11, %r11 mov $0x6162636465666768, %rsi movq %rsi, (%rdi) nop nop nop nop sub %rbp, %rbp lea addresses_UC_ht+0x1b0f1, %r15 nop nop and $61306, %rcx mov $0x6162636465666768, %rsi movq %rsi, (%r15) nop nop cmp %rbp, %rbp lea addresses_normal_ht+0xc799, %rdi nop nop nop xor %r10, %r10 mov $0x6162636465666768, %rdx movq %rdx, (%rdi) nop nop nop nop nop xor $22094, %rdi lea addresses_UC_ht+0x135b1, %rsi lea addresses_UC_ht+0x65b1, %rdi dec %r10 mov $105, %rcx rep movsl nop nop nop nop nop sub %rcx, %rcx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbp pop %r15 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r13 push %r14 push %r15 push %r8 push %rax push %rbx push %rcx // Store lea addresses_RW+0x1adb1, %r13 nop nop sub $7217, %r8 movl $0x51525354, (%r13) xor %r8, %r8 // Load lea addresses_D+0x1c5b1, %rbx nop sub $22582, %r15 movb (%rbx), %r13b nop nop nop nop nop sub %r8, %r8 // Store lea addresses_D+0x1e431, %r15 nop nop nop nop nop and %rax, %rax mov $0x5152535455565758, %r8 movq %r8, (%r15) nop nop nop nop add $63880, %rcx // Load lea addresses_WT+0x11db1, %r14 nop nop nop nop and $20913, %r8 mov (%r14), %bx xor %r15, %r15 // Load lea addresses_normal+0x13bd1, %rax nop nop nop and $44168, %r8 mov (%rax), %r13 sub %r14, %r14 // Faulty Load mov $0x18683e00000005b1, %rax nop nop add $23717, %r13 movb (%rax), %r15b lea oracles, %rbx and $0xff, %r15 shlq $12, %r15 mov (%rbx,%r15,1), %r15 pop %rcx pop %rbx pop %rax pop %r8 pop %r15 pop %r14 pop %r13 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_NC', 'congruent': 0}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_RW', 'congruent': 9}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_D', 'congruent': 11}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_D', 'congruent': 7}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_WT', 'congruent': 8}} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_normal', 'congruent': 4}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_NC', 'congruent': 0}} <gen_prepare_buffer> {'dst': {'same': False, 'congruent': 6, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': True, 'congruent': 4, 'type': 'addresses_WT_ht'}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_A_ht', 'congruent': 8}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WT_ht', 'congruent': 4}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 4, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 8, 'type': 'addresses_A_ht'}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WT_ht', 'congruent': 9}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_WT_ht', 'congruent': 11}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_A_ht', 'congruent': 7}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_WT_ht', 'congruent': 11}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': True, 'size': 8, 'type': 'addresses_WC_ht', 'congruent': 9}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_A_ht', 'congruent': 11}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_UC_ht', 'congruent': 6}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_normal_ht', 'congruent': 1}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 11, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}} {'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 */
test/Succeed/InstanceSearchExplicitArgumentNoLooping.agda
shlevy/agda
1,989
4988
<filename>test/Succeed/InstanceSearchExplicitArgumentNoLooping.agda postulate A : Set module _ {{a : A}} (f : A → A) where g : {{a : A}} → A g {{a}} = a t : A t = g
libsrc/stdio/ansi/nascom/f_ansi_attr.asm
andydansby/z88dk-mk2
1
88754
; ; ANSI Video handling for the NASCOM1/2 ; By <NAME> ; ; Text Attributes ; m - Set Graphic Rendition ; ; $Id: f_ansi_attr.asm,v 1.2 2004/07/27 09:40:19 stefano Exp $ ; XLIB ansi_attr .ansi_attr ret
oeis/112/A112690.asm
neoneye/loda-programs
11
86098
<filename>oeis/112/A112690.asm ; A112690: Expansion of 1/(1+x^2-x^3-x^5). ; 0,1,0,-1,1,1,-1,0,1,0,0,0,0,1,0,-1,1,1,-1,0,1,0,0,0,0,1,0,-1,1,1,-1,0,1,0,0,0,0,1,0,-1,1,1,-1,0,1,0,0,0,0,1,0,-1,1,1,-1,0,1,0,0,0,0,1,0,-1,1,1,-1,0,1,0,0,0,0,1,0,-1,1,1,-1,0,1,0,0,0,0,1,0,-1,1,1,-1,0,1,0,0,0,0,1,0,-1 lpb $0 mov $1,$0 sub $0,2 sub $2,$0 trn $0,1 mod $2,2 pow $2,$1 lpe mov $0,$2
programs/oeis/106/A106231.asm
karttu/loda
1
15471
; A106231: Least j > 1 such that j^2 = (4*n^2 + 2)*(k^2) + (4*n^2 + 2)*k + 1. ; 11,19,77,199,409,731,1189,1807,2609,3619,4861,6359,8137,10219,12629,15391,18529,22067,26029,30439,35321,40699,46597,53039,60049,67651,75869,84727,94249,104459,115381,127039,139457,152659,166669,181511,197209,213787 pow $1,$0 mul $1,10 add $1,1 mov $2,$0 mul $2,6 add $1,$2 mov $3,$0 mul $3,$0 mov $2,$3 mul $2,8 add $1,$2 mul $3,$0 mov $2,$3 mul $2,4 add $1,$2
oeis/088/A088538.asm
neoneye/loda-programs
11
23137
<reponame>neoneye/loda-programs<gh_stars>10-100 ; A088538: Decimal expansion of 4/Pi. ; Submitted by <NAME> ; 1,2,7,3,2,3,9,5,4,4,7,3,5,1,6,2,6,8,6,1,5,1,0,7,0,1,0,6,9,8,0,1,1,4,8,9,6,2,7,5,6,7,7,1,6,5,9,2,3,6,5,1,5,8,9,9,8,1,3,3,8,7,5,2,4,7,1,1,7,4,3,8,1,0,7,3,8,1,2,2,8,0,7,2,0,9,1,0,4,2,2,1,3,0,0,2,4,6,8,7 mov $1,1 mov $3,$0 mul $3,4 lpb $3 mov $6,$1 mul $1,2 mul $2,2 mov $5,$3 cmp $5,0 add $3,$5 div $6,$3 add $1,$6 add $2,$1 mul $1,2 sub $3,1 lpe mov $4,10 pow $4,$0 div $2,$4 cmp $5,0 add $2,$5 div $1,$2 mov $0,$1 mod $0,10
agda-stdlib/src/Data/Tree/Binary/Relation/Unary/All.agda
DreamLinuxer/popl21-artifact
5
2663
------------------------------------------------------------------------ -- The Agda standard library -- -- Pointwise lifting of a predicate to a binary tree ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Data.Tree.Binary.Relation.Unary.All where open import Level open import Data.Tree.Binary as Tree using (Tree; leaf; node) open import Relation.Unary private variable a b p q : Level A : Set a B : Set b data All {A : Set a} (P : A → Set p) : Tree A → Set (a ⊔ p) where leaf : All P leaf node : ∀ {l m r} → All P l → P m → All P r → All P (node l m r) module _ {P : A → Set p} {Q : A → Set q} where map : ∀[ P ⇒ Q ] → ∀[ All P ⇒ All Q ] map f leaf = leaf map f (node l m r) = node (map f l) (f m) (map f r)
alloy4fun_models/trashltl/models/4/4KMZ5tcY4i6dkPxwu.als
Kaixi26/org.alloytools.alloy
0
4132
<gh_stars>0 open main pred id4KMZ5tcY4i6dkPxwu_prop5 { eventually (all t: Trash | Trash' = Trash - t) } pred __repair { id4KMZ5tcY4i6dkPxwu_prop5 } check __repair { id4KMZ5tcY4i6dkPxwu_prop5 <=> prop5o }
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ce/ce3905a.ada
best08618/asylo
7
28540
<reponame>best08618/asylo -- CE3905A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- OBJECTIVE: -- CHECK THAT GET FOR ENUMERATION TYPES OPERATES ON FILE OF MODE -- IN_FILE AND THAT WHEN NO FILE IS SPECIFIED IT OPERATES ON THE -- CURRENT DEFAULT INPUT_FILE. -- APPLICABILITY CRITERIA: -- THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH -- SUPPORT TEXT FILES. -- HISTORY: -- SPS 10/07/82 -- SPS 12/22/82 -- JBG 02/22/84 CHANGED TO .ADA TEST. -- TBN 11/10/86 REVISED TEST TO OUTPUT A NON_APPLICABLE -- RESULT WHEN FILES ARE NOT SUPPORTED. -- DWC 09/16/87 REMOVED DEPENDENCE ON RESET AND CORRECTED -- EXCEPTION HANDLING. WITH REPORT; USE REPORT; WITH TEXT_IO; USE TEXT_IO; PROCEDURE CE3905A IS INCOMPLETE : EXCEPTION; BEGIN TEST ("CE3905A", "CHECK THAT GET FOR ENUMERATION TYPES " & "OPERATES ON FILE OF MODE IN_FILE AND THAT " & "WHEN NO FILE IS SPECIFIED IT OPERATES ON " & "THE CURRENT DEFAULT INPUT_FILE"); DECLARE TYPE DAY IS (MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY); PACKAGE DAY_IO IS NEW ENUMERATION_IO (DAY); FT : FILE_TYPE; FILE : FILE_TYPE; USE DAY_IO; X : DAY; BEGIN -- CREATE AND INITIALIZE DATA FILES. BEGIN CREATE (FT, OUT_FILE, LEGAL_FILE_NAME); EXCEPTION WHEN USE_ERROR => NOT_APPLICABLE ("USE_ERROR RAISED; TEXT CREATE " & "WITH OUT_FILE MODE - 1"); RAISE INCOMPLETE; WHEN NAME_ERROR => NOT_APPLICABLE ("NAME_ERROR RAISED; TEXT CREATE " & "WITH OUT_FILE MODE - 1"); RAISE INCOMPLETE; END; PUT (FT, "WEDNESDAY"); NEW_LINE (FT); PUT (FT, "FRIDAY"); CREATE (FILE, OUT_FILE, LEGAL_FILE_NAME(2)); PUT (FILE, "TUESDAY"); NEW_LINE (FILE); PUT (FILE, "THURSDAY"); CLOSE (FT); BEGIN OPEN (FT, IN_FILE, LEGAL_FILE_NAME); EXCEPTION WHEN USE_ERROR => NOT_APPLICABLE ("USE_ERROR RAISED; TEXT OPEN " & "FOR IN_FILE MODE"); RAISE INCOMPLETE; END; CLOSE (FILE); OPEN (FILE, IN_FILE, LEGAL_FILE_NAME(2)); SET_INPUT (FILE); -- BEGIN TEST GET (FT, X); IF X /= WEDNESDAY THEN FAILED ("VALUE FROM FILE INCORRECT"); END IF; GET (X); IF X /= TUESDAY THEN FAILED ("VALUE FROM DEFAULT INCORRECT"); END IF; GET (FT, X); IF X /= FRIDAY THEN FAILED ("VALUE FROM FILE INCORRECT"); END IF; GET (FILE, X); IF X /= THURSDAY THEN FAILED ("VALUE FROM DEFAULT INCORRECT"); END IF; BEGIN DELETE (FT); DELETE (FILE); EXCEPTION WHEN USE_ERROR => NULL; END; EXCEPTION WHEN INCOMPLETE => NULL; END; RESULT; END CE3905A;
oeis/018/A018070.asm
neoneye/loda-programs
11
242071
<filename>oeis/018/A018070.asm ; A018070: Expansion of 1/((1-3x)(1-8x)(1-11x)). ; Submitted by <NAME>(s4) ; 1,22,339,4532,56357,672210,7813303,89300464,1009144713,11315328398,126186563867,1401795991596,15529706751469,171706382611786,1895807080277631,20910172869786728,230462261504563025,2538687756174605574,27954388355303380195,307728856208561194660,3386862092699452025781,37270240414946663712962,410090703726466213337159,4511942214287645789844192,49638920143536525662906137,546088567869882005377537150,6007457816896546385703294123,66085904548484772480736804124,726975898534314618068901850493 add $0,1 mov $3,1 lpb $0 sub $0,1 add $2,$3 add $1,$2 mul $1,8 mul $2,11 mul $3,3 lpe mov $0,$1 div $0,8
test/fail/TermSplicingLooping.agda
asr/agda-kanso
1
818
open import Common.Prelude open import Common.Reflect module TermSplicingLooping where mutual f : Set -> Set f = unquote (def (quote f) [])
projects/batfish/src/main/antlr4/org/batfish/grammar/palo_alto/PaloAlto_virtual_router.g4
zabrewer/batfish
0
3281
parser grammar PaloAlto_virtual_router; import PaloAlto_common, PaloAlto_redist_profile; options { tokenVocab = PaloAltoLexer; } protocol_ad : // 10-240 uint8 ; sn_virtual_router : VIRTUAL_ROUTER vr_definition? ; vr_definition : name = variable ( vr_admin_dists | vr_interface | vr_protocol | vr_routing_table )? ; vr_admin_dists : ADMIN_DISTS ( vrad_ebgp | vrad_ibgp | vrad_ospf_int | vrad_ospf_ext | vrad_ospfv3_int | vrad_ospfv3_ext | vrad_rip | vrad_static | vrad_static_ipv6 )? ; vrad_ebgp : EBGP ad = protocol_ad ; vrad_ibgp : IBGP ad = protocol_ad ; vrad_ospf_int : OSPF_INT ad = protocol_ad ; vrad_ospf_ext : OSPF_EXT ad = protocol_ad ; vrad_ospfv3_int : OSPFV3_INT ad = protocol_ad ; vrad_ospfv3_ext : OSPFV3_EXT ad = protocol_ad ; vrad_rip : RIP ad = protocol_ad ; vrad_static : STATIC ad = protocol_ad ; vrad_static_ipv6 : STATIC_IPV6 ad = protocol_ad ; vr_interface : INTERFACE variable_list ; vr_protocol : PROTOCOL ( vrp_bgp | vrp_ospf | vrp_redist_profile | vrp_rip )? ; vr_routing_table : ROUTING_TABLE IP STATIC_ROUTE name = variable ( vrrt_admin_dist | vrrt_destination | vrrt_interface | vrrt_metric | vrrt_nexthop ) ; vrrt_admin_dist : ADMIN_DIST distance = protocol_ad ; vrrt_destination : DESTINATION destination = ip_prefix ; vrrt_interface : INTERFACE iface = variable ; vrrt_metric : METRIC metric = uint16 ; vrrt_nexthop : NEXTHOP ( vrrtn_ip | vrrtn_next_vr ) ; vrrtn_ip : IP_ADDRESS_LITERAL addr = ip_address_or_slash32 ; vrrtn_next_vr : NEXT_VR name = variable ;
project/src/avr-watchdog.adb
pvrego/adaino
8
5668
<reponame>pvrego/adaino with System.Machine_Code; -- ============================================================================= -- Package body AVR.INTERRUPTS -- ============================================================================= package body AVR.WATCHDOG is procedure Watchdog_Reset is begin System.Machine_Code.Asm ("wdr", Volatile => True); end Watchdog_Reset; end AVR.WATCHDOG;
OperationalSemantics.agda
iwilare/imp-semantics
6
17085
<filename>OperationalSemantics.agda open import Data.Nat using (ℕ; _+_; _≤?_) open import Data.Bool using (Bool; true; false; not; _∧_) open import Data.String using (String; _≟_) open import Relation.Nullary using (¬_; yes; no) open import Relation.Nullary.Negation using (contradiction) open import Relation.Binary.PropositionalEquality using (_≡_; refl; sym) open import Function.Equivalence using (_⇔_; equivalence) open import IMP data ⦅_,_⦆⇒_ : com → state → state → Set where Skip : ∀{s} → ⦅ SKIP , s ⦆⇒ s Loc : ∀{x a s} → ⦅ x ::= a , s ⦆⇒ (s [ x ::= aval a s ]) Comp : ∀{c₁ c₂ s₁ s₂ s₃} → ⦅ c₁ , s₁ ⦆⇒ s₂ → ⦅ c₂ , s₂ ⦆⇒ s₃ → ⦅ c₁ :: c₂ , s₁ ⦆⇒ s₃ IfTrue : ∀{c₁ c₂ b s t} → bval b s ≡ true → ⦅ c₁ , s ⦆⇒ t → ⦅ IF b THEN c₁ ELSE c₂ , s ⦆⇒ t IfFalse : ∀{c₁ c₂ b s t} → bval b s ≡ false → ⦅ c₂ , s ⦆⇒ t → ⦅ IF b THEN c₁ ELSE c₂ , s ⦆⇒ t WhileFalse : ∀{c b s} → bval b s ≡ false → ⦅ WHILE b DO c , s ⦆⇒ s WhileTrue : ∀{c b s₁ s₂ s₃} → bval b s₁ ≡ true → ⦅ c , s₁ ⦆⇒ s₂ → ⦅ WHILE b DO c , s₂ ⦆⇒ s₃ → ⦅ WHILE b DO c , s₁ ⦆⇒ s₃ true≢false : ¬ (true ≡ false) true≢false = λ () deterministic : ∀{c s t t′} → ⦅ c , s ⦆⇒ t → ⦅ c , s ⦆⇒ t′ → t ≡ t′ deterministic Skip Skip = refl deterministic Loc Loc = refl deterministic (Comp r₁ r₂) (Comp r₁′ r₂′) rewrite deterministic r₁ r₁′ = deterministic r₂ r₂′ deterministic (IfTrue v r) (IfTrue v′ r′) = deterministic r r′ deterministic (IfTrue v r) (IfFalse v′ r′) rewrite v = contradiction v′ true≢false deterministic (IfFalse v r) (IfTrue v′ r′) rewrite v′ = contradiction v true≢false deterministic (IfFalse v r) (IfFalse v′ r′) = deterministic r r′ deterministic (WhileFalse v) (WhileFalse x₁) = refl deterministic (WhileFalse v) (WhileTrue x₁ r₁ r₂) rewrite x₁ = contradiction v true≢false deterministic (WhileTrue v r₁ r₂) (WhileFalse v′) rewrite v = contradiction v′ true≢false deterministic (WhileTrue v r₁ r₂) (WhileTrue v′ r₁′ r₂′) rewrite deterministic r₁ r₁′ = deterministic r₂ r₂′ lemma2-3-5 : ∀{s t} → ¬ ( ⦅ WHILE (Bc true) DO SKIP , s ⦆⇒ t ) lemma2-3-5 (WhileTrue x Skip (WhileTrue v r₁ r₂)) = lemma2-3-5 r₂ infixl 19 _∼_ _∼_ : com → com → Set c ∼ c′ = ∀{s t} → ⦅ c , s ⦆⇒ t ⇔ ⦅ c′ , s ⦆⇒ t lemma2-4-3 : ∀{b c} → (WHILE b DO c) ∼ (IF b THEN (c :: (WHILE b DO c)) ELSE SKIP) lemma2-4-3 = equivalence (λ { (WhileFalse x) → IfFalse x Skip ; (WhileTrue x r r₁) → IfTrue x (Comp r r₁) }) (λ { (IfTrue x (Comp r r₁)) → WhileTrue x r r₁ ; (IfFalse x Skip) → WhileFalse x }) data ⦅_,_⦆→⦅_,_⦆ : com → state → com → state → Set where Loc : ∀{x a s} → ⦅ x ::= a , s ⦆→⦅ SKIP , s [ x ::= aval a s ] ⦆ Comp₁ : ∀{c s} → ⦅ SKIP :: c , s ⦆→⦅ c , s ⦆ Comp₂ : ∀{c₁ c₁′ c₂ s s′} → ⦅ c₁ , s ⦆→⦅ c₁′ , s′ ⦆ → ⦅ c₁ :: c₂ , s ⦆→⦅ c₁′ :: c₂ , s′ ⦆ IfTrue : ∀{b s c₁ c₂} → bval b s ≡ true → ⦅ IF b THEN c₁ ELSE c₂ , s ⦆→⦅ c₁ , s ⦆ IfFalse : ∀{b s c₁ c₂} → bval b s ≡ false → ⦅ IF b THEN c₁ ELSE c₂ , s ⦆→⦅ c₂ , s ⦆ While : ∀{b s c} → ⦅ WHILE b DO c , s ⦆→⦅ IF b THEN (c :: (WHILE b DO c)) ELSE SKIP , s ⦆ infix 3 ⦅_,_⦆∎ infixr 2 ⦅_,_⦆→⟨_⟩_ ⦅_,_⦆→*⟨_⟩_ data ⦅_,_⦆→*⦅_,_⦆ : com → state → com → state → Set where ⦅_,_⦆∎ : ∀ c s → ⦅ c , s ⦆→*⦅ c , s ⦆ ⦅_,_⦆→⟨_⟩_ : ∀ c s {c′ c″ s′ s″} → ⦅ c , s ⦆→⦅ c′ , s′ ⦆ → ⦅ c′ , s′ ⦆→*⦅ c″ , s″ ⦆ → ⦅ c , s ⦆→*⦅ c″ , s″ ⦆ ⦅_,_⦆→*⟨_⟩_ : ∀ c s {c′ c″ s′ s″} → ⦅ c , s ⦆→*⦅ c′ , s′ ⦆ → ⦅ c′ , s′ ⦆→*⦅ c″ , s″ ⦆ → ⦅ c , s ⦆→*⦅ c″ , s″ ⦆ ⦅ c , s ⦆→*⟨ ⦅ _ , _ ⦆∎ ⟩ b = b ⦅ c , s ⦆→*⟨ ⦅ _ , _ ⦆→⟨ x ⟩ r ⟩ b = ⦅ _ , _ ⦆→⟨ x ⟩ ⦅ _ , _ ⦆→*⟨ r ⟩ b lemma2-5-6 : ∀{c₁ c₁′ c₂ s s′} → ⦅ c₁ , s ⦆→*⦅ c₁′ , s′ ⦆ → ⦅ c₁ :: c₂ , s ⦆→*⦅ c₁′ :: c₂ , s′ ⦆ lemma2-5-6 ⦅ _ , _ ⦆∎ = ⦅ _ , _ ⦆∎ lemma2-5-6 (⦅ _ , _ ⦆→⟨ x ⟩ r) = ⦅ _ , _ ⦆→⟨ Comp₂ x ⟩ lemma2-5-6 r big-small : ∀{c s t} → ⦅ c , s ⦆⇒ t → ⦅ c , s ⦆→*⦅ SKIP , t ⦆ big-small (Skip {s}) = ⦅ SKIP , s ⦆∎ big-small (Loc {x}{s}{a}) = ⦅ x ::= s , a ⦆→⟨ Loc ⟩ ⦅ SKIP , a [ x ::= aval s a ] ⦆∎ big-small (Comp {c₁}{c₂}{s}{s′}{t} r₁ r₂) = ⦅ c₁ :: c₂ , s ⦆→*⟨ lemma2-5-6 (big-small r₁) ⟩ ⦅ SKIP :: c₂ , s′ ⦆→⟨ Comp₁ ⟩ ⦅ c₂ , s′ ⦆→*⟨ big-small r₂ ⟩ ⦅ SKIP , t ⦆∎ big-small (IfTrue {c₁}{c₂}{b}{s}{t} v r₁) = ⦅ IF b THEN c₁ ELSE c₂ , s ⦆→⟨ IfTrue v ⟩ ⦅ c₁ , s ⦆→*⟨ big-small r₁ ⟩ ⦅ SKIP , t ⦆∎ big-small (IfFalse {c₁}{c₂}{b}{s}{t} v r₂) = ⦅ IF b THEN c₁ ELSE c₂ , s ⦆→⟨ IfFalse v ⟩ ⦅ c₂ , s ⦆→*⟨ big-small r₂ ⟩ ⦅ SKIP , t ⦆∎ big-small (WhileFalse {c}{b}{s} v) = ⦅ WHILE b DO c , s ⦆→⟨ While ⟩ ⦅ IF b THEN c :: (WHILE b DO c) ELSE SKIP , s ⦆→⟨ IfFalse v ⟩ ⦅ SKIP , s ⦆∎ big-small (WhileTrue {c}{b}{s}{s′}{t} v r₁ r₂) = ⦅ WHILE b DO c , s ⦆→⟨ While ⟩ ⦅ IF b THEN c :: (WHILE b DO c) ELSE SKIP , s ⦆→⟨ IfTrue v ⟩ ⦅ c :: (WHILE b DO c) , s ⦆→*⟨ lemma2-5-6 (big-small r₁) ⟩ ⦅ SKIP :: (WHILE b DO c) , s′ ⦆→⟨ Comp₁ ⟩ ⦅ WHILE b DO c , s′ ⦆→*⟨ big-small r₂ ⟩ ⦅ SKIP , t ⦆∎ lemma2-5-8 : ∀{c s c′ s′ t} → ⦅ c , s ⦆→⦅ c′ , s′ ⦆ → ⦅ c′ , s′ ⦆⇒ t → ⦅ c , s ⦆⇒ t lemma2-5-8 Loc Skip = Loc lemma2-5-8 Comp₁ r₁ = Comp Skip r₁ lemma2-5-8 (Comp₂ x) (Comp r₁ r₂) = Comp (lemma2-5-8 x r₁) r₂ lemma2-5-8 (IfTrue x) r₁ = IfTrue x r₁ lemma2-5-8 (IfFalse x) r₁ = IfFalse x r₁ lemma2-5-8 While (IfTrue x (Comp r₁ r₂)) = WhileTrue x r₁ r₂ lemma2-5-8 While (IfFalse x Skip) = WhileFalse x small-big : ∀{c s t} → ⦅ c , s ⦆→*⦅ SKIP , t ⦆ → ⦅ c , s ⦆⇒ t small-big ⦅ SKIP , s ⦆∎ = Skip small-big (⦅ c , s ⦆→⟨ x ⟩ r) = lemma2-5-8 x (small-big r)
agda/Function/Fiber.agda
oisdk/combinatorics-paper
6
11895
{-# OPTIONS --cubical --safe #-} module Function.Fiber where open import Level open import Data.Sigma.Base open import Path open import Cubical.Foundations.Everything using (fiber) public
programs/oeis/266/A266444.asm
neoneye/loda
22
175007
<reponame>neoneye/loda ; A266444: Middle column of the "Rule 25" elementary cellular automaton starting with a single ON (black) cell. ; 1,0,0,0,1,0,1,0,1,1,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1 mov $1,6 mov $2,1 mov $4,5 lpb $1 mov $1,$0 sub $0,1 div $1,2 add $4,$2 mov $3,$4 lpb $3 trn $1,$0 mov $3,$0 sub $3,2 lpe lpe add $0,2 mod $0,2
Take Home Test/Kamal_Faheem_Code/Kamal_Faheem_2.21.asm
FaheemAKamal/CS342Projects
0
18448
<filename>Take Home Test/Kamal_Faheem_Code/Kamal_Faheem_2.21.asm .data a: .word 1 b: .word 2 c: .word 3 d: .word 4 e: .word 5 .text lw $s0, a lw $s1, b lw $s2, c lw $s3, d lw $s4, e # a = b + c add $s0, $s1, $s2 sw $s0, a # d = a - e sub $s3, $s0, $s4 sw $s3, d
test/interaction/Issue1278/A.agda
shlevy/agda
1,989
3425
<reponame>shlevy/agda module Issue1278.A (X : Set1) where data D : Set where d : D
test/reldef.asm
bitwiseworks/nasm-os2
1
164817
<filename>test/reldef.asm bits 64 default rel %if 1 extern bar %else section .bss bar: resd 0 %endif global start global foo section .rodata rod1: dd 0x01234567 rod2: dd 0x89abcdef section .text start: call .next .next: pop rsi sub rsi,.next-$$ lea rax, [rod1] lea rcx, [rod2] lea rdx, [bar] lea rbx, [foo] lea rax, [rdi+rod1-$$] lea rcx, [rdi+rod2-$$] lea rdx, [rdi+bar-$$] lea rbx, [rdi+foo-$$] mov rax, [rdi+rod1-$$] mov rcx, [rdi+rod2-$$] mov rdx, [rdi+bar-$$] mov rbx, [rdi+foo-$$] mov rax, dword rod1-$$ mov rcx, dword rod2-$$ mov rdx, dword bar-$$ mov rbx, dword foo-$$ section .data dq rod1 dq rod2 dq bar dq foo foo: dd rod1 - $ dd rod1 - $$ dd rod2 - $ dd rod2 - $$ dd bar - $ dd bar - $$ dd foo - $ dd foo - $$
libsrc/_DEVELOPMENT/alloc/malloc/c/sdcc_iy/_falloc__unlocked_callee.asm
meesokim/z88dk
0
161318
; void *_falloc__unlocked_callee(void *p, size_t size) SECTION code_alloc_malloc PUBLIC __falloc__unlocked_callee __falloc__unlocked_callee: pop hl pop bc ex (sp),hl INCLUDE "alloc/malloc/z80/asm__falloc_unlocked.asm"
src/Categories/Object/Group.agda
Trebor-Huang/agda-categories
5
3716
<filename>src/Categories/Object/Group.agda {-# OPTIONS --safe --without-K #-} ------------------------------------------------------------------------ -- Group objects in a cartesian category. ------------------------------------------------------------------------ open import Categories.Category open import Categories.Category.Cartesian module Categories.Object.Group {o ℓ e} {𝒞 : Category o ℓ e} (C : Cartesian 𝒞) where open import Level open import Categories.Category.BinaryProducts 𝒞 using (BinaryProducts) open import Categories.Category.Cartesian.Monoidal open import Categories.Object.Monoid (CartesianMonoidal.monoidal C) open import Categories.Object.Terminal 𝒞 open Category 𝒞 open Cartesian C module Π = BinaryProducts products open BinaryProducts products using (_×_; _⁂_; ⟨_,_⟩) open Terminal terminal record IsGroup (G : Obj) : Set (ℓ ⊔ e) where -- any group object is also a monoid object field isMonoid : IsMonoid G open IsMonoid isMonoid public field -- inverse operation ι : G ⇒ G -- ι is in fact an inverse inverseˡ : η ∘ ! ≈ μ ∘ ⟨ ι , id ⟩ inverseʳ : η ∘ ! ≈ μ ∘ ⟨ id , ι ⟩ record Group : Set (o ⊔ ℓ ⊔ e) where field Carrier : Obj isGroup : IsGroup Carrier open IsGroup isGroup public monoid : Monoid monoid = record { isMonoid = isMonoid } open Group record Group⇒ (G H : Group) : Set (ℓ ⊔ e) where field arr : Carrier G ⇒ Carrier H preserves-μ : arr ∘ μ G ≈ μ H ∘ (arr ⁂ arr) preserves-η : arr ∘ η G ≈ η H preserves-ι : arr ∘ ι G ≈ ι H ∘ arr
gcc-gcc-7_3_0-release/gcc/ada/g-spchge.ads
best08618/asylo
7
12095
<gh_stars>1-10 ------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- G N A T . S P E L L I N G _ C H E C K E R _ G E N E R I C -- -- -- -- S p e c -- -- -- -- Copyright (C) 1998-2013, 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/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- Spelling checker -- This package provides a utility generic routine for checking for bad -- spellings. This routine must be instantiated with an appropriate array -- element type, which must represent a character encoding in which the -- codes for ASCII characters in the range 16#20#..16#7F# have their normal -- expected encoding values (e.g. the Pos value 16#31# must be digit 1). pragma Compiler_Unit_Warning; package GNAT.Spelling_Checker_Generic is pragma Pure; generic type Char_Type is (<>); -- See above for restrictions on what types can be used here type String_Type is array (Positive range <>) of Char_Type; function Is_Bad_Spelling_Of (Found : String_Type; Expect : String_Type) return Boolean; -- Determines if the string Found is a plausible misspelling of the string -- Expect. Returns True for an exact match or a probably misspelling, False -- if no near match is detected. This routine is case sensitive, so the -- caller should fold both strings to get a case insensitive match if the -- character encoding represents upper/lower case. -- -- Note: the spec of this routine is deliberately rather vague. This -- routine is the one used by GNAT itself to detect misspelled keywords -- and identifiers, and is heuristically adjusted to be appropriate to -- this usage. It will work well in any similar case of named entities. end GNAT.Spelling_Checker_Generic;
oeis/089/A089253.asm
neoneye/loda-programs
11
7016
<filename>oeis/089/A089253.asm ; A089253: Numbers n such that 2n - 5 is a prime. ; Submitted by <NAME> ; 4,5,6,8,9,11,12,14,17,18,21,23,24,26,29,32,33,36,38,39,42,44,47,51,53,54,56,57,59,66,68,71,72,77,78,81,84,86,89,92,93,98,99,101,102,108,114,116,117,119,122,123,128,131,134,137,138,141,143,144,149,156,158,159,161,168,171,176,177,179,182,186,189,192,194,197,201,203,207,212,213,218,219,222,224,227,231,233,234,236,242,246,248,252,254,257,263,264,273,276 mov $1,2 mov $2,$0 pow $2,2 lpb $2 mov $3,$1 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 add $1,2 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 sub $2,1 lpe mov $0,$1 div $0,2 add $0,3
Test/kmat.asm
koutheir/i8086sim
3
83674
<gh_stars>1-10 ;input: ;dx: matrix number (0=>A or 1=>B) enter_matrix_dimensions proc push ax push si enter_matrix_dimensions_0: ;Write the prompt push ax push dx add dl,'A' mov s_enter_matrix_rows_count,dl mov dx,offset s_enter_matrix_rows_count mov ah,9 int 21h pop dx pop ax call get_int cmp ax,0 jle enter_matrix_dimensions_0 cmp ax,max_matrix_rows_count jg enter_matrix_dimensions_0 mov si,dx mov rows[si],al enter_matrix_dimensions_1: ;Write the prompt push ax push dx add dl,'A' mov s_enter_matrix_columns_count,dl mov dx,offset s_enter_matrix_columns_count mov ah,9 int 21h pop dx pop ax call get_int cmp ax,0 jle enter_matrix_dimensions_1 cmp ax,max_matrix_columns_count jg enter_matrix_dimensions_1 mov columns[si],al pop si pop ax ret enter_matrix_dimensions endp ;Compute the offset of the item in the matrix ;input: ;al: row <= 7 ;ah: column <= 7 ;dx: matrix number (0=>A or 1=>B or 2=>C) ;output: ;cx: offset = number_of_columns * row_index + column_index get_matrix_item_offset proc push ax push bx push dx push di mov di,dx mov bl,columns[di] ;bx=number of columns xor bh,bh xor ah,ah ;ax=row index mul bx mov cx,ax ;cx=number_of_columns * row_index pop di pop dx pop bx pop ax push ax mov al,ah xor ah,ah ;ax=column index add cx,ax ;cx=number_of_columns * row_index + column_index shl cx,1 ;multiply cx by 2 because integers are words pop ax ret get_matrix_item_offset endp ;input: ;al: row <= 7 ;ah: column <= 7 ;dx: matrix number (0=>A or 1=>B) enter_matrix_item proc ;Write the prompt push ax push dx add dl,'A' add al,'1' add ah,'1' mov s_enter_matrix_item,dl mov s_enter_matrix_item[2],al mov s_enter_matrix_item[4],ah mov dx,offset s_enter_matrix_item mov ah,9 int 21h pop dx pop ax push ax push cx push si ;Get the offset of item in the matrix in cx call get_matrix_item_offset ;Get the value in ax call get_int mov si,cx cmp dl,1 je enter_matrix_item_0 mov matA[si],ax ;modify matrix A jmp enter_matrix_item_1 enter_matrix_item_0: mov matB[si],ax ;modify matrix A enter_matrix_item_1: pop si pop cx pop ax ret enter_matrix_item endp ;input: ;dx: matrix number (0=>A or 1=>B) enter_matrix proc call enter_matrix_dimensions push ax push bx push si mov si,dx mov bl,rows[si] mov bh,columns[si] xor al,al enter_matrix_loop1: xor ah,ah enter_matrix_loop2: call enter_matrix_item inc ah cmp ah,bh jne enter_matrix_loop2 inc al cmp al,bl jne enter_matrix_loop1 pop si pop bx pop ax ret enter_matrix endp ;input: ;dx: matrix number (0=>A or 1=>B or 2=>C) print_matrix proc push ax push bx push cx push dx push si push di push dx mov si,dx add dl,'A' mov s_matrix_name[7],dl mov dx,offset s_matrix_name mov ah,9 int 21h ;Calculate the number of '-' char to write mov al,columns[si] xor ah,ah mov cx,7 xor dx,dx mul cx dec ax ;Draw horizontal line mov cx,ax mov al,'-' mov bh,0 mov ah,0ah int 10h mov dx,offset s_new_line mov ah,9 int 21h pop dx push cx mov bl,rows[si] mov bh,columns[si] xor al,al print_matrix_loop1: xor ah,ah print_matrix_loop2: call get_matrix_item_offset mov di,cx push ax push bx push dx cmp dx,2 je print_matrix_2 cmp dx,1 je print_matrix_1 mov cx,matA[di] jmp print_matrix_3 print_matrix_1: mov cx,matB[di] jmp print_matrix_3 print_matrix_2: mov cx,matC[di] print_matrix_3: push cx xor bh,bh mov ah,3 int 10h ;Get cursor position into dx pop ax ;ax=old cx call print_int ;Advance cursor position by 7 characters add dl,7 xor bh,bh mov ah,2 int 10h pop dx pop bx pop ax inc ah cmp ah,bh jne print_matrix_loop2 push ax push dx mov dx,offset s_new_line mov ah,9 int 21h pop dx pop ax inc al cmp al,bl jne print_matrix_loop1 ;Draw horizontal line pop cx mov al, '-' mov bh, 0 mov ah, 0ah int 10h mov dx,offset s_new_line mov ah,9 int 21h pop di pop si pop dx pop cx pop bx pop ax ret print_matrix endp ;output: ;ax: zero if success, non-zero on failure add_matrices proc push dx push si mov dx,offset s_matrix_addition mov ah,9 int 21h mov al,rows[0] xor ah,ah cmp al,rows[1] jne add_matrices_0 mov rows[2],al ;Set the dimensions of the resulting matrix mov al,columns[0] xor ah,ah cmp al,columns[1] jne add_matrices_0 mov columns[2],al ;Set the dimensions of the resulting matrix mul rows[0] shl ax,1 ;integers are words => ax = ax*2 mov si,ax add_matrices_loop1: sub si,2 mov ax,matA[si] add ax,matB[si] jno add_matrices_2 push ax push dx mov dx,offset s_overflow mov ah,9 int 21h pop dx pop ax add_matrices_2: mov matC[si],ax cmp si,0 jne add_matrices_loop1 mov dx,offset s_matrix_addition_done mov ah,9 int 21h xor ax,ax ;success jmp add_matrices_1 add_matrices_0: mov dx,offset s_incompatible_dimensions mov ah,9 int 21h mov ax,1 ;error add_matrices_1: pop si pop dx ret add_matrices endp ;output: ;ax: zero if success, non-zero on failure multiply_matrices proc push bx push cx push dx push si push di mov dx,offset s_matrix_multiplication mov ah,9 int 21h mov al,columns[0] mov ah,rows[1] cmp al,ah jne multiply_matrices_0 ;Set the dimensions of the resulting matrix mov al,rows[0] mov rows[2],al mov al,columns[1] mov columns[2],al mov al,rows[0] ;al=number of rows of A multiply_matrices_loop1: dec al mov ah,columns[1] ;ah=number of columns of B multiply_matrices_loop2: dec ah push dx mov dx,2 ;Matrix C call get_matrix_item_offset mov si,cx mov matC[si],0 pop dx mov bl,columns[0] ;bl=number of columns of A multiply_matrices_loop3: dec bl push ax mov ah,bl mov dx,0 ;Matrix A call get_matrix_item_offset mov dl,cl ;dl=offsetA[al,bl] pop ax push ax mov al,bl push dx mov dx,1 ;Matrix B call get_matrix_item_offset pop dx mov dh,cl ;dh=offsetB[bl,ah] pop ax push dx mov dx,2 call get_matrix_item_offset mov si,cx pop dx push ax push dx mov di,dx and di,0ffh mov ax,matA[di] mov di,dx shr di,8 mov cx,matB[di] mul cx add matC[si],ax cmp dx,0 je multiply_matrices_2 mov dx,offset s_overflow mov ah,9 int 21h multiply_matrices_2: pop dx pop ax cmp bl,0 jne multiply_matrices_loop3 cmp ah,0 jne multiply_matrices_loop2 cmp al,0 jne multiply_matrices_loop1 mov dx,offset s_matrix_multiplication_done mov ah,9 int 21h xor ax,ax jmp multiply_matrices_1 multiply_matrices_0: mov dx,offset s_incompatible_dimensions mov ah,9 int 21h mov ax,1 ;error multiply_matrices_1: pop di pop si pop dx pop cx pop bx ret multiply_matrices endp
pwnlib/shellcraft/templates/amd64/linux/futimesat.asm
IMULMUL/python3-pwntools
325
83011
<% from pwnlib.shellcraft.amd64.linux import syscall %> <%page args="fd, file, tvp"/> <%docstring> Invokes the syscall futimesat. See 'man 2 futimesat' for more information. Arguments: fd(int): fd file(char): file tvp(timeval): tvp </%docstring> ${syscall('SYS_futimesat', fd, file, tvp)}
drivers/drivers-text_io.ads
ekoeppen/STM32_Generic_Ada_Drivers
1
4585
<reponame>ekoeppen/STM32_Generic_Ada_Drivers<gh_stars>1-10 with HAL; generic with package USART is new HAL.USART (<>); package Drivers.Text_IO is procedure Put (C : Character); procedure Put (S : String); procedure Put_Line (S : String); procedure Put_Integer (N : Integer; Width : Natural := 0); procedure Put_Hex (N : Unsigned_32; Width : Unsigned_8 := 0); procedure New_Line; procedure Get_Line (S : out String; Count : out Natural); procedure Hex_Dump (S : String); end Drivers.Text_IO;
Groups/DirectSum/Definition.agda
Smaug123/agdaproofs
4
5475
<reponame>Smaug123/agdaproofs {-# OPTIONS --safe --warning=error --without-K #-} open import LogicalFormulae open import Setoids.Setoids open import Groups.Definition module Groups.DirectSum.Definition {m n o p : _} {A : Set m} {S : Setoid {m} {o} A} {_·A_ : A → A → A} {B : Set n} {T : Setoid {n} {p} B} {_·B_ : B → B → B} (G : Group S _·A_) (H : Group T _·B_) where open import Setoids.Product S T directSumGroup : Group productSetoid (λ x1 y1 → (((_&&_.fst x1) ·A (_&&_.fst y1)) ,, ((_&&_.snd x1) ·B (_&&_.snd y1)))) Group.+WellDefined directSumGroup (s ,, t) (u ,, v) = Group.+WellDefined G s u ,, Group.+WellDefined H t v Group.0G directSumGroup = (Group.0G G ,, Group.0G H) Group.inverse directSumGroup (g1 ,, H1) = (Group.inverse G g1) ,, (Group.inverse H H1) Group.+Associative directSumGroup = Group.+Associative G ,, Group.+Associative H Group.identRight directSumGroup = Group.identRight G ,, Group.identRight H Group.identLeft directSumGroup = Group.identLeft G ,, Group.identLeft H Group.invLeft directSumGroup = Group.invLeft G ,, Group.invLeft H Group.invRight directSumGroup = Group.invRight G ,, Group.invRight H
oeis/010/A010984.asm
neoneye/loda-programs
11
93390
<filename>oeis/010/A010984.asm ; A010984: Binomial coefficient C(n,31). ; 1,32,528,5984,52360,376992,2324784,12620256,61523748,273438880,1121099408,4280561376,15338678264,51915526432,166871334960,511738760544,1503232609098,4244421484512,11554258485616,30405943383200,77535155627160,191991813933920,462525733568080,1085929983159840,2488589544741300,5574440580220512,12220888964329584,26252279997448736,55317304280338408,114449595062769120,232714176627630544,465428353255261088,916312070471295267,1777090076065542336,3397378086595889760,6406484391866534976 add $0,31 bin $0,31
programs/oeis/245/A245380.asm
neoneye/loda
22
243634
; A245380: (7*n^5+5*n^3)/12. ; 0,1,22,153,624,1875,4626,9947,19328,34749,58750,94501,145872,217503,314874,444375,613376,830297,1104678,1447249,1870000,2386251,3010722,3759603,4650624,5703125,6938126,8378397,10048528,11974999,14186250,16712751,19587072,22843953,26520374,30655625,35291376,40471747,46243378,52655499,59760000,67611501,76267422,85788053,96236624,107679375,120185626,133827847,148681728,164826249,182343750,201320001,221844272,244009403,267911874,293651875,321333376,351064197,382956078,417124749,453690000,492775751,534510122,579025503,626458624,676950625,730647126,787698297,848258928,912488499,980551250,1052616251,1128857472,1209453853,1294589374,1384453125,1479239376,1579147647,1684382778,1795154999,1911680000,2034179001,2162878822,2298011953,2439816624,2588536875,2744422626,2907729747,3078720128,3257661749,3444828750,3640501501,3844966672,4058517303,4281452874,4514079375,4756709376,5009662097,5273263478,5547846249 lpb $0 sub $0,1 mov $2,$0 max $2,0 seq $2,8384 ; Crystal ball sequence for A_4 lattice. add $1,$2 lpe mov $0,$1
vscode-pvs/server/src/core/PvsLanguage.g4
thehogfather/vscode-pvs
0
3440
<filename>vscode-pvs/server/src/core/PvsLanguage.g4 /** * ANTLR4 parser rules for the PVS language * @author <NAME> * @date 2019.12.22 * @copyright * Copyright 2019 United States Government as represented by the Administrator * of the National Aeronautics and Space Administration. All Rights Reserved. * * Disclaimers * * No Warranty: THE SUBJECT SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY * WARRANTY OF ANY KIND, EITHER EXPRESSED, IMPLIED, OR STATUTORY, * INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY THAT THE SUBJECT SOFTWARE * WILL CONFORM TO SPECIFICATIONS, ANY IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR FREEDOM FROM * INFRINGEMENT, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL BE ERROR * FREE, OR ANY WARRANTY THAT DOCUMENTATION, IF PROVIDED, WILL CONFORM TO * THE SUBJECT SOFTWARE. THIS AGREEMENT DOES NOT, IN ANY MANNER, * CONSTITUTE AN ENDORSEMENT BY GOVERNMENT AGENCY OR ANY PRIOR RECIPIENT * OF ANY RESULTS, RESULTING DESIGNS, HARDWARE, SOFTWARE PRODUCTS OR ANY * OTHER APPLICATIONS RESULTING FROM USE OF THE SUBJECT SOFTWARE. * FURTHER, GOVERNMENT AGENCY DISCLAIMS ALL WARRANTIES AND LIABILITIES * REGARDING THIRD-PARTY SOFTWARE, IF PRESENT IN THE ORIGINAL SOFTWARE, * AND DISTRIBUTES IT "AS IS." * * Waiver and Indemnity: RECIPIENT AGREES TO WAIVE ANY AND ALL CLAIMS * AGAINST THE UNITED STATES GOVERNMENT, ITS CONTRACTORS AND * SUBCONTRACTORS, AS WELL AS ANY PRIOR RECIPIENT. IF RECIPIENT'S USE OF * THE SUBJECT SOFTWARE RESULTS IN ANY LIABILITIES, DEMANDS, DAMAGES, * EXPENSES OR LOSSES ARISING FROM SUCH USE, INCLUDING ANY DAMAGES FROM * PRODUCTS BASED ON, OR RESULTING FROM, RECIPIENT'S USE OF THE SUBJECT * SOFTWARE, RECIPIENT SHALL INDEMNIFY AND HOLD HARMLESS THE UNITED * STATES GOVERNMENT, ITS CONTRACTORS AND SUBCONTRACTORS, AS WELL AS ANY * PRIOR RECIPIENT, TO THE EXTENT PERMITTED BY LAW. RECIPIENT'S SOLE * REMEDY FOR ANY SUCH MATTER SHALL BE THE IMMEDIATE, UNILATERAL * TERMINATION OF THIS AGREEMENT. */ grammar PvsLanguage; import PvsLexer; //------------------------ // Parser Rules (ATTN: in antlr, all parser rules start with a small letter) //------------------------ parse : theory* datatype* EOF ; theory : theoryBegin theoryBody theoryEnd ; theoryBegin : identifier theoryFormals? ':' K_THEORY exporting? K_BEGIN ; theoryEnd : K_END identifier // error handling | { notifyErrorListeners("Theory name expected after keyword 'END'."); } K_END ; datatype : datatypeBegin datatypeBody datatypeEnd ; datatypeBegin : identifier theoryFormals? ':' (K_DATATYPE | K_CODATATYPE) (K_WITH K_SUBTYPES name (',' name)*)? K_BEGIN ; datatypeEnd : K_END identifier // error handling | { notifyErrorListeners("Datatype name expected after keyword 'END'."); } K_END ; datatypeBody : (importing | datatypeConstructor)* ; datatypeConstructor : term ':' identifier (':' identifier)? ; theoryBody : assumingPart? (importing | declaration)* ; theoryFormals : ('[' (theoryFormalType | theoryFormalConstant) (',' (theoryFormalType | theoryFormalConstant))* ']') ; theoryFormalType : ('(' importing ')')? typeDeclaration ; theoryFormalConstant : ('(' importing ')')? identifierOrOperators ':' typeExpression ; assumingPart : K_ASSUMING (assumingElement ';'?)+ K_ENDASSUMING ; assumingElement : importing | assumption | declaration ; assumption : identifier ':' K_ASSUMPTION expr ; declaration : typeDeclaration | formulaDeclaration | varDeclaration | functionDeclaration | constantDeclaration | judgementDeclaration | conversionDeclaration | autorewriteDeclaration | datatype | declaration ';' ; autorewriteDeclaration : (K_AUTO_REWRITE | K_AUTO_REWRITE_PLUS | K_AUTO_REWRITE_MINUS) name (',' name)* ; typeDeclaration : typeName (',' typeName)* ':' (K_TYPE | K_NONEMPTY_TYPE | K_TYPE_PLUS) (('=' | K_FROM) typeDefinition)? ; typeName : identifier actuals* arguments* ; typeDefinition : typeExpression (K_CONTAINING expr)? ; formulaDeclaration : identifier ':' K_FORMULA formulaDefinition // error handling | identifier { notifyErrorListeners("':' expected."); } K_FORMULA formulaDefinition ; formulaDefinition : expr ; constantDeclaration : constantName (',' constantName)* ':' typeExpression | constantName ':' K_MACRO? typeExpression '=' constantDefinition ; constantName : identifierOrOperator actuals* arguments* ; constantDefinition : expr ; functionDeclaration : functionName arguments+ ':' (((K_MACRO | K_INDUCTIVE | K_COINDUCTIVE)? typeExpression ('=' functionDefinition)?) | (K_RECURSIVE typeExpression '=' functionDefinition measureExpression)) ; functionName : (identifier | redefinableOp) ; functionDefinition : expr ; judgementDeclaration : (judgementName ':')? K_RECURSIVE? K_JUDGEMENT judgementExpression (K_HAS_TYPE | K_SUBTYPE_OF) typeExpression ; judgementName : identifierOrOperator ; judgementExpression : bindingExpression | identifierOrOperator actuals* arguments* | typeExpression | judgementExpression (',' judgementExpression)+ ; conversionDeclaration : (K_CONVERSION | K_CONVERSION_PLUS | K_CONVERSION_MINUS) idType (',' idType)* ; varDeclaration : varIdentifiers':' K_VAR typeExpression ; varIdentifiers : identifierOrOperators ; arguments : '(' expr (':' typeExpression)? (',' expr (':' typeExpression)?)* ')' | '(' subtype (',' subtype)* ')' ; typeExpression : subtype // important: subtype needs to come before enumeration type | enumerationType | recordType | tupleType | functionType | bindingDeclaration | name | theoryName ('.' typeExpression)? | typeExpression actuals+ ; theoryName: (identifier '@')? identifier actuals?; expr: builtin #builtinExpr | expr logicalBinaryOp expr #binaryOpExpr | expr comparisonBinaryOp expr #binaryOpExpr | expr arithmeticBinaryOp expr #binaryOpExpr | expr otherBuiltinBinaryOp expr #binaryOpExpr | unaryOp expr #unaryOpExpr | expr '`' expr #accessorExpr | listExpression #listExpr | recordExpression #recordExpr | tableExpression #tableExpr | ifExpression #ifExpr | bindingExpression #bindingExpr | letExpression #letExpr | tupleExpression #tupleExpr | expr '::' typeExpression #corcExpr | expr K_WITH withAssignments #withExpr | expr K_WHERE letBindings #whereExpr | expr '(' expr ')' #holFunctionExpr | '(' expr ')' expr #hol2FunctionExpr | '(' expr ')' #parenExpr | '{|' expr '|}' #parenOperatorExpr | typeExpression #typeExpr // NB: typeExpression needs to be after parenExpression, otherwise expression surrounded by parentheses will be mistakenly identified as subtypes | expr redefinableOp expr #binaryOpExpr | redefinableOp #operatorExpr // error handling | expr K_WITH '[' (assignmentExpression (',' assignmentExpression)*)? { notifyErrorListeners("',' expected."); } assignmentExpression (assignmentExpression+ (',' assignmentExpression)*)? ']' #exprError ; withAssignments : '[' assignmentExpression (',' assignmentExpression)* ']' ; builtin : number | true_false | string | builtin comparisonBinaryOp builtin | builtin arithmeticBinaryOp builtin | '(' builtin ')' ; number : ('+' | '-')? NUMBER; true_false: TRUE_FALSE; string: STRING; ifExpression : K_IF expr K_THEN expr (K_ELSIF expr K_THEN expr)* K_ELSE expr K_ENDIF | K_CASES expr K_OF expr ':' expr (',' expr ':' expr)* (K_ELSE expr)? K_ENDCASES | K_COND expr '->' expr (',' expr '->' expr)* (',' K_ELSE '->' expr)? K_ENDCOND | '(' ifExpression ')' ; letExpression : K_LET letBindings K_IN expr | '(' letExpression ')' ; tupleExpression : '(' expr (',' expr)+ ')' | '(' tupleExpression ')' ; listExpression : '(:' expr? (',' expr)* ':)' | 'cons' actuals? '(' expr (',' expr)* ')' ; recordExpression : '(#' assignmentExpression (',' assignmentExpression)* '#)' | '{|' expr (',' expr) '|}' | '(' recordExpression ')' // error handling | '(#' (assignmentExpression (',' assignmentExpression)*)? { notifyErrorListeners("','' expected."); } (assignmentExpression+ (',' assignmentExpression)*)* '#)' // error: omission of comma | '(#' (assignmentExpression (',' assignmentExpression)*)? (','+ { notifyErrorListeners("Assignment expression expected."); } assignmentExpression?)* '#)' // error: extra commas ; tableExpression : K_TABLE colHeading? tableEntry+ K_ENDTABLE | '[|' expr (',' (expr | K_ELSE) )* '|]' ; colHeading : '|[' expr ('|' (expr | K_ELSE) )* ']''|' ; tableEntry : '|' expr ('|' (expr | K_ELSE) )* '|' ; measureExpression : K_MEASURE expr (K_BY (unaryOp | binaryOp | expr))? ; bindingExpression : (K_FORALL | K_EXISTS | K_LAMBDA | K_EPSILON | K_THE) lambdaBindings ':' lambdaBody | '(' bindingExpression ')' ; lambdaBindings : bindingName (',' bindingName)* (':' typeExpression)? ('|' expr)? | lambdaBindings (',' lambdaBindings)+ | '(' lambdaBindings ')' ('(' lambdaBindings ')')* ; bindingName: identifierOrOperator; lambdaBody: expr ; typeId : localName (':' typeExpression)? ('|' expr)? ; localName : identifierOrOperator ; typeIds : terms (':' typeExpression)? ('|' expr)? // error handling | expr { notifyErrorListeners("':' expected."); } expr ; letBindings : letBinding (',' letBinding)* ; letBinding : letBind (',' letBind)* '=' expr ; letBind : (name | unaryOp | binaryOp) (':' typeExpression)? | '(' (name | unaryOp | binaryOp) (',' (name | unaryOp | binaryOp))* ')' (':' typeExpression)? | '(' letBind ')' ; assignmentExpression : (assignmentIdentifier | expr) (':=' | '|->') expr | '(' assignmentExpression ')' // error handling | assignmentIdentifier { notifyErrorListeners("':=' expected."); } '=' expr ; assignmentIdentifier : (name? '`')? name | '(' assignmentIdentifier ')' ; bindingDeclaration : K_LAMBDA? identifierOrOperators ':' expr ; recordType : (name K_WITH)? '[#' bindingDeclaration (',' bindingDeclaration)* '#]' // error handling | '[#' (bindingDeclaration (',' bindingDeclaration)*)? { notifyErrorListeners("`,` expected."); } (bindingDeclaration+ (',' bindingDeclaration)*)* '#]' // error: missing commas | '[#' (bindingDeclaration (',' bindingDeclaration)*)? (','+ { notifyErrorListeners("Binding declaration expected."); } bindingDeclaration?)* '#]' // error: extra commas ; functionType : (K_FUNCTION | K_ARRAY)? '[' (terms ':')? typeExpression (',' (terms ':')? typeExpression)* '->' typeExpression ']' ; tupleType : '[' (identifierOrOperators ':')? typeExpression (',' (identifierOrOperators ':')? typeExpression)* ']' ; subtype : '{' idType ('|' expr)? '}' | '(' expr ((',' | '/' | '*') expr)* ('|' expr)? ')' // shotcut for subtype ; idType : terms (':' typeExpression)? | idType (',' idType)+ | '(' idType ')' ; terms : term (',' term)* ; term : identifierOrOperator actuals? arguments* | '(' term (',' term)* ')' ; name : (theoryName '.')? identifierOrOperator actuals? arguments* ; actuals : '[' (expr | typeDeclaration) (',' (expr | typeDeclaration))* ']' ; enumerationType : '{' identifier (',' identifier) '}' ; importing : K_IMPORTING importingElement (',' importingElement)* ';'? ; importingElement : importTheoryName (K_AS identifier)? ('{''{' identifierOrOperator ':=' identifierOrOperator (',' identifierOrOperator ':=' identifierOrOperator)* '}''}')? ; importTheoryName : (identifier '@')? identifier actuals? ; exporting : K_EXPORTING exportingNames (K_WITH exportingTheories)? ; exportingNames : K_ALL ((K_BUT | K_WITH) exportingName (',' exportingName)*)? | exportingName (',' exportingName)* ; exportingName : identifierOrOperator actuals? (':' '{' (typeExpression | K_TYPE | K_FORMULA) '}')? ; exportingTheories : K_ALL | K_CLOSURE | (theoryName (',' theoryName)*) ; identifier : ID ; identifierOrOperators : identifierOrOperator (',' identifierOrOperator)*; identifierOrOperator : identifier | redefinableConstant | redefinableOp ; binaryOp: redefinableOp; unaryOp: builtinUnaryOp; redefinableOp: '~' | '[]' | '<>' | '##' | '#' | '<<' | '>>' | '<<=' | '>>=' | '{||}' | '[||]' | builtinBinaryOp | unaryOp | 'o' | '++' | '^^' | '==' | '|=' | '|-'; redefinableConstant: NUMBER; builtinUnaryOp: '+' | '-' | O_NOT; builtinBinaryOp: logicalBinaryOp | arithmeticBinaryOp | comparisonBinaryOp | otherBuiltinBinaryOp; otherBuiltinBinaryOp: O_EXP | O_SUCH_THAT; logicalBinaryOp: O_IFF | O_IMPLIES | O_AND | O_OR | O_XOR; arithmeticBinaryOp: '*' | operatorDiv | '+' | '-'; comparisonBinaryOp: O_LE | '<' | '>' | O_GE | O_NOT_EQUAL | O_EQUAL; operatorDiv: O_DIV;
Show:Hide Hidden Files.applescript
ed789d0/hidden-files-macos
0
1512
<gh_stars>0 activate application "Finder" tell application "System Events" key code 47 using {shift down, command down} -- command shift period end tell
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_5.asm
ljhsiun2/medusa
9
89633
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r15 push %r9 push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_normal_ht+0x4590, %r15 clflush (%r15) nop nop nop nop add %rbx, %rbx mov (%r15), %bp sub $2216, %r15 lea addresses_D_ht+0x16dd0, %rsi nop nop xor %r12, %r12 mov (%rsi), %r9w nop nop nop nop xor %r12, %r12 lea addresses_A_ht+0x1cde5, %rbp clflush (%rbp) nop nop nop nop add %r11, %r11 movups (%rbp), %xmm0 vpextrq $1, %xmm0, %rsi xor $37984, %rbp lea addresses_D_ht+0xc867, %r9 nop nop nop nop and $58159, %r12 mov $0x6162636465666768, %rbp movq %rbp, (%r9) nop dec %r11 lea addresses_WT_ht+0x8690, %rbx nop xor %rsi, %rsi mov $0x6162636465666768, %r12 movq %r12, %xmm3 vmovups %ymm3, (%rbx) xor $44943, %r15 lea addresses_WC_ht+0x16530, %rsi lea addresses_D_ht+0x1ce76, %rdi clflush (%rsi) nop nop nop nop nop dec %r12 mov $74, %rcx rep movsb nop nop nop nop nop add $49218, %rdi lea addresses_D_ht+0x1e110, %rbx add $63023, %r15 movb $0x61, (%rbx) sub %r11, %r11 lea addresses_UC_ht+0x1e258, %rsi lea addresses_A_ht+0x11b10, %rdi nop add $54069, %r9 mov $106, %rcx rep movsw nop nop sub $29481, %rdi lea addresses_WC_ht+0x11fa8, %rcx and $20628, %rdi movb (%rcx), %r12b nop nop nop nop nop add %rcx, %rcx lea addresses_D_ht+0x1a610, %r15 nop nop cmp %rbx, %rbx movb (%r15), %r9b nop nop nop xor $18461, %rsi lea addresses_UC_ht+0x2018, %r15 clflush (%r15) nop nop nop dec %rcx mov (%r15), %r9 nop nop and $42586, %rbx pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r9 pop %r15 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %rax push %rbx push %rcx push %rdi push %rsi // REPMOV lea addresses_D+0x17270, %rsi lea addresses_A+0x12d71, %rdi nop nop add %rax, %rax mov $7, %rcx rep movsw nop nop sub $13687, %rdi // Store lea addresses_WC+0xa560, %r12 nop nop sub %rsi, %rsi movw $0x5152, (%r12) sub $26986, %rax // Store lea addresses_US+0xc0c0, %r12 nop add %rsi, %rsi mov $0x5152535455565758, %rdi movq %rdi, %xmm5 vmovups %ymm5, (%r12) nop add %rcx, %rcx // Faulty Load lea addresses_WT+0x12310, %rcx clflush (%rcx) nop nop nop sub %rax, %rax movb (%rcx), %r12b lea oracles, %r13 and $0xff, %r12 shlq $12, %r12 mov (%r13,%r12,1), %r12 pop %rsi pop %rdi pop %rcx pop %rbx pop %rax pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'} {'src': {'congruent': 4, 'same': False, 'type': 'addresses_D'}, 'OP': 'REPM', 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_A'}} {'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WC'}} {'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_US'}} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 1, 'NT': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': True, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_D_ht'}} {'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WT_ht'}} {'src': {'congruent': 3, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_D_ht'}} {'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_D_ht'}} {'src': {'congruent': 3, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 10, 'same': True, 'type': 'addresses_A_ht'}} {'src': {'congruent': 3, 'AVXalign': True, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'} {'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 */
SVLexer.g4
hlt0f4h/SVParser
0
509
/* * IEEE 1800-2017 SystemVerilog * Lexer Rule * * [#02] 2022-04-19 * * https://github.com/hlt0f4h/SVParser */ lexer grammar SVLexer; channels { COMMENTS_CH } // String literal L_String : '"' SCharSequence? '"' ; fragment SCharSequence : SChar+ ; fragment SChar : ~["\\\r\n] | EscapeSequence | '\\\n' // Added line | '\\\r\n' // Added line ; fragment EscapeSequence : SimpleEscapeSequence | OctalEscapeSequence | HexadecimalEscapeSequence | UniversalCharacterName ; fragment SimpleEscapeSequence : '\\' ['"?abfnrtv\\] ; fragment OctalEscapeSequence : '\\' Octal_digit | '\\' Octal_digit Octal_digit | '\\' Octal_digit Octal_digit Octal_digit ; fragment HexadecimalEscapeSequence : '\\x' Hex_digit+ ; fragment UniversalCharacterName : '\\u' Hex_digit Hex_digit Hex_digit Hex_digit | '\\U' Hex_digit Hex_digit Hex_digit Hex_digit Hex_digit Hex_digit Hex_digit Hex_digit ; // Macro Keywords Compiler_directive : '`' .*? '\r'? '\n' -> channel (HIDDEN) ; /* M___FILE__ : '`__FILE__' ; M___LINE__ : '`__LINE__' ; M_begin_keywords : '`begin_keywords' ; M_cell_define : '`cell_define' ; M_default_nettype : '`default_nettype' ; M_define : '`define' ; M_else : '`else' ; M_elsif : '`elsif' ; M_end_cell_define : '`end_cell_define' ; M_end_keywords : '`end_keywords' ; M_endif : '`endif' ; M_ifdef : '`ifdef' ; M_ifndef : '`ifndef' ; M_include : '`include' ; M_line : '`line' ; M_nounconnected_drive: '`nounconnected_drive' ; M_pragma : '`pragma' ; M_timescale : '`timescale' ; M_unconnected_drive : '`unconnected_drive' ; M_undef : '`undef' ; M_undefineall : '`undefineall' ; I_Text_macro : S_BQ Any_Alpha_Bar ( Any_Alpha_Num_Bar_Dol )* | S_BQ '\\' ( Any_printable_ASCII_character_except_white_space )* ; */ // System task Keywords D_root : '$root' ; D_unit : '$unit' ; D_error : '$error' ; D_fatal : '$fatal' ; D_fullskew : '$fullskew' ; D_hold : '$hold' ; D_info : '$info' ; D_nochange : '$nochange' ; D_period : '$period' ; D_recovery : '$recovery' ; D_recrem : '$recrem' ; D_removal : '$removal' ; D_setup : '$setup' ; D_setuphold : '$setuphold' ; D_skew : '$skew' ; D_timeskew : '$timeskew' ; D_warning : '$warning' ; D_width : '$width' ; I_System_tf : S_DL Any_Alpha_Num_Bar_Dol ( Any_Alpha_Num_Bar_Dol )* ; // Block Keywords B_begin : 'begin' ; B_case : 'case' ; B_casex : 'casex' ; B_casez : 'casez' ; B_checker : 'checker' ; B_class : 'class' ; B_clocking : 'clocking' ; B_config : 'config' ; B_covergroup : 'covergroup' ; B_end : 'end' ; B_endcase : 'endcase' ; B_endchecker : 'endchecker' ; B_endclass : 'endclass' ; B_endclocking : 'endclocking' ; B_endconfig : 'endconfig' ; B_endfunction : 'endfunction' ; B_endgenerate : 'endgenerate' ; B_endgroup : 'endgroup' ; B_endinterface : 'endinterface' ; B_endmodule : 'endmodule' ; B_endpackage : 'endpackage' ; B_endprimitive : 'endprimitive' ; B_endprogram : 'endprogram' ; B_endproperty : 'endproperty' ; B_endsequence : 'endsequence' ; B_endspecify : 'endspecify' ; B_endtask : 'endtask' ; B_function : 'function' ; B_generate : 'generate' ; B_interface : 'interface' ; B_macromodule : 'macromodule' ; B_module : 'module' ; B_package : 'package' ; B_primitive : 'primitive' ; B_program : 'program' ; B_property : 'property' ; B_sequence : 'sequence' ; B_specify : 'specify' ; B_table : 'table' -> mode(UDP); B_task : 'task' ; // Statement Keywords K_DPI_C : 'DPI-C' ; K_DPI : 'DPI' ; K_PATHPULSE_DL : 'PATHPULSE$' ; K_1step : '1step' ; K_accept_on : 'accept_on' ; K_alias : 'alias' ; K_always : 'always' ; K_always_comb : 'always_comb' ; K_always_ff : 'always_ff' ; K_always_latch : 'always_latch' ; K_assert : 'assert' ; K_assign : 'assign' ; K_assume : 'assume' ; K_before : 'before' ; K_bind : 'bind' ; K_bins : 'bins' ; K_binsof : 'binsof' ; K_break : 'break' ; K_cell : 'cell' ; K_constraint : 'constraint' ; K_continue : 'continue' ; K_cover : 'cover' ; K_coverpoint : 'coverpoint' ; K_cross : 'cross' ; K_deassign : 'deassign' ; K_default : 'default' ; K_defparam : 'defparam' ; K_design : 'design' ; K_disable : 'disable' ; K_dist : 'dist' ; K_do : 'do' ; K_else : 'else' ; K_event : 'event' ; K_eventually : 'eventually' ; K_expect : 'expect' ; K_export : 'export' ; K_extends : 'extends' ; K_extern : 'extern' ; K_first_match : 'first_match' ; K_for : 'for' ; K_force : 'force' ; K_foreach : 'foreach' ; K_forever : 'forever' ; K_fork : 'fork' ; K_forkjoin : 'forkjoin' ; K_global : 'global' ; K_if : 'if' ; K_iff : 'iff' ; K_ifnone : 'ifnone' ; K_ignore_bins : 'ignore_bins' ; K_illegal_bins : 'illegal_bins' ; K_implements : 'implements' ; K_implies : 'implies' ; K_import : 'import' ; K_include : 'include' ; K_initial : 'initial' ; K_inside : 'inside' ; K_instance : 'instance' ; K_intersect : 'intersect' ; K_join : 'join' ; K_join_any : 'join_any' ; K_join_none : 'join_none' ; K_let : 'let' ; K_liblist : 'liblist' ; K_library : 'library' ; K_local_CO_CO : 'local::' ; K_matches : 'matches' ; K_modport : 'modport' ; K_nettype : 'nettype' ; K_new : 'new' ; K_nexttime : 'nexttime' ; K_noshowcancelled : 'noshowcancelled' ; K_option : 'option' ; K_priority : 'priority' ; K_pulsestyle_ondetect: 'pulsestyle_ondetect'; K_pulsestyle_onevent : 'pulsestyle_onevent' ; K_rand : 'rand' ; K_randc : 'randc' ; K_randcase : 'randcase' ; K_randomize : 'randomize' ; K_randsequence : 'randsequence' ; K_reject_on : 'reject_on' ; K_release : 'release' ; K_repeat : 'repeat' ; K_restrict : 'restrict' ; K_return : 'return' ; K_s_always : 's_always' ; K_s_eventually : 's_eventually' ; K_s_nexttime : 's_nexttime' ; K_s_until : 's_until' ; K_s_until_with : 's_until_with' ; //K_sample : 'sample' ; K_showcancelled : 'showcancelled' ; K_soft : 'soft' ; K_solve : 'solve' ; K_specparam : 'specparam' ; K_std_CO_CO : 'std::' ; K_strong : 'strong' ; K_super : 'super' ; K_sync_accept_on : 'sync_accept_on' ; K_sync_reject_on : 'sync_reject_on' ; K_this : 'this' ; K_throughout : 'throughout' ; K_timeprecision : 'timeprecision' ; K_timeunit : 'timeunit' ; K_type_option : 'type_option' ; K_typedef : 'typedef' ; K_unique : 'unique' ; K_unique0 : 'unique0' ; K_until : 'until' ; K_until_with : 'until_with' ; K_untyped : 'untyped' ; K_use : 'use' ; K_wait : 'wait' ; K_wait_order : 'wait_order' ; K_weak : 'weak' ; K_while : 'while' ; K_wildcard : 'wildcard' ; K_with : 'with' ; K_within : 'within' ; // Type Keywords T_automatic : 'automatic' ; T_bit : 'bit' ; T_byte : 'byte' ; T_chandle : 'chandle' ; T_const : 'const' ; T_context : 'context' ; T_edge : 'edge' -> pushMode(EDGE); T_enum : 'enum' ; T_final : 'final' ; T_genvar : 'genvar' ; T_highz0 : 'highz0' ; T_highz1 : 'highz1' ; T_inout : 'inout' ; T_input : 'input' ; T_int : 'int' ; T_integer : 'integer' ; T_interconnect : 'interconnect' ; T_large : 'large' ; T_local : 'local' ; T_localparam : 'localparam' ; T_logic : 'logic' ; T_longint : 'longint' ; T_medium : 'medium' ; T_negedge : 'negedge' ; T_null : 'null' ; T_output : 'output' ; T_packed : 'packed' ; T_parameter : 'parameter' ; T_posedge : 'posedge' ; T_protected : 'protected' ; T_pull0 : 'pull0' ; T_pull1 : 'pull1' ; T_pure : 'pure' ; T_real : 'real' ; T_realtime : 'realtime' ; T_ref : 'ref' ; T_reg : 'reg' ; T_scalared : 'scalared' ; T_shortint : 'shortint' ; T_shortreal : 'shortreal' ; T_signed : 'signed' ; T_small : 'small' ; T_static : 'static' ; T_string : 'string' ; T_strong0 : 'strong0' ; T_strong1 : 'strong1' ; T_struct : 'struct' ; T_supply0 : 'supply0' ; T_supply1 : 'supply1' ; T_tagged : 'tagged' ; T_time : 'time' ; T_tri : 'tri' ; T_tri0 : 'tri0' ; T_tri1 : 'tri1' ; T_triand : 'triand' ; T_trior : 'trior' ; T_trireg : 'trireg' ; T_type : 'type' ; T_union : 'union' ; T_unsigned : 'unsigned' ; T_uwire : 'uwire' ; T_var : 'var' ; T_vectored : 'vectored' ; T_virtual : 'virtual' ; T_void : 'void' ; T_wand : 'wand' ; T_weak0 : 'weak0' ; T_weak1 : 'weak1' ; T_wire : 'wire' ; T_wor : 'wor' ; // Other keyword O_and : 'and' ; O_buf : 'buf' ; O_bufif0 : 'bufif0' ; O_bufif1 : 'bufif1' ; O_cmos : 'cmos' ; O_nand : 'nand' ; O_nmos : 'nmos' ; O_nor : 'nor' ; O_not : 'not' ; O_notif0 : 'notif0' ; O_notif1 : 'notif1' ; O_or : 'or' ; O_pmos : 'pmos' ; O_pulldown : 'pulldown' ; O_pullup : 'pullup' ; O_rcmos : 'rcmos' ; O_rnmos : 'rnmos' ; O_rpmos : 'rpmos' ; O_rtran : 'rtran' ; O_rtranif0 : 'rtranif0' ; O_rtranif1 : 'rtranif1' ; O_tran : 'tran' ; O_tranif0 : 'tranif0' ; O_tranif1 : 'tranif1' ; O_xnor : 'xnor' ; O_xor : 'xor' ; // Number N_Unbased_unsized : S_SQ ( '0' | '1' | X_digit | Z_digit_mod ) ; N_Dec : Decimal_base (' ')? N_Unsigned | Decimal_base (' ')? X_digit ( S_UB )* | Decimal_base (' ')? Z_digit ( S_UB )* ; N_Bin : Binary_base (' ')? Binary_value ; N_Oct : Octal_base (' ')? Octal_value ; N_Hex : Hex_base (' ')? Hex_value ; N_Exp : N_Unsigned ( S_DT N_Unsigned )? Exp ( Sign )? N_Unsigned ; N_Fix : N_Unsigned S_DT N_Unsigned ; N_Unsigned : Decimal_digit ( S_UB | Decimal_digit )* ; fragment Sign : S_PL | S_MI ; fragment Exp : 'e' | 'E' ; fragment Binary_value : Binary_xz_digit ( S_UB | Binary_xz_digit )* ; fragment Octal_value : Octal_xz_digit ( S_UB | Octal_xz_digit )* ; fragment Hex_value : Hex_xz_digit ( S_UB | Hex_xz_digit )* ; fragment Decimal_base : S_SQ ( 's' | 'S' )? 'd' | S_SQ ( 's' | 'S' )? 'D' ; fragment Binary_base : S_SQ ( 's' | 'S' )? 'b' | S_SQ ( 's' | 'S' )? 'B' ; fragment Octal_base : S_SQ ( 's' | 'S' )? 'o' | S_SQ ( 's' | 'S' )? 'O' ; fragment Hex_base : S_SQ ( 's' | 'S' )? 'h' | S_SQ ( 's' | 'S' )? 'H' ; fragment Decimal_digit : '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' ; fragment Binary_xz_digit : X_digit | Z_digit | '0' | '1' ; fragment Octal_xz_digit : X_digit | Z_digit | Octal_digit ; fragment Octal_digit : '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' ; fragment Hex_xz_digit : X_digit | Z_digit | Hex_digit ; fragment Hex_digit : '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' ; fragment X_digit : 'x' | 'X' ; fragment Z_digit : 'z' | 'Z' | S_QU ; fragment Z_digit_mod : 'z' | 'Z' ; // Time literal L_Time : N_Unsigned Time_unit | N_Fix Time_unit ; fragment Time_unit : 's' | 'ms' | 'us' | 'ns' | 'ps' | 'fs' ; // Symbols S_BQ : '`' ; S_SQ : '\'' ; S_MI : '-' ; S_MI_MI : '--' ; S_EX : '!' ; S_EX_EQ : '!=' ; S_EX_EQ_QU : '!=?' ; S_EX_EQ_EQ : '!==' ; S_SH : '#' ; S_SH_0 : '#0' ; S_SH_SH : '##' ; S_SH_MI_SH : '#-#' ; S_SH_SH_LK_AS_RK : '##[*]' ; S_SH_SH_LK_PL_RK : '##[+]' ; S_SH_EQ_SH : '#=#' ; S_DL : '$' ; S_PE : '%' ; S_PE_EQ : '%=' ; S_AN : '&' ; S_AN_AN : '&&' ; S_AN_AN_AN : '&&&' ; S_AN_EQ : '&=' ; S_LM : '(' ; S_LM_AS : '(*' ; S_LM_AS_RM : '(*)' ; S_RM : ')' ; S_AS : '*' ; S_AS_RM : '*)' ; S_AS_AS : '**' ; S_AS_CO_CO_AS : '*::*' ; S_AS_EQ : '*=' ; S_AS_RB : '*>' ; S_CM : ',' ; S_DT : '.' ; S_DT_AS : '.*' ; S_DV : '/' ; S_DV_EQ : '/=' ; S_CO : ':' ; S_MI_CO : '-:' ; S_CO_DV : ':/' ~[/*] ; S_CO_CO : '::' ; S_CO_EQ : ':=' ; S_SC : ';' ; S_QU : '?' ; S_AT : '@' ; S_AT_AS : '@*' ; S_AT_AT : '@@' ; S_AT_AT_LM : '@@(' ; S_LK : '[' ; S_LK_AS : '[*' ; S_LK_AS_RK : '[*]' ; S_LK_PL_RK : '[+]' ; S_LK_EQ : '[=' ; S_LK_MI_RB : '[->' ; S_RK : ']' ; S_XO : '^' ; S_XO_NE : '^~' ; S_XO_EQ : '^=' ; S_UB : '_' ; S_LN : '{' ; S_SQ_LN : '\'{' ; S_OR : '|' ; S_OR_OR : '||' ; S_OR_EQ : '|=' ; S_OR_EQ_RB : '|=>' ; S_OR_MI_RB : '|->' ; S_RN : '}' ; S_NE : '~' ; S_NE_AN : '~&' ; S_NE_OR : '~|' ; S_NE_XO : '~^' ; S_PL : '+' ; S_PL_CO : '+:' ; S_PL_PL : '++' ; S_PL_EQ : '+=' ; S_LB : '<' ; S_LB_LB : '<<' ; S_LB_LB_LB : '<<<' ; S_LB_LB_LB_EQ : '<<<=' ; S_LB_LB_EQ : '<<=' ; S_LB_EQ : '<=' ; S_LB_MI_RB : '<->' ; S_EQ : '=' ; S_MI_EQ : '-=' ; S_EQ_EQ : '==' ; S_EQ_EQ_QU : '==?' ; S_EQ_EQ_EQ : '===' ; S_EQ_RB : '=>' ; S_RB : '>' ; S_MI_RB : '->' ; S_RB_EQ : '>=' ; S_RB_RB : '>>' ; S_MI_RB_RB : '->>' ; S_RB_RB_EQ : '>>=' ; S_RB_RB_RB : '>>>' ; S_RB_RB_RB_EQ : '>>>=' ; // Identifier I_Escaped : '\\' ( Any_printable_ASCII_character_except_white_space )* ; I_Simple : Any_Alpha_Bar ( Any_Alpha_Num_Bar_Dol )* ; fragment Any_Alpha_Bar : [a-zA-Z_] ; fragment Any_Alpha_Num_Bar : [a-zA-Z0-9_] ; fragment Any_Alpha_Num_Bar_Dol : [a-zA-Z0-9_$] ; fragment Any_printable_ASCII_character_except_white_space : ~[ \r\t\n] ; // White Space // Numbers can be aligned with spaces WS : [ \t\n\r]+ -> skip ; // Comments C_Block : '/*' .*? '*/' -> channel(COMMENTS_CH) ; C_Line : '//' .*? '\r'? '\n' -> channel(COMMENTS_CH) ; //------------------------------------------------------------------ mode UDP; S_Level : '0' | '1' | 'X' | 'x' | '?' | 'b' | 'B' ; S_Edge : 'r' | 'R' | 'f' | 'F' | 'p' | 'P' | 'n' | 'N' | '*' ; S_CO_EDGE : ':' ; S_SC_EDGE : ';' ; S_LM_EDGE : '(' ; S_RM_EDGE : ')' ; S_MI_EDGE : '-' ; B_endtable : 'endtable' -> mode(DEFAULT_MODE) ; WS_UDP : [ \t\n\r]+ -> skip ; C_Block_UDP : '/*' .*? '*/' -> channel(COMMENTS_CH) ; C_Line_UDP : '//' .*? '\r'? '\n' -> channel(COMMENTS_CH) ; //------------------------------------------------------------------ mode EDGE; S_ZO_OZ : '01' | '10' ; S_Z_O : '0' | '1' ; S_Z_X : 'z' | 'Z' | 'x' | 'X' ; S_CM_EDGE : ',' ; S_RK_EDGE : ']' -> popMode ; S_ID_EDGE : . -> more, popMode ; WS_EDGE : [ \t\n\r]+ -> skip ; C_Block_EDGE : '/*' .*? '*/' -> channel(COMMENTS_CH) ; C_Line_EDGE : '//' .*? '\r'? '\n' -> channel(COMMENTS_CH) ;
unittests/32Bit_ASM/X87/D9_EB.asm
cobalt2727/FEX
628
88168
%ifdef CONFIG { "RegData": { "MM7": ["0xC90FDAA22168C235", "0x4000"] }, "Mode": "32BIT" } %endif fldpi hlt
oeis/172/A172048.asm
neoneye/loda-programs
11
103581
<filename>oeis/172/A172048.asm ; A172048: a(n) = A104275(n) + A014076(n). ; Submitted by <NAME>(s2) ; 2,14,23,32,38,41,50,53,59,68,74,77,83,86,95,98,104,113,116,122,128,131,137,140,143,149,158,167,173,176,179,182,185,188,194,200,203,212,215,218,221,230,233,239,242,248,254,257,263,266,275,278,281,284,293,302,305,308,311,314,320,323,326,329,332,338,347,353,356,365,368,371,374,380,383,389,392,398,401,410,413,419,428,431,434,437,443,446,449,452,455,458,464,473,479,482,485,488,491,494 lpb $0 trn $0,1 seq $0,309355 ; Even numbers k such that k! is divisible by k*(k+1)/2. mov $2,$0 mov $0,$1 lpe mov $0,$2 div $0,2 mul $0,3 add $0,2
examples/dump_tree/errors.adb
reznikmm/gela
0
19341
<reponame>reznikmm/gela -- SPDX-FileCopyrightText: 2020 <NAME> <<EMAIL>> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- with Ada.Wide_Wide_Text_IO; with Ada.Command_Line; package body Errors is ------------------------- -- Circular_Dependency -- ------------------------- overriding procedure Circular_Dependency (Self : access Error_Listener; Name : Program.Text) is pragma Unreferenced (Self); begin Ada.Wide_Wide_Text_IO.Put_Line (Ada.Wide_Wide_Text_IO.Standard_Error, "Circular dependency for unit: " & Name); Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure); end Circular_Dependency; ------------------ -- No_Body_Text -- ------------------ overriding procedure No_Body_Text (Self : access Error_Listener; Name : Program.Text) is pragma Unreferenced (Self); begin Ada.Wide_Wide_Text_IO.Put_Line (Ada.Wide_Wide_Text_IO.Standard_Error, "No text for unit/body: " & Name); Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure); end No_Body_Text; end Errors;
EXP_6_7/multiply_two_32bit.asm
L12161/assembly_habijabi
0
85526
<reponame>L12161/assembly_habijabi<gh_stars>0 CODE SEGMENT ASSUME CS:CODE ASSUME DS:CODE ORG 100h ; MULTIPLYING THE LESSER SIGNIFICANT 16BIT VALUES MOV AX,A MUL B MOV P,AX ADC P+2,0h MOV AX,A+2 MUL B ADD P+2,AX ADC P+4,DX ADC P+6,0h ; MULTIPLYING THE MORE SIGNIFICANT 16BIT VALUES MOV AX,A MUL B+2 MOV P+2,AX ADC P+4,DX ADC P+6,0h MOV AX,A+2 MUL B+2 ADD P+4,AX ADC P+6,DX HLT ; DEFINING THE VARIABLES A DW 1606h,3800h B DW 4141h,4160h P DW 0h,0h,0h,0h CODE ENDS END
Agda/07-equivalences.agda
hemangandhi/HoTT-Intro
0
17127
{-# OPTIONS --without-K --exact-split #-} module 07-equivalences where import 06-universes open 06-universes public -- Section 7.1 Homotopies -- Definition 7.1.1 _~_ : {i j : Level} {A : UU i} {B : A → UU j} (f g : (x : A) → B x) → UU (i ⊔ j) f ~ g = (x : _) → Id (f x) (g x) -- Definition 7.1.2 refl-htpy : {i j : Level} {A : UU i} {B : A → UU j} {f : (x : A) → B x} → f ~ f refl-htpy x = refl {- Most of the time we get by with refl-htpy. However, sometimes Agda wants us to specify the implicit argument. The it is easier to call refl-htpy' than to use Agda's {f = ?} notation. -} refl-htpy' : {i j : Level} {A : UU i} {B : A → UU j} (f : (x : A) → B x) → f ~ f refl-htpy' f = refl-htpy htpy-inv : {i j : Level} {A : UU i} {B : A → UU j} {f g : (x : A) → B x} → (f ~ g) → (g ~ f) htpy-inv H x = inv (H x) _∙h_ : {i j : Level} {A : UU i} {B : A → UU j} {f g h : (x : A) → B x} → (f ~ g) → (g ~ h) → (f ~ h) _∙h_ H K x = (H x) ∙ (K x) htpy-concat : {i j : Level} {A : UU i} {B : A → UU j} {f g : (x : A) → B x} → (f ~ g) → (h : (x : A) → B x) → (g ~ h) → (f ~ h) htpy-concat H h K x = concat (H x) (h x) (K x) htpy-concat' : {l1 l2 : Level} {A : UU l1} {B : A → UU l2} (f : (x : A) → B x) {g h : (x : A) → B x} → (g ~ h) → (f ~ g) → (f ~ h) htpy-concat' f K H = H ∙h K htpy-assoc : {i j : Level} {A : UU i} {B : A → UU j} {f g h k : (x : A) → B x} → (H : f ~ g) → (K : g ~ h) → (L : h ~ k) → ((H ∙h K) ∙h L) ~ (H ∙h (K ∙h L)) htpy-assoc H K L x = assoc (H x) (K x) (L x) htpy-left-unit : {i j : Level} {A : UU i} {B : A → UU j} {f g : (x : A) → B x} {H : f ~ g} → (refl-htpy ∙h H) ~ H htpy-left-unit x = left-unit htpy-right-unit : {i j : Level} {A : UU i} {B : A → UU j} {f g : (x : A) → B x} {H : f ~ g} → (H ∙h refl-htpy) ~ H htpy-right-unit x = right-unit htpy-left-inv : {i j : Level} {A : UU i} {B : A → UU j} {f g : (x : A) → B x} (H : f ~ g) → ((htpy-inv H) ∙h H) ~ refl-htpy htpy-left-inv H x = left-inv (H x) htpy-right-inv : {i j : Level} {A : UU i} {B : A → UU j} {f g : (x : A) → B x} (H : f ~ g) → (H ∙h (htpy-inv H)) ~ refl-htpy htpy-right-inv H x = right-inv (H x) -- Definition 7.1.3 htpy-left-whisk : {i j k : Level} {A : UU i} {B : UU j} {C : UU k} (h : B → C) {f g : A → B} → (f ~ g) → ((h ∘ f) ~ (h ∘ g)) htpy-left-whisk h H x = ap h (H x) _·l_ = htpy-left-whisk htpy-right-whisk : {i j k : Level} {A : UU i} {B : UU j} {C : UU k} {g h : B → C} (H : g ~ h) (f : A → B) → ((g ∘ f) ~ (h ∘ f)) htpy-right-whisk H f x = H (f x) _·r_ = htpy-right-whisk -- Section 7.2 Bi-invertible maps -- Definition 7.2.1 sec : {i j : Level} {A : UU i} {B : UU j} (f : A → B) → UU (i ⊔ j) sec {i} {j} {A} {B} f = Σ (B → A) (λ g → (f ∘ g) ~ id) retr : {i j : Level} {A : UU i} {B : UU j} (f : A → B) → UU (i ⊔ j) retr {i} {j} {A} {B} f = Σ (B → A) (λ g → (g ∘ f) ~ id) _retract-of_ : {i j : Level} → UU i → UU j → UU (i ⊔ j) A retract-of B = Σ (A → B) retr section-retract-of : {i j : Level} {A : UU i} {B : UU j} → A retract-of B → A → B section-retract-of = pr1 retr-section-retract-of : {i j : Level} {A : UU i} {B : UU j} (R : A retract-of B) → retr (section-retract-of R) retr-section-retract-of = pr2 retraction-retract-of : {i j : Level} {A : UU i} {B : UU j} → (A retract-of B) → B → A retraction-retract-of R = pr1 (retr-section-retract-of R) is-retr-retraction-retract-of : {i j : Level} {A : UU i} {B : UU j} (R : A retract-of B) → ((retraction-retract-of R) ∘ (section-retract-of R)) ~ id is-retr-retraction-retract-of R = pr2 (retr-section-retract-of R) is-equiv : {i j : Level} {A : UU i} {B : UU j} (f : A → B) → UU (i ⊔ j) is-equiv f = sec f × retr f _≃_ : {i j : Level} (A : UU i) (B : UU j) → UU (i ⊔ j) A ≃ B = Σ (A → B) (λ f → is-equiv f) map-equiv : {i j : Level} {A : UU i} {B : UU j} → (A ≃ B) → (A → B) map-equiv e = pr1 e is-equiv-map-equiv : {i j : Level} {A : UU i} {B : UU j} (e : A ≃ B) → is-equiv (map-equiv e) is-equiv-map-equiv e = pr2 e -- Remark 7.2.2 has-inverse : {i j : Level} {A : UU i} {B : UU j} (f : A → B) → UU (i ⊔ j) has-inverse {i} {j} {A} {B} f = Σ (B → A) (λ g → ((f ∘ g) ~ id) × ((g ∘ f) ~ id)) is-equiv-has-inverse' : {i j : Level} {A : UU i} {B : UU j} {f : A → B} → has-inverse f → is-equiv f is-equiv-has-inverse' (pair g (pair H K)) = pair (pair g H) (pair g K) is-equiv-has-inverse : {i j : Level} {A : UU i} {B : UU j} {f : A → B} → (g : B → A) (H : (f ∘ g) ~ id) (K : (g ∘ f) ~ id) → is-equiv f is-equiv-has-inverse g H K = is-equiv-has-inverse' (pair g (pair H K)) -- Lemma 7.2.3 {- We now show that if f is an equivalence, then it has an inverse. -} htpy-section-retraction : { i j : Level} {A : UU i} {B : UU j} {f : A → B} ( is-equiv-f : is-equiv f) → ( (pr1 (pr1 is-equiv-f))) ~ (pr1 (pr2 is-equiv-f)) htpy-section-retraction {i} {j} {A} {B} {f} (pair (pair g G) (pair h H)) = (htpy-inv (H ·r g)) ∙h (h ·l G) has-inverse-is-equiv : {i j : Level} {A : UU i} {B : UU j} {f : A → B} → is-equiv f → has-inverse f has-inverse-is-equiv {i} {j} {A} {B} {f} (pair (pair g G) (pair h H)) = let is-equiv-f = pair (pair g G) (pair h H) in pair g (pair G (((htpy-section-retraction is-equiv-f) ·r f) ∙h H)) -- Corollary 7.2.4 inv-is-equiv : {i j : Level} {A : UU i} {B : UU j} {f : A → B} → is-equiv f → B → A inv-is-equiv is-equiv-f = pr1 (has-inverse-is-equiv is-equiv-f) issec-inv-is-equiv : {i j : Level} {A : UU i} {B : UU j} {f : A → B} → (is-equiv-f : is-equiv f) → (f ∘ (inv-is-equiv is-equiv-f)) ~ id issec-inv-is-equiv is-equiv-f = pr1 (pr2 (has-inverse-is-equiv is-equiv-f)) isretr-inv-is-equiv : {i j : Level} {A : UU i} {B : UU j} {f : A → B} → (is-equiv-f : is-equiv f) → ((inv-is-equiv is-equiv-f) ∘ f) ~ id isretr-inv-is-equiv is-equiv-f = pr2 (pr2 (has-inverse-is-equiv is-equiv-f)) is-equiv-inv-is-equiv : {i j : Level} {A : UU i} {B : UU j} {f : A → B} → (is-equiv-f : is-equiv f) → is-equiv (inv-is-equiv is-equiv-f) is-equiv-inv-is-equiv {i} {j} {A} {B} {f} is-equiv-f = is-equiv-has-inverse f ( isretr-inv-is-equiv is-equiv-f) ( issec-inv-is-equiv is-equiv-f) inv-map-equiv : {i j : Level} {A : UU i} {B : UU j} → (A ≃ B) → (B → A) inv-map-equiv e = inv-is-equiv (is-equiv-map-equiv e) is-equiv-inv-map-equiv : {i j : Level} {A : UU i} {B : UU j} (e : A ≃ B) → is-equiv (inv-map-equiv e) is-equiv-inv-map-equiv e = is-equiv-inv-is-equiv (is-equiv-map-equiv e) inv-equiv : {i j : Level} {A : UU i} {B : UU j} → (A ≃ B) → (B ≃ A) inv-equiv e = pair (inv-map-equiv e) (is-equiv-inv-map-equiv e) -- Remark 7.2.5 is-equiv-id : {i : Level} (A : UU i) → is-equiv (id {i} {A}) is-equiv-id A = pair (pair id refl-htpy) (pair id refl-htpy) equiv-id : {i : Level} (A : UU i) → A ≃ A equiv-id A = pair id (is-equiv-id A) -- Example 7.2.6 inv-Π-swap : {i j k : Level} {A : UU i} {B : UU j} (C : A → B → UU k) → ((y : B) (x : A) → C x y) → ((x : A) (y : B) → C x y) inv-Π-swap C g x y = g y x abstract is-equiv-Π-swap : {i j k : Level} {A : UU i} {B : UU j} (C : A → B → UU k) → is-equiv (Π-swap {i} {j} {k} {A} {B} {C}) is-equiv-Π-swap C = is-equiv-has-inverse ( inv-Π-swap C) ( refl-htpy) ( refl-htpy) -- Section 7.3 The identity type of a Σ-type -- Definition 7.3.1 Eq-Σ : {i j : Level} {A : UU i} {B : A → UU j} (s t : Σ A B) → UU (i ⊔ j) Eq-Σ {B = B} s t = Σ (Id (pr1 s) (pr1 t)) (λ α → Id (tr B α (pr2 s)) (pr2 t)) -- Lemma 7.3.2 reflexive-Eq-Σ : {i j : Level} {A : UU i} {B : A → UU j} (s : Σ A B) → Eq-Σ s s reflexive-Eq-Σ (pair a b) = pair refl refl -- Definition 7.3.3 pair-eq : {i j : Level} {A : UU i} {B : A → UU j} {s t : Σ A B} → (Id s t) → Eq-Σ s t pair-eq {s = s} refl = reflexive-Eq-Σ s -- Theorem 7.3.4 eq-pair : {i j : Level} {A : UU i} {B : A → UU j} {s t : Σ A B} → (α : Id (pr1 s) (pr1 t)) → Id (tr B α (pr2 s)) (pr2 t) → Id s t eq-pair {B = B} {pair x y} {pair .x .y} refl refl = refl eq-pair' : {i j : Level} {A : UU i} {B : A → UU j} {s t : Σ A B} → Eq-Σ s t → Id s t eq-pair' (pair α β) = eq-pair α β isretr-pair-eq : {i j : Level} {A : UU i} {B : A → UU j} (s t : Σ A B) → ((pair-eq {s = s} {t}) ∘ (eq-pair' {s = s} {t})) ~ id {A = Eq-Σ s t} isretr-pair-eq (pair x y) (pair .x .y) (pair refl refl) = refl issec-pair-eq : {i j : Level} {A : UU i} {B : A → UU j} (s t : Σ A B) → ((eq-pair' {s = s} {t}) ∘ (pair-eq {s = s} {t})) ~ id issec-pair-eq (pair x y) .(pair x y) refl = refl abstract is-equiv-eq-pair : {i j : Level} {A : UU i} {B : A → UU j} (s t : Σ A B) → is-equiv (eq-pair' {s = s} {t}) is-equiv-eq-pair s t = is-equiv-has-inverse ( pair-eq) ( issec-pair-eq s t) ( isretr-pair-eq s t) abstract is-equiv-pair-eq : {i j : Level} {A : UU i} {B : A → UU j} (s t : Σ A B) → is-equiv (pair-eq {s = s} {t}) is-equiv-pair-eq s t = is-equiv-has-inverse ( eq-pair') ( isretr-pair-eq s t) ( issec-pair-eq s t) η-pair : {l1 l2 : Level} {A : UU l1} {B : A → UU l2} (t : Σ A B) → Id (pair (pr1 t) (pr2 t)) t η-pair t = eq-pair refl refl {- For our convenience, we repeat the above argument for cartesian products. -} Eq-prod : {i j : Level} {A : UU i} {B : UU j} (s t : A × B) → UU (i ⊔ j) Eq-prod s t = (Id (pr1 s) (pr1 t)) × (Id (pr2 s) (pr2 t)) {- We also define a function eq-pair-triv, which is like eq-pair but simplified for the case where B is just a type. -} eq-pair-triv' : {i j : Level} {A : UU i} {B : UU j} (s t : prod A B) → Eq-prod s t → Id s t eq-pair-triv' (pair x y) (pair .x .y) (pair refl refl) = refl eq-pair-triv : {i j : Level} {A : UU i} {B : UU j} {s t : prod A B} → Eq-prod s t → Id s t eq-pair-triv {s = s} {t} = eq-pair-triv' s t {- Ideally, we would use the 3-for-2 property of equivalences to show that eq-pair-triv is an equivalence, using that eq-pair is an equivalence. Indeed, there is an equivalence (Id x x') × (Id y y') → Σ (Id x x') (λ p → Id (tr (λ x → B) p y) y'). However, to show that this map is an equivalence we either give a direct proof (in which case we might as well have given a direct proof that eq-pair-triv is an equivalence), or we use the fact that it is the induced map on total spaces of a fiberwise equivalence (the topic of Lecture 8). Thus it seems that a direct proof showing that eq-pair-triv is an equivalence is quickest for now. -} pair-eq-triv' : {i j : Level} {A : UU i} {B : UU j} (s t : prod A B) → Id s t → Eq-prod s t pair-eq-triv' s t α = pair (ap pr1 α) (ap pr2 α) isretr-pair-eq-triv' : {i j : Level} {A : UU i} {B : UU j} (s t : prod A B) → ((pair-eq-triv' s t) ∘ (eq-pair-triv' s t)) ~ id isretr-pair-eq-triv' (pair x y) (pair .x .y) (pair refl refl) = refl issec-pair-eq-triv' : {i j : Level} {A : UU i} {B : UU j} (s t : prod A B) → ((eq-pair-triv' s t) ∘ (pair-eq-triv' s t)) ~ id issec-pair-eq-triv' (pair x y) (pair .x .y) refl = refl abstract is-equiv-eq-pair-triv' : {i j : Level} {A : UU i} {B : UU j} (s t : prod A B) → is-equiv (eq-pair-triv' s t) is-equiv-eq-pair-triv' s t = is-equiv-has-inverse ( pair-eq-triv' s t) ( issec-pair-eq-triv' s t) ( isretr-pair-eq-triv' s t) -- Exercises -- Exercise 7.1 {- We show that inv is an equivalence. -} inv-inv : {i : Level} {A : UU i} {x y : A} (p : Id x y) → Id (inv (inv p)) p inv-inv refl = refl abstract is-equiv-inv : {i : Level} {A : UU i} (x y : A) → is-equiv (λ (p : Id x y) → inv p) is-equiv-inv x y = is-equiv-has-inverse inv inv-inv inv-inv equiv-inv : {i : Level} {A : UU i} (x y : A) → (Id x y) ≃ (Id y x) equiv-inv x y = pair inv (is-equiv-inv x y) {- We show that concat p is an equivalence, for any path p. -} inv-concat : {i : Level} {A : UU i} {x y : A} (p : Id x y) (z : A) → (Id x z) → (Id y z) inv-concat p = concat (inv p) isretr-inv-concat : {i : Level} {A : UU i} {x y : A} (p : Id x y) (z : A) → ((inv-concat p z) ∘ (concat p z)) ~ id isretr-inv-concat refl z q = refl issec-inv-concat : {i : Level} {A : UU i} {x y : A} (p : Id x y) (z : A) → ((concat p z) ∘ (inv-concat p z)) ~ id issec-inv-concat refl z refl = refl abstract is-equiv-concat : {i : Level} {A : UU i} {x y : A} (p : Id x y) (z : A) → is-equiv (concat p z) is-equiv-concat p z = is-equiv-has-inverse ( inv-concat p z) ( issec-inv-concat p z) ( isretr-inv-concat p z) equiv-concat : {i : Level} {A : UU i} {x y : A} (p : Id x y) (z : A) → Id y z ≃ Id x z equiv-concat p z = pair (concat p z) (is-equiv-concat p z) {- We show that concat' q is an equivalence, for any path q. -} concat' : {i : Level} {A : UU i} (x : A) {y z : A} → Id y z → Id x y → Id x z concat' x q p = p ∙ q inv-concat' : {i : Level} {A : UU i} (x : A) {y z : A} → Id y z → Id x z → Id x y inv-concat' x q = concat' x (inv q) isretr-inv-concat' : {i : Level} {A : UU i} (x : A) {y z : A} (q : Id y z) → ((inv-concat' x q) ∘ (concat' x q)) ~ id isretr-inv-concat' x refl refl = refl issec-inv-concat' : {i : Level} {A : UU i} (x : A) {y z : A} (q : Id y z) → ((concat' x q) ∘ (inv-concat' x q)) ~ id issec-inv-concat' x refl refl = refl abstract is-equiv-concat' : {i : Level} {A : UU i} (x : A) {y z : A} (q : Id y z) → is-equiv (concat' x q) is-equiv-concat' x q = is-equiv-has-inverse ( inv-concat' x q) ( issec-inv-concat' x q) ( isretr-inv-concat' x q) equiv-concat' : {i : Level} {A : UU i} (x : A) {y z : A} (q : Id y z) → Id x y ≃ Id x z equiv-concat' x q = pair (concat' x q) (is-equiv-concat' x q) {- We show that tr B p is an equivalence, for an path p and any type family B. -} inv-tr : {i j : Level} {A : UU i} (B : A → UU j) {x y : A} → Id x y → B y → B x inv-tr B p = tr B (inv p) isretr-inv-tr : {i j : Level} {A : UU i} (B : A → UU j) {x y : A} (p : Id x y) → ((inv-tr B p ) ∘ (tr B p)) ~ id isretr-inv-tr B refl b = refl issec-inv-tr : {i j : Level} {A : UU i} (B : A → UU j) {x y : A} (p : Id x y) → ((tr B p) ∘ (inv-tr B p)) ~ id issec-inv-tr B refl b = refl abstract is-equiv-tr : {i j : Level} {A : UU i} (B : A → UU j) {x y : A} (p : Id x y) → is-equiv (tr B p) is-equiv-tr B p = is-equiv-has-inverse ( inv-tr B p) ( issec-inv-tr B p) ( isretr-inv-tr B p) equiv-tr : {i j : Level} {A : UU i} (B : A → UU j) {x y : A} (p : Id x y) → (B x) ≃ (B y) equiv-tr B p = pair (tr B p) (is-equiv-tr B p) -- Exercise 7.2 {- We prove the left unit law for coproducts. -} inv-inr-coprod-empty : {l : Level} (X : UU l) → coprod empty X → X inv-inr-coprod-empty X (inr x) = x issec-inv-inr-coprod-empty : {l : Level} (X : UU l) → (inr ∘ (inv-inr-coprod-empty X)) ~ id issec-inv-inr-coprod-empty X (inr x) = refl isretr-inv-inr-coprod-empty : {l : Level} (X : UU l) → ((inv-inr-coprod-empty X) ∘ inr) ~ id isretr-inv-inr-coprod-empty X x = refl is-equiv-inr-coprod-empty : {l : Level} (X : UU l) → is-equiv (inr {A = empty} {B = X}) is-equiv-inr-coprod-empty X = is-equiv-has-inverse ( inv-inr-coprod-empty X) ( issec-inv-inr-coprod-empty X) ( isretr-inv-inr-coprod-empty X) left-unit-law-coprod : {l : Level} (X : UU l) → X ≃ (coprod empty X) left-unit-law-coprod X = pair inr (is-equiv-inr-coprod-empty X) {- We prove the right unit law for coproducts. -} inv-inl-coprod-empty : {l : Level} (X : UU l) → (coprod X empty) → X inv-inl-coprod-empty X (inl x) = x issec-inv-inl-coprod-empty : {l : Level} (X : UU l) → (inl ∘ (inv-inl-coprod-empty X)) ~ id issec-inv-inl-coprod-empty X (inl x) = refl isretr-inv-inl-coprod-empty : {l : Level} (X : UU l) → ((inv-inl-coprod-empty X) ∘ inl) ~ id isretr-inv-inl-coprod-empty X x = refl is-equiv-inl-coprod-empty : {l : Level} (X : UU l) → is-equiv (inl {A = X} {B = empty}) is-equiv-inl-coprod-empty X = is-equiv-has-inverse ( inv-inl-coprod-empty X) ( issec-inv-inl-coprod-empty X) ( isretr-inv-inl-coprod-empty X) right-unit-law-coprod : {l : Level} (X : UU l) → X ≃ (coprod X empty) right-unit-law-coprod X = pair inl (is-equiv-inl-coprod-empty X) {- We prove a left zero law for cartesian products. -} inv-pr1-prod-empty : {l : Level} (X : UU l) → empty → empty × X inv-pr1-prod-empty X () issec-inv-pr1-prod-empty : {l : Level} (X : UU l) → (pr1 ∘ (inv-pr1-prod-empty X)) ~ id issec-inv-pr1-prod-empty X () isretr-inv-pr1-prod-empty : {l : Level} (X : UU l) → ((inv-pr1-prod-empty X) ∘ pr1) ~ id isretr-inv-pr1-prod-empty X (pair () x) is-equiv-pr1-prod-empty : {l : Level} (X : UU l) → is-equiv (pr1 {A = empty} {B = λ t → X}) is-equiv-pr1-prod-empty X = is-equiv-has-inverse ( inv-pr1-prod-empty X) ( issec-inv-pr1-prod-empty X) ( isretr-inv-pr1-prod-empty X) left-zero-law-prod : {l : Level} (X : UU l) → (empty × X) ≃ empty left-zero-law-prod X = pair pr1 (is-equiv-pr1-prod-empty X) {- We prove the right zero law for cartesian products. -} inv-pr2-prod-empty : {l : Level} (X : UU l) → empty → (X × empty) inv-pr2-prod-empty X () issec-inv-pr2-prod-empty : {l : Level} (X : UU l) → (pr2 ∘ (inv-pr2-prod-empty X)) ~ id issec-inv-pr2-prod-empty X () isretr-inv-pr2-prod-empty : {l : Level} (X : UU l) → ((inv-pr2-prod-empty X) ∘ pr2) ~ id isretr-inv-pr2-prod-empty X (pair x ()) is-equiv-pr2-prod-empty : {l : Level} (X : UU l) → is-equiv (pr2 {A = X} {B = λ x → empty}) is-equiv-pr2-prod-empty X = is-equiv-has-inverse ( inv-pr2-prod-empty X) ( issec-inv-pr2-prod-empty X) ( isretr-inv-pr2-prod-empty X) right-zero-law-prod : {l : Level} (X : UU l) → (X × empty) ≃ empty right-zero-law-prod X = pair pr2 (is-equiv-pr2-prod-empty X) -- Exercise 7.3 -- Exercise 7.3(a) abstract is-equiv-htpy : {i j : Level} {A : UU i} {B : UU j} {f : A → B} (g : A → B) → f ~ g → is-equiv g → is-equiv f is-equiv-htpy g H (pair (pair gs issec) (pair gr isretr)) = pair ( pair gs ((H ·r gs) ∙h issec)) ( pair gr ((gr ·l H) ∙h isretr)) abstract is-equiv-htpy' : {i j : Level} {A : UU i} {B : UU j} (f : A → B) {g : A → B} → f ~ g → is-equiv f → is-equiv g is-equiv-htpy' f H = is-equiv-htpy f (htpy-inv H) -- Exercise 7.3(b) htpy-inv-is-equiv : {i j : Level} {A : UU i} {B : UU j} {f f' : A → B} (H : f ~ f') → (is-equiv-f : is-equiv f) (is-equiv-f' : is-equiv f') → (inv-is-equiv is-equiv-f) ~ (inv-is-equiv is-equiv-f') htpy-inv-is-equiv H is-equiv-f is-equiv-f' b = ( inv (isretr-inv-is-equiv is-equiv-f' (inv-is-equiv is-equiv-f b))) ∙ ( ap (inv-is-equiv is-equiv-f') ( ( inv (H (inv-is-equiv is-equiv-f b))) ∙ ( issec-inv-is-equiv is-equiv-f b))) -- Exercise 7.4 -- Exercise 7.4(a) {- Exercise 7.4 (a) asks to show that, given a commuting triangle f ~ g ∘ h and a section s of h, we get a new commuting triangle g ~ f ∘ s. Moreover, under the same assumptions it follows that f has a section if and only if g has a section. -} triangle-section : {i j k : Level} {A : UU i} {B : UU j} {X : UU k} (f : A → X) (g : B → X) (h : A → B) (H : f ~ (g ∘ h)) (S : sec h) → g ~ (f ∘ (pr1 S)) triangle-section f g h H (pair s issec) = htpy-inv (( H ·r s) ∙h (g ·l issec)) section-comp : {i j k : Level} {A : UU i} {B : UU j} {X : UU k} (f : A → X) (g : B → X) (h : A → B) (H : f ~ (g ∘ h)) → sec h → sec f → sec g section-comp f g h H sec-h sec-f = pair (h ∘ (pr1 sec-f)) ((htpy-inv (H ·r (pr1 sec-f))) ∙h (pr2 sec-f)) section-comp' : {i j k : Level} {A : UU i} {B : UU j} {X : UU k} (f : A → X) (g : B → X) (h : A → B) (H : f ~ (g ∘ h)) → sec h → sec g → sec f section-comp' f g h H sec-h sec-g = pair ( (pr1 sec-h) ∘ (pr1 sec-g)) ( ( H ·r ((pr1 sec-h) ∘ (pr1 sec-g))) ∙h ( ( g ·l ((pr2 sec-h) ·r (pr1 sec-g))) ∙h ((pr2 sec-g)))) -- Exercise 7.4(b) {- Exercise 7.4 (b) is dual to exercise 5.5 (a). It asks to show that, given a commuting triangle f ~ g ∘ h and a retraction r of g, we get a new commuting triangle h ~ r ∘ f. Moreover, under these assumptions it also follows that f has a retraction if and only if h has a retraction. -} triangle-retraction : {i j k : Level} {A : UU i} {B : UU j} {X : UU k} (f : A → X) (g : B → X) (h : A → B) (H : f ~ (g ∘ h)) (R : retr g) → h ~ ((pr1 R) ∘ f) triangle-retraction f g h H (pair r isretr) = htpy-inv (( r ·l H) ∙h (isretr ·r h)) retraction-comp : {i j k : Level} {A : UU i} {B : UU j} {X : UU k} (f : A → X) (g : B → X) (h : A → B) (H : f ~ (g ∘ h)) → retr g → retr f → retr h retraction-comp f g h H retr-g retr-f = pair ( (pr1 retr-f) ∘ g) ( (htpy-inv ((pr1 retr-f) ·l H)) ∙h (pr2 retr-f)) retraction-comp' : {i j k : Level} {A : UU i} {B : UU j} {X : UU k} (f : A → X) (g : B → X) (h : A → B) (H : f ~ (g ∘ h)) → retr g → retr h → retr f retraction-comp' f g h H retr-g retr-h = pair ( (pr1 retr-h) ∘ (pr1 retr-g)) ( ( ((pr1 retr-h) ∘ (pr1 retr-g)) ·l H) ∙h ( ((pr1 retr-h) ·l ((pr2 retr-g) ·r h)) ∙h (pr2 retr-h))) -- Exercise 7.4(c) {- In Exercise 7.4 (c) we use the constructions of parts (a) and (b) to derive the 3-for-2 property of equivalences. -} abstract is-equiv-comp : {i j k : Level} {A : UU i} {B : UU j} {X : UU k} (f : A → X) (g : B → X) (h : A → B) (H : f ~ (g ∘ h)) → is-equiv h → is-equiv g → is-equiv f is-equiv-comp f g h H (pair sec-h retr-h) (pair sec-g retr-g) = pair ( section-comp' f g h H sec-h sec-g) ( retraction-comp' f g h H retr-g retr-h) abstract is-equiv-comp' : {i j k : Level} {A : UU i} {B : UU j} {X : UU k} (g : B → X) (h : A → B) → is-equiv h → is-equiv g → is-equiv (g ∘ h) is-equiv-comp' g h = is-equiv-comp (g ∘ h) g h refl-htpy equiv-comp : {i j k : Level} {A : UU i} {B : UU j} {X : UU k} → (B ≃ X) → (A ≃ B) → (A ≃ X) equiv-comp g h = pair ((pr1 g) ∘ (pr1 h)) (is-equiv-comp' (pr1 g) (pr1 h) (pr2 h) (pr2 g)) _∘e_ : {i j k : Level} {A : UU i} {B : UU j} {X : UU k} → (B ≃ X) → (A ≃ B) → (A ≃ X) _∘e_ = equiv-comp abstract is-equiv-left-factor : {i j k : Level} {A : UU i} {B : UU j} {X : UU k} (f : A → X) (g : B → X) (h : A → B) (H : f ~ (g ∘ h)) → is-equiv f → is-equiv h → is-equiv g is-equiv-left-factor f g h H ( pair sec-f retr-f) ( pair (pair sh sh-issec) retr-h) = pair ( section-comp f g h H (pair sh sh-issec) sec-f) ( retraction-comp' g f sh ( triangle-section f g h H (pair sh sh-issec)) ( retr-f) ( pair h sh-issec)) abstract is-equiv-left-factor' : {i j k : Level} {A : UU i} {B : UU j} {X : UU k} (g : B → X) (h : A → B) → is-equiv (g ∘ h) → is-equiv h → is-equiv g is-equiv-left-factor' g h = is-equiv-left-factor (g ∘ h) g h refl-htpy abstract is-equiv-right-factor : {i j k : Level} {A : UU i} {B : UU j} {X : UU k} (f : A → X) (g : B → X) (h : A → B) (H : f ~ (g ∘ h)) → is-equiv g → is-equiv f → is-equiv h is-equiv-right-factor f g h H ( pair sec-g (pair rg rg-isretr)) ( pair sec-f retr-f) = pair ( section-comp' h rg f ( triangle-retraction f g h H (pair rg rg-isretr)) ( sec-f) ( pair g rg-isretr)) ( retraction-comp f g h H (pair rg rg-isretr) retr-f) abstract is-equiv-right-factor' : {i j k : Level} {A : UU i} {B : UU j} {X : UU k} (g : B → X) (h : A → B) → is-equiv g → is-equiv (g ∘ h) → is-equiv h is-equiv-right-factor' g h = is-equiv-right-factor (g ∘ h) g h refl-htpy -- Exercise 7.5 -- Exercise 7.5(a) {- In this exercise we show that the negation function on the booleans is an equivalence. Moreover, we show that any constant function on the booleans is not an equivalence. -} neg-neg-𝟚 : (neg-𝟚 ∘ neg-𝟚) ~ id neg-neg-𝟚 true = refl neg-neg-𝟚 false = refl abstract is-equiv-neg-𝟚 : is-equiv neg-𝟚 is-equiv-neg-𝟚 = is-equiv-has-inverse neg-𝟚 neg-neg-𝟚 neg-neg-𝟚 equiv-neg-𝟚 : bool ≃ bool equiv-neg-𝟚 = pair neg-𝟚 is-equiv-neg-𝟚 -- Exercise 7.5(b) abstract not-true-is-false : ¬ (Id true false) not-true-is-false p = tr (Eq-𝟚 true) p (reflexive-Eq-𝟚 true) -- Exercise 7.5(c) abstract not-equiv-const : (b : bool) → ¬ (is-equiv (const bool bool b)) not-equiv-const true (pair (pair s issec) (pair r isretr)) = not-true-is-false (issec false) not-equiv-const false (pair (pair s issec) (pair r isretr)) = not-true-is-false (inv (issec true)) -- Exercise 7.6 is-equiv-succ-ℤ : is-equiv succ-ℤ is-equiv-succ-ℤ = is-equiv-has-inverse pred-ℤ right-inverse-pred-ℤ left-inverse-pred-ℤ equiv-succ-ℤ : ℤ ≃ ℤ equiv-succ-ℤ = pair succ-ℤ is-equiv-succ-ℤ -- Exercise 7.7 {- In this exercise we construct an equivalence from A + B to B + A, showing that the coproduct is commutative. -} swap-coprod : {i j : Level} (A : UU i) (B : UU j) → coprod A B → coprod B A swap-coprod A B (inl x) = inr x swap-coprod A B (inr x) = inl x swap-swap-coprod : {i j : Level} (A : UU i) (B : UU j) → ((swap-coprod B A) ∘ (swap-coprod A B)) ~ id swap-swap-coprod A B (inl x) = refl swap-swap-coprod A B (inr x) = refl abstract is-equiv-swap-coprod : {i j : Level} (A : UU i) (B : UU j) → is-equiv (swap-coprod A B) is-equiv-swap-coprod A B = is-equiv-has-inverse ( swap-coprod B A) ( swap-swap-coprod B A) ( swap-swap-coprod A B) equiv-swap-coprod : {i j : Level} (A : UU i) (B : UU j) → coprod A B ≃ coprod B A equiv-swap-coprod A B = pair (swap-coprod A B) (is-equiv-swap-coprod A B) swap-prod : {i j : Level} (A : UU i) (B : UU j) → prod A B → prod B A swap-prod A B t = pair (pr2 t) (pr1 t) swap-swap-prod : {i j : Level} (A : UU i) (B : UU j) → ((swap-prod B A) ∘ (swap-prod A B)) ~ id swap-swap-prod A B (pair x y) = refl abstract is-equiv-swap-prod : {i j : Level} (A : UU i) (B : UU j) → is-equiv (swap-prod A B) is-equiv-swap-prod A B = is-equiv-has-inverse ( swap-prod B A) ( swap-swap-prod B A) ( swap-swap-prod A B) equiv-swap-prod : {i j : Level} (A : UU i) (B : UU j) → (A × B) ≃ (B × A) equiv-swap-prod A B = pair (swap-prod A B) (is-equiv-swap-prod A B) -- Exercise 7.8 {- In this exercise we show that if A is a retract of B, then so are its identity types. -} ap-retraction : {i j : Level} {A : UU i} {B : UU j} (i : A → B) (r : B → A) (H : (r ∘ i) ~ id) (x y : A) → Id (i x) (i y) → Id x y ap-retraction i r H x y p = ( inv (H x)) ∙ ((ap r p) ∙ (H y)) isretr-ap-retraction : {i j : Level} {A : UU i} {B : UU j} (i : A → B) (r : B → A) (H : (r ∘ i) ~ id) (x y : A) → ((ap-retraction i r H x y) ∘ (ap i {x} {y})) ~ id isretr-ap-retraction i r H x .x refl = left-inv (H x) retr-ap : {i j : Level} {A : UU i} {B : UU j} (i : A → B) → retr i → (x y : A) → retr (ap i {x} {y}) retr-ap i (pair r H) x y = pair (ap-retraction i r H x y) (isretr-ap-retraction i r H x y) Id-retract-of-Id : {i j : Level} {A : UU i} {B : UU j} (R : A retract-of B) → (x y : A) → (Id x y) retract-of (Id (pr1 R x) (pr1 R y)) Id-retract-of-Id (pair i (pair r H)) x y = pair ( ap i {x} {y}) ( retr-ap i (pair r H) x y) -- Exercise 7.9 Σ-assoc : {i j k : Level} (A : UU i) (B : A → UU j) (C : (Σ A B) → UU k) → Σ (Σ A B) C → Σ A (λ x → Σ (B x) (λ y → C (pair x y))) Σ-assoc A B C (pair (pair x y) z) = pair x (pair y z) Σ-assoc' : {i j k : Level} (A : UU i) (B : A → UU j) (C : (Σ A B) → UU k) → Σ A (λ x → Σ (B x) (λ y → C (pair x y))) → Σ (Σ A B) C Σ-assoc' A B C t = pair (pair (pr1 t) (pr1 (pr2 t))) (pr2 (pr2 t)) Σ-assoc-assoc : {i j k : Level} (A : UU i) (B : A → UU j) (C : (Σ A B) → UU k) → ((Σ-assoc' A B C) ∘ (Σ-assoc A B C)) ~ id Σ-assoc-assoc A B C (pair (pair x y) z) = refl Σ-assoc-assoc' : {i j k : Level} (A : UU i) (B : A → UU j) (C : (Σ A B) → UU k) → ((Σ-assoc A B C) ∘ (Σ-assoc' A B C)) ~ id Σ-assoc-assoc' A B C (pair x (pair y z)) = refl abstract is-equiv-Σ-assoc : {i j k : Level} (A : UU i) (B : A → UU j) (C : (Σ A B) → UU k) → is-equiv (Σ-assoc A B C) is-equiv-Σ-assoc A B C = is-equiv-has-inverse ( Σ-assoc' A B C) ( Σ-assoc-assoc' A B C) ( Σ-assoc-assoc A B C) equiv-Σ-assoc : {i j k : Level} (A : UU i) (B : A → UU j) (C : (Σ A B) → UU k) → Σ (Σ A B) C ≃ Σ A (λ x → Σ (B x) (λ y → C (pair x y))) equiv-Σ-assoc A B C = pair (Σ-assoc A B C) (is-equiv-Σ-assoc A B C) -- Exercise 7.10 Σ-swap : {i j k : Level} (A : UU i) (B : UU j) (C : A → B → UU k) → Σ A (λ x → Σ B (C x)) → Σ B (λ y → Σ A (λ x → C x y)) Σ-swap A B C t = pair (pr1 (pr2 t)) (pair (pr1 t) (pr2 (pr2 t))) Σ-swap' : {i j k : Level} (A : UU i) (B : UU j) (C : A → B → UU k) → Σ B (λ y → Σ A (λ x → C x y)) → Σ A (λ x → Σ B (C x)) Σ-swap' A B C = Σ-swap B A (λ y x → C x y) Σ-swap-swap : {i j k : Level} (A : UU i) (B : UU j) (C : A → B → UU k) → ((Σ-swap' A B C) ∘ (Σ-swap A B C)) ~ id Σ-swap-swap A B C (pair x (pair y z)) = refl abstract is-equiv-Σ-swap : {i j k : Level} (A : UU i) (B : UU j) (C : A → B → UU k) → is-equiv (Σ-swap A B C) is-equiv-Σ-swap A B C = is-equiv-has-inverse ( Σ-swap' A B C) ( Σ-swap-swap B A (λ y x → C x y)) ( Σ-swap-swap A B C) -- Exercise 7.11 abstract is-equiv-add-ℤ-right : (x : ℤ) → is-equiv (add-ℤ x) is-equiv-add-ℤ-right x = is-equiv-has-inverse ( add-ℤ (neg-ℤ x)) ( λ y → ( inv (associative-add-ℤ x (neg-ℤ x) y)) ∙ ( ap (λ t → add-ℤ t y) (right-inverse-law-add-ℤ x))) ( λ y → ( inv (associative-add-ℤ (neg-ℤ x) x y)) ∙ ( ap (λ t → add-ℤ t y) (left-inverse-law-add-ℤ x))) abstract is-equiv-add-ℤ-left : (y : ℤ) → is-equiv (λ x → add-ℤ x y) is-equiv-add-ℤ-left y = is-equiv-htpy (add-ℤ y) ( λ x → commutative-add-ℤ x y) ( is-equiv-add-ℤ-right y) -- Exercise 7.12 -- Exercise 7.13 {- We construct the functoriality of coproducts. -} functor-coprod : {l1 l2 l1' l2' : Level} {A : UU l1} {B : UU l2} {A' : UU l1'} {B' : UU l2'} → (A → A') → (B → B') → coprod A B → coprod A' B' functor-coprod f g (inl x) = inl (f x) functor-coprod f g (inr y) = inr (g y) htpy-functor-coprod : {l1 l2 l1' l2' : Level} {A : UU l1} {B : UU l2} {A' : UU l1'} {B' : UU l2'} {f f' : A → A'} (H : f ~ f') {g g' : B → B'} (K : g ~ g') → (functor-coprod f g) ~ (functor-coprod f' g') htpy-functor-coprod H K (inl x) = ap inl (H x) htpy-functor-coprod H K (inr y) = ap inr (K y) id-functor-coprod : {l1 l2 : Level} (A : UU l1) (B : UU l2) → (functor-coprod (id {A = A}) (id {A = B})) ~ id id-functor-coprod A B (inl x) = refl id-functor-coprod A B (inr x) = refl compose-functor-coprod : {l1 l2 l1' l2' l1'' l2'' : Level} {A : UU l1} {B : UU l2} {A' : UU l1'} {B' : UU l2'} {A'' : UU l1''} {B'' : UU l2''} (f : A → A') (f' : A' → A'') (g : B → B') (g' : B' → B'') → (functor-coprod (f' ∘ f) (g' ∘ g)) ~ ((functor-coprod f' g') ∘ (functor-coprod f g)) compose-functor-coprod f f' g g' (inl x) = refl compose-functor-coprod f f' g g' (inr y) = refl abstract is-equiv-functor-coprod : {l1 l2 l1' l2' : Level} {A : UU l1} {B : UU l2} {A' : UU l1'} {B' : UU l2'} {f : A → A'} {g : B → B'} → is-equiv f → is-equiv g → is-equiv (functor-coprod f g) is-equiv-functor-coprod {A = A} {B = B} {A' = A'} {B' = B'} {f = f} {g = g} (pair (pair sf issec-sf) (pair rf isretr-rf)) (pair (pair sg issec-sg) (pair rg isretr-rg)) = pair ( pair ( functor-coprod sf sg) ( ( ( htpy-inv (compose-functor-coprod sf f sg g)) ∙h ( htpy-functor-coprod issec-sf issec-sg)) ∙h ( id-functor-coprod A' B'))) ( pair ( functor-coprod rf rg) ( ( ( htpy-inv (compose-functor-coprod f rf g rg)) ∙h ( htpy-functor-coprod isretr-rf isretr-rg)) ∙h ( id-functor-coprod A B))) equiv-functor-coprod : {l1 l2 l1' l2' : Level} {A : UU l1} {B : UU l2} {A' : UU l1'} {B' : UU l2'} → (A ≃ A') → (B ≃ B') → ((coprod A B) ≃ (coprod A' B')) equiv-functor-coprod (pair e is-equiv-e) (pair f is-equiv-f) = pair ( functor-coprod e f) ( is-equiv-functor-coprod is-equiv-e is-equiv-f) -- Extra material abstract is-equiv-inv-con : {i : Level} {A : UU i} {x y z : A} (p : Id x y) (q : Id y z) (r : Id x z) → is-equiv (inv-con p q r) is-equiv-inv-con refl q r = is-equiv-id (Id q r) equiv-inv-con : {i : Level} {A : UU i} {x y z : A} (p : Id x y) (q : Id y z) (r : Id x z) → Id (p ∙ q) r ≃ Id q ((inv p) ∙ r) equiv-inv-con p q r = pair (inv-con p q r) (is-equiv-inv-con p q r) abstract is-equiv-con-inv : {i : Level} {A : UU i} {x y z : A} (p : Id x y) (q : Id y z) (r : Id x z) → is-equiv (con-inv p q r) is-equiv-con-inv p refl r = is-equiv-comp' ( concat' p (inv right-unit)) ( concat (inv right-unit) r) ( is-equiv-concat (inv right-unit) r) ( is-equiv-concat' p (inv right-unit)) equiv-con-inv : {i : Level} {A : UU i} {x y z : A} (p : Id x y) (q : Id y z) (r : Id x z) → Id (p ∙ q) r ≃ Id p (r ∙ (inv q)) equiv-con-inv p q r = pair (con-inv p q r) (is-equiv-con-inv p q r) -- Extra constructions with homotopies htpy-inv-con : {l1 l2 : Level} {A : UU l1} {B : A → UU l2} {f g h : (x : A) → B x} → (H : f ~ g) (K : g ~ h) (L : f ~ h) → (H ∙h K) ~ L → K ~ ((htpy-inv H) ∙h L) htpy-inv-con H K L M x = inv-con (H x) (K x) (L x) (M x) htpy-con-inv : {l1 l2 : Level} {A : UU l1} {B : A → UU l2} {f g h : (x : A) → B x} → (H : f ~ g) (K : g ~ h) (L : f ~ h) → (H ∙h K) ~ L → H ~ (L ∙h (htpy-inv K)) htpy-con-inv H K L M x = con-inv (H x) (K x) (L x) (M x) htpy-ap-concat : {l1 l2 : Level} {A : UU l1} {B : A → UU l2} {f g h : (x : A) → B x} → (H : f ~ g) (K K' : g ~ h) → K ~ K' → (H ∙h K) ~ (H ∙h K') htpy-ap-concat {g = g} {h} H K K' L x = ap (concat (H x) (h x)) (L x) htpy-ap-concat' : {l1 l2 : Level} {A : UU l1} {B : A → UU l2} {f g h : (x : A) → B x} → (H H' : f ~ g) (K : g ~ h) → H ~ H' → (H ∙h K) ~ (H' ∙h K) htpy-ap-concat' H H' K L x = ap (concat' _ (K x)) (L x) htpy-distributive-inv-concat : {l1 l2 : Level} {A : UU l1} {B : A → UU l2} {f g h : (x : A) → B x} → (H : f ~ g) (K : g ~ h) → (htpy-inv (H ∙h K)) ~ ((htpy-inv K) ∙h (htpy-inv H)) htpy-distributive-inv-concat H K x = distributive-inv-concat (H x) (K x) htpy-ap-inv : {l1 l2 : Level} {A : UU l1} {B : A → UU l2} {f g : (x : A) → B x} → {H H' : f ~ g} → H ~ H' → (htpy-inv H) ~ (htpy-inv H') htpy-ap-inv K x = ap inv (K x) htpy-left-whisk-htpy-inv : {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {C : UU l3} {f f' : A → B} (g : B → C) (H : f ~ f') → (g ·l (htpy-inv H)) ~ htpy-inv (g ·l H) htpy-left-whisk-htpy-inv g H x = ap-inv g (H x) htpy-right-whisk-htpy-inv : {l1 l2 l3 : Level} {A : UU l1} {B : UU l2} {C : UU l3} {g g' : B → C} (H : g ~ g') (f : A → B) → ((htpy-inv H) ·r f) ~ (htpy-inv (H ·r f)) htpy-right-whisk-htpy-inv H f = refl-htpy -- Old stuff element : {i : Level} {A : UU i} → A → unit → A element a star = a htpy-element-constant : {i : Level} {A : UU i} (a : A) → (element a) ~ (const unit A a) htpy-element-constant a star = refl ap-const : {i j : Level} {A : UU i} {B : UU j} (b : B) (x y : A) → (ap (const A B b) {x} {y}) ~ const (Id x y) (Id b b) refl ap-const b x .x refl = refl
oeis/028/A028171.asm
neoneye/loda-programs
11
172551
; A028171: Expansion of 1/((1-5x)(1-6x)(1-8x)(1-10x)). ; Submitted by <NAME> ; 1,29,533,7945,105021,1285809,14944693,167428745,1826266541,19529198689,205738222053,2142884743545,22124707610461,226886218153169,2314414985326613,23511240805642345,238065299395424781 mov $1,1 mov $2,$0 mov $3,$0 lpb $2 mov $0,$3 sub $2,1 sub $0,$2 seq $0,19783 ; Expansion of 1/((1-5x)(1-6x)(1-8x)). mul $1,10 add $1,$0 lpe mov $0,$1
data/mapObjects/FuchsiaGym.asm
AmateurPanda92/pokemon-rby-dx
9
171646
FuchsiaGym_Object: db $3 ; border block db 2 ; warps warp 4, 17, 5, -1 warp 5, 17, 5, -1 db 0 ; signs db 8 ; objects object SPRITE_BLACKBELT, 4, 10, STAY, DOWN, 1, OPP_KOGA, 1 object SPRITE_ROCKER, 8, 13, STAY, DOWN, 2, OPP_JUGGLER, 7 object SPRITE_ROCKER, 7, 8, STAY, RIGHT, 3, OPP_JUGGLER, 3 object SPRITE_ROCKER, 1, 12, STAY, DOWN, 4, OPP_JUGGLER, 8 object SPRITE_ROCKER, 3, 5, STAY, UP, 5, OPP_TAMER, 1 object SPRITE_ROCKER, 8, 2, STAY, DOWN, 6, OPP_TAMER, 2 object SPRITE_ROCKER, 2, 7, STAY, LEFT, 7, OPP_JUGGLER, 4 object SPRITE_GYM_HELPER, 7, 15, STAY, DOWN, 8 ; person ; warp-to warp_to 4, 17, FUCHSIA_GYM_WIDTH warp_to 5, 17, FUCHSIA_GYM_WIDTH
Definition/LogicalRelation/Substitution/Introductions/Emptyrec.agda
CoqHott/logrel-mltt
2
14450
{-# OPTIONS --safe #-} open import Definition.Typed.EqualityRelation module Definition.LogicalRelation.Substitution.Introductions.Emptyrec {{eqrel : EqRelSet}} where open EqRelSet {{...}} open import Definition.Untyped as U hiding (wk) open import Definition.Untyped.Properties open import Definition.Typed import Definition.Typed.Weakening as T open import Definition.Typed.Properties open import Definition.Typed.RedSteps open import Definition.LogicalRelation open import Definition.LogicalRelation.ShapeView open import Definition.LogicalRelation.Irrelevance open import Definition.LogicalRelation.Properties open import Definition.LogicalRelation.Application open import Definition.LogicalRelation.Substitution open import Definition.LogicalRelation.Substitution.Properties import Definition.LogicalRelation.Substitution.Irrelevance as S open import Definition.LogicalRelation.Substitution.Reflexivity open import Definition.LogicalRelation.Substitution.Weakening open import Definition.LogicalRelation.Substitution.Introductions.Empty open import Definition.LogicalRelation.Substitution.Introductions.Pi open import Definition.LogicalRelation.Substitution.Introductions.SingleSubst open import Tools.Product open import Tools.Unit open import Tools.Empty open import Tools.Nat import Tools.PropositionalEquality as PE -- Reducibility of natural recursion under a valid substitution. EmptyrecTerm : ∀ {F rF lF lEmpty n Γ Δ σ l} ([Γ] : ⊩ᵛ Γ) ([F] : Γ ⊩ᵛ⟨ l ⟩ F ^ [ rF , ι lF ] / [Γ]) (⊢Δ : ⊢ Δ) ([σ] : Δ ⊩ˢ σ ∷ Γ / [Γ] / ⊢Δ) ([σn] : Δ ⊩⟨ l ⟩ n ∷ Empty lEmpty ^ [ % , ι lEmpty ] / Emptyᵣ (idRed:*: (univ (Emptyⱼ ⊢Δ)))) → Δ ⊩⟨ l ⟩ Emptyrec lF lEmpty (subst σ F) n ∷ subst σ F ^ [ rF , ι lF ] / proj₁ ([F] ⊢Δ [σ]) EmptyrecTerm {F} {rF = !} {lF} {lEmpty} {n} {Γ} {Δ} {σ} {l} [Γ] [F] ⊢Δ [σ] (Emptyₜ (ne d)) = let [Empty] = Emptyᵛ {ll = lEmpty} {l = l} [Γ] [σEmpty] = proj₁ ([Empty] ⊢Δ [σ]) [σF] = proj₁ ([F] ⊢Δ [σ]) ⊢F = escape [σF] ⊢F≡F = escapeEq [σF] (reflEq [σF]) in neuTerm [σF] (Emptyrecₙ) (Emptyrecⱼ ⊢F d) (~-Emptyrec ⊢F≡F d d) EmptyrecTerm {F} {rF = %} {lF} {lEmpty} {n} {Γ} {Δ} {σ} {l} [Γ] [F] ⊢Δ [σ] (Emptyₜ (ne d)) = let [Empty] = Emptyᵛ {ll = lEmpty} {l = l} [Γ] [σEmpty] = proj₁ ([Empty] ⊢Δ [σ]) [σF] = proj₁ ([F] ⊢Δ [σ]) ⊢F = escape [σF] ⊢F≡F = escapeEq [σF] (reflEq [σF]) in logRelIrr [σF] (Emptyrecⱼ ⊢F d) -- Reducibility of natural recursion congurence under a valid substitution equality. Emptyrec-congTerm : ∀ {F F′ rF lF lEmpty n m Γ Δ σ σ′ l} ([Γ] : ⊩ᵛ Γ) ([F] : Γ ⊩ᵛ⟨ l ⟩ F ^ [ rF , ι lF ] / [Γ]) ([F′] : Γ ⊩ᵛ⟨ l ⟩ F′ ^ [ rF , ι lF ] / [Γ]) ([F≡F′] : Γ ⊩ᵛ⟨ l ⟩ F ≡ F′ ^ [ rF , ι lF ] / [Γ] / [F]) (⊢Δ : ⊢ Δ) ([σ] : Δ ⊩ˢ σ ∷ Γ / [Γ] / ⊢Δ) ([σ′] : Δ ⊩ˢ σ′ ∷ Γ / [Γ] / ⊢Δ) ([σ≡σ′] : Δ ⊩ˢ σ ≡ σ′ ∷ Γ / [Γ] / ⊢Δ / [σ]) ([σn] : Δ ⊩⟨ l ⟩ n ∷ Empty lEmpty ^ [ % , ι lEmpty ] / Emptyᵣ (idRed:*: (univ (Emptyⱼ ⊢Δ)))) ([σm] : Δ ⊩⟨ l ⟩ m ∷ Empty lEmpty ^ [ % , ι lEmpty ] / Emptyᵣ (idRed:*: (univ (Emptyⱼ ⊢Δ)))) → Δ ⊩⟨ l ⟩ Emptyrec lF lEmpty (subst σ F) n ≡ Emptyrec lF lEmpty (subst σ′ F′) m ∷ subst σ F ^ [ rF , ι lF ] / proj₁ ([F] ⊢Δ [σ]) Emptyrec-congTerm {F} {F′} {rF = !} {lF} {lEmpty} {n} {m} {Γ} {Δ} {σ} {σ′} {l} [Γ] [F] [F′] [F≡F′] ⊢Δ [σ] [σ′] [σ≡σ′] (Emptyₜ (ne ⊢n′)) (Emptyₜ (ne ⊢m′)) = let [Empty] = Emptyᵛ {ll = lEmpty} {l = l} [Γ] [σEmpty] = proj₁ ([Empty] ⊢Δ [σ]) [σ′Empty] = proj₁ ([Empty] ⊢Δ [σ′]) [σF] = proj₁ ([F] ⊢Δ [σ]) [σ′F] = proj₁ ([F] ⊢Δ [σ′]) [σ′F′] = proj₁ ([F′] ⊢Δ [σ′]) ⊢F = escape [σF] ⊢F≡F = escapeEq [σF] (reflEq [σF]) ⊢F′ = escape [σ′F′] ⊢F′≡F′ = escapeEq [σ′F′] (reflEq [σ′F′]) ⊢σF≡σ′F = escapeEq [σF] (proj₂ ([F] ⊢Δ [σ]) [σ′] [σ≡σ′]) ⊢σ′F≡σ′F′ = escapeEq [σ′F] ([F≡F′] ⊢Δ [σ′]) ⊢F≡F′ = ≅-trans ⊢σF≡σ′F ⊢σ′F≡σ′F′ [σF≡σ′F] = proj₂ ([F] ⊢Δ [σ]) [σ′] [σ≡σ′] [σ′F≡σ′F′] = [F≡F′] ⊢Δ [σ′] [σF≡σ′F′] = transEq [σF] [σ′F] [σ′F′] [σF≡σ′F] [σ′F≡σ′F′] EmptyrecN = neuTerm [σF] (Emptyrecₙ) (Emptyrecⱼ ⊢F ⊢n′) (~-Emptyrec ⊢F≡F ⊢n′ ⊢n′) EmptyrecM = neuTerm [σ′F′] (Emptyrecₙ) (Emptyrecⱼ ⊢F′ ⊢m′) (~-Emptyrec ⊢F′≡F′ ⊢m′ ⊢m′) EmptyrecN≡M = neuEqTerm [σF] Emptyrecₙ Emptyrecₙ (Emptyrecⱼ ⊢F ⊢n′) (conv (Emptyrecⱼ ⊢F′ ⊢m′) (sym (≅-eq (escapeEq [σF] (transEq [σF] [σ′F] [σ′F′] [σF≡σ′F] [σ′F≡σ′F′]))))) (~-Emptyrec ⊢F≡F′ ⊢n′ ⊢m′) in EmptyrecN≡M Emptyrec-congTerm {F} {F′} {rF = %} {lF} {lEmpty} {n} {m} {Γ} {Δ} {σ} {σ′} {l} [Γ] [F] [F′] [F≡F′] ⊢Δ [σ] [σ′] [σ≡σ′] (Emptyₜ (ne ⊢n′)) (Emptyₜ (ne ⊢m′)) = let [Empty] = Emptyᵛ {ll = lEmpty} {l = l} [Γ] [σEmpty] = proj₁ ([Empty] ⊢Δ [σ]) [σ′Empty] = proj₁ ([Empty] ⊢Δ [σ′]) [σF] = proj₁ ([F] ⊢Δ [σ]) [σ′F] = proj₁ ([F] ⊢Δ [σ′]) [σ′F′] = proj₁ ([F′] ⊢Δ [σ′]) ⊢F = escape [σF] ⊢F≡F = escapeEq [σF] (reflEq [σF]) ⊢F′ = escape [σ′F′] ⊢F′≡F′ = escapeEq [σ′F′] (reflEq [σ′F′]) ⊢σF≡σ′F = escapeEq [σF] (proj₂ ([F] ⊢Δ [σ]) [σ′] [σ≡σ′]) ⊢σ′F≡σ′F′ = escapeEq [σ′F] ([F≡F′] ⊢Δ [σ′]) ⊢F≡F′ = ≅-trans ⊢σF≡σ′F ⊢σ′F≡σ′F′ [σF≡σ′F] = proj₂ ([F] ⊢Δ [σ]) [σ′] [σ≡σ′] [σ′F≡σ′F′] = [F≡F′] ⊢Δ [σ′] [σF≡σ′F′] = transEq [σF] [σ′F] [σ′F′] [σF≡σ′F] [σ′F≡σ′F′] in logRelIrrEq [σF] (Emptyrecⱼ ⊢F ⊢n′) (conv (Emptyrecⱼ ⊢F′ ⊢m′) (sym (≅-eq (escapeEq [σF] (transEq [σF] [σ′F] [σ′F′] [σF≡σ′F] [σ′F≡σ′F′]))))) -- Validity of empty recursion. Emptyrecᵛ : ∀ {F rF lF lEmpty n Γ l} ([Γ] : ⊩ᵛ Γ) ([Empty] : Γ ⊩ᵛ⟨ l ⟩ Empty lEmpty ^ [ % , ι lEmpty ] / [Γ]) ([F] : Γ ⊩ᵛ⟨ l ⟩ F ^ [ rF , ι lF ] / [Γ]) → ([n] : Γ ⊩ᵛ⟨ l ⟩ n ∷ Empty lEmpty ^ [ % , ι lEmpty ] / [Γ] / [Empty]) → Γ ⊩ᵛ⟨ l ⟩ Emptyrec lF lEmpty F n ∷ F ^ [ rF , ι lF ] / [Γ] / [F] Emptyrecᵛ {F} {rF} {lF} {lEmpty} {n} {l = l} [Γ] [Empty] [F] [n] {Δ = Δ} {σ = σ} ⊢Δ [σ] = let [σn] = irrelevanceTerm {l′ = l} (proj₁ ([Empty] ⊢Δ [σ])) (Emptyᵣ (idRed:*: (univ (Emptyⱼ ⊢Δ)))) (proj₁ ([n] ⊢Δ [σ])) in EmptyrecTerm {F = F} [Γ] [F] ⊢Δ [σ] [σn] , λ {σ'} [σ′] [σ≡σ′] → let [σ′n] = irrelevanceTerm {l′ = l} (proj₁ ([Empty] ⊢Δ [σ′])) (Emptyᵣ (idRed:*: (univ (Emptyⱼ ⊢Δ)))) (proj₁ ([n] ⊢Δ [σ′])) [σn≡σ′n] = irrelevanceEqTerm {l′ = l} (proj₁ ([Empty] ⊢Δ [σ])) (Emptyᵣ (idRed:*: (univ (Emptyⱼ ⊢Δ)))) (proj₂ ([n] ⊢Δ [σ]) [σ′] [σ≡σ′]) congTerm = Emptyrec-congTerm {F = F} {F′ = F} [Γ] [F] [F] (reflᵛ {F} {l = l} [Γ] [F]) ⊢Δ [σ] [σ′] [σ≡σ′] [σn] [σ′n] in congTerm -- Validity of natural recursion congurence. Emptyrec-congᵛ : ∀ {F F′ rF lF lEmpty n n′ Γ l} ([Γ] : ⊩ᵛ Γ) ([Empty] : Γ ⊩ᵛ⟨ l ⟩ Empty lEmpty ^ [ % , ι lEmpty ] / [Γ]) ([F] : Γ ⊩ᵛ⟨ l ⟩ F ^ [ rF , ι lF ] / [Γ]) ([F′] : Γ ⊩ᵛ⟨ l ⟩ F′ ^ [ rF , ι lF ] / [Γ]) ([F≡F′] : Γ ⊩ᵛ⟨ l ⟩ F ≡ F′ ^ [ rF , ι lF ] / [Γ] / [F]) ([n] : Γ ⊩ᵛ⟨ l ⟩ n ∷ Empty lEmpty ^ [ % , ι lEmpty ] / [Γ] / [Empty]) ([n′] : Γ ⊩ᵛ⟨ l ⟩ n′ ∷ Empty lEmpty ^ [ % , ι lEmpty ] / [Γ] / [Empty]) → Γ ⊩ᵛ⟨ l ⟩ Emptyrec lF lEmpty F n ≡ Emptyrec lF lEmpty F′ n′ ∷ F ^ [ rF , ι lF ] / [Γ] / [F] Emptyrec-congᵛ {F} {F′} {rF} {lF} {lEmpty} {n} {n′} {l = l} [Γ] [Empty] [F] [F′] [F≡F′] [n] [n′] {Δ = Δ} {σ = σ} ⊢Δ [σ] = let [σn] = irrelevanceTerm {l′ = l} (proj₁ ([Empty] ⊢Δ [σ])) (Emptyᵣ (idRed:*: (univ (Emptyⱼ ⊢Δ)))) (proj₁ ([n] ⊢Δ [σ])) [σn′] = irrelevanceTerm {l′ = l} (proj₁ ([Empty] ⊢Δ [σ])) (Emptyᵣ (idRed:*: (univ (Emptyⱼ ⊢Δ)))) (proj₁ ([n′] ⊢Δ [σ])) congTerm = Emptyrec-congTerm {F} {F′} [Γ] [F] [F′] [F≡F′] ⊢Δ [σ] [σ] (reflSubst [Γ] ⊢Δ [σ]) [σn] [σn′] in congTerm
programs/oeis/086/A086025.asm
neoneye/loda
22
28425
<filename>programs/oeis/086/A086025.asm ; A086025: a(n) = Sum_{i=1..n} C(i+4,5)^2. ; 1,37,478,3614,19490,82994,296438,923702,2580071,6588075,15606084,34685508,72976852,146387476,281597860,521971876,936053677,1629533233,2761788434,4568378450,7391175350,11718183750,18235516650,27894475050,41997225075,62305185111,91174933032,131727226408,188055603304,265482004840,370867940264,512990908328,702997102937,954942874301,1286438997350,1719413525414,2281010887818,3004646934042,3931241843646,5110655219710,6603350273791,8482316802307,10835285658028,13767270646444,17403477235900,21892621173500,27410704057100,34165297138700,42400389137925,52401858638025,64503636733146,79094631007002,96626487662238,117622274699694,142686175480690,172514288806834,207906638834443,249780505718447,299185195867856,357318379106000,425544128878544,505412810955728,598682975847632,707345420408016,833649594859185,980132542743381,1149650573111662,1345413876615598,1571024310087154,1830516587694850,2128403130866950,2469722843892550,2860094097466775,3305772218454875,3813711800830100,4391634170110356,5048100351697572,5792589912330468,6635586063415284,7588667435319540,8664606952820829,9877478263816033,11242770196136482,12777509740901986,14500394085302150,16431932243037974,18594596856911738,21012986775240122,23714001031906211,26727024888982535,30084128630971896,33820279830847992,37973569840256568,42585455289483064,47701015417127800,53369226084878200,59643251369353225,66580753660742125,74244223236892150,82701328321642550 lpb $0 mov $2,$0 sub $0,1 add $2,1 seq $2,151974 ; a(n) = n*(n+1)*(n+2)*(n+3)*(n+4)/8. pow $2,2 add $1,$2 lpe div $1,225 add $1,1 mov $0,$1
_GetKernel.asm
Leviathaner/exeLocking
2
20968
<filename>_GetKernel.asm ;******************************************************************* ; 公用模块:_GetKernel.asm ; 根据程序被调用的时候堆栈中有个用于 Ret 的地址指向 Kernel32.dll ; 而从内存中扫描并获取 Kernel32.dll 的基址 ;******************************************************************* ;******************************************************************* ; 错误处理 ;******************************************************************* _SEHHandler proc frame uses rbx rsi rdi _lpExceptionRecord:qword, _lpFrame:qword, _lpContext:qword local @szBuffer[256]:byte mov rsi,_lpExceptionRecord mov rdi,_lpContext assume rsi:ptr EXCEPTION_RECORD,rdi:ptr CONTEXT lea rax,_GetKernelBase_PageError mov [rdi].Rip_,rax assume rsi:nothing,rdi:nothing mov eax,ExceptionContinueExecution ret align 8 _SEHHandler Endp ;******************************************************************* ; 在内存中扫描 Kernel32.dll 的基址 ;******************************************************************* _GetKernelBase proc frame:_SEHHandler uses rbx rsi rdi _lpKernelRet:qword local @dqReturn:qword mov @dqReturn,0 ;******************************************************************** ; 重定位 ;******************************************************************** call @F @@: pop rbx mov rax,offset @b sub rbx,rax ;******************************************************************** ; 查找 Kernel32.dll 的基地址 ;******************************************************************** mov rdi,_lpKernelRet and rdi,0ffff0000h .while TRUE .if word ptr [rdi] == IMAGE_DOS_SIGNATURE mov rsi,rdi xor rax,rax mov eax,dword ptr [rsi+003ch] add rsi,rax .if word ptr [rsi] == IMAGE_NT_SIGNATURE mov @dqReturn,rdi .break .endif .endif _GetKernelBase_PageError:: sub rdi,010000h .break .if rdi < 070000000h .endw mov rax,@dqReturn ret _GetKernelBase Endp ;******************************************************************* ; 错误处理 ;******************************************************************* _SEHHandler2 proc frame uses rbx rsi rdi _lpExceptionRecord:qword, _lpFrame:qword, _lpContext:qword local @szBuffer[256]:byte mov rsi,_lpExceptionRecord mov rdi,_lpContext assume rsi:ptr EXCEPTION_RECORD,rdi:ptr CONTEXT lea rax,_GetApi_Error mov [rdi].Rip_,rax assume rsi:nothing,rdi:nothing mov eax,ExceptionContinueExecution ret align 8 _SEHHandler2 Endp ;******************************************************************* ; 从内存中模块的导出表中获取某个 API 的入口地址 ;******************************************************************* _GetApi Proc frame:_SEHHandler2 uses rbx rsi rdi _hModule:qword,_lpszApi:qword local @dqReturn:qword local @dwStringLength mov @dqReturn,0 ;******************************************************************** ; 重定位 ;******************************************************************** call @F @@: pop rbx mov rax,offset @b sub rbx,rax mov rdi,_lpszApi mov rcx,-1 xor al,al cld repnz scasb mov rcx,rdi sub rcx,_lpszApi mov @dwStringLength,ecx mov rsi,_hModule xor rax,rax mov eax,dword ptr [rsi + 3ch] add rsi,rax assume rsi:ptr IMAGE_NT_HEADERS mov eax,[rsi].OptionalHeader.DataDirectory.VirtualAddress mov rsi,_hModule add rsi,rax assume rsi:ptr IMAGE_EXPORT_DIRECTORY mov ebx,[rsi].AddressOfNames add rbx,_hModule xor edx,edx .repeat push rsi xor rdi,rdi mov edi,dword ptr [rbx] add rdi,_hModule mov rsi,_lpszApi mov ecx,@dwStringLength repz cmpsb .if ZERO? pop rsi jmp @F .endif pop rsi add rbx,4 inc edx .until edx >= [rsi].NumberOfNames jmp _GetApi_Error @@: mov eax,[rsi].AddressOfNames sub rbx,rax sub rbx,_hModule shr rbx,1 mov eax,[rsi].AddressOfNameOrdinals add rbx,rax add rbx,_hModule movzx rax,word ptr [rbx] shl rax,2 xor rcx,rcx mov ecx,[rsi].AddressOfFunctions add rax,rcx add rax,_hModule mov eax,dword ptr [rax] add rax,_hModule mov @dqReturn,rax _GetApi_Error:: assume rsi:nothing mov rax,@dqReturn ret _GetApi endp