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 |
|---|---|---|---|---|
test/Fail/Issue3318-4.agda | shlevy/agda | 1,989 | 3761 | primitive
primSetOmega : _
|
reference/ANTLRv4Parser.g4 | mgreminger/js_antlr4_book | 1 | 5026 | /*
* [The "BSD license"]
* Copyright (c) 2012 <NAME>
* Copyright (c) 2012 <NAME>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/** A grammar for ANTLR v4 tokens suitable for use in an IDE for handling
erroneous input well. Experimental.
*/
parser grammar GrammarParser;
options {
tokenVocab = ANTLRv4Lexer;
}
tokens {
COMBINED
}
// The main entry point for parsing a V4 grammar.
//
grammarSpec
: // The grammar itself can have a documentation comment, which is the
// first terminal in the file.
//
DOC_COMMENT?
// Next we should see the type and name of the grammar file that
// we are about to parse.
//
grammarType id SEMI
// There now follows zero or more declaration sections that should
// be given to us before the rules are declared
//
// A number of things can be declared/stated before the grammar rules
// 'proper' are parsed. These include grammar imports (delegate), grammar
// options, imaginary token declarations, global scope declarations,
// and actions such as @header. In this rule we allow any number of
// these constructs in any order so that the grammar author is not
// constrained by some arbitrary order of declarations that nobody
// can remember. In the next phase of the parse, we verify that these
// constructs are valid, not repeated and so on.
prequelConstruct*
// We should now see at least one ANTLR EBNF style rule
// declaration. If the rules are missing we will let the
// semantic verification phase tell the user about it.
//
rules
modeSpec*
// And we force ANTLR to process everything it finds in the input
// stream by specifying hte need to match End Of File before the
// parse is complete.
//
EOF
;
grammarType
: ( LEXER GRAMMAR
| // A standalone parser specification
PARSER GRAMMAR
// A combined lexer and parser specification
| GRAMMAR
)
;
// This is the list of all constructs that can be declared before
// the set of rules that compose the grammar, and is invoked 0..n
// times by the grammarPrequel rule.
prequelConstruct
: // A list of options that affect analysis and/or code generation
optionsSpec
| // A list of grammars to which this grammar will delegate certain
// parts of the parsing sequence - a set of imported grammars
delegateGrammars
| // The declaration of any token types we need that are not already
// specified by a preceeding grammar, such as when a parser declares
// imaginary tokens with which to construct the AST, or a rewriting
// tree parser adds further imaginary tokens to ones defined in a prior
// {tree} parser.
tokensSpec
| // A declaration of language target implemented constructs. All such
// action sections start with '@' and are given to the language target's
// StringTemplate group. For instance @parser::header and @lexer::header
// are gathered here.
action
;
// A list of options that affect analysis and/or code generation
optionsSpec
: OPTIONS (option SEMI)* RBRACE
;
option
: id ASSIGN optionValue
;
// ------------
// Option Value
//
optionValue
: // If the option value is a single word that conforms to the
// lexical rules of token or rule names, then the user may skip quotes
// and so on. Many option values meet this description
qid
| // The value is a long string
STRING_LITERAL
| // The value was an integer number
INT
| // Asterisk, used for things like k=*
STAR
;
// A list of grammars to which this grammar will delegate certain
// parts of the parsing sequence - a set of imported grammars
delegateGrammars
: IMPORT delegateGrammar (COMMA delegateGrammar)* SEMI
;
// A possibly named grammar file that should be imported to this gramamr
// and delgated to for the rules it specifies
delegateGrammar
: id ASSIGN id
| id
;
/** The declaration of any token types we need that are not already
* specified by a preceeding grammar, such as when a parser declares
* imaginary tokens with which to construct the AST, or a rewriting
* tree parser adds further imaginary tokens to ones defined in a prior
* {tree} parser.
*/
tokensSpec
: TOKENS id (COMMA id)* COMMA? RBRACE
;
actionBlock
: BEGIN_ACTION
( actionBlock
| actionExpression
| actionScopeExpression
| ACTION_WS
| ACTION_NEWLINE
| ACTION_COMMENT
| ACTION_LITERAL
| ACTION_TEXT
| ACTION_LT
| ACTION_GT
| ACTION_LPAREN
| ACTION_RPAREN
| ACTION_LBRACK
| ACTION_RBRACK
| ACTION_EQUALS
| ACTION_COMMA
| ACTION_ESCAPE
| ACTION_WORD
| ACTION_REFERENCE
| ACTION_COLON
| ACTION_COLON2
| ACTION_MINUS
| ACTION_DOT
)*
END_ACTION
;
actionExpression
: ref=ACTION_REFERENCE ignored* op=ACTION_DOT ignored* member=ACTION_WORD
;
actionScopeExpression
: ref=ACTION_REFERENCE ignored* (ACTION_LBRACK ignored* (neg=ACTION_MINUS ignored*)? index=ACTION_WORD ignored* ACTION_RBRACK ignored*)? op=ACTION_COLON2 ignored* member=ACTION_WORD
;
argActionBlock
: BEGIN_ARG_ACTION
( ARG_ACTION_ELEMENT
| ARG_ACTION_TEXT
| ARG_ACTION_LT
| ARG_ACTION_GT
| ARG_ACTION_LPAREN
| ARG_ACTION_RPAREN
| ARG_ACTION_EQUALS
| ARG_ACTION_COMMA
| ARG_ACTION_ESCAPE
| ARG_ACTION_WORD
| ARG_ACTION_WS
| ARG_ACTION_NEWLINE
)*
END_ARG_ACTION
;
argActionParameters
: BEGIN_ARG_ACTION
ignored* (parameters+=argActionParameter ignored* (ARG_ACTION_COMMA ignored* parameters+=argActionParameter ignored*)*)?
END_ARG_ACTION
;
argActionParameter
: type=argActionParameterType? ignored* name=ARG_ACTION_WORD
;
argActionParameterType
: argActionParameterTypePart (ignored* argActionParameterTypePart)*
;
argActionParameterTypePart
: ARG_ACTION_WORD
| ARG_ACTION_LT argActionParameterType? ARG_ACTION_GT
| ARG_ACTION_LPAREN argActionParameterType? ARG_ACTION_RPAREN
;
ignored
: ACTION_WS
| ACTION_NEWLINE
| ACTION_COMMENT
| ARG_ACTION_WS
| ARG_ACTION_NEWLINE
;
// A declaration of a language target specifc section,
// such as @header, @includes and so on. We do not verify these
// sections, they are just passed on to the language target.
/** Match stuff like @parser::members {int i;} */
action
: AT (actionScopeName COLONCOLON)? id actionBlock
;
/** Sometimes the scope names will collide with keywords; allow them as
* ids for action scopes.
*/
actionScopeName
: id
| LEXER
| PARSER
;
modeSpec
: MODE id SEMI ruleSpec+
;
rules
: ruleSpec*
;
ruleSpec
: parserRuleSpec
| lexerRule
;
// The specification of an EBNF rule in ANTLR style, with all the
// rule level parameters, declarations, actions, rewrite specs and so
// on.
//
// Note that here we allow any number of rule declaration sections (such
// as scope, returns, etc) in any order and we let the upcoming semantic
// verification of the AST determine if things are repeated or if a
// particular functional element is not valid in the context of the
// grammar type, such as using returns in lexer rules and so on.
parserRuleSpec
: // A rule may start with an optional documentation comment
DOC_COMMENT?
// Following the documentation, we can declare a rule to be
// public, private and so on. This is only valid for some
// language targets of course but the target will ignore these
// modifiers if they make no sense in that language.
ruleModifiers?
// Next comes the rule name. Here we do not distinguish between
// parser or lexer rules, the semantic verification phase will
// reject any rules that make no sense, such as lexer rules in
// a pure parser or tree parser.
name=RULE_REF
// Immediately following the rulename, there may be a specification
// of input parameters for the rule. We do not do anything with the
// parameters here except gather them for future phases such as
// semantic verifcation, type assignment etc. We require that
// the input parameters are the next syntactically significant element
// following the rule id.
argActionParameters?
ruleReturns?
throwsSpec?
localsSpec?
// Now, before the rule specification itself, which is introduced
// with a COLON, we may have zero or more configuration sections.
// As usual we just accept anything that is syntactically valid for
// one form of the rule or another and let the semantic verification
// phase throw out anything that is invalid.
// At the rule level, a programmer may specify a number of sections, such
// as scope declarations, rule return elements, @ sections (which may be
// language target specific) and so on. We allow any number of these in any
// order here and as usual rely onthe semantic verification phase to reject
// anything invalid using its addinotal context information. Here we are
// context free and just accept anything that is a syntactically correct
// construct.
//
rulePrequels
COLON
// The rule is, at the top level, just a list of alts, with
// finer grained structure defined within the alts.
ruleBlock
SEMI
exceptionGroup
;
// Many language targets support exceptions and the rule will
// generally be able to throw the language target equivalent
// of a recognition exception. The grammar programmar can
// specify a list of exceptions to catch or a generic catch all
// and the target language code generation template is
// responsible for generating code that makes sense.
exceptionGroup
: exceptionHandler* finallyClause?
;
// Specifies a handler for a particular type of exception
// thrown by a rule
exceptionHandler
: CATCH argActionBlock actionBlock
;
finallyClause
: FINALLY actionBlock
;
rulePrequels
: rulePrequel*
;
// An individual rule level configuration as referenced by the ruleActions
// rule above.
//
rulePrequel
: optionsSpec
| ruleAction
;
// A rule can return elements that it constructs as it executes.
// The return values are specified in a 'returns' prequel element,
// which contains COMMA separated declarations, where the declaration
// is target language specific. Here we see the returns declaration
// as a single lexical action element, to be processed later.
//
ruleReturns
: RETURNS argActionParameters
;
// --------------
// Exception spec
//
// Some target languages, such as Java and C# support exceptions
// and they are specified as a prequel element for each rule that
// wishes to throw its own exception type. Note that the name of the
// exception is just a single word, so the header section of the grammar
// must specify the correct import statements (or language equivalent).
// Target languages that do not support exceptions just safely ignore
// them.
//
throwsSpec
: THROWS qid (COMMA qid)*
;
localsSpec
: LOCALS argActionParameters
;
// @ Sections are generally target language specific things
// such as local variable declarations, code to run before the
// rule starts and so on. Fir instance most targets support the
// @init {} section where declarations and code can be placed
// to run before the rule is entered. The C target also has
// an @declarations {} section, where local variables are declared
// in order that the generated code is C89 copmliant.
//
/** Match stuff like @init {int i;} */
ruleAction
: AT id actionBlock
;
// A set of access modifiers that may be applied to rule declarations
// and which may or may not mean something to the target language.
// Note that the parser allows any number of these in any order and the
// semantic pass will throw out invalid combinations.
//
ruleModifiers
: ruleModifier+
;
// An individual access modifier for a rule. The 'fragment' modifier
// is an internal indication for lexer rules that they do not match
// from the input but are like subroutines for other lexer rules to
// reuse for certain lexical patterns. The other modifiers are passed
// to the code generation templates and may be ignored by the template
// if they are of no use in that language.
ruleModifier
: PUBLIC
| PRIVATE
| PROTECTED
| FRAGMENT
;
// A set of alts, rewritten as a BLOCK for generic processing
// in tree walkers. Used by the rule 'rule' so that the list of
// alts for a rule appears as a BLOCK containing the alts and
// can be processed by the generic BLOCK rule. Note that we
// use a separate rule so that the BLOCK node has start and stop
// boundaries set correctly by rule post processing of rewrites.
ruleBlock
: ruleAltList
;
ruleAltList
: labeledAlt (OR labeledAlt)*
;
labeledAlt
: alternative (POUND id)?
;
lexerRule
: DOC_COMMENT? FRAGMENT?
name=TOKEN_REF COLON lexerRuleBlock SEMI
;
lexerRuleBlock
: lexerAltList
;
lexerAltList
: lexerAlt (OR lexerAlt)*
;
lexerAlt
: lexerElements? lexerCommands?
;
lexerElements
: lexerElement+
;
lexerElement
: labeledLexerElement ebnfSuffix?
| lexerAtom ebnfSuffix?
| lexerBlock ebnfSuffix?
| actionBlock QUESTION? // actions only allowed at end of outer alt actually,
// but preds can be anywhere
;
labeledLexerElement
: id ass=(ASSIGN|PLUS_ASSIGN)
( lexerAtom
| block
)
;
lexerBlock
: LPAREN lexerAltList RPAREN
;
// channel=HIDDEN, skip, more, mode(INSIDE), push(INSIDE), pop
lexerCommands
: RARROW lexerCommand (COMMA lexerCommand)*
;
lexerCommand
: lexerCommandName LPAREN lexerCommandExpr RPAREN
| lexerCommandName
;
lexerCommandName
: id
| MODE
;
lexerCommandExpr
: id
| INT
;
altList
: alternative (OR alternative)*
;
// An individual alt with an optional rewrite clause for the
// elements of the alt.
alternative
: elements
| // empty alt
;
elements
: element+
;
element
: labeledElement
( ebnfSuffix
|
)
| atom
( ebnfSuffix
|
)
| ebnf
| actionBlock QUESTION? // SEMPRED is actionBlock followed by QUESTION
;
labeledElement
: label=id ass=(ASSIGN|PLUS_ASSIGN)
( atom
| block
)
;
// A block of gramamr structure optionally followed by standard EBNF
// notation, or ANTLR specific notation. I.E. ? + ^ and so on
ebnf
: block
// And now we see if we have any of the optional suffixs and rewrite
// the AST for this rule accordingly
( blockSuffix
|
)
;
// The standard EBNF suffixes with additional components that make
// sense only to ANTLR, in the context of a grammar block.
blockSuffix
: ebnfSuffix // Standard EBNF
;
ebnfSuffix
: QUESTION
| STAR
| PLUS
;
lexerAtom
: range
| terminal
| RULE_REF
| notSet
| LEXER_CHAR_SET
| // Wildcard '.' means any character in a lexer, any
// token in parser and any node or subtree in a tree parser
// Because the terminal rule is allowed to be the node
// specification for the start of a tree rule, we must
// later check that wildcard was not used for that.
DOT elementOptions?
;
atom
: // Qualified reference delegate.rule. This must be
// lexically contiguous (no spaces either side of the DOT)
// otherwise it is two references with a wildcard in between
// and not a qualified reference.
range // Range x..y - only valid in lexers
| terminal
| ruleref
| notSet
| // Wildcard '.' means any character in a lexer, any
// token in parser and any node or subtree in a tree parser
// Because the terminal rule is allowed to be the node
// specification for the start of a tree rule, we must
// later check that wildcard was not used for that.
DOT elementOptions?
;
// --------------------
// Inverted element set
//
// A set of characters (in a lexer) or terminal tokens, if a parser,
// that are then used to create the inverse set of them.
notSet
: NOT setElement
| NOT blockSet
;
blockSet
: LPAREN setElement (OR setElement)* RPAREN
;
setElement
: TOKEN_REF
| STRING_LITERAL
| range
| LEXER_CHAR_SET
;
// -------------
// Grammar Block
//
// Anywhere where an element is valid, the grammar may start a new block
// of alts by surrounding that block with ( ). A new block may also have a set
// of options, which apply only to that block.
//
block
: LPAREN
( optionsSpec? ruleAction* COLON )?
altList
RPAREN
;
// ----------------
// Parser rule ref
//
// Reference to a parser rule with optional arguments and optional
// directive to become the root node or ignore the tree produced
//
ruleref
: RULE_REF argActionBlock?
;
// ---------------
// Character Range
//
// Specifies a range of characters. Valid for lexer rules only, but
// we do not check that here, the tree walkers shoudl do that.
// Note also that the parser also allows through more than just
// character literals so that we can produce a much nicer semantic
// error about any abuse of the .. operator.
//
range
: STRING_LITERAL RANGE STRING_LITERAL
;
terminal
: TOKEN_REF elementOptions?
| STRING_LITERAL elementOptions?
;
// Terminals may be adorned with certain options when
// reference in the grammar: TOK<,,,>
elementOptions
: LT elementOption (COMMA elementOption)* GT
;
// WHen used with elements we can specify what the tree node type can
// be and also assign settings of various options (which we do not check here)
elementOption
: // This format indicates the default node option
qid
| // This format indicates option assignment
id ASSIGN (qid | STRING_LITERAL)
;
// The name of the grammar, and indeed some other grammar elements may
// come through to the parser looking like a rule reference or a token
// reference, hence this rule is used to pick up whichever it is and rewrite
// it as a generic ID token.
id
: RULE_REF
| TOKEN_REF
;
qid
: id (DOT id)*
;
|
src/firmware-tests/Platform/Clock/Poll/PollWithTickedFlagTest.asm | pete-restall/Cluck2Sesame-Prototype | 1 | 29925 | <reponame>pete-restall/Cluck2Sesame-Prototype
#include "Platform.inc"
#include "FarCalls.inc"
#include "Clock.inc"
#include "TestFixture.inc"
#include "../PollAfterClockMock.inc"
#include "../../ResetFlagsStubs.inc"
radix decimal
udata
global expectedClockYearBcd
global expectedClockMonthBcd
global expectedClockDayBcd
global expectedClockHourBcd
global expectedClockMinuteBcd
global expectedClockSecondBcd
expectedClockYearBcd res 1
expectedClockMonthBcd res 1
expectedClockDayBcd res 1
expectedClockHourBcd res 1
expectedClockMinuteBcd res 1
expectedClockSecondBcd res 1
PollWithTickedFlagTest code
global testArrange
testArrange:
fcall stubIsLastResetDueToBrownOutToReturnTrue
fcall initialisePollAfterClockMock
fcall initialiseClock
testAct:
banksel clockFlags
bsf clockFlags, CLOCK_FLAG_TICKED
.assert "(clockFlags & 0x01) == 0x01, 'CLOCK_FLAG_TICKED should be 0x01.'"
fcall pollClock
testAssert:
.aliasForAssert clockYearBcd, _a
.aliasForAssert expectedClockYearBcd, _b
.assert "_a == _b, 'Year mismatch.'"
.aliasForAssert clockMonthBcd, _a
.aliasForAssert expectedClockMonthBcd, _b
.assert "_a == _b, 'Month mismatch.'"
.aliasForAssert clockDayBcd, _a
.aliasForAssert expectedClockDayBcd, _b
.assert "_a == _b, 'Day mismatch.'"
.aliasForAssert clockHourBcd, _a
.aliasForAssert expectedClockHourBcd, _b
.assert "_a == _b, 'Hour mismatch.'"
.aliasForAssert clockMinuteBcd, _a
.aliasForAssert expectedClockMinuteBcd, _b
.assert "_a == _b, 'Minute mismatch.'"
.aliasForAssert clockSecondBcd, _a
.aliasForAssert expectedClockSecondBcd, _b
.assert "_a == _b, 'Second mismatch.'"
banksel clockFlags
.assert "(clockFlags & 0x01) == 0, 'CLOCK_FLAG_TICKED was not reset.'"
banksel calledPollAfterClock
.assert "calledPollAfterClock != 0, 'Next poll in chain was not called.'"
return
end
|
audio/sfx/battle_19.asm | AmateurPanda92/pokemon-rby-dx | 9 | 94238 | <reponame>AmateurPanda92/pokemon-rby-dx
SFX_Battle_19_Ch7:
noisenote 2, 8, 4, 67
noisenote 2, 12, 4, 34
noisenote 8, 15, 2, 52
endchannel
|
src/sparknacl-hashing.adb | yannickmoy/SPARKNaCl | 76 | 4143 | package body SPARKNaCl.Hashing
with SPARK_Mode => On
is
pragma Warnings (GNATProve, Off, "pragma * ignored (not yet supported)");
subtype Index_80 is I32 range 0 .. 79;
type K_Table is array (Index_80) of U64;
K : constant K_Table :=
(16#428a2f98d728ae22#, 16#7137449123ef65cd#,
16#b5c0fbcfec4d3b2f#, 16#e9b5dba58189dbbc#,
16#3956c25bf348b538#, 16#59f111f1b605d019#,
16#923f82a4af194f9b#, 16#ab1c5ed5da6d8118#,
16#d807aa98a3030242#, 16#12835b0145706fbe#,
16#243185be4ee4b28c#, 16#550c7dc3d5ffb4e2#,
16#72be5d74f27b896f#, 16#80deb1fe3b1696b1#,
16#9bdc06a725c71235#, 16#c19bf174cf692694#,
16#e49b69c19ef14ad2#, 16#efbe4786384f25e3#,
16#0fc19dc68b8cd5b5#, 16#240ca1cc77ac9c65#,
16#2de92c6f592b0275#, 16#4a7484aa6ea6e483#,
16#5cb0a9dcbd41fbd4#, 16#76f988da831153b5#,
16#983e5152ee66dfab#, 16#a831c66d2db43210#,
16#b00327c898fb213f#, 16#bf597fc7beef0ee4#,
16#c6e00bf33da88fc2#, 16#d5a79147930aa725#,
16#06ca6351e003826f#, 16#142929670a0e6e70#,
16#27b70a8546d22ffc#, 16#2e1b21385c26c926#,
16#4d2c6dfc5ac42aed#, 16#53380d139d95b3df#,
16#650a73548baf63de#, 16#766a0abb3c77b2a8#,
16#81c2c92e47edaee6#, 16#92722c851482353b#,
16#a2bfe8a14cf10364#, 16#a81a664bbc423001#,
16#c24b8b70d0f89791#, 16#c76c51a30654be30#,
16#d192e819d6ef5218#, 16#d69906245565a910#,
16#f40e35855771202a#, 16#106aa07032bbd1b8#,
16#19a4c116b8d2d0c8#, 16#1e376c085141ab53#,
16#2748774cdf8eeb99#, 16#34b0bcb5e19b48a8#,
16#391c0cb3c5c95a63#, 16#4ed8aa4ae3418acb#,
16#5b9cca4f7763e373#, 16#682e6ff3d6b2b8a3#,
16#748f82ee5defb2fc#, 16#78a5636f43172f60#,
16#84c87814a1f0ab72#, 16#8cc702081a6439ec#,
16#90befffa23631e28#, 16#a4506cebde82bde9#,
16#bef9a3f7b2c67915#, 16#c67178f2e372532b#,
16#ca273eceea26619c#, 16#d186b8c721c0c207#,
16#eada7dd6cde0eb1e#, 16#f57d4f7fee6ed178#,
16#06f067aa72176fba#, 16#0a637dc5a2c898a6#,
16#113f9804bef90dae#, 16#1b710b35131c471b#,
16#28db77f523047d84#, 16#32caab7b40c72493#,
16#3c9ebe0a15c9bebc#, 16#431d67c49c100d4c#,
16#4cc5d4becb3e42b6#, 16#597f299cfc657e2a#,
16#5fcb6fab3ad6faec#, 16#6c44198c4a475817#);
function TS64 (U : in U64) return Bytes_8
with Global => null;
function TS64 (U : in U64) return Bytes_8
is
X : Bytes_8;
T : U64 := U;
begin
for I in reverse Index_8 loop
pragma Loop_Optimize (No_Unroll);
X (I) := Byte (T mod 256);
T := Shift_Right (T, 8);
end loop;
return X;
end TS64;
-- Big-Endian 8 bytes to U64. The input bytes are in
-- X (I) (the MSB) through X (I + 8) (the LSB)
function DL64 (X : in Byte_Seq;
I : in N32) return U64
with Global => null,
Pre => X'Length >= 8 and then
I >= X'First and then
I <= X'Last - 7;
function DL64 (X : in Byte_Seq;
I : in N32) return U64
is
LSW, MSW : U32;
begin
-- Doing this in two 32-bit groups avoids the need
-- for 64-bit shifts on 32-bit machines.
MSW := Shift_Left (U32 (X (I)), 24) or
Shift_Left (U32 (X (I + 1)), 16) or
Shift_Left (U32 (X (I + 2)), 8) or
U32 (X (I + 3));
LSW := Shift_Left (U32 (X (I + 4)), 24) or
Shift_Left (U32 (X (I + 5)), 16) or
Shift_Left (U32 (X (I + 6)), 8) or
U32 (X (I + 7));
return Shift_Left (U64 (MSW), 32) or U64 (LSW);
end DL64;
procedure Hashblocks
(X : in out Digest;
M : in Byte_Seq)
is
Z, B, A : U64_Seq_8;
W : U64_Seq_16;
T : U64;
LN : I64;
CB : I32;
function RR64 (X : in U64;
C : in Natural) return U64
renames Rotate_Right;
function Ch (X, Y, Z : in U64) return U64
is ((X and Y) xor ((not X) and Z))
with Global => null;
function Maj (X, Y, Z : in U64) return U64
is ((X and Y) xor (X and Z) xor (Y and Z))
with Global => null;
-- Sigma0 with an upper-case S!
function UC_Sigma0 (X : in U64) return U64
is (RR64 (X, 28) xor RR64 (X, 34) xor RR64 (X, 39))
with Global => null;
-- Sigma1 with an upper-case S!
function UC_Sigma1 (X : in U64) return U64
is (RR64 (X, 14) xor RR64 (X, 18) xor RR64 (X, 41))
with Global => null;
-- sigma0 with a lower-case s!
function LC_Sigma0 (X : in U64) return U64
is (RR64 (X, 1) xor RR64 (X, 8) xor Shift_Right (X, 7))
with Global => null;
-- sigma1 with a lower-case s!
function LC_Sigma1 (X : in U64) return U64
is (RR64 (X, 19) xor RR64 (X, 61) xor Shift_Right (X, 6))
with Global => null;
begin
A := (0 => DL64 (X, 0),
1 => DL64 (X, 8),
2 => DL64 (X, 16),
3 => DL64 (X, 24),
4 => DL64 (X, 32),
5 => DL64 (X, 40),
6 => DL64 (X, 48),
7 => DL64 (X, 56));
Z := A;
LN := I64 (M'Length);
CB := M'First; -- Current block base offset
while (LN >= 128) loop
pragma Loop_Optimize (No_Unroll);
pragma Warnings (Off, "lower bound test*");
pragma Loop_Invariant
((LN + I64 (CB) = I64 (M'Last) + 1) and
(LN in 128 .. M'Length) and
(CB in M'First .. (M'Last - 127)));
W := (0 => DL64 (M, CB),
1 => DL64 (M, CB + 8),
2 => DL64 (M, CB + 16),
3 => DL64 (M, CB + 24),
4 => DL64 (M, CB + 32),
5 => DL64 (M, CB + 40),
6 => DL64 (M, CB + 48),
7 => DL64 (M, CB + 56),
8 => DL64 (M, CB + 64),
9 => DL64 (M, CB + 72),
10 => DL64 (M, CB + 80),
11 => DL64 (M, CB + 88),
12 => DL64 (M, CB + 96),
13 => DL64 (M, CB + 104),
14 => DL64 (M, CB + 112),
15 => DL64 (M, CB + 120));
for I in Index_80 loop
pragma Loop_Optimize (No_Unroll);
pragma Loop_Invariant ((LN + I64 (CB) = I64 (M'Last) + 1) and
(LN in 128 .. M'Length) and
(CB in M'First .. (M'Last - 127)));
B := A;
T := A (7) + UC_Sigma1 (A (4)) + Ch (A (4), A (5), A (6)) +
K (I) + W (I mod 16);
B (7) := T + UC_Sigma0 (A (0)) + Maj (A (0), A (1), A (2));
B (3) := B (3) + T;
A := (0 => B (7),
1 => B (0),
2 => B (1),
3 => B (2),
4 => B (3),
5 => B (4),
6 => B (5),
7 => B (6));
if (I mod 16 = 15) then
for J in Index_16 loop
pragma Loop_Optimize (No_Unroll);
W (J) := W (J) + W ((J + 9) mod 16) +
LC_Sigma0 (W ((J + 1) mod 16)) +
LC_Sigma1 (W ((J + 14) mod 16));
end loop;
end if;
end loop;
for I in Index_8 loop
pragma Loop_Optimize (No_Unroll);
A (I) := A (I) + Z (I);
Z (I) := A (I);
end loop;
exit when LN < 256;
pragma Assert (LN >= 128);
CB := CB + 128;
LN := LN - 128;
end loop;
for I in Index_8 loop
pragma Loop_Optimize (No_Unroll);
X (8 * I .. (8 * I + 7)) := TS64 (Z (I));
end loop;
end Hashblocks;
procedure Hash (Output : out Digest;
M : in Byte_Seq)
is
subtype Final_Block_Length is I32 range 0 .. 127;
H : Bytes_64;
X : Bytes_256;
B : Final_Block_Length;
Final_Block_First : I32;
ML_MSB : Byte;
ML_LSBs : U64;
begin
H := IV;
X := (others => 0);
Hashblocks (H, M);
B := Final_Block_Length (I64 (M'Length) mod 128);
if B > 0 then
Final_Block_First := (M'Last - B) + 1;
X (0 .. B - 1) := M (Final_Block_First .. M'Last);
end if;
X (B) := 128;
-- Final 9 bytes are the length of M in bits
ML_MSB := Byte (Shift_Right (U64'(M'Length), 61));
ML_LSBs := U64 (M'Length) * 8;
if B < 112 then
X (119) := ML_MSB;
X (120 .. 127) := TS64 (ML_LSBs);
Hashblocks (H, X (0 .. 127));
else
X (247) := ML_MSB;
X (248 .. 255) := TS64 (ML_LSBs);
Hashblocks (H, X);
end if;
Output := H;
end Hash;
function Hash (M : in Byte_Seq) return Digest
is
R : Digest;
begin
Hash (R, M);
return R;
end Hash;
end SPARKNaCl.Hashing;
|
asm/printch.asm | pedroreissantos/pepe | 0 | 85046 | <reponame>pedroreissantos/pepe
MOV r0, 80
PUSH r0
CALL printch
POP r0
MOV r0, 101
SWE 245 ; printBYTE
MOV r0, 100
SWE 245 ; printBYTE
MOV r0, 114
SWE 245 ; printBYTE
MOV r0, 111
SWE 245 ; printBYTE
MOV r0, 10
SWE 245 ; printBYTE
|
oeis/318/A318397.asm | neoneye/loda-programs | 11 | 177600 | ; A318397: Triangle read by rows: T(n,k) = binomial(n,k)^2 * binomial(2*(n-k), n-k).
; Submitted by <NAME>
; 1,2,1,6,8,1,20,54,18,1,70,320,216,32,1,252,1750,2000,600,50,1,924,9072,15750,8000,1350,72,1,3432,45276,111132,85750,24500,2646,98,1,12870,219648,724416,790272,343000,62720,4704,128,1,48620,1042470,4447872,6519744,4000752,1111320,141120,7776,162,1
lpb $0
add $1,1
sub $0,$1
mov $2,$1
sub $2,$0
lpe
bin $1,$0
mov $0,2
mul $0,$2
bin $0,$2
mul $0,$1
mul $1,16
mul $1,$0
mov $0,$1
div $0,16
|
audio/music/aftertherivalfight.asm | AtmaBuster/pokeplat-gen2 | 6 | 240728 | Music_AfterTheRivalFight:
musicheader 4, 1, Music_AfterTheRivalFight_Ch1
musicheader 1, 2, Music_AfterTheRivalFight_Ch2
musicheader 1, 3, Music_AfterTheRivalFight_Ch3
musicheader 1, 4, Music_AfterTheRivalFight_Ch4
Music_AfterTheRivalFight_Ch1:
Music_AfterTheRivalFight_Ch2:
Music_AfterTheRivalFight_Ch3:
Music_AfterTheRivalFight_Ch4:
endchannel
; Duplicate of nothing.asm because of references upon replacement
|
test/succeed/Issue435.agda | larrytheliquid/agda | 1 | 16307 | <gh_stars>1-10
-- {-# OPTIONS -v extendedlambda:100 -v int2abs.reifyterm.def:100 #-}
module Issue435 where
data Bool : Set where
true false : Bool
record Unit : Set where
postulate
Dh : ({ x : Bool } → Bool) → Set
Di : ({{x : Bool}} → Bool) → Set
noth : Set
noth = Dh (\ { {true} → false ; {false} → true})
noti : Set
noti = Di (\ { {{true}} → false ; {{false}} → true})
-- Testing absurd patterns
data ⊥ : Set where
data T : Set where
expl : (⊥ → ⊥) → T
impl : ({_ : ⊥} → ⊥) → T
inst : ({{_ : ⊥}} → ⊥) → T
explicit : T
explicit = expl (λ ())
implicit : T
implicit = impl (λ {})
instance : T
instance = inst (λ {{ }})
explicit-match : T
explicit-match = expl (λ { () })
implicit-match : T
implicit-match = impl (λ { {} })
implicit-match′ : T
implicit-match′ = impl (λ { { () } })
instance-match : T
instance-match = inst (λ { {{}} })
instance-match′ : T
instance-match′ = inst (λ { {{ () }} })
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1566.asm | ljhsiun2/medusa | 9 | 24755 | <filename>Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1566.asm<gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r13
push %r14
push %r8
push %rbp
lea addresses_WC_ht+0x147e0, %r10
xor $12302, %r13
mov (%r10), %r8w
dec %r8
lea addresses_WT_ht+0x17b7e, %rbp
nop
nop
nop
nop
nop
inc %r11
mov $0x6162636465666768, %r10
movq %r10, (%rbp)
nop
nop
nop
and $933, %r11
lea addresses_UC_ht+0xa8d0, %r14
nop
nop
nop
inc %r11
mov (%r14), %r8d
nop
nop
cmp $51370, %r10
pop %rbp
pop %r8
pop %r14
pop %r13
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r15
push %r8
push %rax
// Faulty Load
lea addresses_D+0x19ed0, %r8
sub $44698, %rax
mov (%r8), %r11d
lea oracles, %rax
and $0xff, %r11
shlq $12, %r11
mov (%rax,%r11,1), %r11
pop %rax
pop %r8
pop %r15
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': True, 'type': 'addresses_D', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_D', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 9, 'NT': True, 'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
|
libsrc/_DEVELOPMENT/adt/b_array/c/sccz80/b_array_destroy.asm | meesokim/z88dk | 0 | 93797 | <filename>libsrc/_DEVELOPMENT/adt/b_array/c/sccz80/b_array_destroy.asm<gh_stars>0
; void b_array_destroy(b_array_t *a)
SECTION code_adt_b_array
PUBLIC b_array_destroy
b_array_destroy:
INCLUDE "adt/b_array/z80/asm_b_array_destroy.asm"
|
src/input.asm | TypeDefinition/NautiBuoy | 2 | 92108 | <reponame>TypeDefinition/NautiBuoy<filename>src/input.asm
INCLUDE "./src/include/hardware.inc"
P1F_NONE EQU $30 ; 0011 0000, used to release the controller
P1F_BUTTONS EQU $10 ; 0001 0000, select button, set bit 4 high, rest low
P1F_DPAD EQU $20 ; 0010 0000, select Dpad by setting bit 5 to high and bit 4 low
/* Variables to keep track of the input keys
first 4 bits: down(7), up(6), left(5), rigjt(4)
last 4 bits: start(3), select(2), B(1), A(0)
How to use:
ld a, [wCurrentInputKeys/wNewlyInputKeys] ; get current/new inputs
bit PADB_START, a ; check if bit n of register a is not z, so can use nz or z flag to check. */
SECTION "Input Variables", WRAM0
wCurrentInputKeys:: ds 1 ; the input currently initialised, stores all current inputs regardless if pressed previously or not
wNewlyInputKeys:: ds 1 ; inputs that was not pressed previously, but pressed this time
/* Logic to handle and update input */
SECTION "Input Handler", ROM0
/* For updating input,
rP1 ($FF00), is the register for reading joy pad info */
UpdateInput::
; Read D-Pad input.
ld a, P1F_BUTTONS
call .readInput
ld b, a ; Store the button inputs in b first
; Read button input.
ld a, P1F_DPAD
call .readInput
swap a ; Move the lower 4 bits (d pad input) to the first 4 bits
xor b ; Merge the button and d-pad input to a. Cause 0 means press, 1 means not pressed. XOR will make the press button to 1, and unpress to 0
ld b, a
; Release the controller.
ld a, P1F_NONE
ldh [rP1], a
; Update wCurrentInputKeys & wNewlyInputKeys.
ld a, [wCurrentInputKeys]
xor b ; keys that were pressed currently and previously becomes 0
and b ; keys that is currently pressed is kept, prev input becomes 0
ld [wNewlyInputKeys], a
ld a, b ; load the values currently pressed
ld [wCurrentInputKeys], a
ret
/* Function to handle stablization and debouncing inputs before getting the correct one. */
.readInput:
ldh [rP1], a ; switch the key matrix
; Need some cycles before writing to P1 and reading the result, need wait for it to stabalize.
call BurnCycles ; Burn 10 cycles with a call.
; Debouncing
ldh a, [rP1] ; Ignore value while waiting for the key matrix to settle.
ldh a, [rP1]
ldh a, [rP1] ; Store this read.
or $F0 ; We only want the last 4 bits. Input returned: 0 = pressed, 1 = !pressed.
ret |
src/spread/fpars/monitor.asm | olifink/qspread | 0 | 91792 | <reponame>olifink/qspread
* Parser Monitor
*
include win1_mac_oli
include win1_keys_qdos_ioa
include win1_spread_fpars_keys
section pars
xdef pma_init,pma_item
xdef pma_stak,pma_clos
xdef pma_ops
pmt_pipe qstrg {pipe_monitor}
pmt_item qstrg {found: }
pmt_stak qstrg { stack: }
pmt_ops qstrg { ops: }
pma_init subr a0-a3/d0-d3
lea pmt_pipe,a0 ; open pipeline
moveq #ioa.kexc,d3
xjsr gu_fopen
move.l a0,pma_ch(a5) ; store channel ID
subend
pma_clos subr a0
move.l pma_ch(a5),a0
xjsr ut_prlf
xjsr gu_fclos
subend
pma_item subr a0-a4/d0-d3
move.l a1,a4 ; save item address
move.l pma_ch(a5),a0 ; channel id
lea pmt_item,a1
xjsr ut_prstr ; print item text
move.l a4,a1
jsr ut_prstr ; item item itself
xjsr ut_prspc
move.l d2,d1
xjsr ut_prchr ; print delimiter
subend
pma_stak subr a0-a4/d0-d3
lea pma_buff(a5),a0
move.l pd_stak(a5),a1
* subq.l #6,a1
xjsr ut_fpdec
move.l a0,a1
move.l pma_ch(a5),a0
lea pmt_stak,a1
xjsr ut_prstr
lea pma_buff(a5),a1
xjsr ut_prstr
subend
pma_ops subr a0-a4/d0-d3
move.l pma_ch(a5),a0
lea pmt_ops,a1
xjsr ut_prstr
move.l pd_plev(a5),a1
move.w lv_opcnt(a1),d1
xjsr ut_priwd
xjsr ut_prlf
subend
end
|
src/fltk-devices-graphics.ads | micahwelf/FLTK-Ada | 1 | 11420 | <reponame>micahwelf/FLTK-Ada
with
FLTK.Images;
package FLTK.Devices.Graphics is
type Graphics_Driver is new Device with private;
type Graphics_Driver_Reference (Data : not null access Graphics_Driver'Class) is
limited null record with Implicit_Dereference => Data;
function Get_Color
(This : in Graphics_Driver)
return Color;
function Get_Text_Descent
(This : in Graphics_Driver)
return Integer;
function Get_Line_Height
(This : in Graphics_Driver)
return Integer;
function Get_Width
(This : in Graphics_Driver;
Char : in Character)
return Long_Float;
function Get_Width
(This : in Graphics_Driver;
Str : in String)
return Long_Float;
function Get_Font_Kind
(This : in Graphics_Driver)
return Font_Kind;
function Get_Font_Size
(This : in Graphics_Driver)
return Font_Size;
procedure Set_Font
(This : in Graphics_Driver;
Face : in Font_Kind;
Size : in Font_Size);
procedure Draw_Scaled_Image
(This : in Graphics_Driver;
Img : in FLTK.Images.Image'Class;
X, Y, W, H : in Integer);
private
type Graphics_Driver is new Device with null record;
pragma Inline (Get_Color);
pragma Inline (Get_Text_Descent);
pragma Inline (Get_Line_Height);
pragma Inline (Get_Width);
pragma Inline (Get_Font_Kind);
pragma Inline (Get_Font_Size);
pragma Inline (Set_Font);
pragma Inline (Draw_Scaled_Image);
end FLTK.Devices.Graphics;
|
simd/ji3dnflt.asm | prismskylabs/libjpeg-turbo-1.3.x | 0 | 98018 | ;
; ji3dnflt.asm - floating-point IDCT (3DNow! & MMX)
;
; Copyright 2009 <NAME> <<EMAIL>> for Cendio AB
;
; Based on
; x86 SIMD extension for IJG JPEG library
; Copyright (C) 1999-2006, MIYASAKA Masaru.
; For conditions of distribution and use, see copyright notice in jsimdext.inc
;
; This file should be assembled with NASM (Netwide Assembler),
; can *not* be assembled with Microsoft's MASM or any compatible
; assembler (including Borland's Turbo Assembler).
; NASM is available from http://nasm.sourceforge.net/ or
; http://sourceforge.net/project/showfiles.php?group_id=6208
;
; This file contains a floating-point implementation of the inverse DCT
; (Discrete Cosine Transform). The following code is based directly on
; the IJG's original jidctflt.c; see the jidctflt.c for more details.
;
; [TAB8]
%include "jsimdext.inc"
%include "jdct.inc"
; --------------------------------------------------------------------------
SECTION SEG_CONST
alignz 16
global EXTN(jconst_idct_float_3dnow)
EXTN(jconst_idct_float_3dnow):
PD_1_414 times 2 dd 1.414213562373095048801689
PD_1_847 times 2 dd 1.847759065022573512256366
PD_1_082 times 2 dd 1.082392200292393968799446
PD_2_613 times 2 dd 2.613125929752753055713286
PD_RNDINT_MAGIC times 2 dd 100663296.0 ; (float)(0x00C00000 << 3)
PB_CENTERJSAMP times 8 db CENTERJSAMPLE
alignz 16
; --------------------------------------------------------------------------
SECTION SEG_TEXT
BITS 32
;
; Perform dequantization and inverse DCT on one block of coefficients.
;
; GLOBAL(void)
; jsimd_idct_float_3dnow (void * dct_table, JCOEFPTR coef_block,
; JSAMPARRAY output_buf, JDIMENSION output_col)
;
%define dct_table(b) (b)+8 ; void * dct_table
%define coef_block(b) (b)+12 ; JCOEFPTR coef_block
%define output_buf(b) (b)+16 ; JSAMPARRAY output_buf
%define output_col(b) (b)+20 ; JDIMENSION output_col
%define original_ebp ebp+0
%define wk(i) ebp-(WK_NUM-(i))*SIZEOF_MMWORD ; mmword wk[WK_NUM]
%define WK_NUM 2
%define workspace wk(0)-DCTSIZE2*SIZEOF_FAST_FLOAT
; FAST_FLOAT workspace[DCTSIZE2]
align 16
global EXTN(jsimd_idct_float_3dnow)
EXTN(jsimd_idct_float_3dnow):
push ebp
mov eax,esp ; eax = original ebp
sub esp, byte 4
and esp, byte (-SIZEOF_MMWORD) ; align to 64 bits
mov [esp],eax
mov ebp,esp ; ebp = aligned ebp
lea esp, [workspace]
push ebx
; push ecx ; need not be preserved
; push edx ; need not be preserved
push esi
push edi
get_GOT ebx ; get GOT address
; ---- Pass 1: process columns from input, store into work array.
; mov eax, [original_ebp]
mov edx, POINTER [dct_table(eax)] ; quantptr
mov esi, JCOEFPTR [coef_block(eax)] ; inptr
lea edi, [workspace] ; FAST_FLOAT * wsptr
mov ecx, DCTSIZE/2 ; ctr
alignx 16,7
.columnloop:
%ifndef NO_ZERO_COLUMN_TEST_FLOAT_3DNOW
mov eax, DWORD [DWBLOCK(1,0,esi,SIZEOF_JCOEF)]
or eax, DWORD [DWBLOCK(2,0,esi,SIZEOF_JCOEF)]
jnz short .columnDCT
pushpic ebx ; save GOT address
mov ebx, DWORD [DWBLOCK(3,0,esi,SIZEOF_JCOEF)]
mov eax, DWORD [DWBLOCK(4,0,esi,SIZEOF_JCOEF)]
or ebx, DWORD [DWBLOCK(5,0,esi,SIZEOF_JCOEF)]
or eax, DWORD [DWBLOCK(6,0,esi,SIZEOF_JCOEF)]
or ebx, DWORD [DWBLOCK(7,0,esi,SIZEOF_JCOEF)]
or eax,ebx
poppic ebx ; restore GOT address
jnz short .columnDCT
; -- AC terms all zero
movd mm0, DWORD [DWBLOCK(0,0,esi,SIZEOF_JCOEF)]
punpcklwd mm0,mm0
psrad mm0,(DWORD_BIT-WORD_BIT)
pi2fd mm0,mm0
pfmul mm0, MMWORD [MMBLOCK(0,0,edx,SIZEOF_FLOAT_MULT_TYPE)]
movq mm1,mm0
punpckldq mm0,mm0
punpckhdq mm1,mm1
movq MMWORD [MMBLOCK(0,0,edi,SIZEOF_FAST_FLOAT)], mm0
movq MMWORD [MMBLOCK(0,1,edi,SIZEOF_FAST_FLOAT)], mm0
movq MMWORD [MMBLOCK(0,2,edi,SIZEOF_FAST_FLOAT)], mm0
movq MMWORD [MMBLOCK(0,3,edi,SIZEOF_FAST_FLOAT)], mm0
movq MMWORD [MMBLOCK(1,0,edi,SIZEOF_FAST_FLOAT)], mm1
movq MMWORD [MMBLOCK(1,1,edi,SIZEOF_FAST_FLOAT)], mm1
movq MMWORD [MMBLOCK(1,2,edi,SIZEOF_FAST_FLOAT)], mm1
movq MMWORD [MMBLOCK(1,3,edi,SIZEOF_FAST_FLOAT)], mm1
jmp near .nextcolumn
alignx 16,7
%endif
.columnDCT:
; -- Even part
movd mm0, DWORD [DWBLOCK(0,0,esi,SIZEOF_JCOEF)]
movd mm1, DWORD [DWBLOCK(2,0,esi,SIZEOF_JCOEF)]
movd mm2, DWORD [DWBLOCK(4,0,esi,SIZEOF_JCOEF)]
movd mm3, DWORD [DWBLOCK(6,0,esi,SIZEOF_JCOEF)]
punpcklwd mm0,mm0
punpcklwd mm1,mm1
psrad mm0,(DWORD_BIT-WORD_BIT)
psrad mm1,(DWORD_BIT-WORD_BIT)
pi2fd mm0,mm0
pi2fd mm1,mm1
pfmul mm0, MMWORD [MMBLOCK(0,0,edx,SIZEOF_FLOAT_MULT_TYPE)]
pfmul mm1, MMWORD [MMBLOCK(2,0,edx,SIZEOF_FLOAT_MULT_TYPE)]
punpcklwd mm2,mm2
punpcklwd mm3,mm3
psrad mm2,(DWORD_BIT-WORD_BIT)
psrad mm3,(DWORD_BIT-WORD_BIT)
pi2fd mm2,mm2
pi2fd mm3,mm3
pfmul mm2, MMWORD [MMBLOCK(4,0,edx,SIZEOF_FLOAT_MULT_TYPE)]
pfmul mm3, MMWORD [MMBLOCK(6,0,edx,SIZEOF_FLOAT_MULT_TYPE)]
movq mm4,mm0
movq mm5,mm1
pfsub mm0,mm2 ; mm0=tmp11
pfsub mm1,mm3
pfadd mm4,mm2 ; mm4=tmp10
pfadd mm5,mm3 ; mm5=tmp13
pfmul mm1,[GOTOFF(ebx,PD_1_414)]
pfsub mm1,mm5 ; mm1=tmp12
movq mm6,mm4
movq mm7,mm0
pfsub mm4,mm5 ; mm4=tmp3
pfsub mm0,mm1 ; mm0=tmp2
pfadd mm6,mm5 ; mm6=tmp0
pfadd mm7,mm1 ; mm7=tmp1
movq MMWORD [wk(1)], mm4 ; tmp3
movq MMWORD [wk(0)], mm0 ; tmp2
; -- Odd part
movd mm2, DWORD [DWBLOCK(1,0,esi,SIZEOF_JCOEF)]
movd mm3, DWORD [DWBLOCK(3,0,esi,SIZEOF_JCOEF)]
movd mm5, DWORD [DWBLOCK(5,0,esi,SIZEOF_JCOEF)]
movd mm1, DWORD [DWBLOCK(7,0,esi,SIZEOF_JCOEF)]
punpcklwd mm2,mm2
punpcklwd mm3,mm3
psrad mm2,(DWORD_BIT-WORD_BIT)
psrad mm3,(DWORD_BIT-WORD_BIT)
pi2fd mm2,mm2
pi2fd mm3,mm3
pfmul mm2, MMWORD [MMBLOCK(1,0,edx,SIZEOF_FLOAT_MULT_TYPE)]
pfmul mm3, MMWORD [MMBLOCK(3,0,edx,SIZEOF_FLOAT_MULT_TYPE)]
punpcklwd mm5,mm5
punpcklwd mm1,mm1
psrad mm5,(DWORD_BIT-WORD_BIT)
psrad mm1,(DWORD_BIT-WORD_BIT)
pi2fd mm5,mm5
pi2fd mm1,mm1
pfmul mm5, MMWORD [MMBLOCK(5,0,edx,SIZEOF_FLOAT_MULT_TYPE)]
pfmul mm1, MMWORD [MMBLOCK(7,0,edx,SIZEOF_FLOAT_MULT_TYPE)]
movq mm4,mm2
movq mm0,mm5
pfadd mm2,mm1 ; mm2=z11
pfadd mm5,mm3 ; mm5=z13
pfsub mm4,mm1 ; mm4=z12
pfsub mm0,mm3 ; mm0=z10
movq mm1,mm2
pfsub mm2,mm5
pfadd mm1,mm5 ; mm1=tmp7
pfmul mm2,[GOTOFF(ebx,PD_1_414)] ; mm2=tmp11
movq mm3,mm0
pfadd mm0,mm4
pfmul mm0,[GOTOFF(ebx,PD_1_847)] ; mm0=z5
pfmul mm3,[GOTOFF(ebx,PD_2_613)] ; mm3=(z10 * 2.613125930)
pfmul mm4,[GOTOFF(ebx,PD_1_082)] ; mm4=(z12 * 1.082392200)
pfsubr mm3,mm0 ; mm3=tmp12
pfsub mm4,mm0 ; mm4=tmp10
; -- Final output stage
pfsub mm3,mm1 ; mm3=tmp6
movq mm5,mm6
movq mm0,mm7
pfadd mm6,mm1 ; mm6=data0=(00 01)
pfadd mm7,mm3 ; mm7=data1=(10 11)
pfsub mm5,mm1 ; mm5=data7=(70 71)
pfsub mm0,mm3 ; mm0=data6=(60 61)
pfsub mm2,mm3 ; mm2=tmp5
movq mm1,mm6 ; transpose coefficients
punpckldq mm6,mm7 ; mm6=(00 10)
punpckhdq mm1,mm7 ; mm1=(01 11)
movq mm3,mm0 ; transpose coefficients
punpckldq mm0,mm5 ; mm0=(60 70)
punpckhdq mm3,mm5 ; mm3=(61 71)
movq MMWORD [MMBLOCK(0,0,edi,SIZEOF_FAST_FLOAT)], mm6
movq MMWORD [MMBLOCK(1,0,edi,SIZEOF_FAST_FLOAT)], mm1
movq MMWORD [MMBLOCK(0,3,edi,SIZEOF_FAST_FLOAT)], mm0
movq MMWORD [MMBLOCK(1,3,edi,SIZEOF_FAST_FLOAT)], mm3
movq mm7, MMWORD [wk(0)] ; mm7=tmp2
movq mm5, MMWORD [wk(1)] ; mm5=tmp3
pfadd mm4,mm2 ; mm4=tmp4
movq mm6,mm7
movq mm1,mm5
pfadd mm7,mm2 ; mm7=data2=(20 21)
pfadd mm5,mm4 ; mm5=data4=(40 41)
pfsub mm6,mm2 ; mm6=data5=(50 51)
pfsub mm1,mm4 ; mm1=data3=(30 31)
movq mm0,mm7 ; transpose coefficients
punpckldq mm7,mm1 ; mm7=(20 30)
punpckhdq mm0,mm1 ; mm0=(21 31)
movq mm3,mm5 ; transpose coefficients
punpckldq mm5,mm6 ; mm5=(40 50)
punpckhdq mm3,mm6 ; mm3=(41 51)
movq MMWORD [MMBLOCK(0,1,edi,SIZEOF_FAST_FLOAT)], mm7
movq MMWORD [MMBLOCK(1,1,edi,SIZEOF_FAST_FLOAT)], mm0
movq MMWORD [MMBLOCK(0,2,edi,SIZEOF_FAST_FLOAT)], mm5
movq MMWORD [MMBLOCK(1,2,edi,SIZEOF_FAST_FLOAT)], mm3
.nextcolumn:
add esi, byte 2*SIZEOF_JCOEF ; coef_block
add edx, byte 2*SIZEOF_FLOAT_MULT_TYPE ; quantptr
add edi, byte 2*DCTSIZE*SIZEOF_FAST_FLOAT ; wsptr
dec ecx ; ctr
jnz near .columnloop
; -- Prefetch the next coefficient block
prefetch [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 0*32]
prefetch [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 1*32]
prefetch [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 2*32]
prefetch [esi + (DCTSIZE2-8)*SIZEOF_JCOEF + 3*32]
; ---- Pass 2: process rows from work array, store into output array.
mov eax, [original_ebp]
lea esi, [workspace] ; FAST_FLOAT * wsptr
mov edi, JSAMPARRAY [output_buf(eax)] ; (JSAMPROW *)
mov eax, JDIMENSION [output_col(eax)]
mov ecx, DCTSIZE/2 ; ctr
alignx 16,7
.rowloop:
; -- Even part
movq mm0, MMWORD [MMBLOCK(0,0,esi,SIZEOF_FAST_FLOAT)]
movq mm1, MMWORD [MMBLOCK(2,0,esi,SIZEOF_FAST_FLOAT)]
movq mm2, MMWORD [MMBLOCK(4,0,esi,SIZEOF_FAST_FLOAT)]
movq mm3, MMWORD [MMBLOCK(6,0,esi,SIZEOF_FAST_FLOAT)]
movq mm4,mm0
movq mm5,mm1
pfsub mm0,mm2 ; mm0=tmp11
pfsub mm1,mm3
pfadd mm4,mm2 ; mm4=tmp10
pfadd mm5,mm3 ; mm5=tmp13
pfmul mm1,[GOTOFF(ebx,PD_1_414)]
pfsub mm1,mm5 ; mm1=tmp12
movq mm6,mm4
movq mm7,mm0
pfsub mm4,mm5 ; mm4=tmp3
pfsub mm0,mm1 ; mm0=tmp2
pfadd mm6,mm5 ; mm6=tmp0
pfadd mm7,mm1 ; mm7=tmp1
movq MMWORD [wk(1)], mm4 ; tmp3
movq MMWORD [wk(0)], mm0 ; tmp2
; -- Odd part
movq mm2, MMWORD [MMBLOCK(1,0,esi,SIZEOF_FAST_FLOAT)]
movq mm3, MMWORD [MMBLOCK(3,0,esi,SIZEOF_FAST_FLOAT)]
movq mm5, MMWORD [MMBLOCK(5,0,esi,SIZEOF_FAST_FLOAT)]
movq mm1, MMWORD [MMBLOCK(7,0,esi,SIZEOF_FAST_FLOAT)]
movq mm4,mm2
movq mm0,mm5
pfadd mm2,mm1 ; mm2=z11
pfadd mm5,mm3 ; mm5=z13
pfsub mm4,mm1 ; mm4=z12
pfsub mm0,mm3 ; mm0=z10
movq mm1,mm2
pfsub mm2,mm5
pfadd mm1,mm5 ; mm1=tmp7
pfmul mm2,[GOTOFF(ebx,PD_1_414)] ; mm2=tmp11
movq mm3,mm0
pfadd mm0,mm4
pfmul mm0,[GOTOFF(ebx,PD_1_847)] ; mm0=z5
pfmul mm3,[GOTOFF(ebx,PD_2_613)] ; mm3=(z10 * 2.613125930)
pfmul mm4,[GOTOFF(ebx,PD_1_082)] ; mm4=(z12 * 1.082392200)
pfsubr mm3,mm0 ; mm3=tmp12
pfsub mm4,mm0 ; mm4=tmp10
; -- Final output stage
pfsub mm3,mm1 ; mm3=tmp6
movq mm5,mm6
movq mm0,mm7
pfadd mm6,mm1 ; mm6=data0=(00 10)
pfadd mm7,mm3 ; mm7=data1=(01 11)
pfsub mm5,mm1 ; mm5=data7=(07 17)
pfsub mm0,mm3 ; mm0=data6=(06 16)
pfsub mm2,mm3 ; mm2=tmp5
movq mm1,[GOTOFF(ebx,PD_RNDINT_MAGIC)] ; mm1=[PD_RNDINT_MAGIC]
pcmpeqd mm3,mm3
psrld mm3,WORD_BIT ; mm3={0xFFFF 0x0000 0xFFFF 0x0000}
pfadd mm6,mm1 ; mm6=roundint(data0/8)=(00 ** 10 **)
pfadd mm7,mm1 ; mm7=roundint(data1/8)=(01 ** 11 **)
pfadd mm0,mm1 ; mm0=roundint(data6/8)=(06 ** 16 **)
pfadd mm5,mm1 ; mm5=roundint(data7/8)=(07 ** 17 **)
pand mm6,mm3 ; mm6=(00 -- 10 --)
pslld mm7,WORD_BIT ; mm7=(-- 01 -- 11)
pand mm0,mm3 ; mm0=(06 -- 16 --)
pslld mm5,WORD_BIT ; mm5=(-- 07 -- 17)
por mm6,mm7 ; mm6=(00 01 10 11)
por mm0,mm5 ; mm0=(06 07 16 17)
movq mm1, MMWORD [wk(0)] ; mm1=tmp2
movq mm3, MMWORD [wk(1)] ; mm3=tmp3
pfadd mm4,mm2 ; mm4=tmp4
movq mm7,mm1
movq mm5,mm3
pfadd mm1,mm2 ; mm1=data2=(02 12)
pfadd mm3,mm4 ; mm3=data4=(04 14)
pfsub mm7,mm2 ; mm7=data5=(05 15)
pfsub mm5,mm4 ; mm5=data3=(03 13)
movq mm2,[GOTOFF(ebx,PD_RNDINT_MAGIC)] ; mm2=[PD_RNDINT_MAGIC]
pcmpeqd mm4,mm4
psrld mm4,WORD_BIT ; mm4={0xFFFF 0x0000 0xFFFF 0x0000}
pfadd mm3,mm2 ; mm3=roundint(data4/8)=(04 ** 14 **)
pfadd mm7,mm2 ; mm7=roundint(data5/8)=(05 ** 15 **)
pfadd mm1,mm2 ; mm1=roundint(data2/8)=(02 ** 12 **)
pfadd mm5,mm2 ; mm5=roundint(data3/8)=(03 ** 13 **)
pand mm3,mm4 ; mm3=(04 -- 14 --)
pslld mm7,WORD_BIT ; mm7=(-- 05 -- 15)
pand mm1,mm4 ; mm1=(02 -- 12 --)
pslld mm5,WORD_BIT ; mm5=(-- 03 -- 13)
por mm3,mm7 ; mm3=(04 05 14 15)
por mm1,mm5 ; mm1=(02 03 12 13)
movq mm2,[GOTOFF(ebx,PB_CENTERJSAMP)] ; mm2=[PB_CENTERJSAMP]
packsswb mm6,mm3 ; mm6=(00 01 10 11 04 05 14 15)
packsswb mm1,mm0 ; mm1=(02 03 12 13 06 07 16 17)
paddb mm6,mm2
paddb mm1,mm2
movq mm4,mm6 ; transpose coefficients(phase 2)
punpcklwd mm6,mm1 ; mm6=(00 01 02 03 10 11 12 13)
punpckhwd mm4,mm1 ; mm4=(04 05 06 07 14 15 16 17)
movq mm7,mm6 ; transpose coefficients(phase 3)
punpckldq mm6,mm4 ; mm6=(00 01 02 03 04 05 06 07)
punpckhdq mm7,mm4 ; mm7=(10 11 12 13 14 15 16 17)
pushpic ebx ; save GOT address
mov edx, JSAMPROW [edi+0*SIZEOF_JSAMPROW]
mov ebx, JSAMPROW [edi+1*SIZEOF_JSAMPROW]
movq MMWORD [edx+eax*SIZEOF_JSAMPLE], mm6
movq MMWORD [ebx+eax*SIZEOF_JSAMPLE], mm7
poppic ebx ; restore GOT address
add esi, byte 2*SIZEOF_FAST_FLOAT ; wsptr
add edi, byte 2*SIZEOF_JSAMPROW
dec ecx ; ctr
jnz near .rowloop
femms ; empty MMX/3DNow! state
pop edi
pop esi
; pop edx ; need not be preserved
; pop ecx ; need not be preserved
pop ebx
mov esp,ebp ; esp <- aligned ebp
pop esp ; esp <- original ebp
pop ebp
ret
; For some reason, the OS X linker does not honor the request to align the
; segment unless we do this.
align 16
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_425.asm | ljhsiun2/medusa | 9 | 93015 | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r14
push %r15
push %r8
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0xcd28, %r8
inc %r15
mov $0x6162636465666768, %rcx
movq %rcx, %xmm2
and $0xffffffffffffffc0, %r8
vmovntdq %ymm2, (%r8)
nop
nop
nop
nop
and $48177, %rbx
lea addresses_UC_ht+0x5190, %rsi
lea addresses_UC_ht+0x3d40, %rdi
and %r14, %r14
mov $69, %rcx
rep movsw
nop
nop
add %rdi, %rdi
lea addresses_A_ht+0x386c, %r8
and %rbx, %rbx
movb (%r8), %cl
nop
nop
dec %rcx
lea addresses_UC_ht+0x16050, %rsi
and %r8, %r8
mov $0x6162636465666768, %r15
movq %r15, (%rsi)
add %rcx, %rcx
lea addresses_WT_ht+0xe250, %r15
inc %rsi
mov $0x6162636465666768, %rbx
movq %rbx, (%r15)
nop
nop
and %rcx, %rcx
lea addresses_WT_ht+0x7ad0, %rsi
lea addresses_A_ht+0x4250, %rdi
nop
nop
nop
nop
nop
and %r12, %r12
mov $111, %rcx
rep movsb
nop
nop
nop
nop
nop
and %r14, %r14
lea addresses_D_ht+0x1a790, %rbx
inc %rsi
mov (%rbx), %rcx
nop
nop
nop
cmp %r15, %r15
lea addresses_UC_ht+0x42, %r14
cmp %rbx, %rbx
movb $0x61, (%r14)
nop
nop
nop
nop
and $41271, %rbx
lea addresses_normal_ht+0x15eec, %r8
nop
nop
nop
nop
and %rcx, %rcx
movups (%r8), %xmm0
vpextrq $1, %xmm0, %r14
sub %rsi, %rsi
lea addresses_UC_ht+0x3e50, %r12
nop
cmp %r15, %r15
mov (%r12), %rdi
inc %r8
lea addresses_A_ht+0x18408, %r14
nop
nop
mfence
mov (%r14), %r15w
and $2523, %r12
lea addresses_A_ht+0x1d250, %rsi
lea addresses_normal_ht+0x6d50, %rdi
clflush (%rdi)
nop
nop
nop
dec %r12
mov $82, %rcx
rep movsq
sub %r12, %r12
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r8
pop %r15
pop %r14
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r14
push %r15
push %r8
push %r9
push %rcx
push %rdx
// Store
lea addresses_D+0x12250, %rcx
clflush (%rcx)
nop
nop
nop
nop
nop
sub %r9, %r9
movb $0x51, (%rcx)
nop
nop
nop
nop
add $40106, %rcx
// Faulty Load
lea addresses_PSE+0x11a50, %rcx
clflush (%rcx)
nop
nop
nop
nop
inc %r11
mov (%rcx), %r14
lea oracles, %rcx
and $0xff, %r14
shlq $12, %r14
mov (%rcx,%r14,1), %r14
pop %rdx
pop %rcx
pop %r9
pop %r8
pop %r15
pop %r14
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 9}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 1}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_UC_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 9}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_WT_ht'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_A_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 2}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 4}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 2}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_normal_ht'}}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
|
Lab_5/Forum(Notes)/MACROS.asm | nickbel7/ntua-microprocessors-systems | 0 | 241384 | <filename>Lab_5/Forum(Notes)/MACROS.asm
; Microcomputer Systems - Flow Y [6th Semester]
; <NAME> - 031 17 198 - <EMAIL>
; <NAME> - 031 17 165 - <EMAIL>
; 5th Group of Exercises
; BASIC MACROS TO INCLUDE FOR EASY USE IN EXERCISES
; PRINT CHAR
PRINT MACRO CHAR
PUSH AX
PUSH DX
MOV DL,CHAR
MOV AH,2
INT 21H
POP DX
POP AX
ENDM PRINT
; EXIT TO DOS
EXIT MACRO
MOV AX,4C00H
INT 21H
ENDM EXIT
; PRINT STRING
PRNT_STR MACRO STRING
MOV DX,OFFSET STRING
MOV AH,9
INT 21H
ENDM PRNT_STR
; READ ASCII CODED DIGIT
READ MACRO
MOV AH,8
INT 21H
ENDM READ |
alarm.applescript | bendodson/Apple-TV-Alarm-Clock | 28 | 3486 | <reponame>bendodson/Apple-TV-Alarm-Clock
set AirplayDeviceName to "Kitchen"
set PlaylistName to "5 Star Music"
set AirplayVolume to 100
set EnableShuffle to true
-- Ready up Music App
tell application "Music"
activate
set visible of front browser window to true
set the view of the front browser window to playlist PlaylistName
set shuffle enabled to EnableShuffle
end tell
-- Set up Airplay
tell application "Music"
set AirplayNames to (get name of AirPlay devices)
set AirplayDevices to (get AirPlay devices)
set AirplayToPlay to {}
repeat with i from 1 to length of AirplayNames
if item i of AirplayNames as string = AirplayDeviceName then set end of AirplayToPlay to item i of AirplayDevices
end repeat
set current AirPlay devices to AirplayToPlay
end tell
-- Play the music
tell application "Music"
play playlist PlaylistName
set the sound volume to AirplayVolume
end tell |
alloy4fun_models/trashltl/models/5/EWr3eS7JpYe8dYAZ4.als | Kaixi26/org.alloytools.alloy | 0 | 37 | open main
pred idEWr3eS7JpYe8dYAZ4_prop6 {
all f : File | f in Trash implies always f in Trash
}
pred __repair { idEWr3eS7JpYe8dYAZ4_prop6 }
check __repair { idEWr3eS7JpYe8dYAZ4_prop6 <=> prop6o } |
sbsext/ut/cksep.asm | olifink/smsqe | 0 | 3183 | <filename>sbsext/ut/cksep.asm
* Check separators V0.5 1984 <NAME> QJUMP
*
* check if parameter is preceded by a given separator
*
section utils
*
xdef ut_ckcomma
xdef ut_ckto
xdef ut_cksemi
xdef ut_cksep
*
include dev8_sbsext_ext_keys
include dev8_sbsext_ext_ex_defs
*
ut_ckcomma
moveq #%00010000,d0 check for comma
bra.s ut_cksep (hash permitted)
ut_ckto
moveq #%01010000,d0 check for to
bra.s ut_cksep
ut_cksemi
moveq #%00100000,d0 check for semicolon
tst.b 1(a6,a3.l) is it preceded by a #?
bmi.s ut_ckbp ... yes
ut_cksep
cmp.l parm_st+4(sp),a3
ble.s ut_ckbp it is the first parameter, preceded by no sep
moveq #%01110000,d1 mask out all but the separator
and.b -7(a6,a3.l),d1 ... from previous entry
sub.b d1,d0 and set d0 to 0 if equal
beq.s ut_ckrts
ut_ckbp
moveq #err.bp,d0 otherwise err.bp
ut_ckrts
rts
end
|
libsrc/graphics/cpc/clrarea.asm | andydansby/z88dk-mk2 | 1 | 20531 | <filename>libsrc/graphics/cpc/clrarea.asm
xlib cleararea
INCLUDE "cpcfirm.def"
INCLUDE "graphics/grafix.inc"
;
; $Id: clrarea.asm,v 1.2 2009/06/22 21:44:17 dom Exp $
;
; ***********************************************************************
;
; Clear specified graphics area in map.
; Generic version
;
; <NAME> - March 2002
;
;
; IN: HL = (x,y)
; BC = (width,heigth)
;
.cleararea
dec b ; centered experimentally
dec b
dec b
dec c
push hl
push bc
call firmware
defw gra_get_w_width
ld (wwde+1),de
ld (wwhl+1),hl
call firmware
defw gra_get_w_height
ld (whde+1),de
ld (whhl+1),hl
pop bc
pop hl
push hl
push bc
xor a
ld l,h
ld e,b
ld h,a ; 0
ld d,a ; 0
add hl,hl
push hl
add hl,de
add hl,de
pop de
ex de,hl
call firmware
defw gra_win_width
pop de
pop bc
ld hl,maxy
xor a
sbc hl,bc
;xor a
ld h,a ; 0
ld d,a ; 0
add hl,hl
push hl
sbc hl,de
sbc hl,de
pop de
ex de,hl
call firmware
defw gra_win_height
call firmware
defw gra_clear_window
.wwde ld de,0
.wwhl ld hl,0
call firmware
defw gra_win_width
.whde ld de,0
.whhl ld hl,0
call firmware
defw gra_win_height
ret
|
Functional/Combinations.agda | Lolirofle/stuff-in-agda | 6 | 6180 | module Functional.Combinations where
open import Type
-- TODO: Generalize these. Probably by lists and foldᵣ of combination and rotation construction functions. Also categorically or dependently
rotate₃Fn₃Op₂ : ∀{ℓ₁ ℓ₂}{A : Type{ℓ₁}}{B : Type{ℓ₂}} → (A → A → A → B) → (B → B → B) → (A → A → A → B)
rotate₃Fn₃Op₂(F)(_▫_) a b c = (F a b c) ▫ ((F b c a) ▫ (F c a b))
combine₃Fn₂Op₂ : ∀{ℓ₁ ℓ₂}{A : Type{ℓ₁}}{B : Type{ℓ₂}} → (A → A → B) → (B → B → B) → (A → A → A → B)
combine₃Fn₂Op₂(F)(_▫_) a b c = (F a b) ▫ ((F a c) ▫ (F b c))
all₃Fn₁Op₂ : ∀{ℓ₁ ℓ₂}{A : Type{ℓ₁}}{B : Type{ℓ₂}} → (A → B) → (B → B → B) → (A → A → A → B)
all₃Fn₁Op₂(F)(_▫_) a b c = (F a) ▫ ((F b) ▫ (F c))
combine₄Fn₃Op₂ : ∀{ℓ₁ ℓ₂}{A : Type{ℓ₁}}{B : Type{ℓ₂}} → (A → A → A → B) → (B → B → B) → (A → A → A → A → B)
combine₄Fn₃Op₂(F)(_▫_) a b c d = (F a b c) ▫ ((F a b d) ▫ ((F a c d) ▫ (F b c d)))
|
lib/Runtime/Language/arm64/arm64_Thunks.asm | Taritsyn/ChakraCore | 8,664 | 179586 | <reponame>Taritsyn/ChakraCore
;-------------------------------------------------------------------------------------------------------
; Copyright (C) Microsoft. All rights reserved.
; Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
;-------------------------------------------------------------------------------------------------------
OPT 2 ; disable listing
#include "ksarm64.h"
OPT 1 ; re-enable listing
TTL Lib\Runtime\Language\arm64\arm64_DelayDynamicInterpreterThunk.asm
;Var InterpreterStackFrame::DelayDynamicInterpreterThunk(RecyclableObject* function, CallInfo callInfo, ...)
EXPORT |?DelayDynamicInterpreterThunk@InterpreterStackFrame@Js@@SAPEAXPEAVRecyclableObject@2@UCallInfo@2@ZZ|
;Var DynamicProfileInfo::EnsureDynamicProfileInfoThunk(RecyclableObject* function, CallInfo callInfo, ...)
EXPORT |?EnsureDynamicProfileInfoThunk@DynamicProfileInfo@Js@@SAPEAXPEAVRecyclableObject@2@UCallInfo@2@ZZ|
; Var ScriptContext::ProfileModeDeferredParsingThunk(RecyclableObject* function, CallInfo callInfo, ...)
EXPORT |?ProfileModeDeferredParsingThunk@ScriptContext@Js@@SAPEAXPEAVRecyclableObject@2@UCallInfo@2@ZZ|
; Var InterpreterStackFrame::StaticInterpreterThunk(RecyclableObject* function, CallInfo callInfo)
EXPORT |?StaticInterpreterThunk@InterpreterStackFrame@Js@@SAPEAXPEAVRecyclableObject@2@UCallInfo@2@ZZ|
;JavascriptMethod InterpreterStackFrame::EnsureDynamicInterpreterThunk(Js::ScriptFunction * function)
IMPORT |?EnsureDynamicInterpreterThunk@InterpreterStackFrame@Js@@CAP6APEAXPEAVRecyclableObject@2@UCallInfo@2@ZZPEAVScriptFunction@2@@Z|
;JavascriptMethod DynamicProfileInfo::EnsureDynamicProfileInfoThunk(Js::ScriptFunction * function)
IMPORT |?EnsureDynamicProfileInfo@DynamicProfileInfo@Js@@CAP6APEAXPEAVRecyclableObject@2@UCallInfo@2@ZZPEAVScriptFunction@2@@Z|
;JavascriptMethod ScriptContext::ProfileModeDeferredParse(ScriptFunction **function)
IMPORT |?ProfileModeDeferredParse@ScriptContext@Js@@SAP6APEAXPEAVRecyclableObject@2@UCallInfo@2@ZZPEAPEAVScriptFunction@2@@Z|
;JavascriptMethod ScriptContext::ProfileModeDeferredDeserialize(ScriptFunction *function)
IMPORT |?ProfileModeDeferredDeserialize@ScriptContext@Js@@SAP6APEAXPEAVRecyclableObject@2@UCallInfo@2@ZZPEAVScriptFunction@2@@Z|
;Var InterpreterStackFrame::InterpreterThunk(JavascriptCallStackLayout* layout)
IMPORT |?InterpreterThunk@InterpreterStackFrame@Js@@SAPEAXPEAVJavascriptCallStackLayout@2@@Z|
TEXTAREA
;;============================================================================================================
;; InterpreterStackFrame::DelayDynamicInterpreterThunk
;;============================================================================================================
;Var InterpreterStackFrame::DelayDynamicInterpreterThunk(RecyclableObject* function, CallInfo callInfo, ...)
NESTED_ENTRY ?DelayDynamicInterpreterThunk@InterpreterStackFrame@Js@@SAPEAXPEAVRecyclableObject@2@UCallInfo@2@ZZ
PROLOG_SAVE_REG_PAIR fp, lr, #-80! ; save volatile registers
stp x0, x1, [sp, #16]
stp x2, x3, [sp, #32]
stp x4, x5, [sp, #48]
stp x6, x7, [sp, #64]
bl |?EnsureDynamicInterpreterThunk@InterpreterStackFrame@Js@@CAP6APEAXPEAVRecyclableObject@2@UCallInfo@2@ZZPEAVScriptFunction@2@@Z| ; call InterpreterStackFrame::EnsureDynamicInterpreterThunk
mov x16, x0 ; back up entryPoint in x16
ldp x6, x7, [sp, #64] ; restore arguments and return address
ldp x4, x5, [sp, #48]
ldp x2, x3, [sp, #32]
ldp x0, x1, [sp, #16]
EPILOG_RESTORE_REG_PAIR fp, lr, #80!
EPILOG_NOP br x16 ; jump (tail call) to new entryPoint
NESTED_END
;;============================================================================================================
;; DynamicProfileInfo::EnsureDynamicProfileInfoThunk
;;============================================================================================================
;Var DynamicProfileInfo::EnsureDynamicProfileInfoThunk(RecyclableObject* function, CallInfo callInfo, ...)
NESTED_ENTRY ?EnsureDynamicProfileInfoThunk@DynamicProfileInfo@Js@@SAPEAXPEAVRecyclableObject@2@UCallInfo@2@ZZ
PROLOG_SAVE_REG_PAIR fp, lr, #-80! ; save volatile registers
stp x0, x1, [sp, #16]
stp x2, x3, [sp, #32]
stp x4, x5, [sp, #48]
stp x6, x7, [sp, #64]
bl |?EnsureDynamicProfileInfo@DynamicProfileInfo@Js@@CAP6APEAXPEAVRecyclableObject@2@UCallInfo@2@ZZPEAVScriptFunction@2@@Z| ; call DynamicProfileInfo::EnsureDynamicProfileInfo
mov x16, x0 ; back up entryPoint in x16
ldp x6, x7, [sp, #64] ; restore arguments and return address
ldp x4, x5, [sp, #48]
ldp x2, x3, [sp, #32]
ldp x0, x1, [sp, #16]
EPILOG_RESTORE_REG_PAIR fp, lr, #80!
EPILOG_NOP br x16 ; jump (tail call) to new entryPoint
NESTED_END
;;============================================================================================================
;; ScriptContext::ProfileModeDeferredParsingThunk
;;============================================================================================================
;; Var ScriptContext::ProfileModeDeferredParsingThunk(RecyclableObject* function, CallInfo callInfo, ...)
NESTED_ENTRY ?ProfileModeDeferredParsingThunk@ScriptContext@Js@@SAPEAXPEAVRecyclableObject@2@UCallInfo@2@ZZ
PROLOG_SAVE_REG_PAIR fp, lr, #-80! ; save volatile registers
stp x0, x1, [sp, #16]
stp x2, x3, [sp, #32]
stp x4, x5, [sp, #48]
stp x6, x7, [sp, #64]
mov x0, sp ; Pass the address of the function at the saved x0 in case it need to be boxed
add x0, x0, #16 ; 16 is subtracted from the stack pointer when the a function is called, add it back here.
bl |?ProfileModeDeferredParse@ScriptContext@Js@@SAP6APEAXPEAVRecyclableObject@2@UCallInfo@2@ZZPEAPEAVScriptFunction@2@@Z| ; call ScriptContext::ProfileModeDeferredParse
mov x16, x0 ; back up entryPoint in x16
ldp x6, x7, [sp, #64] ; restore arguments and return address
ldp x4, x5, [sp, #48]
ldp x2, x3, [sp, #32]
ldp x0, x1, [sp, #16]
EPILOG_RESTORE_REG_PAIR fp, lr, #80!
EPILOG_NOP br x16 ; jump (tail call) to new entryPoint
NESTED_END
;;============================================================================================================
;; ScriptContext::ProfileModeDeferredDeserializeThunk
;;============================================================================================================
;; Var ScriptContext::ProfileModeDeferredDeserializeThunk(RecyclableObject* function, CallInfo callInfo, ...)
NESTED_ENTRY ?ProfileModeDeferredDeserializeThunk@ScriptContext@Js@@SAPEAXPEAVRecyclableObject@2@UCallInfo@2@ZZ
PROLOG_SAVE_REG_PAIR fp, lr, #-80! ; save volatile registers
stp x0, x1, [sp, #16]
stp x2, x3, [sp, #32]
stp x4, x5, [sp, #48]
stp x6, x7, [sp, #64]
bl |?ProfileModeDeferredDeserialize@ScriptContext@Js@@SAP6APEAXPEAVRecyclableObject@2@UCallInfo@2@ZZPEAVScriptFunction@2@@Z| ; call ScriptContext::ProfileModeDeferredDeserialize
mov x16, x0 ; back up entryPoint in x16
ldp x6, x7, [sp, #64] ; restore arguments and return address
ldp x4, x5, [sp, #48]
ldp x2, x3, [sp, #32]
ldp x0, x1, [sp, #16]
EPILOG_RESTORE_REG_PAIR fp, lr, #80!
EPILOG_NOP br x16 ; jump (tail call) to new entryPoint
NESTED_END
;;============================================================================================================
;; InterpreterStackFrame::StaticInterpreterThunk
;;============================================================================================================
;; Var InterpreterStackFrame::StaticInterpreterThunk(RecyclableObject* function, CallInfo callInfo, ...)
NESTED_ENTRY ?StaticInterpreterThunk@InterpreterStackFrame@Js@@SAPEAXPEAVRecyclableObject@2@UCallInfo@2@ZZ
PROLOG_SAVE_REG_PAIR fp, lr, #-80!
stp x0, x1, [sp, #16]
stp x2, x3, [sp, #32]
stp x4, x5, [sp, #48]
stp x6, x7, [sp, #64]
add x0, sp, #16
bl |?InterpreterThunk@InterpreterStackFrame@Js@@SAPEAXPEAVJavascriptCallStackLayout@2@@Z| ; call InterpreterStackFrame::InterpreterThunk
EPILOG_RESTORE_REG_PAIR fp, lr, #80!
EPILOG_RETURN
NESTED_END
;;============================================================================================================
END
|
src/bintoasc-base85.adb | jhumphry/Ada_BinToAsc | 0 | 25348 | <gh_stars>0
-- BinToAsc.Base85
-- Various binary data to ASCII codecs known as Base85, ASCII85 etc
-- Copyright (c) 2015, <NAME> - see LICENSE file for details
package body BinToAsc.Base85 is
Reverse_Alphabet : constant Reverse_Alphabet_Lookup
:= Make_Reverse_Alphabet(Alphabet, True);
type Bin_Frame is mod 2**32;
subtype String_Frame is String(1..5);
--
-- Base85_To_String
--
procedure Reset (C : out Base85_To_String) is
begin
C := (State => Ready,
Next_Index => 0,
Buffer => (others => 0));
end Reset;
procedure Process
(C : in out Base85_To_String;
Input : in Bin;
Output : out String;
Output_Length : out Natural)
is
Input_Frame : Bin_Frame;
Output_Frame : String_Frame;
begin
C.Buffer(C.Next_Index) := Input;
if C.Next_Index /= 3 then
Output := (others => ' ');
Output_Length := 0;
C.Next_Index := C.Next_Index + 1;
else
C.Next_Index := 0;
Input_Frame := Bin_Frame(C.Buffer(0)) * 2**24 or
Bin_Frame(C.Buffer(1)) * 2**16 or
Bin_Frame(C.Buffer(2)) * 2**8 or
Bin_Frame(C.Buffer(3));
for I in reverse 1..5 loop
Output_Frame(I) := Alphabet(Bin(Input_Frame mod 85));
Input_Frame := Input_Frame / 85;
end loop;
Output(Output'First..Output'First + 4) := Output_Frame;
Output_Length := 5;
end if;
end Process;
procedure Process
(C : in out Base85_To_String;
Input : in Bin_Array;
Output : out String;
Output_Length : out Natural)
is
Input_Frame : Bin_Frame;
Output_Frame : String_Frame;
Output_Index : Integer := Output'First;
begin
for I in Input'Range loop
C.Buffer(C.Next_Index) := Input(I);
if C.Next_Index /= 3 then
C.Next_Index := C.Next_Index + 1;
else
C.Next_Index := 0;
Input_Frame := Bin_Frame(C.Buffer(0)) * 2**24 or
Bin_Frame(C.Buffer(1)) * 2**16 or
Bin_Frame(C.Buffer(2)) * 2**8 or
Bin_Frame(C.Buffer(3));
for I in reverse 1..5 loop
Output_Frame(I) := Alphabet(Bin(Input_Frame mod 85));
Input_Frame := Input_Frame / 85;
end loop;
Output (Output_Index .. Output_Index + 4) := Output_Frame;
Output_Index := Output_Index + 5;
end if;
end loop;
Output_Length := Output_Index - Output'First;
end Process;
procedure Complete
(C : in out Base85_To_String;
Output : out String;
Output_Length : out Natural)
is
Input_Frame : Bin_Frame;
Output_Frame : String_Frame;
begin
C.State := Completed;
if C.Next_Index = 0 then
Output_Length := 0;
Output := (others => ' ');
else
C.Buffer(C.Next_Index .. 3) := (others => 0);
Input_Frame := Bin_Frame(C.Buffer(0)) * 2**24 or
Bin_Frame(C.Buffer(1)) * 2**16 or
Bin_Frame(C.Buffer(2)) * 2**8 or
Bin_Frame(C.Buffer(3));
for I in reverse 1..5 loop
Output_Frame(I) := Alphabet(Bin(Input_Frame mod 85));
Input_Frame := Input_Frame / 85;
end loop;
Output(Output'First..Output'First + 4) := Output_Frame;
Output_Length := 5 - (4 - Integer(C.Next_Index));
end if;
end Complete;
function To_String_Private is
new BinToAsc.To_String(Codec => Base85_To_String);
function To_String (Input : in Bin_Array) return String
renames To_String_Private;
--
-- Base85_To_Bin
--
procedure Reset (C : out Base85_To_Bin) is
begin
C := (State => Ready,
Next_Index => 0,
Buffer => (others => 0));
end Reset;
procedure Process (C : in out Base85_To_Bin;
Input : in Character;
Output : out Bin_Array;
Output_Length : out Bin_Array_Index)
is
Input_Bin : Bin;
Output_Frame : Bin_Frame;
MSB_Limit : Bin_Frame;
begin
Input_Bin := Reverse_Alphabet(Input);
if Input_Bin = Invalid_Character_Input then
C.State := Failed;
Output := (others => 0);
Output_Length := 0;
else
C.Buffer(C.Next_Index) := Input_Bin;
if C.Next_Index /= 4 then
Output := (others => 0);
Output_Length := 0;
C.Next_Index := C.Next_Index + 1;
else
C.Next_Index := 0;
Output_Frame := Bin_Frame(C.Buffer(4)) +
Bin_Frame(C.Buffer(3)) * 85 +
Bin_Frame(C.Buffer(2)) * 85 * 85 +
Bin_Frame(C.Buffer(1)) * 85 * 85 * 85;
MSB_Limit := (not Output_Frame) / (85*85*85*85);
if Bin_Frame(C.Buffer(0)) > MSB_Limit then
C.State := Failed;
Output := (others => 0);
Output_Length := 0;
else
Output_Frame := Output_Frame +
Bin_Frame(C.Buffer(0))*85*85*85*85;
Output(Output'First..Output'First+3) :=
(Bin((Output_Frame / 2**24)),
Bin((Output_Frame / 2**16) and 255),
Bin((Output_Frame / 2**8) and 255),
Bin((Output_Frame) and 255),
others => 0);
Output_Length := 4;
end if;
end if;
end if;
end Process;
procedure Process (C : in out Base85_To_Bin;
Input : in String;
Output : out Bin_Array;
Output_Length : out Bin_Array_Index)
is
Input_Bin : Bin;
Output_Frame : Bin_Frame;
MSB_Limit : Bin_Frame;
Output_Index : Bin_Array_Index := Output'First;
begin
for I in Input'Range loop
Input_Bin := Reverse_Alphabet(Input(I));
if Input_Bin = Invalid_Character_Input then
C.State := Failed;
exit;
end if;
C.Buffer(C.Next_Index) := Input_Bin;
if C.Next_Index /= 4 then
C.Next_Index := C.Next_Index + 1;
else
C.Next_Index := 0;
Output_Frame := Bin_Frame(C.Buffer(4)) +
Bin_Frame(C.Buffer(3)) * 85 +
Bin_Frame(C.Buffer(2)) * 85 * 85 +
Bin_Frame(C.Buffer(1)) * 85 * 85 * 85;
MSB_Limit := (not Output_Frame) / (85*85*85*85);
if Bin_Frame(C.Buffer(0)) > MSB_Limit then
C.State := Failed;
exit;
else
Output_Frame := Output_Frame +
Bin_Frame(C.Buffer(0))*85*85*85*85;
Output(Output_Index..Output_Index+3) :=
(
Bin((Output_Frame / 2**24)),
Bin((Output_Frame / 2**16) and 255),
Bin((Output_Frame / 2**8) and 255),
Bin((Output_Frame) and 255)
);
Output_Index := Output_Index + 4;
end if;
end if;
end loop;
if C.State = Failed then
Output := (others => 0);
Output_Length := 0;
else
Output(Output_Index .. Output'Last) := (others => 0);
Output_Length := Output_Index - Output'First;
end if;
end Process;
procedure Complete (C : in out Base85_To_Bin;
Output : out Bin_Array;
Output_Length : out Bin_Array_Index)
is
Output_Frame : Bin_Frame;
MSB_Limit : Bin_Frame;
begin
if C.State = Ready then
if C.Next_Index = 0 then
Output := (others => 0);
Output_Length := 0;
C.State := Completed;
elsif C.Next_Index = 1 then
-- This is an invalid state as one Base85 character is not enough
-- to represent a single byte.
Output := (others => 0);
Output_Length := 0;
C.State := Failed;
else
C.Buffer(C.Next_Index .. 4) := (others => 84);
-- Note padding must be all ones for decoding even though it
-- was all zeros for encoding. Base85 <-> Binary is not a
-- simple rearrangement of bits so high and low bits can interact.
Output_Frame := Bin_Frame(C.Buffer(4)) +
Bin_Frame(C.Buffer(3)) * 85 +
Bin_Frame(C.Buffer(2)) * 85 * 85 +
Bin_Frame(C.Buffer(1)) * 85 * 85 * 85;
MSB_Limit := (not Output_Frame) / (85*85*85*85);
if Bin_Frame(C.Buffer(0)) > MSB_Limit then
Output := (others => 0);
Output_Length := 0;
C.State := Failed;
else
Output_Frame := Output_Frame +
Bin_Frame(C.Buffer(0))*85*85*85*85;
Output :=
(Bin((Output_Frame / 2**24)),
Bin((Output_Frame / 2**16) and 255),
Bin((Output_Frame / 2**8) and 255),
Bin((Output_Frame) and 255),
others => 0);
Output_Length := Bin_Array_Index(C.Next_Index - 1);
C.State := Completed;
end if;
end if;
else
Output := (others => 0);
Output_Length := 0;
end if;
end Complete;
function To_Bin_Private is new BinToAsc.To_Bin(Codec => Base85_To_Bin);
function To_Bin (Input : in String) return Bin_Array renames To_Bin_Private;
begin
-- The following Compile_Time_Error test is silently ignored by GNAT GPL 2015,
-- although it does appear to be a static boolean expression as required by
-- the user guide. It works if converted to a run-time test so it has been
-- left in, in the hope that in a future version of GNAT it will actually be
-- tested.
pragma Warnings (GNATprove, Off, "Compile_Time_Error");
pragma Compile_Time_Error ((for some X in 1..Alphabet'Last =>
(for some Y in 0..X-1 =>
Alphabet(Y) = Alphabet(X)
)
),
"Duplicate letter in alphabet for Base85 codec.");
pragma Warnings (GNATprove, On, "Compile_Time_Error");
end BinToAsc.Base85;
|
programs/oeis/319/A319014.asm | jmorken/loda | 1 | 29348 | <reponame>jmorken/loda<filename>programs/oeis/319/A319014.asm
; A319014: a(n) = 1*2*3 + 4*5*6 + 7*8*9 + 10*11*12 + 13*14*15 + 16*17*18 + ... + (up to n).
; 1,2,6,10,26,126,133,182,630,640,740,1950,1963,2132,4680,4696,4952,9576,9595,9956,17556,17578,18062,29700,29725,30350,47250,47278,48062,71610,71641,72602,104346,104380,105536,147186,147223,148592,202020,202060,203660,270900,270943,272792,356040,356086,358202,459816,459865,462266,584766,584818,587522,733590,733645,736670,909150,909208,912572,1114470,1114531,1118252,1352736,1352800,1356896,1627296,1627363,1631852,1941660,1941730,1946630,2299500,2299573,2304902,2704650,2704726,2710502,3161106,3161185,3167426,3673026,3673108,3679832,4244730,4244815,4252040,4880700,4880788,4888532,5585580,5585671,5593952,6364176,6364270,6373106,7221456,7221553,7230962,8162550,8162650,8172650,9192750,9192853,9203462,10317510,10317616,10328852,11542446,11542555,11554436,12873336,12873448,12885992,14316120,14316235,14329460,15876900,15877018,15890942,17561940,17562061,17576702,19377666,19377790,19393166,21330666,21330793,21346922,23427690,23427820,23444720,25675650,25675783,25693472,28081620,28081756,28100252,30652836,30652975,30672296,33396696,33396838,33417002,36320760,36320905,36341930,39432750,39432898,39454802,42740550,42740701,42763502,46252206,46252360,46276076,49975926,49976083,50000732,53920080,53920240,53945840,58093200,58093363,58119932,62503980,62504146,62531702,67161276,67161445,67190006,72074106,72074278,72103862,77251650,77251825,77282450,82703250,82703428,82735112,88438410,88438591,88471352,94466796,94466980,94500836,100798236,100798423,100833392,107442720,107442910,107479010,114410400,114410593,114447842,121711590,121711786,121750202,129356766,129356965,129396566,137356566,137356768,137397572,145721790,145721995,145764020,154463400,154463608,154506872,163592520,163592731,163637252,173120436,173120650,173166446,183058596,183058813,183105902,193418610,193418830,193467230,204212250,204212473,204262202,215451450,215451676,215502752,227148306,227148535,227200976,239315076,239315308,239369132,251964180,251964415,252019640,265108200,265108438,265165082,278759880,278760121,278818202,292932126,292932370,292991906,307638006,307638253,307699262,322890750,322891000
mov $2,$0
add $2,1
mov $5,$0
lpb $2
mov $0,$5
sub $2,1
sub $0,$2
mov $3,$0
mov $4,$0
mod $4,3
sub $3,$4
add $3,1
mov $6,2
mul $6,$0
sub $6,$0
pow $6,$4
mul $6,$3
add $1,$6
lpe
|
src/pal.adb | dshadrin/AProxy | 1 | 11400 | <filename>src/pal.adb
----------------------------------------
-- Copyright (C) 2019 <NAME> --
-- All rights reserved. --
----------------------------------------
with Ada.Unchecked_Deallocation;
with Ada.Text_IO; use Ada.Text_IO;
--------------------------------------------------------------------------------
package body Pal is
package body Smart_Ptr is
procedure Free is new Ada.Unchecked_Deallocation (TypeName, SharedObject);
procedure Free is new Ada.Unchecked_Deallocation (uint32_t, uint32_Ptr);
--------------------------------------------------------------------------
procedure Initialize (obj : in out Shared_Ptr) is
begin
obj.pn := new uint32_t;
obj.pn.all := 1;
end Initialize;
--------------------------------------------------------------------------
procedure Adjust (obj : in out Shared_Ptr) is
var : aliased uint32_t;
begin
var := Atomic_Add_Fetch_32 (obj.pn, 1);
end Adjust;
--------------------------------------------------------------------------
procedure Finalize (obj : in out Shared_Ptr) is
begin
if Atomic_Sub_Fetch_32 (obj.pn, 1) = 0 then
Free (obj.pt);
Free (obj.pn);
end if;
end Finalize;
--------------------------------------------------------------------------
function Get (obj : in Shared_Ptr) return SharedObject is
begin
return obj.pt;
end Get;
--------------------------------------------------------------------------
function Make_Shared (ptr : in SharedObject) return Shared_Ptr is
obj : Shared_Ptr;
begin
obj.pt := ptr;
return obj;
end Make_Shared;
end Smart_Ptr;
end Pal;
|
server-go/filtering/parser/gen/FilterExpressionLexer.g4 | agv426/grafeas | 915 | 6226 | <gh_stars>100-1000
// Copyright 2018 The Grafeas Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
lexer grammar FilterExpressionLexer;
// Lexer Rules
// ===========
DOT : '.';
HAS : ':';
OR : 'OR';
AND : 'AND';
NOT : 'NOT';
LPAREN : '(';
RPAREN : ')';
LBRACE : '[';
RBRACE : ']';
LBRACKET : '{';
RBRACKET : '}';
COMMA : ',';
LESS_THAN : '<';
LESS_EQUALS : '<=';
GREATER_THAN : '>';
GREATER_EQUALS : '>=';
NOT_EQUALS : '!=';
EQUALS : '=';
EXCLAIM : '!';
MINUS : '-';
PLUS : '+';
STRING : '"' Character* '"';
WS : Whitespace;
DIGIT : Digit;
HEX_DIGIT : '0x' HexDigit+;
EXPONENT : Exponent;
TEXT : (StartChar | TextEsc) (MidChar | TextEsc)*;
BACKSLASH : '\\';
fragment Character
: ' ' | '!' | '#' .. '[' | ']' .. '~'
| CharactersFromU00A1
| TextEsc
| '\\' ('a' | 'b' | 'f' | 'n' | 'r' | 't' | 'v')?
| Whitespace
;
fragment TextEsc
: EscapedChar
| UnicodeEsc
| OctalEsc
| HexEsc
;
fragment UnicodeEsc
: '\\' 'u' HexDigit HexDigit HexDigit HexDigit
;
fragment OctalEsc
: '\\' [0-3]? OctalDigit? OctalDigit
;
fragment HexEsc
: '\\x' HexDigit HexDigit
;
fragment Digit
: [0-9]
;
fragment Exponent
: [eE] (PLUS|MINUS)? Digit+
;
fragment HexDigit
: Digit | [a-fA-F]
;
fragment OctalDigit
: [0-7]
;
fragment StartChar
: '#' .. '\''
| '*'
| '/'
| ';'
| '?'
| '@'
| [A-Z]
| '^' .. 'z'
| '|'
| CharactersFromU00A1
;
fragment MidChar
: StartChar
| Digit
| PLUS
| MINUS
;
fragment EscapedChar
: '\\' [:=<>+~"\\.*]
;
fragment Whitespace
: (' '|'\r'|'\t'|'\u000C'|'\n')
;
fragment CharactersFromU00A1
: '\u00A1' .. '\ufffe'
;
|
source/amf/mof/amf.ads | svn2github/matreshka | 24 | 19186 | <reponame>svn2github/matreshka<filename>source/amf/mof/amf.ads
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010-2012, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- Root package of Ada Modeling Framework.
--
-- This package contains declarations of primitive types corresponding to
-- types defined in PrimitiveTypes package and types to represent their
-- optional values (values with multiplicity 0..1).
--
-- Some primitive types are mapped implicitly:
--
-- - PrimitiveTypes::Boolean is mapped to Standard.Boolean;
--
-- - PrimitiveTypes::Integer is mapped to Standard.Integer;
--
-- - PrimitiveTypes::String is mapped to League.Strings.Universal_String.
--
------------------------------------------------------------------------------
with League.Strings;
package AMF is
pragma Preelaborate;
---------------------
-- Primitive types --
---------------------
type Real is new Long_Float;
type Unlimited_Natural (Unlimited : Boolean := False) is record
case Unlimited is
when False =>
Value : Natural;
when True =>
null;
end case;
end record;
Unlimited : constant Unlimited_Natural;
function "<"
(Left : Unlimited_Natural; Right : Unlimited_Natural) return Boolean;
function "<="
(Left : Unlimited_Natural; Right : Unlimited_Natural) return Boolean;
function ">"
(Left : Unlimited_Natural; Right : Unlimited_Natural) return Boolean;
function ">="
(Left : Unlimited_Natural; Right : Unlimited_Natural) return Boolean;
function "=" (Left : Unlimited_Natural; Right : Integer) return Boolean;
function "<" (Left : Unlimited_Natural; Right : Integer) return Boolean;
function "<=" (Left : Unlimited_Natural; Right : Integer) return Boolean;
function ">" (Left : Unlimited_Natural; Right : Integer) return Boolean;
function ">=" (Left : Unlimited_Natural; Right : Integer) return Boolean;
function "=" (Left : Integer; Right : Unlimited_Natural) return Boolean;
function "<" (Left : Integer; Right : Unlimited_Natural) return Boolean;
function "<=" (Left : Integer; Right : Unlimited_Natural) return Boolean;
function ">" (Left : Integer; Right : Unlimited_Natural) return Boolean;
function ">=" (Left : Integer; Right : Unlimited_Natural) return Boolean;
----------------------------------------
-- Optional values of primitive types --
----------------------------------------
type Optional_String (Is_Empty : Boolean := True) is record
case Is_Empty is
when True =>
null;
when False =>
Value : League.Strings.Universal_String;
end case;
end record;
function "="
(Left : Optional_String; Right : Optional_String) return Boolean;
function "="
(Left : Optional_String;
Right : League.Strings.Universal_String) return Boolean;
function "="
(Left : League.Strings.Universal_String;
Right : Optional_String) return Boolean;
function "<"
(Left : Optional_String; Right : Optional_String) return Boolean;
function "<"
(Left : Optional_String;
Right : League.Strings.Universal_String) return Boolean;
function "<"
(Left : League.Strings.Universal_String;
Right : Optional_String) return Boolean;
function "<="
(Left : Optional_String; Right : Optional_String) return Boolean;
function "<="
(Left : Optional_String;
Right : League.Strings.Universal_String) return Boolean;
function "<="
(Left : League.Strings.Universal_String;
Right : Optional_String) return Boolean;
function ">"
(Left : Optional_String; Right : Optional_String) return Boolean;
function ">"
(Left : Optional_String;
Right : League.Strings.Universal_String) return Boolean;
function ">"
(Left : League.Strings.Universal_String;
Right : Optional_String) return Boolean;
function ">="
(Left : Optional_String; Right : Optional_String) return Boolean;
function ">="
(Left : Optional_String;
Right : League.Strings.Universal_String) return Boolean;
function ">="
(Left : League.Strings.Universal_String;
Right : Optional_String) return Boolean;
type Optional_Boolean (Is_Empty : Boolean := True) is record
case Is_Empty is
when True =>
null;
when False =>
Value : Boolean;
end case;
end record;
type Optional_Integer (Is_Empty : Boolean := True) is record
case Is_Empty is
when True =>
null;
when False =>
Value : Integer;
end case;
end record;
function "=" (Left : Optional_Integer; Right : Integer) return Boolean;
function "=" (Left : Integer; Right : Optional_Integer) return Boolean;
type Optional_Unlimited_Natural (Is_Empty : Boolean := True) is record
case Is_Empty is
when True =>
null;
when False =>
Value : Unlimited_Natural;
end case;
end record;
function "="
(Left : Optional_Unlimited_Natural; Right : Integer) return Boolean;
function "="
(Left : Optional_Unlimited_Natural;
Right : Unlimited_Natural) return Boolean;
function "="
(Left : Optional_Unlimited_Natural;
Right : Optional_Integer) return Boolean;
function "="
(Left : Integer; Right : Optional_Unlimited_Natural) return Boolean;
function "="
(Left : Unlimited_Natural;
Right : Optional_Unlimited_Natural) return Boolean;
function "="
(Left : Optional_Integer;
Right : Optional_Unlimited_Natural) return Boolean;
type Optional_Real (Is_Empty : Boolean := True) is record
case Is_Empty is
when True =>
null;
when False =>
Value : Real;
end case;
end record;
private
Unlimited : constant Unlimited_Natural := (Unlimited => True);
end AMF;
|
Irvine/Examples/ch08/32 bit/Endless.asm | alieonsido/ASM_TESTING | 0 | 164492 | ; Endless Recursion (Endless.asm)
; This program demonstrates nonstop recursion. It
; causes a stack overflow.
.386
.model flat,stdcall
.stack 0FFFFFh
ExitProcess PROTO, dwExitCode:dword
.code
main PROC
call Endless
INVOKE ExitProcess, 0
main ENDP
.code
Endless PROC
call Endless
ret ; never reaches this line
Endless ENDP
END main |
windows/core/ntgdi/halftone/ht/i386/htstub.asm | npocmaka/Windows-Server-2003 | 17 | 9283 | <filename>windows/core/ntgdi/halftone/ht/i386/htstub.asm
PAGE 60, 132
TITLE Stub for halftone DLL
COMMENT `
Copyright (c) 1990-1991 Microsoft Corporation
Module Name:
htstub.asm
Abstract:
This module is provided as necessary for OS/2 as a DLL entry point
Author:
05-Apr-1991 Fri 15:55:08 created -by- <NAME> (danielc)
[Environment:]
Printer Driver.
[Notes:]
Revision History:
`
.XLIST
INCLUDE i386\i80x86.inc
.LIST
EndFunctionName CATSTR <>
IF HT_ASM_80x86
NeedStub = 0
IFDEF _OS2_
NeedStub = 1
ENDIF
IFDEF _OS_20_
NeedStub = 1
ENDIF
IF NeedStub
EndFunctionName CATSTR <HalftoneInitProc>
.CODE
extrn HalftoneInitProc:FAR
HalftoneDLLEntry proc FAR
push di ; push the hModule
call HalftoneInitProc
pop bx ; C calling convention
ret
HalftoneDLLEntry ENDP
ENDIF ; NeedStub
ENDIF ; HT_ASM_80x86
% END EndFunctionName ; make this one at offset 0
|
code/yellow.asm | FIX94/pkm-sound-visualizer | 2 | 98913 | <gh_stars>1-10
; Copyright (C) 2018 FIX94
;
; This software may be modified and distributed under the terms
; of the MIT license. See the LICENSE file for details.
SECTION "WRAM",ROM0[$DA7F]
;some game functions used
gameUpdateControls EQU $01B9
gamePlaySong EQU $2211
;some game variables used
gameUpdateOAMData EQU $CFCA
gameDisableWindowScroll EQU $D09F
;include our actual code
include "visualizer.asm"
|
handlebars/src/main/antlr4/com/github/jknack/handlebars/internal/HbsLexer.g4 | mcdan/handlebars.java | 0 | 3080 | lexer grammar HbsLexer;
@members {
// Some default values
String start = "{{";
String end = "}}";
boolean whiteSpaceControl;
public HbsLexer(CharStream input, String start, String end) {
this(input);
this.start = start;
this.end = end;
}
private boolean isWhite(int ch) {
return ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n';
}
private boolean consumeUntil(final String token) {
int offset = 0;
while(!isEOF(offset) && !(ahead("\\" + token, offset) || ahead(token, offset)) &&
!isWhite(_input.LA(offset + 1))) {
offset+=1;
}
if (offset == 0) {
return false;
}
// Since we found the text, increase the CharStream's index.
_input.seek(_input.index() + offset - 1);
getInterpreter().setCharPositionInLine(_tokenStartCharPositionInLine + offset - 1);
return true;
}
private boolean comment(final String start, final String end) {
String commentClose;
if (ahead(start + "!--")) {
commentClose = "--" + end;
} else if (ahead(start + "!")) {
commentClose = end;
} else {
return false;
}
int offset = 0;
while (!isEOF(offset)) {
if (ahead(commentClose, offset)) {
break;
}
offset += 1;
}
offset += commentClose.length();
// Since we found the text, increase the CharStream's index.
_input.seek(_input.index() + offset - 1);
getInterpreter().setCharPositionInLine(_tokenStartCharPositionInLine + offset - 1);
return true;
}
private boolean varEscape(final String start, final String end) {
if (ahead("\\" + start)) {
int offset = start.length();
while (!isEOF(offset)) {
if (ahead(end, offset)) {
break;
}
if (ahead(start, offset)) {
return false;
}
offset += 1;
}
offset += end.length();
// Since we found the text, increase the CharStream's index.
_input.seek(_input.index() + offset - 1);
getInterpreter().setCharPositionInLine(_tokenStartCharPositionInLine + offset - 1);
return true;
}
return false;
}
private boolean startToken(final String delim) {
boolean matches = tryToken(delim + "~");
if (matches) {
whiteSpaceControl = true;
}
return matches || tryToken(delim);
}
private boolean startToken(final String delim, String subtype) {
boolean matches = tryToken(delim + subtype);
if (!matches) {
matches = tryToken(delim + "~" + subtype);
if (matches) {
whiteSpaceControl = true;
}
}
return matches;
}
private boolean endToken(final String delim) {
return endToken(delim, "");
}
private boolean endToken(final String delim, String subtype) {
boolean matches = tryToken(subtype + delim);
if (!matches) {
matches = tryToken(subtype + "~" + delim);
if (matches) {
whiteSpaceControl = true;
}
}
return matches;
}
private boolean tryToken(final String text) {
if (ahead(text)) {
// Since we found the text, increase the CharStream's index.
_input.seek(_input.index() + text.length() - 1);
getInterpreter().setCharPositionInLine(_tokenStartCharPositionInLine + text.length() - 1);
return true;
}
return false;
}
private boolean isEOF(final int offset) {
return _input.LA(offset + 1) == EOF;
}
private boolean ahead(final String text) {
return ahead(text, 0);
}
private boolean ahead(final String text, int offset) {
// See if `text` is ahead in the CharStream.
for (int i = 0; i < text.length(); i++) {
int ch = _input.LA(i + offset + 1);
if (ch != text.charAt(i)) {
// Nope, we didn't find `text`.
return false;
}
}
return true;
}
}
ESC_VAR
: {varEscape(start, end)}? .
;
TEXT
: {consumeUntil(start)}? .
;
COMMENT
: {comment(start, end)}? .
;
START_AMP
:
{startToken(start, "&")}? . -> pushMode(VAR)
;
END_RAW_BLOCK
: {startToken(start, "{{/")}? . -> pushMode(VAR)
;
START_RAW
:
{startToken(start, "{{")}? . -> pushMode(VAR)
;
START_T
:
{startToken(start, "{")}? . -> pushMode(VAR)
;
UNLESS
: {startToken(start, "^")}? . -> pushMode(VAR)
;
START_PARTIAL_BLOCK
: {startToken(start, "#>")}? . -> pushMode(VAR)
;
START_BLOCK
: {startToken(start, "#")}? . -> pushMode(VAR)
;
START_DELIM
: {startToken(start, "=")}? . -> pushMode(SET_DELIMS)
;
START_PARTIAL
: {startToken(start, ">")}? . -> pushMode(VAR)
;
END_BLOCK
: {startToken(start, "/")}? . -> pushMode(VAR)
;
START
: {startToken(start)}? . -> pushMode(VAR)
;
SPACE
:
[ \t]+
;
NL
:
'\r'? '\n'
| '\r'
;
mode SET_DELIMS;
END_DELIM
:
{endToken("=" + end)}? . -> popMode
;
WS_DELIM
:
[ \t\r\n]
;
DELIM
:
.
;
mode RAW;
RAW_SPACE
:
[ \t\r\n]
;
RAW_CONTENT
:
{consumeUntil(start + "{{/")}? . -> popMode
;
mode VAR;
END_RAW
:
{endToken(end, "}}")}? . -> mode(RAW)
;
END_T
:
{endToken(end, "}")}? . -> popMode
;
END
:
{endToken(end)}? . -> mode(DEFAULT_MODE)
;
DECORATOR
:
'*'
;
AS
:
'as'
;
PIPE
:
'|'
;
DOUBLE_STRING
:
'"' ( '\\"' | ~[\n] )*? '"'
;
SINGLE_STRING
:
'\'' ( '\\\'' | ~[\n] )*? '\''
;
EQ
:
'='
;
INT
:
'-'? [0-9]+
;
BOOLEAN
:
'true'
| 'false'
;
ELSE
:
'~'? 'else' '~'?
;
QID
:
'../' QID
| '..'
| './' QID
| '.'
| '[' ID ']' ID_SEPARATOR QID
| '[' ID ']'
| ID ID_SEPARATOR QID
| ID
;
PATH
:
'[' PATH_SEGMENT ']'
| PATH_SEGMENT
;
fragment
PATH_SEGMENT
: [a-zA-Z0-9_$'/.:\-]+
;
fragment
ID_SEPARATOR
: ('.'|'/'|'-');
fragment
ID
:
ID_START ID_SUFFIX*
| ID_ESCAPE ID_SUFFIX*
;
fragment
ID_START
:
[a-zA-Z_$@]
;
fragment
ID_SUFFIX
:
'.' ID_ESCAPE
| ID_START
| ID_PART
| '-'
;
fragment
ID_ESCAPE
:
'[' ~[\]]+? ']'
;
fragment
ID_PART
:
[0-9./]
;
LP
:
'('
;
RP
:
')'
;
WS
: [ \t\r\n] -> skip
;
|
asmFiles/test.rtype.asm | hythzz/MIPS-Processor | 0 | 174332 | <filename>asmFiles/test.rtype.asm
#------------------------------------------------------------------
# R-type Instruction (ALU) Test Program
#------------------------------------------------------------------
org 0x0000
ori $1,$zero,0xD269
ori $2,$zero,0x37F1
ori $21,$zero,0x80
ori $22,$zero,0xF0
# Now running all R type instructions
or $3,$1,$2
and $4,$1,$2
andi $5,$1,0xF
addu $6,$1,$2
addiu $7,$3,0x8740
subu $8,$4,$2
xor $9,$5,$2
xori $10,$1,0xf33f
sll $11,$1,4
srl $12,$1,5
nor $13,$1,$2
# Store them to verify the results
sw $13,0($22)
sw $3,0($21)
sw $4,4($21)
sw $5,8($21)
sw $6,12($21)
sw $7,16($21)
sw $8,20($21)
sw $9,24($21)
sw $10,28($21)
sw $11,32($21)
sw $12,36($21)
halt # that's all
|
Transynther/x86/_processed/AVXALIGN/_zr_un_/i7-7700_9_0x48_notsx.log_12_1968.asm | ljhsiun2/medusa | 9 | 241214 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x120ce, %rsi
lea addresses_normal_ht+0x1c9ce, %rdi
nop
add %r11, %r11
mov $58, %rcx
rep movsb
nop
nop
dec %r11
pop %rsi
pop %rdi
pop %rcx
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %r8
push %r9
push %rcx
push %rdx
// Faulty Load
lea addresses_A+0xe2ce, %r12
nop
add %rcx, %rcx
vmovaps (%r12), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $1, %xmm4, %r9
lea oracles, %rcx
and $0xff, %r9
shlq $12, %r9
mov (%rcx,%r9,1), %r9
pop %rdx
pop %rcx
pop %r9
pop %r8
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_A', 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': True, 'size': 32, 'type': 'addresses_A', 'congruent': 0}}
<gen_prepare_buffer>
{'dst': {'same': False, 'congruent': 8, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_UC_ht'}}
{'08': 1, '00': 11}
00 00 00 00 00 00 00 00 00 00 00 08
*/
|
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_2104.asm | ljhsiun2/medusa | 9 | 247284 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r14
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x19b95, %rsi
lea addresses_normal_ht+0x12649, %rdi
nop
nop
nop
inc %r14
mov $8, %rcx
rep movsw
nop
nop
nop
nop
nop
inc %rbp
lea addresses_WT_ht+0xd8d5, %r13
clflush (%r13)
nop
cmp $43266, %r11
movb $0x61, (%r13)
nop
nop
nop
nop
and %rdi, %rdi
lea addresses_A_ht+0x120d5, %r14
clflush (%r14)
cmp %r11, %r11
movl $0x61626364, (%r14)
nop
inc %rdi
lea addresses_UC_ht+0x11cd5, %rsi
dec %r14
mov $0x6162636465666768, %r11
movq %r11, %xmm1
movups %xmm1, (%rsi)
xor $22285, %rcx
lea addresses_UC_ht+0xb6d5, %r11
add %rsi, %rsi
movb (%r11), %cl
nop
nop
xor $49957, %rsi
lea addresses_WT_ht+0x68d5, %rsi
lea addresses_UC_ht+0xf6d5, %rdi
nop
nop
nop
nop
add %rax, %rax
mov $77, %rcx
rep movsq
nop
nop
nop
nop
nop
add %r14, %r14
lea addresses_WT_ht+0x9329, %rax
nop
nop
nop
nop
xor $53104, %rdi
mov (%rax), %rbp
nop
nop
and $60804, %rax
lea addresses_WT_ht+0xba55, %rax
nop
nop
nop
nop
and $61701, %rsi
mov (%rax), %r13d
nop
nop
nop
nop
nop
add $43056, %r11
lea addresses_WC_ht+0x112cf, %rdi
nop
nop
nop
sub $7503, %rcx
movb (%rdi), %al
nop
nop
nop
add %rsi, %rsi
lea addresses_WC_ht+0x1d655, %rbp
nop
nop
nop
nop
nop
sub %r14, %r14
movb (%rbp), %r11b
nop
nop
nop
nop
add %rax, %rax
lea addresses_normal_ht+0x3cd5, %rax
nop
nop
sub $51719, %rsi
vmovups (%rax), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $1, %xmm6, %r14
nop
nop
xor $39406, %r14
lea addresses_A_ht+0x26c7, %rsi
lea addresses_D_ht+0xd4af, %rdi
clflush (%rdi)
add %rbp, %rbp
mov $38, %rcx
rep movsq
nop
nop
nop
nop
nop
dec %r13
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r14
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r14
push %r8
push %rbp
push %rbx
push %rdx
// Store
lea addresses_WT+0x1a8d5, %rbx
nop
nop
nop
nop
nop
and %r8, %r8
mov $0x5152535455565758, %r10
movq %r10, %xmm6
vmovups %ymm6, (%rbx)
nop
nop
nop
nop
sub $23690, %rbp
// Store
lea addresses_normal+0xe6d5, %rdx
nop
nop
nop
nop
nop
sub %r14, %r14
mov $0x5152535455565758, %r8
movq %r8, (%rdx)
nop
nop
nop
sub %r14, %r14
// Load
lea addresses_UC+0xce2a, %r14
cmp %rdx, %rdx
movups (%r14), %xmm3
vpextrq $1, %xmm3, %r10
nop
nop
and $34337, %rdx
// Faulty Load
lea addresses_A+0x1e0d5, %rdx
clflush (%rdx)
nop
nop
nop
nop
nop
add $39845, %r12
vmovups (%rdx), %ymm0
vextracti128 $0, %ymm0, %xmm0
vpextrq $1, %xmm0, %r14
lea oracles, %r12
and $0xff, %r14
shlq $12, %r14
mov (%r12,%r14,1), %r14
pop %rdx
pop %rbx
pop %rbp
pop %r8
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 8, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 9, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 10, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 5, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 10, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 9, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 1, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': True, 'congruent': 7, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 1, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 6, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 10, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}}
{'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
*/
|
alloy4fun_models/trashltl/models/5/BGdSxexzyD7KHzjcQ.als | Kaixi26/org.alloytools.alloy | 0 | 3325 | <reponame>Kaixi26/org.alloytools.alloy<filename>alloy4fun_models/trashltl/models/5/BGdSxexzyD7KHzjcQ.als
open main
pred idBGdSxexzyD7KHzjcQ_prop6 {
eventually (some f : File | f in Trash implies always f in Trash)
}
pred __repair { idBGdSxexzyD7KHzjcQ_prop6 }
check __repair { idBGdSxexzyD7KHzjcQ_prop6 <=> prop6o } |
src/main/java/com/metadave/kash/parser/Kash.g4 | metadave/kash | 0 | 224 | grammar Kash;
stmts: connect_stmt | create_topic | describe_topic;
connect_stmt : CONNECT hps+=hostport SEMI;
// TODO: NOT REALLY A HOSTNAME REGEX!
hostport : host=ID ':' port=INT;
create_topic : CREATE TOPIC topicname=string_value WITH keyvalues SEMI;
describe_topic : DESCRIBE TOPIC topicname=string_value SEMI;
keyvalues: kvs+=keyvalue (AND kvs+=keyvalue)*;
keyvalue: keyname=ID EQUALS thevalue=valuetype;
valuetype : string_value | INT | FLOAT;
string_value : SINGLE_STRING | DOUBLE_STRING;
/*
create topic "test" with replication_factor=1 and partitions=1;
describe topic "test";
*/
CONNECT : 'connect';
CREATE : 'create';
TOPIC : 'topic';
DESCRIBE : 'describe';
WITH : 'with';
AND : 'and';
OR : 'or';
NOT : 'not';
AT : '@';
DOLLAR : '$';
SPLAT : '*';
COMMA : ',';
LSQUARE : '[';
RSQUARE : ']';
LPAREN : '(';
RPAREN : ')';
EQUALS : '=';
DOT : '.';
SEMI : ';';
ID : LOWER (UPPER | LOWER | DIGIT | '-' | '_' | '.')*;
fragment LOWER : 'a' .. 'z';
fragment UPPER : 'A' .. 'Z';
INT : DIGIT+;
fragment DIGIT : '0' .. '9';
FLOAT : DIGIT+ DOT DIGIT*
| DOT DIGIT+
;
// double quoted string
DOUBLE_STRING : '"' (ESC|.)*? '"';
fragment ESC : '\\"' | '\\\\' ;
// single quoted string
SINGLE_STRING : '\'' (SESC|.)*? '\'';
fragment SESC : '\\\'' | '\\\\' ;
// scissors op, dude riding a pterodactyl, drunken bird
DATA_CONTENT: '~%~' (DATA_ESC|.)*? '~%~';
fragment DATA_ESC: '\\~%~' | '\\~%~';
LINE_COMMENT : '//' .*? '\r'? '\n' -> skip ;
COMMENT : '/*' .*? '*/' -> skip ;
// unicode space chars generated by http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%3AZs%3A%5D&g=
WS : (WSCHARS | Zs | Cc)+ -> channel(HIDDEN);
WSCHARS:
[ \t\r\n];
fragment Zs:
'\u0020' |
'\u3000' |
'\u1680' |
'\u2000'..'\u2006' |
'\u2008'..'\u200A' |
'\u205F' |
'\u00A0' |
'\u2007' |
'\u202F';
fragment Cc:
'\u0000'..'\u0008' |
'\u000E'..'\u001F' |
'\u007F'..'\u0084' |
'\u0086'..'\u009F' |
'\u0009'..'\u000D' |
'\u0085';
|
Transynther/x86/_processed/US/_zr_/i7-7700_9_0xca_notsx.log_16_1962.asm | ljhsiun2/medusa | 9 | 162831 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r14
push %rax
push %rbp
push %rbx
push %rsi
lea addresses_normal_ht+0x10426, %r13
nop
xor $34710, %r11
movb $0x61, (%r13)
cmp $24506, %r14
lea addresses_A_ht+0x1487f, %rax
nop
cmp %rbx, %rbx
mov $0x6162636465666768, %rsi
movq %rsi, %xmm0
movups %xmm0, (%rax)
nop
nop
nop
nop
nop
and $14818, %r11
lea addresses_A_ht+0xc58e, %r11
cmp %rbx, %rbx
movw $0x6162, (%r11)
nop
nop
xor $22781, %rax
pop %rsi
pop %rbx
pop %rbp
pop %rax
pop %r14
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r9
push %rax
push %rdx
push %rsi
// Faulty Load
lea addresses_US+0x10e26, %rax
cmp %r9, %r9
movups (%rax), %xmm4
vpextrq $0, %xmm4, %r13
lea oracles, %r9
and $0xff, %r13
shlq $12, %r13
mov (%r9,%r13,1), %r13
pop %rsi
pop %rdx
pop %rax
pop %r9
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': True, 'type': 'addresses_US'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 9, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'}
{'00': 16}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
programs/oeis/006/A006519.asm | karttu/loda | 1 | 81620 | ; A006519: Highest power of 2 dividing n.
; 1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,16,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,32,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,16,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,64,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,16,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,32,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,16,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,128,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,16,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,32,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,16,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,64,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,16,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,32,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,16,1,2,1,4,1,2,1,8,1,2
mov $1,1
add $1,$0
gcd $1,4096
|
src/apsepp-output_class-quiet-create.ads | thierr26/ada-apsepp | 0 | 8252 | -- Copyright (C) 2019 <NAME> <<EMAIL>>
-- MIT license. Please refer to the LICENSE file.
function Apsepp.Output_Class.Quiet.Create return Output_Quiet;
|
projects/04/fill/Fill.asm | feliposz/nand2tetris | 0 | 167816 | <reponame>feliposz/nand2tetris
// This file is part of www.nand2tetris.org
// and the book "The Elements of Computing Systems"
// by <NAME>, MIT Press.
// File name: projects/04/Fill.asm
// Runs an infinite loop that listens to the keyboard input.
// When a key is pressed (any key), the program blackens the screen,
// i.e. writes "black" in every pixel;
// the screen should remain fully black as long as the key is pressed.
// When no key is pressed, the program clears the screen, i.e. writes
// "white" in every pixel;
// the screen should remain fully clear as long as no key is pressed.
(WAIT_KEY_PRESS)
@KBD
D=M
@WAIT_KEY_PRESS
D;JEQ // if key == 0 goto WAIT_KEY_PRESS
@fill_value
M=-1 // fill = -1
@FILL_START
0;JMP
(WAIT_KEY_RELEASE)
@KBD
D=M
@WAIT_KEY_RELEASE
D;JNE // if key != 0 goto WAIT_KEY_RELEASE
@fill_value
M=0 // fill_value = 0
@FILL_START
0;JMP
(FILL_START)
@8192
D=A
@i
M=D // i = 8192 (512 width x 256 height / 16-bits)
@SCREEN
D=A
@address
M=D // address = SCREEN
(FILL_LOOP)
@i
D=M
@FILL_END
D;JEQ // if i == 0 goto FILL_END
@fill_value
D=M
@address
A=M
M=D // *address = fill_value
@address
M=M+1 // address++
@i
M=M-1 // i--
@FILL_LOOP
0;JMP
(FILL_END)
@fill_value
D=M
@WAIT_KEY_PRESS
D;JEQ // if fill_value = 0 then goto WAIT_KEY_PRESS
@WAIT_KEY_RELEASE
0;JMP // else goto WAIT_KEY_RELEASE
|
programs/oeis/080/A080424.asm | jmorken/loda | 1 | 92037 | ; A080424: a(n) = 3*a(n-1) + 18*a(n-2), a(0)=0, a(1)=1.
; 0,1,3,27,135,891,5103,31347,185895,1121931,6711903,40330467,241805655,1451365371,8706597903,52244370387,313451873415,1880754287211,11284396583103,67706766919107,406239439253175,2437440122303451
add $0,1
mov $4,2
lpb $0
sub $0,1
mov $3,$1
mov $1,$2
mul $1,6
add $4,$3
mul $4,3
mov $2,$4
lpe
div $1,36
|
src/code-injection/main.asm | lewismoten/6502-program-1 | 1 | 11709 | ; Start at address 0x0F00
; Create a jump instruction at 0x0401 to jump to the start of our project
; Jump to 0x0401
; Repeatedly
; Everything else is no-operation instructions
; 64kb file
; Set default value to no-operation instruction
FILLVALUE $EA
; start assembling at address 0
ORG $0000
; Fill no-op instructions to address 3840
PAD $0F00
; start of program
main:
; ------- Inject jmp main at 0x0400 -------
; Load accumulator with value of a JMP instruction
lda #$4C ; A9 4C
; Store accumulator at address 1024
sta $0400 ; 8D 00 04
; Load accumulator with value of least significant byte of 'main' label (0x0400) 00
lda #$00 ; A9 00
; Store value in accumulator at address 1025
sta $0401 ; 8D 01 04
; Load accumulator with value of most significant byte of 'main' label (0x0F00)
lda #$0F ; A9 0F
; Store value in accumulator at address 1026
sta $0402 ; 8D 02 04
; ------- Jump to the injected code -------
; Jump to the instruction we stored at 0x0400
jmp $0400 ; 4C 00 04
; Fill memory with no-operation instructions up to 1 less than entry address
PAD $FFFA
; set start of program at address 3840
; hack - set jump instruction just before it
jmp main ; 4C 00 0F
; set rest of memory up to 64kb with no-operation instructions
ALIGN $10000
|
opal/mca/pmix/pmix2x/pmix/src/atomics/asm/base/IA32.asm | karasevb/ompi | 0 | 105109 | START_FILE
TEXT
START_FUNC(pmix_atomic_mb)
pushl %ebp
movl %esp, %ebp
leave
ret
END_FUNC(pmix_atomic_mb)
START_FUNC(pmix_atomic_rmb)
pushl %ebp
movl %esp, %ebp
leave
ret
END_FUNC(pmix_atomic_rmb)
START_FUNC(pmix_atomic_wmb)
pushl %ebp
movl %esp, %ebp
leave
ret
END_FUNC(pmix_atomic_wmb)
START_FUNC(pmix_atomic_cmpset_32)
pushl %ebp
movl %esp, %ebp
movl 8(%ebp), %edx
movl 16(%ebp), %ecx
movl 12(%ebp), %eax
lock; cmpxchgl %ecx,(%edx)
sete %dl
movzbl %dl, %eax
leave
ret
END_FUNC(pmix_atomic_cmpset_32)
START_FUNC(pmix_atomic_cmpset_64)
pushl %ebp
movl %esp, %ebp
subl $32, %esp
movl %ebx, -12(%ebp)
movl %esi, -8(%ebp)
movl %edi, -4(%ebp)
movl 8(%ebp), %edi
movl 12(%ebp), %eax
movl 16(%ebp), %edx
movl %eax, -24(%ebp)
movl %edx, -20(%ebp)
movl 20(%ebp), %eax
movl 24(%ebp), %edx
movl %eax, -32(%ebp)
movl %edx, -28(%ebp)
movl -24(%ebp), %ebx
movl -20(%ebp), %edx
movl -32(%ebp), %esi
movl -28(%ebp), %ecx
movl %ebx, %eax
push %ebx
movl %esi, %ebx
lock; cmpxchg8b (%edi)
sete %dl
pop %ebx
movzbl %dl, %eax
movl -12(%ebp), %ebx
movl -8(%ebp), %esi
movl -4(%ebp), %edi
movl %ebp, %esp
popl %ebp
ret
END_FUNC(pmix_atomic_cmpset_64)
START_FUNC(pmix_atomic_add_32)
pushl %ebp
movl %esp, %ebp
movl 8(%ebp), %eax
movl 12(%ebp), %edx
lock; addl %edx,(%eax)
movl (%eax), %eax
leave
ret
END_FUNC(pmix_atomic_add_32)
START_FUNC(pmix_atomic_sub_32)
pushl %ebp
movl %esp, %ebp
movl 8(%ebp), %eax
movl 12(%ebp), %edx
lock; subl %edx,(%eax)
movl (%eax), %eax
leave
ret
END_FUNC(pmix_atomic_sub_32)
START_FUNC(pmix_sys_timer_get_cycles)
pushl %ebp
movl %esp, %ebp
rdtsc
popl %ebp
ret
END_FUNC(pmix_sys_timer_get_cycles)
|
model/alloy/traces.als | diorga/harpy | 4 | 962 | <reponame>diorga/harpy<gh_stars>1-10
module traces
open exec_F
open axioms
// Allowed under TSO,
// Disallowed under SC
pred store_buffering[X:Exec_F] {
consistent[none->none, X]
some disj E3,E2,E1,E0 : E {
X.CpuFence = none
X.CpuRead = E3+E1
X.CpuWrite = E2+E0
X.EV_C = E3+E2+E1+E0
X.fr = (E3->E0)+(E1->E2)
X.sloc = sq[E0+E3] + sq[E1+E2]
X.sthd = sq[E0+E1] + sq[E2+E3]
X.sb = (E0->E1)+(E2->E3)
}
}
// Allowed
pred page1_ex1[X:Exec_F] {
consistent[none->none, X]
some disj E3, E2, E1, E0 : E {
X.WrReq = E0
X.WrRsp = E1
X.RdRsp = E2
X.RdReq = E3
(E0->E1) + (E1->E2) in X.sb
(E2->E1) in X.fr
X.sch = sq[E0 + E1 + E2 + E3]
X.sloc = sq[E0+ E1 + E2 + E3]
}
}
// Disallowed
pred page1_ex2[X:Exec_F] {
consistent[none->none, X]
some disj E3, E2, E1, E0 : E {
X.WrReq = E0
X.WrRsp = E2
X.RdRsp = E1
X.RdReq = E3
(E0->E1) + (E1->E2) in X.sb
(E2->E1) in X.rf
X.sch = sq[E0 + E1 + E2 + E3]
X.sloc = sq[E0+ E1 + E2 + E3]
}
}
// Allowed
pred page1_ex3[X:Exec_F] {
consistent[none->none, X]
some disj E5, E4, E3, E2, E1, E0 : E {
X.WrReq = E0
X.WrRsp = E1
X.RdRsp = E2 + E3
X.RdReq = E4 + E5
(E0->E1) + (E1->E2) + (E2->E3) in X.sb
(E1->E2) in X.rf
(E3->E1) in X.fr
X.sch = sq[E0 + E1 + E2 + E3 + E4 + E5]
X.sloc = sq[E0+ E1 + E2 + E3 + E4 + E5]
}
}
// Allowed
pred page1_ex4[X:Exec_F] {
consistent[none->none, X]
some disj E5, E4, E3, E2, E1, E0 : E {
X.WrReq = E0
X.WrRsp = E1
X.RdRsp = E2 + E3
X.RdReq = E4 + E5
(E0->E1) + (E1->E2) + (E2->E3) in X.sb
(E1->E3) in X.rf
(E2->E1) in X.fr
X.sch = sq[E0 + E1 + E2 + E3 + E4 + E5]
X.sloc = sq[E0+ E1 + E2 + E3 + E4 + E5]
}
}
// Disallowed
pred page1_ex5[X:Exec_F] {
consistent[none->none, X]
some disj E5, E4, E3, E2, E1, E0 : E {
X.WrReq = E0
X.WrRsp = E2
X.RdRsp = E1 + E3
X.RdReq = E4 + E5
(E0->E1) + (E1->E2) + (E2->E3) in X.sb
(E2->E1) in X.rf
(E3->E2) in X.fr
X.sch = sq[E0 + E1 + E2 + E3 + E4 + E5]
X.sloc = sq[E0+ E1 + E2 + E3 + E4 + E5]
}
}
// Disallowed
pred page1_ex6[X:Exec_F] {
consistent[none->none, X]
some disj E5, E4, E3, E2, E1, E0 : E {
X.WrReq = E0
X.WrRsp = E3
X.RdRsp = E1 + E2
X.RdReq = E4 + E5
(E0->E1) + (E1->E2) + (E2->E3) in X.sb
(E3->E1) in X.rf
X.sch = sq[E0 + E1 + E2 + E3 + E4 + E5]
X.sloc = sq[E0+ E1 + E2 + E3 + E4 + E5]
}
}
// Allowed
pred page1_ex7[X:Exec_F] {
axioms_fpga[none->none, X]
some disj E5, E4,E3, E2, E1, E0 : E {
X.WrReq = E0 + E2
X.WrRsp = E1 + E3
X.RdRsp = E4
X.RdReq = E5
(E0->E1) + (E1->E2) + (E2->E3) + (E3->E4) in X.sb
(E0->E1) + (E2->E3) in X.writepair
(E1->E4) in X.rf
X.sch = sq[E0 + E1 + E2 + E3 + E4 + E5]
X.sloc = sq[E0+ E1 + E2 + E3 + E4 + E5]
}
}
// Allowed
pred page1_ex8[X:Exec_F] {
consistent[none->none, X]
some disj E5, E4,E3, E2, E1, E0 : E {
X.WrReq = E0 + E1
X.WrRsp = E2 + E3
X.RdRsp = E4
X.RdReq = E5
(E0->E1) + (E1->E2) + (E2->E3) + (E3->E4) in X.sb
(E0->E2) + (E1->E3) in X.writepair
(E2->E4) in X.rf
X.sch = sq[E0 + E1 + E2 + E3 + E4 + E5]
X.sloc = sq[E0+ E1 + E2 + E3 + E4 + E5]
}
}
// Allowed
pred page1_ex9[X:Exec_F] {
consistent[none->none, X]
some disj E5, E4,E3, E2, E1, E0 : E {
X.WrReq = E0 + E1
X.WrRsp = E2 + E3
X.RdRsp = E4
X.RdReq = E5
(E0->E1) + (E1->E2) + (E2->E3) + (E3->E4) in X.sb
(E0->E3) + (E1->E2) in X.writepair
(E2->E4) in X.rf
X.sch = sq[E0 + E1 + E2 + E3 + E4 + E5]
X.sloc = sq[E0+ E1 + E2 + E3 + E4 + E5]
}
}
// Disallowed
pred page1_ex10[X:Exec_F] {
consistent[none->none, X]
some disj E5, E4,E3, E2, E1, E0 : E {
X.WrReq = E0 + E1
X.WrRsp = E2 + E4
X.RdRsp = E3
X.RdReq = E5
(E0->E1) + (E1->E2) + (E2->E3) + (E3->E4) in X.sb
(E0->E2) + (E1->E4) in X.writepair
(E4->E3) in X.rf
X.sch = sq[E0 + E1 + E2 + E3 + E4 + E5]
X.sloc = sq[E0+ E1 + E2 + E3 + E4 + E5]
}
}
// Disallowed
pred page1_ex11[X:Exec_F] {
consistent[none->none, X]
some disj E5, E4, E3, E2, E1, E0 : E {
X.WrReq = E0 + E1
X.WrRsp = E2 + E4
X.RdRsp = E3
X.RdReq = E5
(E0->E1) + (E1->E2) + (E2->E3) + (E3->E4) in X.sb
(E0->E4) + (E1->E2) in X.writepair
(E4->E3) in X.rf
X.sch = sq[E0 + E1 + E2 + E3 + E4 + E5]
X.sloc = sq[E0+ E1 + E2 + E3 + E4 + E5]
}
}
// Disallowed
pred page2_ex1[X:Exec_F] {
consistent[none->none, X]
some disj E3, E2, E1, E0 : E {
X.WrReq = E0
X.WrRsp = E1
X.RdReq = E2
X.RdRsp = E3
(E0->E1) + (E1->E2) + (E2->E3) in X.sb
(E3->E1) in X.fr
X.sch = sq[E0 + E1 + E2 + E3]
X.sloc = sq[E0+ E1 + E2 + E3]
}
}
// Disallowed
pred page2_ex2[X:Exec_F] {
consistent[none->none, X]
some disj E3, E2, E1, E0 : E {
X.RdRsp = E0
X.WrRsp = E1
(E0->E1) in X.sb
(E1->E0) in X.rf
X.sch = sq[E0 + E1 + E2 + E3]
X.sloc = sq[E0+ E1 + E2 + E3]
}
}
// Disallowed
pred page2_ex3[X:Exec_F] {
consistent[none->none, X]
some disj E5, E4, E3, E2, E1, E0 : E {
X.CpuWrite = E0 + E1
X.RdRsp = E2 + E3
(E0->E1) + (E2->E3) in X.sb
(E0->E3) + (E1->E2) in X.rf
X.sch = sq[E2 + E3 + E4 + E5]
X.sloc = sq[E0+ E1 + E2 + E3 + E4 + E5]
X.sthd = sq[E0 + E1] + sq[E2 + E3 + E4 + E5]
}
}
// Disallowed
pred page2_ex4[X:Exec_F] {
consistent[none->none, X]
some disj E5, E4, E3, E2, E1, E0 : E {
X.CpuRead = E0 + E1
X.WrRsp = E2 + E3
(E0->E1) + (E2->E3) in X.sb
(E3->E0) + (E2->E1) in X.rf
X.sch = sq[E2 + E3 + E4 + E5]
X.sloc = sq[E0+ E1 + E2 + E3 + E4 + E5]
X.sthd = sq[E0 + E1] + sq[E2 + E3 + E4 + E5]
}
}
// Disallowed
pred page2_ex5[X:Exec_F] {
consistent[none->none, X]
some disj E5, E4, E3, E2, E1, E0 : E {
X.WrRsp = E0 + E1
X.RdRsp = E2
X.RdReq = E3
(E0->E1) + (E0->E3) + (E1->E2) in X.sb
(E2->E0) in X.fr
X.sch = sq[E0 + E1 + E2 + E3 + E4 + E5]
X.sloc = sq[E0+ E1 + E2 + E3 + E4 + E5]
X.sthd = sq[E0 + E1 + E2 + E3 + E4 + E5]
}
}
// Alowed
pred example1[X:Exec_F] {
consistent[none->none, X]
some disj E3, E2, E1,E0 : E {
X.WrReq = E0
X.WrRsp = E1
X.RdRsp = E2
X.RdReq = E3
(E0->E1) + (E1->E2) in X.sb
(E2->E1) in X.fr
X.sloc = sq[E0+ E1 + E2 + E3]
X.sthd = sq[E0+E1+E2 + E3]
}
}
// Allowed
pred example2[X:Exec_F] {
consistent[none->none, X]
some disj E3, E2, E1, E0 : E {
X.WrReq = E0
X.WrRsp = E1
X.RdRsp = E2
X.RdReq = E3
(E0->E1) + (E1->E2) in X.sb
(E2->E1) in X.fr
X.sch = sq[E0 + E1 + E2 + E3]
X.sloc = sq[E0+ E1 + E2 + E3]
X.sthd = sq[E0 + E1 + E2 + E3]
}
}
// Disallowed
pred example3_single[X:Exec_F] {
consistent[none->none, X]
some disj E5,E4,E3,E2,E1,E0 : E {
X.WrReq = E0
X.WrRsp = E4
X.RdRsp = E3
X.RdReq = E5
X.FnReq = E1
X.FnRsp = E2
(E0->E1) + (E1->E2) + (E2->E5) + (E2->E3) in X.sb // You do not care when the WrRsp arrives
(E0->E1) + (E0->E3) in X.sch
X.fr = (E3->E4)
(E1->E2) in X.fencepair
(E0->E3) in X.sloc
X.sthd = sq[E0+E1+E2+E3+E4 +E5]
}
}
// Disallowed
pred example3_any[X:Exec_F] {
consistent[none->none, X]
some disj E5,E4,E3,E2,E1,E0 : E {
X.WrReq = E0
X.WrRsp = E4
X.RdRsp = E3
X.RdReq = E5
X.FnReqAny = E1
X.FnRspAny = E2
(E0->E1) + (E1->E2) + (E2->E5) + (E2->E3) in X.sb // You do not care when the WrRsp arrives
(E0->E3) in X.sch
X.fr = (E3->E4)
(E1->E2) in X.fenceanypair
(E0->E3) in X.sloc
X.sthd = sq[E0+E1+E2+E3+E4+E5]
}
}
// Allowed
pred example4[X:Exec_F] {
consistent[none->none, X]
some disj E7,E6,E5,E4,E3,E2,E1,E0 : E {
X.WrReq = E0 + E1
X.WrRsp = E4 + E5
X.RdRsp = E2 + E3
X.RdReq = E6 + E7
(E0->E1) + (E1->E2) + (E2->E3) in X.sb // You do not care when the 2 WrRsp arrive
(E0->E4) + (E1->E5) in X.writepair
(E4->E3) + (E5->E2) in X.rf
(E0->E1) in X.sch
sq[E0+E1+E2+E3] in X.sloc
X.sthd = sq[E0+E1+E2+E3+E4+E5+E6+E7]
}
}
// Allowed
pred example5[X:Exec_F] {
consistent[none->none, X]
some disj E7,E6,E5,E4,E3,E2,E1,E0 : E {
X.WrReq = E0 + E2
X.WrRsp = E1 + E3
X.RdRsp = E4 + E5
X.RdReq = E7 + E6
(E0->E1) + (E1->E2) + (E2->E3) + (E3->E4) + (E4->E5) in X.sb
(E5->E3) in X.fr
(E1->E5) + (E3->E4) in X.rf
sq[E0+E1+E2+E3+E4+E5] in X.sloc
X.sthd = sq[E0+E1+E2+E3+E4+E5+E6+E7]
}
}
// Disallowed
pred example6[X:Exec_F] {
consistent[none->none, X]
some disj E7,E6,E5,E4,E3,E2,E1,E0 : E {
X.WrReq = E0 + E2
X.WrRsp = E1 + E3
X.RdRsp = E4 + E5
X.RdReq = E7 + E6
(E0->E1) + (E1->E2) + (E2->E3) +(E3->E6) +(E3->E7) +(E3->E4) + (E4->E5) in X.sb
(E5->E3) in X.fr
(E1->E5) + (E3->E4) in X.rf
X.sch = sq[E0+E1+E2+E3+E4+E5+E6+E7]
sq[E0+E1+E2+E3+E4+E5] in X.sloc
X.sthd = sq[E0+E1+E2+E3+E4+E5+E6+E7]
}
}
// This barely makes sense. I should eliminate it
pred example7[X:Exec_F] {
consistent[none->none, X]
some disj E9, E8, E7, E6, E5, E4, E3, E2, E1, E0 : E {
X.WrReq = E0 + E2
X.WrRsp = E8 + E9
X.RdReq = E3 + E5
X.RdRsp = E4 + E6
X.FnReqAny = E1
X.FnRspAny = E7
(E0->E1) + (E1->E7) + (E7->E2) + (E2->E3) + (E3->E4) + (E4->E5) + (E5->E6) in X.sb
(E0->E8) + (E2->E9) in X.writepair
(E3->E4) + (E5->E6) in X.readpair
(E9->E4) + (E8->E6) in X.rf
X.sthd = sq[E0+E1+E2+E3+E4+E5+E6+E7+E8+E9]
sq[E0+E2+E3+E4+E5+E6+E8+E9] in X.sloc
// sq[E0+E1+E2+E3+E4+E5+E6+E7+E8+E9] in X.sch
}
}
// Allowed
pred example8[X:Exec_F] {
consistent[none->none, X]
some disj E5,E4,E3,E2,E1,E0 : E {
X.WrReq = E0 + E1
X.WrRsp = E3 + E4
X.RdRsp = E2
X.RdReq = E5
(E0->E1) + (E1->E2) in X.sb
(E0->E3) + (E1->E4) in X.writepair
(E3->E2) in X.rf
(E0->E1) in X.sch
sq[E0+E1+E2] in X.sloc
X.sthd = sq[E0+E1+E2+E3+E4+E5]
}
}
// Disallowed
pred example9[X:Exec_F] {
consistent[none->none, X]
some disj E5,E4,E3,E2,E1,E0 : E {
X.WrReq = E0 + E2
X.WrRsp = E1 + E3
X.RdReq = E4
X.RdRsp = E5
(E0->E1) + (E1->E2) + (E2->E3) + (E3->E4) + (E4->E5) in X.sb
(E0->E1) + (E2->E3) in X.writepair
(E5->E3) in X.fr
(E1->E5) in X.rf
sq[E0+E1+E2+E3+E4+E5] in X.sch
sq[E0+E1+E2+E3+E4+E5] in X.sloc
X.sthd = sq[E0+E1+E2+E3+E4+E5]
}
}
// Allowed
pred example10[X:Exec_F] {
consistent[none->none, X]
some disj E3,E2,E1,E0 : E {
X.WrReq = E0
X.WrRsp = E2
X.RdRsp = E1
X.RdReq = E3
(E0->E1) in X.sb
(E1->E2) in X.fr
sq[E0+E1] in X.sch
sq[E0+E1] in X.sloc
X.sthd = sq[E0+E1+E2+E3]
}
}
// Disalllowed
pred fence_order_test[X:Exec_F] {
consistent[none->none, X]
some disj E5, E4,E3,E2,E1,E0 : E {
X.WrReq = E0 + E2
X.FnReqAny = E1
X.WrRsp = E3 + E4
X.FnRspAny = E5
(E0->E1) + (E1->E2) + (E2->E3) in X.sb
(E0->E3) + (E2->E4) in X.writepair
(E1->E5) in X.fenceanypair
(E4->E3) in X.sb // This should be prevented by the axiom
X.sthd = sq[E0+E1+E2 +E3 + E4 +E5]
}
}
// Allowed
pred cpu_fpga1[X:Exec_F] {
consistent[none->none, X]
some disj E5, E4, E3, E2, E1, E0 : E {
X.WrReq = E0 + E2
X.WrRsp = E1 + E3
X.CpuRead = E4 + E5
(E1->E3) + (E4->E5) in X.sb
X.sthd = sq[E0+E1+E2+E3] + sq[E4+E5]
(E1->E3) in X.sch
sq[E0+E1+E2+E3+E4+E5] in X.sloc
(E1->E4) + (E3->E5) in X.rf
}
}
// Disallowed
pred cpu_fpga2[X:Exec_F] {
consistent[none->none, X]
some disj E5, E4, E3, E2, E1, E0 : E {
X.WrReq = E0 + E2
X.WrRsp = E1 + E3
X.CpuRead = E4 + E5
(E1->E3) + (E4->E5) in X.sb
X.sthd = sq[E0+E1+E2+E3] + sq[E4+E5]
(E1->E3) in X.sch
sq[E0+E1+E2+E3+E4+E5] in X.sloc
(E1->E5) + (E3->E4) in X.rf
}
}
// Allowed
pred cpu_fpga3[X:Exec_F] {
consistent[none->none, X]
some disj E5, E4, E3, E2, E1, E0 : E {
X.WrReq = E0 + E2
X.WrRsp = E1 + E3
X.CpuRead = E4 + E5
(E1->E3) + (E4->E5) in X.sb
X.sthd = sq[E0+E1+E2+E3] + sq[E4+E5]
no (X.sch & (E1->E3))
sq[E0+E1+E2+E3+E4+E5] in X.sloc
(E1->E5) + (E3->E4) in X.rf
}
}
// Allowed
pred cpu_fpga4[X:Exec_F] {
consistent[none->none, X]
some disj E5, E4, E3, E2, E1, E0 : E {
X.RdReq = E5 + E4
X.RdRsp = E0 + E1
X.CpuWrite = E2 + E3
(E0->E1) + (E2->E3) in X.sb
X.sthd = sq[E0+E1+E4+E5] + sq[E2+E3]
sq[E0+E1+E2+E3] in X.sloc
(E2->E1) + (E3->E0) in X.rf
}
}
// Allowed
pred cpu_fpga6[X:Exec_F] {
consistent[none->none, X]
some disj E5,E4, E3, E2, E1, E0 : E {
X.RdReq = E5
X.RdRsp = E3
X.WrRsp =E2
X.CpuWrite = E0
X.CpuRead = E1
X.WrReq = E4
(E0->E1) + (E2->E3)+(E2->E5) in X.sb
X.sthd = sq[E0+E1] + sq[E2+E3+E4+E5]
sq[E0+E1+E2+E3+E4+E5] in X.sloc
(E3->E0) + (E1->E2) in X.fr
}
}
// Disallowed
pred cpu_fpga7[X:Exec_F] {
consistent[none->none, X]
some disj E5, E4, E3, E2, E1, E0 : E {
X.CpuWrite = E0
X.CpuRead = E1
X.WrReq = E2
X.WrRsp =E3
X.RdReq = E4
X.RdRsp = E5
(E0->E1) + (E2->E3) + (E3->E4) + (E4->E5) in X.sb
sq[E2+E3+E4+E5] in X.sch
X.sthd = sq[E0+E1] + sq[E2+E3+E4+E5]
sq[E0+E1] +sq[E2+E3+E4+E5] in X.sloc
(E1->E3) + (E5->E0) in X.fr
}
}
// Disallowed
pred automatic_trace1[X:Exec_F] {
consistent[none->none, X]
some disj E3, E2, E1, E0 : E {
X.WrReq = E0
X.WrRsp =E3
X.RdReq = E1
X.RdRsp = E2
(E0->E1) + (E1->E2) + (E2->E3) in X.sb
X.sthd = sq[E0+E1+E2+E3]
sq[E0+E1+E2+E3] in X.sloc
(E3->E2) in X.rf
}
}
// Disallowed
pred automatic_trace2[X:Exec_F] {
consistent[none->none, X]
some disj E3, E2, E1, E0 : E {
X.CpuWrite = E3
X.CpuRead = E2
X.WrReq = E0
X.WrRsp =E1
(E0->E1) + (E2->E3) in X.sb
sq[E0 +E1] in X.sch
X.sthd = sq[E0+E1] + sq[E2+E3]
sq[E0+E1+E2+E3] in X.sloc
(E1->E2) in X.rf
(E3->E1) in X.co
}
}
//Now it is working
pred fpga_fence_cpu_read[X:Exec_F] {
consistent[none->none, X]
some disj E7, E6, E5, E4, E3, E2, E1, E0 : E {
X.CpuRead = E6 + E7
X.WrReq = E0 + E4
X.WrRsp =E1 + E5
X.FnReqAny = E2
X.FnRspAny = E3
(E0->E1) + (E1->E2) + (E2->E3) + (E3->E4) +(E4->E5) + (E6->E7) in X.sb
X.sthd = sq[E0+E1+E2+E3+E4+E5] + sq[E6+E7]
sq[E0+E1+E4+E5+E6+E7] in X.sloc
(E1->E5) in X.co
X.rf = (E1->E7) + (E5->E6)
}
}
//Disallowed. The CPU can not see previous values
pred cpu_read_old_values[X:Exec_F] {
consistent[none->none, X]
some disj E5, E4, E3, E2, E1, E0 : E {
X.WrReq = E0 + E2
X.WrRsp =E1 + E3
X.CpuRead = E4 + E5
(E0->E1) + (E1->E2) + (E2->E3) + (E4->E5) in X.sb
X.sthd = sq[E0+E1+E2+E3] + sq[E4+E5]
(E1->E3) in X.co
sq[E0+E1+E2+E3+E4+E5] in X.sloc
X.rf = (E1->E5) + (E3->E4)
}
}
//Disalllowed
pred fpga_sch_fence_cpu_read[X:Exec_F] {
consistent[none->none, X]
some disj E7, E6, E5, E4, E3, E2, E1, E0 : E {
X.CpuRead = E6 + E7
X.WrReq = E0 + E4
X.WrRsp =E1 + E5
X.FnReq = E2
X.FnRsp = E3
(E0->E1) + (E1->E2) + (E2->E3) + (E3->E4) +(E4->E5) + (E6->E7) in X.sb
X.sthd = sq[E0+E1+E2+E3+E4+E5] + sq[E6+E7]
sq[E0+E1+E2+E3+E4+E5] in X.sch
sq[E0+E1+E4+E5+E6+E7] in X.sloc
X.rf = (E1->E7) + (E5->E6)
}
}
// Disallowed
pred propagation_page_1[X:Exec_F] {
consistent[none->none, X]
some disj E4, E3, E2, E1, E0 : E {
X.CpuWrite = E0 + E1 + E2
X.CpuFence = E3
X.CpuRead = E4
(E0->E1) + (E2->E3) + (E3->E4) in X.sb
(E4->E0) in X.fr
(E1->E2) in X.co
X.sloc = sq[E0 + E4] + sq[E1+E2]
}
}
// Disallowed
pred propagation_page_2[X:Exec_F] {
consistent[none->none, X]
some disj E6, E5, E4, E3, E2, E1, E0 : E {
X.WrReq = E0 + E2
X.WrRsp = E1 + E3
X.CpuWrite = E4
X.CpuFence = E5
X.CpuRead = E6
(E0->E1) + (E1->E2) + (E2->E3) + (E4->E5) + (E5->E6) in X.sb
sq[E0+E1+E2+E3] in X.sch
X.sloc = sq[E0+E1+E6] + sq[E2+E3+E4]
(E6->E1) in X.fr
(E3->E4) in X.co
}
}
// Disallowed
pred propagation_page_3[X:Exec_F] {
consistent[none->none, X]
some disj E8, E7, E6, E5, E4, E3, E2, E1, E0 : E {
X.WrReq = E0 + E4
X.FnReq = E1
X.WrRsp = E2 + E5
X.FnRsp = E3
X.CpuWrite = E6
X.CpuFence = E7
X.CpuRead = E8
(E0->E1) + (E1->E2) + (E2->E3) + (E3->E4) + (E4->E5) + (E6->E7) + (E7->E8) in X.sb
X.sch = sq[E0+E1+E2+E3] + sq[E4+E5]
X.sloc = sq[E0+E2+E8] + sq[E4+E5+E6]
(E8->E2) in X.fr
(E5->E6) in X.co
}
}
// Disallowed
pred propagation_page_4[X:Exec_F] {
consistent[none->none, X]
some disj E5, E4, E3, E2, E1, E0 : E {
X.CpuWrite = E0 + E1
X.WrReq = E2
X.WrRsp = E3
X.RdReq = E4
X.RdRsp = E5
(E0->E1) + (E2->E3) + (E3->E4) + (E4->E5) in X.sb
sq[E2+E3+E4+E5] in X.sch
X.sloc = sq[E0+E4+E5] + sq[E1+E2+E3]
(E5->E0) in X.fr
(E1->E3) in X.co
}
}
// Disallowed
pred propagation_page_5[X:Exec_F] {
consistent[none->none, X]
some disj E7, E6, E5, E4, E3, E2, E1, E0 : E {
X.CpuWrite = E0 + E1
X.WrReq = E2
X.WrRsp = E3
X.FnReq = E4
X.FnRsp = E5
X.RdReq = E6
X.RdRsp = E7
(E0->E1) + (E2->E3) + (E3->E4) + (E4->E5) + (E5->E6) + (E6->E7) in X.sb
sq[E2+E3+E4+E5] + sq[E6+E7] in X.sch
X.sloc = sq[E0+E6+E7] + sq[E1+E2+E3]
(E7->E0) in X.fr
(E1->E3) in X.co
}
}
// Allowed
pred fence_on_reads[X:Exec_F] {
consistent[none->none, X]
some disj E6, E5, E4, E3, E2, E1, E0 : E {
X.RdReq = E0 + E1
X.RdRsp = E2 + E5
X.FnReqAny = E3
X.FnRspAny = E4
X.CpuWrite = E6
(E0->E1) + (E1->E2) + (E2->E3) + (E3->E4) + (E4->E5) in X.sb
sq[E0 + E2] + sq[E1+E5] in X.sch
X.sloc = sq[E0 + E1 + E2 + E5 + E6]
(E0->E2) + (E1->E5) in X.readpair
(E6->E2) in X.rf
(E5->E6) in X.fr
}
}
pred red_req_and_fence[X:Exec_F] {
consistent[none->none, X]
some disj E5, E4, E3, E2, E1, E0 : E {
X.WrReq = E0
X.RdReq = E1
X.FnReq = E2
X.FnRsp = E4
X.WrRsp = E3
X.RdRsp = E5
(E0->E1) + (E1->E2) + (E2->E3) + (E3->E4) + (E4->E5) in X.sb
sq[E0 + E1 + E2 + E3 +E4 + E5] in X.sch
X.sloc = sq[E0 + E1 + E3 + E5]
(E5->E3) in X.fr
}
}
pred red_req_and_fence2[X:Exec_F] {
consistent[none->none, X]
some disj E6, E5, E4, E3, E2, E1, E0 : E {
X.WrReq = E0
X.FnReqAny = E1
X.WrRsp = E2
X.RdReq = E3
X.FnRspAny = E4
X.RdRsp = E5
X.CpuWrite = E6
(E0->E1) + (E1->E2) + (E2->E3) + (E3->E4) + (E4->E5) in X.sb
sq[E0 + E2] + sq[E3 + E5] in X.sch
X.sloc = sq[E0 + E2 + E3 + E5 + E6]
(E5->E2) + (E5->E6) in X.fr
(E6->E2) in X.co
}
}
pred red_req_and_fence3[X:Exec_F] {
consistent[none->none, X]
some disj E6, E5, E4, E3, E2, E1, E0 : E {
X.RdReq = E0
X.WrReq = E1
X.WrRsp = E2
X.FnReq = E3
X.FnRsp = E4
X.RdRsp = E5
X.CpuWrite = E6
(E0->E1) + (E1->E2) + (E2->E3) + (E3->E4) + (E4->E5) in X.sb
sq[E0 + E5] + sq[E1+E2+E3 + E4] in X.sch
X.sloc = sq[E0 + E1 + E2 + E5 + E6]
(E5->E2) + (E5->E6) in X.fr
(E6->E2) in X.co
}
}
// Disallowed
pred wrreq_cpu_allowed[X:Exec_F] {
consistent[none->none, X]
some disj E5, E4, E3, E2, E1, E0 : E {
X.WrReq = E0 + E1
X.WrRsp = E2 + E3
X.CpuRead = E4
X.CpuWrite = E5
(E0->E1) + (E1->E2) + (E2->E3) + (E4->E5) in X.sb
(E0->E2) + (E1->E3) in X.writepair
sq[E0 + E1 + E2 + E3] in X.sch
X.sloc = sq[E0 + E2 + E5] + sq[E1 + E3 + E4]
X.rf = (E3->E4)
X.co = (E5->E2)
}
}
// Disallowed
pred alloy_trace_104[X:Exec_F] {
consistent[none->none, X]
some disj E5, E4, E3, E2, E1, E0 : E {
X.RdReq = E0
X.RdRsp = E1
X.WrReq = E2
X.WrRsp = E3
X.CpuRead = E4
X.CpuWrite = E5
(E0->E1) + (E1->E2) + (E2->E3) + (E4->E5) in X.sb
X.sch = sq[E0+E1]+ sq[E2+E3]
X.sloc = sq[E0 + E1 + E5] + sq[E2 + E3 + E4]
X.rf = (E5->E1) + (E3->E4)
}
}
run alloy_trace_104 for 1 Exec_F, exactly 6 E expect 0
run wrreq_cpu_allowed for 1 Exec_F, exactly 6 E expect 0
run red_req_and_fence3 for 1 Exec_F, exactly 7 E expect 1
run red_req_and_fence2 for 1 Exec_F, exactly 7 E expect 1
run red_req_and_fence for 1 Exec_F, exactly 6 E expect 1
run cpu_read_old_values for 1 Exec_F, exactly 6 E expect 0
run fpga_fence_cpu_read for 1 Exec_F, exactly 8 E expect 0
run fpga_sch_fence_cpu_read for 1 Exec_F, exactly 8 E expect 0
run fence_on_reads for 1 Exec_F, exactly 7 E expect 1
run store_buffering for 1 Exec_F, exactly 4 E expect 1
run page1_ex1 for 1 Exec_F, exactly 4 E expect 1
run page1_ex2 for 1 Exec_F, exactly 4 E expect 0
run page1_ex3 for 1 Exec_F, exactly 6 E expect 1
run page1_ex4 for 1 Exec_F, exactly 6 E expect 1
run page1_ex5 for 1 Exec_F, exactly 6 E expect 0
run page1_ex6 for 1 Exec_F, exactly 6 E expect 0
run page1_ex7 for 1 Exec_F, exactly 6 E expect 1
run page1_ex8 for 1 Exec_F, exactly 6 E expect 1
run page1_ex9 for 1 Exec_F, exactly 6 E expect 1
run page1_ex10 for 1 Exec_F, exactly 6 E expect 0
run page1_ex11 for 1 Exec_F, exactly 6 E expect 0
run page2_ex1 for 1 Exec_F, exactly 4 E expect 0
run page2_ex2 for 1 Exec_F, exactly 4 E expect 0
run page2_ex3 for 1 Exec_F, exactly 6 E expect 0
run page2_ex4 for 1 Exec_F, exactly 6 E expect 0
run page2_ex5 for 1 Exec_F, exactly 6 E expect 0
run example1 for 1 Exec_F, exactly 4 E expect 1
run example2 for 1 Exec_F, exactly 4 E expect 1
run example3_single for 1 Exec_F, exactly 6 E expect 0
run example3_any for 1 Exec_F, exactly 6 E expect 0
run example4 for 1 Exec_F, exactly 8 E expect 1
run example5 for 1 Exec_F, exactly 8 E expect 1
run example6 for 1 Exec_F, exactly 8 E expect 0
//run example7 for 1 Exec_F, exactly 10 E expect 0
run example8 for 1 Exec_F, exactly 6 E expect 1
run example9 for 1 Exec_F, exactly 6 E expect 0
run example10 for 1 Exec_F, exactly 4 E expect 1
run fence_order_test for 1 Exec_F, exactly 6 E expect 0
run cpu_fpga1 for 1 Exec_F, exactly 6 E expect 1
run cpu_fpga2 for 1 Exec_F, exactly 6 E expect 0
run cpu_fpga3 for 1 Exec_F, exactly 6 E expect 1
run cpu_fpga4 for 1 Exec_F, exactly 6 E expect 1
run cpu_fpga6 for 1 Exec_F, exactly 6 E expect 1
run cpu_fpga7 for 1 Exec_F, exactly 6 E expect 0
run automatic_trace1 for 1 Exec_F, exactly 4 E expect 0
run automatic_trace2 for 1 Exec_F, exactly 4 E expect 0
run propagation_page_1 for 1 Exec_F, exactly 5 E expect 0
run propagation_page_2 for 1 Exec_F, exactly 7 E expect 0
run propagation_page_3 for 1 Exec_F, exactly 9 E expect 0
run propagation_page_4 for 1 Exec_F, exactly 6 E expect 0
run propagation_page_5 for 1 Exec_F, exactly 8 E expect 0
|
libsrc/_DEVELOPMENT/stdio/z80/__stdio_lock_file_list.asm | jpoikela/z88dk | 640 | 87379 | <filename>libsrc/_DEVELOPMENT/stdio/z80/__stdio_lock_file_list.asm
SECTION code_clib
SECTION code_stdio
PUBLIC __stdio_lock_file_list
EXTERN __stdio_file_list_lock
EXTERN asm_mtx_lock
__stdio_lock_file_list:
; acquire stdio lock on FILE lists
;
; enter : none
;
; exit : lock acquired
;
; uses : af, bc, de, hl
ld hl,__stdio_file_list_lock
call asm_mtx_lock
ret nc
jr __stdio_lock_file_list ; do not accept lock error on stdio lock
|
data/pokemon/dex_entries/bellrun.asm | AtmaBuster/pokeplat-gen2 | 6 | 18263 | <filename>data/pokemon/dex_entries/bellrun.asm
db "LOUDCAT@" ; species name
db "Each clan has its"
next "own distinctive"
next "pitch to their"
page "bell chime. They"
next "communicate using"
next "chime sequences.@"
|
Transynther/x86/_processed/AVXALIGN/_ht_zr_/i9-9900K_12_0xca_notsx.log_696_1852.asm | ljhsiun2/medusa | 9 | 83710 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r15
push %r9
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0xda68, %rcx
nop
nop
nop
xor $16685, %rbx
mov (%rcx), %dx
nop
nop
sub $21443, %r15
lea addresses_A_ht+0x3a18, %rsi
lea addresses_D_ht+0x1ca18, %rdi
nop
nop
nop
nop
add $28565, %r10
mov $59, %rcx
rep movsb
nop
nop
nop
inc %r15
lea addresses_UC_ht+0x1d118, %r10
nop
nop
nop
xor $28629, %rbx
movl $0x61626364, (%r10)
nop
nop
sub $46928, %rcx
lea addresses_A_ht+0x4c18, %rsi
lea addresses_UC_ht+0x4018, %rdi
clflush (%rsi)
nop
nop
nop
xor %r9, %r9
mov $34, %rcx
rep movsq
nop
nop
nop
nop
nop
add %rbx, %rbx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r15
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r14
push %rax
push %rdi
push %rdx
// Store
lea addresses_WC+0x16e18, %r14
nop
and $48603, %rax
movw $0x5152, (%r14)
nop
nop
nop
nop
and %rdi, %rdi
// Load
lea addresses_WC+0xefc8, %r13
nop
nop
nop
nop
nop
and %r10, %r10
vmovntdqa (%r13), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $0, %xmm5, %rax
nop
nop
nop
nop
sub $40545, %r13
// Store
lea addresses_A+0x51aa, %r13
nop
nop
nop
nop
and $27902, %r10
mov $0x5152535455565758, %r12
movq %r12, %xmm1
movups %xmm1, (%r13)
// Exception!!!
nop
nop
nop
mov (0), %rax
nop
nop
xor $49940, %rax
// Load
lea addresses_UC+0x18618, %r13
clflush (%r13)
xor $64555, %r12
movb (%r13), %r10b
nop
nop
nop
sub %r12, %r12
// Faulty Load
lea addresses_normal+0x11a18, %r12
add %rdx, %rdx
vmovaps (%r12), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $1, %xmm0, %rdi
lea oracles, %r12
and $0xff, %rdi
shlq $12, %rdi
mov (%r12,%rdi,1), %rdi
pop %rdx
pop %rdi
pop %rax
pop %r14
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 9}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC', 'NT': True, 'AVXalign': False, 'size': 32, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 1}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 10}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_normal', 'NT': False, 'AVXalign': True, 'size': 32, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 4}}
{'OP': 'REPM', 'src': {'same': True, 'congruent': 8, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 8}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_UC_ht'}}
{'00': 1, '45': 695}
00 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45
*/
|
a06.asm | Sahilsinggh/MP_SEM4 | 1 | 97021 | %macro print 2
mov rax,01;
mov rdi,01;
mov rsi,%1;
mov rdx,%2;
syscall;
%endmacro
%macro read 2
mov rax,00;
mov rdi,00;
mov rsi,%1;
mov rdx,%2;
syscall;
%endmacro
section .data
dash: db "-------------------------------------------",10;
lenDash: equ $-dash;
rmMsg: db "Processor is in Real Mode!";
lenRmMsg: equ $-rmMsg;
peMsg: db "Processor is in Protected Mode!";
lenPeMsg: equ $-peMsg;
mswMsg: db "Contents of MSW: ";
lenMswMsg: equ $-mswMsg;
gdtrMsg: db "Contents of GDTR: ";
lenGdtrMsg: equ $-gdtrMsg;
idtrMsg: db "Contents of IDTR: ";
lenIdtrMsg: equ $-idtrMsg;
ldtrMsg: db "Contents of LDTR: ";
lenLdtrMsg: equ $-ldtrMsg;
trMsg: db "Contents of TR: ";
lenTrMsg: equ $-trMsg;
space: db " ";
colon: db ":";
newLine: db 10d;
section .bss
gdt:resd 1
resw 1; //48 bits
idt:resd 1
resw 1; //48 bits
ldt: resw 1; //16 bits
tr: resw 1; //16 bits
msw: resw 1;
inAscii: resb 16;
outAscii: resb 4;
section .text
global _start
_start:
smsw ax;
bt ax,0;
jc protected_mode
real_mode:
print newLine,1;
print rmMsg,lenRmMsg;
print newLine,1;
protected_mode:
print newLine,1;
print peMsg,lenPeMsg;
print newLine,1;
store_descriptor_contents:
smsw word[msw];
sgdt [gdt];
sidt [idt];
sldt [ldt];
str [tr];
display_GDTR_contents:
print newLine,1;
print gdtrMsg,lenGdtrMsg;
print newLine,1;
mov ax,word[gdt+4]
call _HexToAscii;
print outAscii,4;
mov ax,word[gdt+2];
call _HexToAscii;
print outAscii,4;
print colon,1;
mov ax,word[gdt];
call _HexToAscii;
print outAscii,4;
print newLine,1;
display_IDTR_contents:
print newLine,1;
print idtrMsg,lenIdtrMsg;
print newLine,1;
mov ax,word[idt+4]
call _HexToAscii;
print outAscii,4;
mov ax,word[idt+2];
call _HexToAscii;
print outAscii,4;
print colon,1;
mov ax,word[idt];
call _HexToAscii;
print outAscii,4;
print newLine,1;
display_LDTR_contents:
print newLine,1;
print ldtrMsg,lenLdtrMsg;
print newLine,1;
mov ax,word[ldt];
call _HexToAscii;
print outAscii,4;
print newLine,1;
display_TR_contents:
print newLine,1;
print trMsg,lenTrMsg;
print newLine,1;
mov ax,word[tr];
call _HexToAscii;
print outAscii,4;
print newLine,1;
diaplay_MSW_contents:
print newLine,1;
print mswMsg,lenMswMsg;
print newLine,1;
mov ax,word[msw];
call _HexToAscii;
print outAscii,4;
print newLine,1;
exit:
mov rax,60;
mov rdi,0
syscall;
_AsciiToHex:; //ASCII in inAscii ----> HEX in RAX
mov rsi,inAscii;
xor rax,rax;
begin1:
cmp byte[rsi],0xA; //Compare With New Line
je done;
rol rax,04d;
mov bl,byte[rsi];
cmp bl,39h;
jbe sub30
sub bl,07h;
sub30:
sub bl,30h;
add al,bl;
inc rsi;
jmp begin1;
done:
ret
_HexToAscii:; // HEX in RAX -----> ASCII in outAscii
mov rsi,outAscii+3d;
mov rcx,4d
begin2:
xor rdx,rdx;
mov rbx,10h; //16d
div rbx;
cmp dl,09h;
jbe add30;
add dl,07h;
add30:
add dl,30h;
mov byte[rsi],dl;
update:
dec rsi;
dec rcx;
jnz begin2;
ret
|
private/ntos/dll/i386/ldrthunk.asm | King0987654/windows2000 | 11 | 13866 | title "LdrInitializeThunk"
;++
;
; Copyright (c) 1989 Microsoft Corporation
;
; Module Name:
;
; ldrthunk.s
;
; Abstract:
;
; This module implements the thunk for the LdrpInitialize APC routine.
;
; Author:
;
; <NAME> (stevewo) 27-Apr-1990
;
; Environment:
;
; Any mode.
;
; Revision History:
;
;--
.386p
.xlist
include ks386.inc
include callconv.inc ; calling convention macros
.list
EXTRNP _LdrpInitialize,3
_TEXT SEGMENT DWORD PUBLIC 'CODE'
ASSUME DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
page , 132
;++
;
; VOID
; LdrInitializeThunk(
; IN PVOID NormalContext,
; IN PVOID SystemArgument1,
; IN PVOID SystemArgument2
; )
;
; Routine Description:
;
; This function computes a pointer to the context record on the stack
; and jumps to the LdrpInitialize function with that pointer as its
; parameter.
;
; Arguments:
;
; NormalContext - User Mode APC context parameter (ignored).
;
; SystemArgument1 - User Mode APC system argument 1 (ignored).
;
; SystemArgument2 - User Mode APC system argument 2 (ignored).
;
; Return Value:
;
; None.
;
;--
cPublicProc _LdrInitializeThunk , 4
NormalContext equ [esp + 4]
SystemArgument1 equ [esp + 8]
SystemArgument2 equ [esp + 12]
Context equ [esp + 16]
lea eax,Context ; Calculate address of context record
mov NormalContext,eax ; Pass as first parameter to
if DEVL
xor ebp,ebp ; Mark end of frame pointer list
endif
IFDEF STD_CALL
jmp _LdrpInitialize@12 ; LdrpInitialize
ELSE
jmp _LdrpInitialize ; LdrpInitialize
ENDIF
stdENDP _LdrInitializeThunk
;++
;
; VOID
; LdrpCallInitRoutine(
; IN PDLL_INIT_ROUTINE InitRoutine,
; IN PVOID DllHandle,
; IN ULONG Reason,
; IN PCONTEXT Context OPTIONAL
; )
;
; Routine Description:
;
; This function calls an x86 DLL init routine. It is robust
; against DLLs that don't preserve EBX or fail to clean up
; enough stack.
;
; The only register that the DLL init routine cannot trash is ESI.
;
; Arguments:
;
; InitRoutine - Address of init routine to call
;
; DllHandle - Handle of DLL to call
;
; Reason - one of the DLL_PROCESS_... or DLL_THREAD... values
;
; Context - context pointer or NULL
;
; Return Value:
;
; FALSE if the init routine fails, TRUE for success.
;
;--
cPublicProc _LdrpCallInitRoutine , 4
InitRoutine equ [ebp + 8]
DllHandle equ [ebp + 12]
Reason equ [ebp + 16]
Context equ [ebp + 20]
stdENDP _LdrpCallInitRoutine
push ebp
mov ebp, esp
push esi ; save esi across the call
push edi ; save edi across the call
push ebx ; save ebx on the stack across the call
mov esi,esp ; save the stack pointer in esi across the call
push Context
push Reason
push DllHandle
call InitRoutine
mov esp,esi ; restore the stack pointer in case callee forgot to clean up
pop ebx ; restore ebx
pop edi ; restore edi
pop esi ; restore esi
pop ebp
stdRET _LdrpCallInitRoutine
_TEXT ends
end
|
libsrc/_DEVELOPMENT/font/font_4x8/_font_4x8_64_omni1.asm | jpoikela/z88dk | 640 | 2798 | <filename>libsrc/_DEVELOPMENT/font/font_4x8/_font_4x8_64_omni1.asm
;
; Font extracted from 64-4.tap
;
; Tap file downloaded from: http://mdfs.net/Software/Spectrum/Coding/Printout/
SECTION rodata_font
SECTION rodata_font_4x8
PUBLIC _font_4x8_64_omni1
PUBLIC _font_4x8_64_omni1_end
_font_4x8_64_omni1:
BINARY "font_4x8_64_omni1.bin"
_font_4x8_64_omni1_end:
|
programs/oeis/084/A084569.asm | jmorken/loda | 1 | 101063 | <filename>programs/oeis/084/A084569.asm
; A084569: Partial sums of A084570.
; 1,3,9,21,44,82,142,230,355,525,751,1043,1414,1876,2444,3132,3957,4935,6085,7425,8976,10758,12794,15106,17719,20657,23947,27615,31690,36200,41176,46648,52649,59211,66369,74157,82612,91770,101670,112350,123851
mov $15,$0
mov $17,$0
add $17,1
lpb $17
clr $0,15
mov $0,$15
sub $17,1
sub $0,$17
mov $12,$0
mov $14,$0
add $14,1
lpb $14
clr $0,12
mov $0,$12
sub $14,1
sub $0,$14
mov $9,$0
mov $11,$0
add $11,1
lpb $11
mov $0,$9
sub $11,1
sub $0,$11
add $0,6
mov $1,$0
div $1,2
mov $6,2
trn $7,$0
add $0,1
lpb $0
mul $1,$6
mul $1,2
mod $1,$0
sub $0,$0
add $7,1
add $0,$7
add $1,$0
add $1,1
lpe
sub $1,6
add $10,$1
lpe
add $13,$10
lpe
add $16,$13
lpe
mov $1,$16
|
test2.asm | DarkShadow44/win16 | 0 | 25304 | extern WinMainCRTStartup_ : near
public wstart_
.code
wstart_:
call WinMainCRTStartup_
; exit
mov ah, 04ch
int 021h
int 021h
end wstart_
|
oeis/014/A014140.asm | neoneye/loda-programs | 11 | 179996 | ; A014140: Apply partial sum operator twice to Catalan numbers.
; 1,3,7,16,39,104,301,927,2983,9901,33615,116115,406627,1440039,5147891,18550588,67310955,245716112,901759969,3325067016,12312494483,45766188970,170702447097,638698318874,2396598337975,9016444758528,34003644251233,128524394659942,486793096819011,1847304015629448,7022801436532189,26742934896661839,101997133233839687,389587461983260645,1490121832882412367,5706941698688865351,21883559950355771827,84010982526644420667,322872267889939770907,1242158924983210921537,4783572624352974180987
lpb $0
mov $2,$0
sub $0,1
seq $2,14137 ; Partial sums of Catalan numbers (A000108).
add $1,$2
lpe
add $1,1
mov $0,$1
|
source/tasking/machine-apple-darwin/s-intnum.adb | ytomino/drake | 33 | 8926 | <gh_stars>10-100
package body System.Interrupt_Numbers is
function Is_Reserved (Interrupt : C.signed_int) return Boolean is
begin
return Interrupt not in First_Interrupt_Id .. Last_Interrupt_Id
or else Interrupt = C.signal.SIGKILL
or else Interrupt = C.signal.SIGSTOP;
end Is_Reserved;
end System.Interrupt_Numbers;
|
z3.adb | Componolit/AZ3 | 5 | 13542 | <reponame>Componolit/AZ3
with Interfaces.C.Extensions;
with Ada.Strings.Hash;
with z3_optimization_h;
with System;
package body Z3
is
use Interfaces.C.Strings;
procedure Set_Param_Value (ID : String; Value : String)
is
C_ID : chars_ptr := New_String (ID);
C_Value : chars_ptr := New_String (Value);
begin
z3_api_h.Z3_set_param_value (c => Default_Config.Data,
param_id => z3_api_h.Z3_string (C_ID),
param_value => z3_api_h.Z3_string (C_Value));
Free (C_ID);
Free (C_Value);
end Set_Param_Value;
------------------------------------------------------------------------------------------------
function Bool (Name : String; Context : Z3.Context := Default_Context) return Bool_Type
is
C_Name : constant chars_ptr := New_String (Name);
Symbol : constant z3_api_h.Z3_symbol :=
z3_api_h.Z3_mk_string_symbol (c => Context.Data,
s => z3_api_h.Z3_string (C_Name));
begin
return (Data => z3_api_h.Z3_mk_const (c => Context.Data,
s => Symbol,
ty => z3_api_h.Z3_mk_bool_sort (Context.Data)),
Context => Context);
end Bool;
------------------------------------------------------------------------------------------------
function Bool (Value : Boolean; Context : Z3.Context := Default_Context) return Bool_Type
is
begin
if Value then
return (Data => z3_api_h.Z3_mk_true (Context.Data),
Context => Context);
end if;
return (Data => z3_api_h.Z3_mk_false (Context.Data),
Context => Context);
end Bool;
------------------------------------------------------------------------------------------------
function Bool (Expr : Expr_Type'Class) return Bool_Type is
(Data => Expr.Data,
Context => Expr.Context);
------------------------------------------------------------------------------------------------
function Equal (Left, Right : Expr_Type'Class) return Bool_Type
is
begin
return (Data => z3_api_h.Z3_mk_eq (c => Left.Context.Data,
l => Left.Data,
r => Right.Data),
Context => Left.Context);
end Equal;
function "=" (Left, Right : Expr_Type'Class) return Bool_Type is (Equal (Left, Right));
function "/=" (Left, Right : Expr_Type'Class) return Bool_Type is (not Equal (Left, Right));
------------------------------------------------------------------------------------------------
function Simplified (Value : Expr_Type) return Expr_Type
is
begin
return (Data => z3_api_h.Z3_simplify (c => Value.Context.Data,
a => Value.Data),
Context => Value.Context);
end Simplified;
------------------------------------------------------------------------------------------------
function Substitute (Expr : Expr_Type'Class;
From : Bool_Array;
To : Bool_Array) return Expr_Type'Class
is
From_Ast : constant Z3_ast_array := To_Z3_ast_array (From);
To_Ast : constant Z3_ast_array := To_Z3_ast_array (To);
begin
if From'Length = 0 then
return Expr;
end if;
return Expr_Type'(Data => z3_api_h.Z3_substitute (Expr.Context.Data,
Expr.Data,
From_Ast'Length,
From_Ast'Address,
To_Ast'Address),
Context => Expr.Context);
end Substitute;
------------------------------------------------------------------------------------------------
function Substitute (Expr : Expr_Type'Class;
From : Int_Array;
To : Int_Array) return Expr_Type'Class
is
From_Ast : constant Z3_ast_array := To_Z3_ast_array (From);
To_Ast : constant Z3_ast_array := To_Z3_ast_array (To);
begin
if From'Length = 0 then
return Expr;
end if;
return Expr_Type'(Data => z3_api_h.Z3_substitute (Expr.Context.Data,
Expr.Data,
From_Ast'Length,
From_Ast'Address,
To_Ast'Address),
Context => Expr.Context);
end Substitute;
------------------------------------------------------------------------------------------------
function New_Context return Context is ((Data => z3_api_h.Z3_mk_context (z3_api_h.Z3_mk_config)));
------------------------------------------------------------------------------------------------
function "not" (Value : Bool_Type) return Bool_Type
is
begin
return (Data => z3_api_h.Z3_mk_not (c => Value.Context.Data,
a => Value.Data),
Context => Value.Context);
end "not";
------------------------------------------------------------------------------------------------
function Conjunction (Terms : Bool_Array) return Bool_Type
is
type Z3_Bool_Array is array (Terms'Range) of z3_api_h.Z3_ast;
Args : Z3_Bool_Array;
First : constant Bool_Type := Terms (Terms'First);
begin
for I in Terms'Range loop
Args (I) := Terms (I).Data;
end loop;
return (Data => z3_api_h.Z3_mk_and (c => First.Context.Data,
num_args => Args'Length,
args => Args'Address),
Context => First.Context);
end Conjunction;
------------------------------------------------------------------------------------------------
function "and" (Left, Right : Bool_Type) return Bool_Type
is
begin
return Conjunction ((Left, Right));
end "and";
------------------------------------------------------------------------------------------------
function Disjunction (Terms : Bool_Array) return Bool_Type
is
type Z3_Bool_Array is array (Terms'Range) of z3_api_h.Z3_ast;
Args : Z3_Bool_Array;
First : constant Bool_Type := Terms (Terms'First);
begin
for I in Terms'Range loop
Args (I) := Terms (I).Data;
end loop;
return (Data => z3_api_h.Z3_mk_or (c => First.Context.Data,
num_args => Args'Length,
args => Args'Address),
Context => First.Context);
end Disjunction;
------------------------------------------------------------------------------------------------
function "or" (Left, Right : Bool_Type) return Bool_Type
is
begin
return Disjunction ((Left, Right));
end "or";
------------------------------------------------------------------------------------------------
function Int (Name : String; Context : Z3.Context := Default_Context) return Int_Type
is
C_Name : constant chars_ptr := New_String (Name);
Symbol : constant z3_api_h.Z3_symbol :=
z3_api_h.Z3_mk_string_symbol (c => Context.Data,
s => z3_api_h.Z3_string (C_Name));
begin
return (Data => z3_api_h.Z3_mk_const (c => Context.Data,
s => Symbol,
ty => z3_api_h.Z3_mk_int_sort (Context.Data)),
Context => Context);
end Int;
------------------------------------------------------------------------------------------------
function Int (Value : Long_Long_Integer;
Context : Z3.Context := Default_Context) return Int_Type
is
begin
return (Data => z3_api_h.Z3_mk_int64 (c => Context.Data,
v => Value,
ty => z3_api_h.Z3_mk_int_sort (Context.Data)),
Context => Context);
end Int;
------------------------------------------------------------------------------------------------
function Int (Expr : Expr_Type'Class) return Int_Type is
(Data => Expr.Data,
Context => Expr.Context);
------------------------------------------------------------------------------------------------
function Int (Value : Long_Long_Unsigned;
Context : Z3.Context := Default_Context) return Int_Type
is
begin
return (Data => z3_api_h.Z3_mk_unsigned_int64 (c => Context.Data,
v => Interfaces.C.Extensions.unsigned_long_long (Value),
ty => z3_api_h.Z3_mk_int_sort (Context.Data)),
Context => Context);
end Int;
------------------------------------------------------------------------------------------------
function Add (Values : Int_Array) return Int_Type
is
type Z3_Int_Array is array (Values'Range) of z3_api_h.Z3_ast;
Args : Z3_Int_Array;
First : constant Int_Type := Values (Values'First);
begin
for I in Values'Range loop
Args (I) := Values (I).Data;
end loop;
return (Data => z3_api_h.Z3_mk_add (c => First.Context.Data,
num_args => Args'Length,
args => Args'Address),
Context => First.Context);
end Add;
------------------------------------------------------------------------------------------------
function "+" (Left : Int_Type; Right : Int_Type) return Int_Type
is
begin
return Add ((Left, Right));
end "+";
------------------------------------------------------------------------------------------------
function Mul (Values : Int_Array) return Int_Type
is
type Z3_Int_Array is array (Values'Range) of z3_api_h.Z3_ast;
Args : Z3_Int_Array;
First : constant Int_Type := Values (Values'First);
begin
for I in Values'Range loop
Args (I) := Values (I).Data;
end loop;
return (Data => z3_api_h.Z3_mk_mul (c => First.Context.Data,
num_args => Args'Length,
args => Args'Address),
Context => First.Context);
end Mul;
------------------------------------------------------------------------------------------------
function "*" (Left : Int_Type; Right : Int_Type) return Int_Type
is
begin
return Mul ((Left, Right));
end "*";
------------------------------------------------------------------------------------------------
function "-" (Left : Int_Type; Right : Int_Type) return Int_Type
is
type Int_Array is array (1 .. 2) of z3_api_h.Z3_ast;
Args : constant Int_Array := (Left.Data, Right.Data);
begin
return (Data => z3_api_h.Z3_mk_sub (c => Left.Context.Data,
num_args => Args'Length,
args => Args'Address),
Context => Left.Context);
end "-";
------------------------------------------------------------------------------------------------
function "/" (Left : Int_Type; Right : Int_Type) return Int_Type
is
begin
return (Data => z3_api_h.Z3_mk_div (c => Left.Context.Data,
arg1 => Left.Data,
arg2 => Right.Data),
Context => Left.Context);
end "/";
------------------------------------------------------------------------------------------------
function "**" (Left : Int_Type; Right : Int_Type) return Int_Type
is
begin
return (Data => z3_api_h.Z3_mk_power (c => Left.Context.Data,
arg1 => Left.Data,
arg2 => Right.Data),
Context => Left.Context);
end "**";
------------------------------------------------------------------------------------------------
function "mod" (Left : Int_Type; Right : Int_Type) return Int_Type
is
begin
return (Data => z3_api_h.Z3_mk_mod (c => Left.Context.Data,
arg1 => Left.Data,
arg2 => Right.Data),
Context => Left.Context);
end "mod";
------------------------------------------------------------------------------------------------
function "-" (Value : Int_Type) return Int_Type
is
begin
return (Data => z3_api_h.Z3_mk_unary_minus (c => Value.Context.Data,
arg => Value.Data),
Context => Value.Context);
end "-";
------------------------------------------------------------------------------------------------
function "<" (Left : Int_Type'Class; Right : Int_Type'Class) return Bool_Type
is
begin
return (Data => z3_api_h.Z3_mk_lt (c => Left.Context.Data,
t1 => Left.Data,
t2 => Right.Data),
Context => Left.Context);
end "<";
------------------------------------------------------------------------------------------------
function "<=" (Left : Int_Type'Class; Right : Int_Type'Class) return Bool_Type
is
begin
return (Data => z3_api_h.Z3_mk_le (c => Left.Context.Data,
t1 => Left.Data,
t2 => Right.Data),
Context => Left.Context);
end "<=";
------------------------------------------------------------------------------------------------
function ">" (Left : Int_Type'Class; Right : Int_Type'Class) return Bool_Type
is
begin
return (Data => z3_api_h.Z3_mk_gt (c => Left.Context.Data,
t1 => Left.Data,
t2 => Right.Data),
Context => Left.Context);
end ">";
------------------------------------------------------------------------------------------------
function ">=" (Left : Int_Type'Class; Right : Int_Type'Class) return Bool_Type
is
begin
return (Data => z3_api_h.Z3_mk_ge (c => Left.Context.Data,
t1 => Left.Data,
t2 => Right.Data),
Context => Left.Context);
end ">=";
------------------------------------------------------------------------------------------------
function Create (Context : Z3.Context := Default_Context) return Solver
is
begin
return (Data => z3_api_h.Z3_mk_solver (Context.Data),
Context => Context);
end Create;
------------------------------------------------------------------------------------------------
function Create (Logic : Solver_Logic;
Context : Z3.Context := Default_Context) return Solver
is
begin
return (Data => z3_api_h.Z3_mk_solver_for_logic
(Context.Data,
z3_api_h.Z3_mk_string_symbol (Context.Data, z3_api_h.Z3_string (Logic))),
Context => Context);
end Create;
------------------------------------------------------------------------------------------------
procedure Assert (Solver : in out Z3.Solver;
Fact : Bool_Type'Class;
Context : Z3.Context := Default_Context)
is
begin
z3_api_h.Z3_solver_assert (c => Context.Data,
s => Solver.Data,
a => Fact.Data);
end Assert;
------------------------------------------------------------------------------------------------
function Check (Solver : Z3.Solver;
Context : Z3.Context := Default_Context) return Result
is
Check_Result : z3_api_h.Z3_lbool;
begin
Check_Result := z3_api_h.Z3_solver_check (c => Context.Data, s => Solver.Data);
case Check_Result is
when z3_api_h.Z3_L_FALSE => return Result_False;
when z3_api_h.Z3_L_TRUE => return Result_True;
when z3_api_h.Z3_L_UNDEF => return Result_Undef;
when others => raise Z3.Internal_Error; -- GCOV_EXCL_LINE
end case;
end Check;
------------------------------------------------------------------------------------------------
procedure Reset (Solver : in out Z3.Solver;
Context : Z3.Context := Default_Context)
is
begin
z3_api_h.Z3_solver_reset (c => Context.Data, s => Solver.Data);
end Reset;
------------------------------------------------------------------------------------------------
function Same_Context (Left, Right : Expr_Type'Class) return Boolean
is
begin
return Left.Context = Right.Context;
end Same_Context;
------------------------------------------------------------------------------------------------
function Same_Context (Terms : Bool_Array) return Boolean
is
First : Bool_Type;
begin
if Terms'Length <= 1 then
return True;
end if;
First := Terms (Terms'First);
return (for all T of Terms (Terms'First + 1 .. Terms'Last) => Same_Context (T, First));
end Same_Context;
------------------------------------------------------------------------------------------------
function Same_Context (Values : Int_Array) return Boolean
is
First : Int_Type;
begin
if Values'Length <= 1 then
return True;
end if;
First := Values (Values'First);
return (for all T of Values (Values'First + 1 .. Values'Last) => Same_Context (T, First));
end Same_Context;
------------------------------------------------------------------------------------------------
function "+" (Value : Expr_Type) return String
is
begin
return ICS.Value (chars_ptr (z3_api_h.Z3_ast_to_string (c => Value.Context.Data,
a => Value.Data)));
end "+";
------------------------------------------------------------------------------------------------
function Value (Data : Int_Type) return Long_Long_Integer
is
Success : z3_api_h.Z3_bool;
Result : aliased Long_Long_Integer;
use type Interfaces.C.Extensions.bool;
begin
Success := z3_api_h.Z3_get_numeral_int64 (c => Data.Context.Data,
v => Data.Data,
i => Result'Access);
if not Success then
raise Z3.Value_Error;
end if;
return Result;
end Value;
------------------------------------------------------------------------------------------------
function Value (Data : Int_Type) return Long_Long_Unsigned
is
Success : z3_api_h.Z3_bool;
Result : aliased Interfaces.C.Extensions.unsigned_long_long;
use type Interfaces.C.Extensions.bool;
begin
Success := z3_api_h.Z3_get_numeral_uint64 (c => Data.Context.Data,
v => Data.Data,
u => Result'Access);
if not Success then
raise Z3.Value_Error;
end if;
return Long_Long_Unsigned (Result);
end Value;
------------------------------------------------------------------------------------------------
function To_Z3_ast_array (Value : Bool_Array) return Z3_ast_array
is
Result : Z3_ast_array (Value'First .. Value'Last);
begin
for I in Value'Range loop
Result (I) := Value (I).Data;
end loop;
return Result;
end To_Z3_ast_array;
------------------------------------------------------------------------------------------------
function To_Z3_ast_array (Value : Int_Array) return Z3_ast_array
is
Result : Z3_ast_array (Value'First .. Value'Last);
begin
for I in Value'Range loop
Result (I) := Value (I).Data;
end loop;
return Result;
end To_Z3_ast_array;
------------------------------------------------------------------------------------------------
function To_Z3_ast_array (Value : Bit_Vector_Array) return Z3_ast_array
is
Result : Z3_ast_array (Value'First .. Value'Last);
begin
for I in Value'Range loop
Result (I) := Value (I).Data;
end loop;
return Result;
end To_Z3_ast_array;
------------------------------------------------------------------------------------------------
function Terms (Value : Expr_Type) return Natural
is
begin
if z3_api_h.Z3_get_ast_kind (Value.Context.Data, Value.Data) = 1 then
return Natural (z3_api_h.Z3_get_app_num_args (Value.Context.Data,
z3_api_h.Z3_to_app (Value.Context.Data,
Value.Data)));
else
return 0;
end if;
end Terms;
------------------------------------------------------------------------------------------------
function Term (Value : Expr_Type;
Index : Natural) return Expr_Type'Class
is
begin
if Index >= Terms (Value) then
raise Z3.Value_Error;
end if;
return Expr_Type'(Context => Value.Context,
Data => z3_api_h.Z3_get_app_arg (Value.Context.Data,
z3_api_h.Z3_to_app (Value.Context.Data, Value.Data),
Interfaces.C.unsigned (Index)));
end Term;
------------------------------------------------------------------------------------------------
function Kind (Value : Expr_Type) return Expr_Kind
is
Ctx : constant z3_api_h.Z3_context := Value.Context.Data;
Decl_Kind : z3_api_h.Z3_decl_kind;
begin
case z3_api_h.Z3_get_ast_kind (Ctx, Value.Data) is
when 0 =>
return Kind_Constant;
when 1 =>
Decl_Kind := z3_api_h.Z3_get_decl_kind
(Ctx, z3_api_h.Z3_get_app_decl (Ctx, z3_api_h.Z3_to_app (Ctx, Value.Data)));
case Decl_Kind is
when z3_api_h.Z3_OP_TRUE => return Kind_Constant;
when z3_api_h.Z3_OP_FALSE => return Kind_Constant;
when z3_api_h.Z3_OP_EQ => return Kind_Equal;
when z3_api_h.Z3_OP_AND => return Kind_And;
when z3_api_h.Z3_OP_OR => return Kind_Or;
when z3_api_h.Z3_OP_NOT => return Kind_Not;
when z3_api_h.Z3_OP_LE => return Kind_Less_Equal;
when z3_api_h.Z3_OP_SLEQ => return Kind_Less_Equal;
when z3_api_h.Z3_OP_GE => return Kind_Greater_Equal;
when z3_api_h.Z3_OP_SGEQ => return Kind_Greater_Equal;
when z3_api_h.Z3_OP_LT => return Kind_Less_Than;
when z3_api_h.Z3_OP_SLT => return Kind_Less_Than;
when z3_api_h.Z3_OP_GT => return Kind_Greater_Than;
when z3_api_h.Z3_OP_SGT => return Kind_Greater_Than;
when z3_api_h.Z3_OP_ADD => return Kind_Add;
when z3_api_h.Z3_OP_BADD => return Kind_Add;
when z3_api_h.Z3_OP_SUB => return Kind_Sub;
when z3_api_h.Z3_OP_BSUB => return Kind_Sub;
when z3_api_h.Z3_OP_MUL => return Kind_Mul;
when z3_api_h.Z3_OP_BMUL => return Kind_Mul;
when z3_api_h.Z3_OP_IDIV => return Kind_Div;
when z3_api_h.Z3_OP_BSDIV => return Kind_Div;
when z3_api_h.Z3_OP_MOD => return Kind_Mod;
when z3_api_h.Z3_OP_BSMOD => return Kind_Mod;
when z3_api_h.Z3_OP_POWER => return Kind_Power;
when z3_api_h.Z3_OP_UNINTERPRETED => return Kind_Var;
when others => return Kind_Any; -- GCOV_EXCL_LINE
end case;
when others => -- GCOV_EXCL_LINE
return Kind_Any; -- GCOV_EXCL_LINE
end case;
end Kind;
------------------------------------------------------------------------------------------------
function Sort (Value : Expr_Type) return Expr_Sort
is
Ctx : constant z3_api_h.Z3_context := Value.Context.Data;
begin
case z3_api_h.Z3_get_sort_kind (Ctx, z3_api_h.Z3_get_sort (Ctx, Value.Data)) is
when z3_api_h.Z3_BOOL_SORT => return Sort_Bool;
when z3_api_h.Z3_INT_SORT => return Sort_Int;
when z3_api_h.Z3_BV_SORT => return Sort_Bit_Vector;
when others => return Sort_Unknown; -- GCOV_EXCL_LINE
end case;
end Sort;
------------------------------------------------------------------------------------------------
overriding
function "=" (Left, Right : Expr_Type) return Boolean
is
begin
return Boolean (z3_api_h.Z3_is_eq_ast (Left.Context.Data, Left.Data, Right.Data));
end "=";
------------------------------------------------------------------------------------------------
function Create (Context : Z3.Context := Default_Context) return Optimize
is
Opt : constant z3_api_h.Z3_optimize := z3_optimization_h.Z3_mk_optimize (Context.Data);
begin
-- ISSUE: Componolit/AZ3#9
z3_optimization_h.Z3_optimize_inc_ref (Context.Data, Opt);
z3_optimization_h.Z3_optimize_push (Context.Data, Opt);
return Optimize'(Data => Opt,
Context => Context,
Objectives => Int_Maps.Empty_Map,
Backtracking_Count => 0);
end Create;
function "+" (Optimize : Z3.Optimize) return String
is
begin
return ICS.Value (chars_ptr (z3_optimization_h.Z3_optimize_to_string (c => Optimize.Context.Data,
o => Optimize.Data)));
end "+";
------------------------------------------------------------------------------------------------
procedure Set_Timeout (Optimize : in out Z3.Optimize;
Timeout : Natural := 1000)
is
Param_Name : constant chars_ptr := New_String ("timeout");
Params : constant z3_api_h.Z3_params := z3_api_h.Z3_mk_params (Optimize.Context.Data);
begin
z3_api_h.Z3_params_set_uint
(Optimize.Context.Data,
Params,
z3_api_h.Z3_mk_string_symbol (Optimize.Context.Data, z3_api_h.Z3_string (Param_Name)),
Interfaces.C.unsigned (Timeout));
z3_optimization_h.Z3_optimize_set_params (Optimize.Context.Data, Optimize.Data, Params);
end Set_Timeout;
------------------------------------------------------------------------------------------------
function Same_Context (Optimize : Z3.Optimize;
Term : Z3.Expr_Type'Class) return Boolean is
(Optimize.Context.Data = Term.Context.Data);
------------------------------------------------------------------------------------------------
procedure Assert (Optimize : in out Z3.Optimize;
Fact : Bool_Type'Class)
is
begin
z3_optimization_h.Z3_optimize_assert (Optimize.Context.Data, Optimize.Data, Fact.Data);
end Assert;
------------------------------------------------------------------------------------------------
procedure Minimize (Optimize : in out Z3.Optimize;
Term : Z3.Arith_Type'Class)
is
Index : Interfaces.C.unsigned;
begin
Index := z3_optimization_h.Z3_optimize_minimize (Optimize.Context.Data, Optimize.Data, Term.Data);
Optimize.Objectives.Insert (Term, (Index, Optimize.Backtracking_Count));
end Minimize;
------------------------------------------------------------------------------------------------
procedure Maximize (Optimize : in out Z3.Optimize;
Term : Z3.Arith_Type'Class)
is
Index : Interfaces.C.unsigned;
begin
Index := z3_optimization_h.Z3_optimize_maximize (Optimize.Context.Data, Optimize.Data, Term.Data);
Optimize.Objectives.Insert (Term, (Index, Optimize.Backtracking_Count));
end Maximize;
------------------------------------------------------------------------------------------------
procedure Check (Optimize : in out Z3.Optimize;
Result : out Z3.Result)
is
Check_Result : z3_api_h.Z3_lbool;
begin
Check_Result := z3_optimization_h.Z3_optimize_check
(Optimize.Context.Data, Optimize.Data, 0, System.Null_Address);
case Check_Result is
when z3_api_h.Z3_L_FALSE => Result := Result_False;
when z3_api_h.Z3_L_TRUE => Result := Result_True;
when z3_api_h.Z3_L_UNDEF => Result := Result_Undef;
when others => raise Z3.Internal_Error; -- GCOV_EXCL_LINE
end case;
end Check;
------------------------------------------------------------------------------------------------
function Lower (Optimize : Z3.Optimize;
Objective : Z3.Arith_Type'Class) return Z3.Int_Type'Class
is
begin
return Z3.Int_Type'(Data => z3_optimization_h.Z3_optimize_get_lower (Optimize.Context.Data,
Optimize.Data,
Optimize.Objectives (Objective).Index),
Context => Optimize.Context);
end Lower;
------------------------------------------------------------------------------------------------
function Upper (Optimize : Z3.Optimize;
Objective : Z3.Arith_Type'Class) return Z3.Int_Type'Class
is
begin
return Z3.Int_Type'(Data => z3_optimization_h.Z3_optimize_get_upper (Optimize.Context.Data,
Optimize.Data,
Optimize.Objectives (Objective).Index),
Context => Optimize.Context);
end Upper;
------------------------------------------------------------------------------------------------
function Hash (Key : Z3.Arith_Type'Class) return Ada.Containers.Hash_Type is (Ada.Strings.Hash (+Key));
------------------------------------------------------------------------------------------------
procedure Reset (Optimize : in out Z3.Optimize)
is
begin
for I in 0 .. Optimize.Backtracking_Count loop
z3_optimization_h.Z3_optimize_pop (Optimize.Context.Data, Optimize.Data);
end loop;
Optimize.Backtracking_Count := 0;
z3_optimization_h.Z3_optimize_push (Optimize.Context.Data, Optimize.Data);
Optimize.Objectives := Int_Maps.Empty_Map;
end Reset;
------------------------------------------------------------------------------------------------
procedure Push (Optimize : in out Z3.Optimize)
is
begin
z3_optimization_h.Z3_optimize_push (Optimize.Context.Data, Optimize.Data);
Optimize.Backtracking_Count := Optimize.Backtracking_Count + 1;
end Push;
------------------------------------------------------------------------------------------------
procedure Pop (Optimize : in out Z3.Optimize)
is
Objectives : constant Int_Maps.Map := Optimize.Objectives;
begin
if Optimize.Backtracking_Count < 1 then
raise Z3.Value_Error;
end if;
z3_optimization_h.Z3_optimize_pop (Optimize.Context.Data, Optimize.Data);
Optimize.Backtracking_Count := Optimize.Backtracking_Count - 1;
for C in Objectives.Iterate loop
if Int_Maps.Element (C).Backtracking_Point > Optimize.Backtracking_Count then
Optimize.Objectives.Delete (Int_Maps.Key (C));
end if;
end loop;
end Pop;
------------------------------------------------------------------------------------------------
function Get_Number_Of_Values (Optimize : Z3.Optimize) return Natural is
(Natural (z3_api_h.Z3_model_get_num_consts (Optimize.Context.Data,
z3_optimization_h.Z3_optimize_get_model (Optimize.Context.Data,
Optimize.Data))));
------------------------------------------------------------------------------------------------
procedure Get_Values (Optimize : Z3.Optimize;
Constants : out Int_Array;
Values : out Int_Array)
is
Model : constant z3_api_h.Z3_model :=
z3_optimization_h.Z3_optimize_get_model (Optimize.Context.Data, Optimize.Data);
Func_Decl : z3_api_h.Z3_func_decl;
begin
for I in 0 .. Interfaces.C.unsigned (Constants'Length - 1) loop
Func_Decl := z3_api_h.Z3_model_get_const_decl (Optimize.Context.Data, Model, I);
Constants (Constants'First + Natural (I)) :=
Int_Type'(Data => z3_api_h.Z3_mk_app (Optimize.Context.Data,
Func_Decl,
0,
System.Null_Address),
Context => Optimize.Context);
Values (Values'First + Natural (I)) :=
Int_Type'(Data => z3_api_h.Z3_model_get_const_interp (Optimize.Context.Data,
Model,
Func_Decl),
Context => Optimize.Context);
end loop;
end Get_Values;
------------------------------------------------------------------------------------------------
function Term (Pos : Cursor) return Expr_Type'Class is (Pos.Expr.Term (Pos.Index));
------------------------------------------------------------------------------------------------
function Has_Term (Pos : Cursor) return Boolean is (Pos.Index < Pos.Expr.Terms);
------------------------------------------------------------------------------------------------
function Term_Value (Expr : Expr_Type;
Pos : Cursor) return Expr_Type'Class is (Term (Pos));
------------------------------------------------------------------------------------------------
function Iterate (Expr : Expr_Type) return Expr_Iterators.Forward_Iterator'Class is
(Expr_Iterator'(Expr_Iterators.Forward_Iterator with Expr => Expr));
------------------------------------------------------------------------------------------------
overriding
function First (Object : Expr_Iterator) return Cursor is (Cursor'(Expr => Object.Expr, Index => 0));
------------------------------------------------------------------------------------------------
overriding
function Next (Object : Expr_Iterator;
Pos : Cursor) return Cursor is (Cursor'(Expr => Pos.Expr, Index => Pos.Index + 1));
------------------------------------------------------------------------------------------------
function Big_Int (Value : String;
Base : Positive := 10;
Context : Z3.Context := Default_Context) return Int_Type
is
Position : Long_Long_Integer := 0;
Result : Int_Type;
procedure Check_Digit (Digit : Character;
Base : Positive)
is
begin
if
Digit not in '0' .. '9' | 'a' .. 'f' | 'A' .. 'F'
or (Digit in '0' .. '9'
and Base <= 10
and Base <= Character'Pos (Digit) - Character'Pos ('0'))
or (Digit in 'A' .. 'F'
and Base <= 16
and Base <= Character'Pos (Digit) - Character'Pos ('A'))
or (Digit in 'a' .. 'f'
and Base <= 16
and Base <= Character'Pos (Digit) - Character'Pos ('a'))
then
raise Z3.Value_Error with "Invalid character '" & Digit & "' in numeric value";
end if;
end Check_Digit;
function Val (Digit : Character) return Int_Type
is
begin
if Digit >= '0' and Digit <= '9' then
return Int (Long_Long_Unsigned (Character'Pos (Digit) - Character'Pos ('0')));
elsif Digit >= 'a' and Digit <= 'f' then
return Int (Long_Long_Unsigned (Character'Pos (Digit) - Character'Pos ('a') + 10));
else
return Int (Long_Long_Unsigned (Character'Pos (Digit) - Character'Pos ('A') + 10));
end if;
end Val;
Underscore_Seen : Boolean := False;
begin
for C of reverse Value loop
if C = '_' then
if Position = 0 then
raise Z3.Value_Error with "Leading underscore in " & Value;
end if;
if Underscore_Seen then
raise Z3.Value_Error with "Double underscore in " & Value;
end if;
else
Check_Digit (C, Base);
if Position = 0 then
Result := Val (C);
else
Result := Result + Int (Long_Long_Unsigned (Base)) ** Int (Position) * Val (C);
end if;
Position := Position + 1;
end if;
Underscore_Seen := C = '_';
end loop;
if Underscore_Seen then
raise Z3.Value_Error with "Trailing underscore in " & Value;
end if;
return Simplified (Result);
end Big_Int;
------------------------------------------------------------------------------------------------
function Bit_Vector (Name : String;
Size : Natural;
Context : Z3.Context := Default_Context) return Bit_Vector_Type
is
C_Name : constant chars_ptr := New_String (Name);
Symbol : constant z3_api_h.Z3_symbol :=
z3_api_h.Z3_mk_string_symbol (c => Context.Data,
s => z3_api_h.Z3_string (C_Name));
begin
return (Data => z3_api_h.Z3_mk_const (c => Context.Data,
s => Symbol,
ty => z3_api_h.Z3_mk_bv_sort
(Context.Data, Interfaces.C.unsigned (Size))),
Context => Context);
end Bit_Vector;
------------------------------------------------------------------------------------------------
function Bit_Vector (Value : Long_Long_Unsigned;
Size : Natural;
Context : Z3.Context := Default_Context) return Bit_Vector_Type
is
begin
return (Data => z3_api_h.Z3_mk_unsigned_int64 (c => Context.Data,
v => Interfaces.C.Extensions.unsigned_long_long (Value),
ty => z3_api_h.Z3_mk_bv_sort
(Context.Data, Interfaces.C.unsigned (Size))),
Context => Context);
end Bit_Vector;
------------------------------------------------------------------------------------------------
function Bit_Vector (Value : Long_Long_Integer;
Size : Natural;
Context : Z3.Context := Default_Context) return Bit_Vector_Type
is
begin
return (Data => z3_api_h.Z3_mk_int64 (c => Context.Data,
v => Value,
ty => z3_api_h.Z3_mk_bv_sort
(Context.Data, Interfaces.C.unsigned (Size))),
Context => Context);
end Bit_Vector;
------------------------------------------------------------------------------------------------
function Bit_Vector (Value : Int_Type'Class;
Size : Natural) return Bit_Vector_Type
is
begin
return Simplified ((Data => z3_api_h.Z3_mk_int2bv (c => Value.Context.Data,
n => Interfaces.C.unsigned (Size),
t1 => Value.Data),
Context => Value.Context));
end Bit_Vector;
------------------------------------------------------------------------------------------------
function Bit_Vector (Expr : Expr_Type'Class) return Bit_Vector_Type is
(Data => Expr.Data,
Context => Expr.Context);
------------------------------------------------------------------------------------------------
function Same_Context (Values : Bit_Vector_Array) return Boolean
is
First : Bit_Vector_Type;
begin
if Values'Length <= 1 then
return True;
end if;
First := Values (Values'First);
return (for all T of Values (Values'First + 1 .. Values'Last) => Same_Context (T, First));
end Same_Context;
------------------------------------------------------------------------------------------------
function Substitute (Expr : Expr_Type'Class;
From : Bit_Vector_Array;
To : Bit_Vector_Array) return Expr_Type'Class
is
From_Ast : constant Z3_ast_array := To_Z3_ast_array (From);
To_Ast : constant Z3_ast_array := To_Z3_ast_array (To);
begin
if From'Length = 0 then
return Expr;
end if;
return Expr_Type'(Data => z3_api_h.Z3_substitute (Expr.Context.Data,
Expr.Data,
From_Ast'Length,
From_Ast'Address,
To_Ast'Address),
Context => Expr.Context);
end Substitute;
------------------------------------------------------------------------------------------------
function Value (Data : Bit_Vector_Type) return Long_Long_Unsigned
is
Success : z3_api_h.Z3_bool;
Result : aliased Interfaces.C.Extensions.unsigned_long_long;
use type Interfaces.C.Extensions.bool;
begin
Success := z3_api_h.Z3_get_numeral_uint64 (c => Data.Context.Data,
v => Data.Data,
u => Result'Access);
if not Success then
raise Z3.Value_Error;
end if;
return Long_Long_Unsigned (Result);
end Value;
------------------------------------------------------------------------------------------------
function Size (Value : Bit_Vector_Type) return Natural
is
begin
return Natural (z3_api_h.Z3_get_bv_sort_size (c => Value.Context.Data,
t => z3_api_h.Z3_get_sort (c => Value.Context.Data,
a => Value.Data)));
end Size;
------------------------------------------------------------------------------------------------
function Add (Values : Bit_Vector_Array) return Bit_Vector_Type
is
Result : Bit_Vector_Type := Values (Values'First);
begin
for I in Values'First + 1 .. Values'Last loop
Result := Result + Values (I);
end loop;
return Result;
end Add;
------------------------------------------------------------------------------------------------
function "+" (Left : Bit_Vector_Type; Right : Bit_Vector_Type) return Bit_Vector_Type
is
begin
return (Data => z3_api_h.Z3_mk_bvadd (c => Left.Context.Data,
t1 => Left.Data,
t2 => Right.Data),
Context => Left.Context);
end "+";
------------------------------------------------------------------------------------------------
function "-" (Left : Bit_Vector_Type; Right : Bit_Vector_Type) return Bit_Vector_Type
is
begin
return (Data => z3_api_h.Z3_mk_bvsub (c => Left.Context.Data,
t1 => Left.Data,
t2 => Right.Data),
Context => Left.Context);
end "-";
------------------------------------------------------------------------------------------------
function Mul (Values : Bit_Vector_Array) return Bit_Vector_Type
is
Result : Bit_Vector_Type := Values (Values'First);
begin
for I in Values'First + 1 .. Values'Last loop
Result := Result * Values (I);
end loop;
return Result;
end Mul;
------------------------------------------------------------------------------------------------
function "*" (Left : Bit_Vector_Type; Right : Bit_Vector_Type) return Bit_Vector_Type
is
begin
return (Data => z3_api_h.Z3_mk_bvmul (c => Left.Context.Data,
t1 => Left.Data,
t2 => Right.Data),
Context => Left.Context);
end "*";
------------------------------------------------------------------------------------------------
function "/" (Left : Bit_Vector_Type; Right : Bit_Vector_Type) return Bit_Vector_Type
is
begin
return (Data => z3_api_h.Z3_mk_bvsdiv (c => Left.Context.Data,
t1 => Left.Data,
t2 => Right.Data),
Context => Left.Context);
end "/";
------------------------------------------------------------------------------------------------
function "mod" (Left : Bit_Vector_Type; Right : Bit_Vector_Type) return Bit_Vector_Type
is
begin
return (Data => z3_api_h.Z3_mk_bvsmod (c => Left.Context.Data,
t1 => Left.Data,
t2 => Right.Data),
Context => Left.Context);
end "mod";
------------------------------------------------------------------------------------------------
function "-" (Value : Bit_Vector_Type) return Bit_Vector_Type
is
begin
return (Data => z3_api_h.Z3_mk_bvneg (c => Value.Context.Data,
t1 => Value.Data),
Context => Value.Context);
end "-";
------------------------------------------------------------------------------------------------
function "<" (Left : Bit_Vector_Type'Class; Right : Bit_Vector_Type'Class) return Bool_Type
is
begin
return (Data => z3_api_h.Z3_mk_bvslt (c => Left.Context.Data,
t1 => Left.Data,
t2 => Right.Data),
Context => Left.Context);
end "<";
------------------------------------------------------------------------------------------------
function "<=" (Left : Bit_Vector_Type'Class; Right : Bit_Vector_Type'Class) return Bool_Type
is
begin
return (Data => z3_api_h.Z3_mk_bvsle (c => Left.Context.Data,
t1 => Left.Data,
t2 => Right.Data),
Context => Left.Context);
end "<=";
------------------------------------------------------------------------------------------------
function ">" (Left : Bit_Vector_Type'Class; Right : Bit_Vector_Type'Class) return Bool_Type
is
begin
return (Data => z3_api_h.Z3_mk_bvsgt (c => Left.Context.Data,
t1 => Left.Data,
t2 => Right.Data),
Context => Left.Context);
end ">";
------------------------------------------------------------------------------------------------
function ">=" (Left : Bit_Vector_Type'Class; Right : Bit_Vector_Type'Class) return Bool_Type
is
begin
return (Data => z3_api_h.Z3_mk_bvsge (c => Left.Context.Data,
t1 => Left.Data,
t2 => Right.Data),
Context => Left.Context);
end ">=";
end Z3;
|
source/declarations/adam-declaration.ads | charlie5/aIDE | 3 | 12151 | <filename>source/declarations/adam-declaration.ads<gh_stars>1-10
with
AdaM.Entity,
Ada.Containers.Vectors,
Ada.Streams;
package AdaM.Declaration
is
type Item is new Entity.item with private;
-- View
--
type View is access all Item'Class;
procedure View_write (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
Self : in View);
procedure View_read (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
Self : out View);
for View'write use View_write;
for View'read use View_read;
-- Vector
--
package Vectors is new ada.Containers.Vectors (Positive, View);
subtype Vector is Vectors.Vector;
-- Forge
--
function new_Subprogram return Declaration.view;
procedure free (Self : in out Declaration.view);
procedure destruct (Self : in out Declaration.item);
-- Attributes
--
overriding
function Id (Self : access Item) return AdaM.Id;
procedure Name_is (Self : in out Item; Now : in Identifier);
overriding
function Name (Self : in Item) return Identifier;
-- function full_Name (Self : in Item) return String;
overriding
function to_Source (Self : in Item) return text_Vectors.Vector;
private
type Item is new Entity.item with
record
Name : Text;
end record;
end AdaM.Declaration;
|
evernote/FindNotes.applescript | kinshuk4/evernote-automation | 4 | 3887 | -- https://github.com/bkfarnsworth/side_projects/tree/master/AppleScripts
var Evernote = Application('Evernote');
var list = Evernote.findNotes('AUTOMATE EVERNOTE');
list.forEach(function(item){
var title = item.title();
console.log(title);
})
Evernote.activate(); |
oeis/158/A158770.asm | neoneye/loda-programs | 11 | 21287 | <reponame>neoneye/loda-programs
; A158770: a(n) = 1521*n^2 - 39.
; 1482,6045,13650,24297,37986,54717,74490,97305,123162,152061,184002,218985,257010,298077,342186,389337,439530,492765,549042,608361,670722,736125,804570,876057,950586,1028157,1108770,1192425,1279122,1368861,1461642,1557465,1656330,1758237,1863186,1971177,2082210,2196285,2313402,2433561,2556762,2683005,2812290,2944617,3079986,3218397,3359850,3504345,3651882,3802461,3956082,4112745,4272450,4435197,4600986,4769817,4941690,5116605,5294562,5475561,5659602,5846685,6036810,6229977,6426186,6625437
mov $1,2
add $1,$0
mul $1,$0
mul $1,1521
add $1,1482
mov $0,$1
|
Mid-Term/Solution/N5/5.asm | TasneemMahmud1731893642/CSE331 | 0 | 9439 | <filename>Mid-Term/Solution/N5/5.asm
; You may customize this and other start-up templates;
; The location of this template is c:\emu8086\inc\0_com_template.txt
org 100h
A DB 1,2,3,4,5,6,7,8,9,10
B DB 10 DUP(0)
MOV AH,4CH
INT 21H
CODE ENDS
END START
ret
|
Cubical/Categories/Constructions/Elements.agda | Edlyr/cubical | 0 | 6574 | <reponame>Edlyr/cubical<filename>Cubical/Categories/Constructions/Elements.agda
{-# OPTIONS --cubical --no-import-sorts --safe #-}
-- The Category of Elements
open import Cubical.Categories.Category
module Cubical.Categories.Constructions.Elements {ℓ ℓ'} {C : Precategory ℓ ℓ'} where
open import Cubical.Categories.Instances.Sets
open import Cubical.Categories.Functor
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.HLevels
open import Cubical.Data.Sigma
import Cubical.Categories.Morphism as Morphism
import Cubical.Categories.Constructions.Slice as Slice
-- some issues
-- * always need to specify objects during composition because can't infer isSet
open Precategory
open Functor
getIsSet : ∀ {ℓS} {C : Precategory ℓ ℓ'} (F : Functor C (SET ℓS)) → (c : C .ob) → isSet (fst (F ⟅ c ⟆))
getIsSet F c = snd (F ⟅ c ⟆)
infix 50 ∫_
∫_ : ∀ {ℓS} → Functor C (SET ℓS) → Precategory (ℓ-max ℓ ℓS) (ℓ-max ℓ' ℓS)
-- objects are (c , x) pairs where c ∈ C and x ∈ F c
(∫ F) .ob = Σ[ c ∈ C .ob ] fst (F ⟅ c ⟆)
-- morphisms are f : c → c' which take x to x'
(∫ F) .Hom[_,_] (c , x) (c' , x') = Σ[ f ∈ C [ c , c' ] ] x' ≡ (F ⟪ f ⟫) x
(∫ F) .id (c , x) = C .id c , sym (funExt⁻ (F .F-id) x ∙ refl)
(∫ F) ._⋆_ {c , x} {c₁ , x₁} {c₂ , x₂} (f , p) (g , q)
= (f ⋆⟨ C ⟩ g) , (x₂
≡⟨ q ⟩
(F ⟪ g ⟫) x₁ -- basically expanding out function composition
≡⟨ cong (F ⟪ g ⟫) p ⟩
(F ⟪ g ⟫) ((F ⟪ f ⟫) x)
≡⟨ funExt⁻ (sym (F .F-seq _ _)) _ ⟩
(F ⟪ f ⋆⟨ C ⟩ g ⟫) x
∎)
(∫ F) .⋆IdL o@{c , x} o1@{c' , x'} f'@(f , p) i
= (cIdL i) , isOfHLevel→isOfHLevelDep 1 (λ a → isS' x' ((F ⟪ a ⟫) x)) p' p cIdL i
where
isS = getIsSet F c
isS' = getIsSet F c'
cIdL = C .⋆IdL f
-- proof from composition with id
p' : x' ≡ (F ⟪ C .id c ⋆⟨ C ⟩ f ⟫) x
p' = snd ((∫ F) ._⋆_ ((∫ F) .id o) f')
(∫ F) .⋆IdR o@{c , x} o1@{c' , x'} f'@(f , p) i
= (cIdR i) , isOfHLevel→isOfHLevelDep 1 (λ a → isS' x' ((F ⟪ a ⟫) x)) p' p cIdR i
where
cIdR = C .⋆IdR f
isS' = getIsSet F c'
p' : x' ≡ (F ⟪ f ⋆⟨ C ⟩ C .id c' ⟫) x
p' = snd ((∫ F) ._⋆_ f' ((∫ F) .id o1))
(∫ F) .⋆Assoc o@{c , x} o1@{c₁ , x₁} o2@{c₂ , x₂} o3@{c₃ , x₃} f'@(f , p) g'@(g , q) h'@(h , r) i
= (cAssoc i) , isOfHLevel→isOfHLevelDep 1 (λ a → isS₃ x₃ ((F ⟪ a ⟫) x)) p1 p2 cAssoc i
where
cAssoc = C .⋆Assoc f g h
isS₃ = getIsSet F c₃
p1 : x₃ ≡ (F ⟪ (f ⋆⟨ C ⟩ g) ⋆⟨ C ⟩ h ⟫) x
p1 = snd ((∫ F) ._⋆_ ((∫ F) ._⋆_ {o} {o1} {o2} f' g') h')
p2 : x₃ ≡ (F ⟪ f ⋆⟨ C ⟩ (g ⋆⟨ C ⟩ h) ⟫) x
p2 = snd ((∫ F) ._⋆_ f' ((∫ F) ._⋆_ {o1} {o2} {o3} g' h'))
-- same thing but for presheaves
∫ᴾ_ : ∀ {ℓS} → Functor (C ^op) (SET ℓS) → Precategory (ℓ-max ℓ ℓS) (ℓ-max ℓ' ℓS)
-- objects are (c , x) pairs where c ∈ C and x ∈ F c
(∫ᴾ F) .ob = Σ[ c ∈ C .ob ] fst (F ⟅ c ⟆)
-- morphisms are f : c → c' which take x to x'
(∫ᴾ F) .Hom[_,_] (c , x) (c' , x') = Σ[ f ∈ C [ c , c' ] ] x ≡ (F ⟪ f ⟫) x'
(∫ᴾ F) .id (c , x) = C .id c , sym (funExt⁻ (F .F-id) x ∙ refl)
(∫ᴾ F) ._⋆_ {c , x} {c₁ , x₁} {c₂ , x₂} (f , p) (g , q)
= (f ⋆⟨ C ⟩ g) , (x
≡⟨ p ⟩
(F ⟪ f ⟫) x₁ -- basically expanding out function composition
≡⟨ cong (F ⟪ f ⟫) q ⟩
(F ⟪ f ⟫) ((F ⟪ g ⟫) x₂)
≡⟨ funExt⁻ (sym (F .F-seq _ _)) _ ⟩
(F ⟪ f ⋆⟨ C ⟩ g ⟫) x₂
∎)
(∫ᴾ F) .⋆IdL o@{c , x} o1@{c' , x'} f'@(f , p) i
= (cIdL i) , isOfHLevel→isOfHLevelDep 1 (λ a → isS x ((F ⟪ a ⟫) x')) p' p cIdL i
where
isS = getIsSet F c
isS' = getIsSet F c'
cIdL = C .⋆IdL f
-- proof from composition with id
p' : x ≡ (F ⟪ C .id c ⋆⟨ C ⟩ f ⟫) x'
p' = snd ((∫ᴾ F) ._⋆_ ((∫ᴾ F) .id o) f')
(∫ᴾ F) .⋆IdR o@{c , x} o1@{c' , x'} f'@(f , p) i
= (cIdR i) , isOfHLevel→isOfHLevelDep 1 (λ a → isS x ((F ⟪ a ⟫) x')) p' p cIdR i
where
cIdR = C .⋆IdR f
isS = getIsSet F c
p' : x ≡ (F ⟪ f ⋆⟨ C ⟩ C .id c' ⟫) x'
p' = snd ((∫ᴾ F) ._⋆_ f' ((∫ᴾ F) .id o1))
(∫ᴾ F) .⋆Assoc o@{c , x} o1@{c₁ , x₁} o2@{c₂ , x₂} o3@{c₃ , x₃} f'@(f , p) g'@(g , q) h'@(h , r) i
= (cAssoc i) , isOfHLevel→isOfHLevelDep 1 (λ a → isS x ((F ⟪ a ⟫) x₃)) p1 p2 cAssoc i
where
cAssoc = C .⋆Assoc f g h
isS = getIsSet F c
p1 : x ≡ (F ⟪ (f ⋆⟨ C ⟩ g) ⋆⟨ C ⟩ h ⟫) x₃
p1 = snd ((∫ᴾ F) ._⋆_ ((∫ᴾ F) ._⋆_ {o} {o1} {o2} f' g') h')
p2 : x ≡ (F ⟪ f ⋆⟨ C ⟩ (g ⋆⟨ C ⟩ h) ⟫) x₃
p2 = snd ((∫ᴾ F) ._⋆_ f' ((∫ᴾ F) ._⋆_ {o1} {o2} {o3} g' h'))
-- helpful results
module _ {ℓS} {F : Functor (C ^op) (SET ℓS)} where
-- morphisms are equal as long as the morphisms in C are equals
∫ᴾhomEq : ∀ {o1 o1' o2 o2'} (f : (∫ᴾ F) [ o1 , o2 ]) (g : (∫ᴾ F) [ o1' , o2' ])
→ (p : o1 ≡ o1') (q : o2 ≡ o2')
→ (eqInC : PathP (λ i → C [ fst (p i) , fst (q i) ]) (fst f) (fst g))
→ PathP (λ i → (∫ᴾ F) [ p i , q i ]) f g
∫ᴾhomEq (f , eqf) (g , eqg) p q eqInC
= ΣPathP (eqInC
, isOfHLevel→isOfHLevelDep 1 {A = Σ[ (o1 , o2) ∈ (∫ᴾ F) .ob × (∫ᴾ F) .ob ] (C [ fst o1 , fst o2 ])}
{B = λ ((o1 , o2) , f) → snd o1 ≡ (F ⟪ f ⟫) (snd o2)}
(λ ((o1 , o2) , f) → snd (F ⟅ (fst o1) ⟆) (snd o1) ((F ⟪ f ⟫) (snd o2)))
eqf
eqg
λ i → ((p i , q i) , eqInC i))
|
Transynther/x86/_processed/P/_zr_/i7-8650U_0xd2_notsx.log_2457_1577.asm | ljhsiun2/medusa | 9 | 15007 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r8
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x34ca, %rsi
nop
nop
dec %r8
mov (%rsi), %r11
nop
nop
nop
nop
nop
add $18560, %rcx
lea addresses_normal_ht+0x99da, %rsi
lea addresses_WC_ht+0x1b702, %rdi
nop
nop
nop
nop
nop
sub $4572, %r10
mov $35, %rcx
rep movsb
nop
nop
inc %r8
pop %rsi
pop %rdi
pop %rcx
pop %r8
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r15
push %rax
push %rcx
push %rsi
// Faulty Load
mov $0x1da, %r11
nop
nop
nop
nop
dec %rcx
mov (%r11), %ax
lea oracles, %rsi
and $0xff, %rax
shlq $12, %rax
mov (%rsi,%rax,1), %rax
pop %rsi
pop %rcx
pop %rax
pop %r15
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_P', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_P', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}}
{'00': 2457}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
formalization/Context.agda | ivoysey/Obsidian | 79 | 1655 | -- Adapted from Wadler: https://plfa.github.io/Lambda/
module Context (A : Set) where
open import Prelude
open import Data.Nat
open import Relation.Binary.PropositionalEquality using (_≡_; _≢_; refl; sym)
open import Data.Maybe
open import Data.Product using (_×_; proj₁; proj₂; ∃-syntax) renaming (_,_ to ⟨_,_⟩)
open import Relation.Nullary.Decidable
open import Relation.Nullary using (Dec; yes; no)
open import Data.Empty
import Data.Nat.Properties
infixl 5 _,_⦂_
-- Internal type of contexts
data ctx : Set where
∅ : ctx
_,_⦂_ : ctx → ℕ → A → ctx
infix 4 _∋_⦂_
data _∋_⦂_ : ctx → ℕ → A → Set where
Z : ∀ {Γ : ctx}
→ ∀ {x : ℕ}
→ ∀ {a : A}
------------------
→ Γ , x ⦂ a ∋ x ⦂ a
S : ∀ {Γ x y a b}
→ x ≢ y
→ Γ ∋ x ⦂ a
------------------
→ Γ , y ⦂ b ∋ x ⦂ a
lookup : ctx → ℕ → Maybe A
lookup ∅ _ = nothing
lookup (Γ , x ⦂ t) y with compare x y
... | equal _ = just t
... | _ = lookup Γ x
data _∈dom_ : ℕ → ctx → Set where
inDom : ∀ {x Γ a}
→ Γ ∋ x ⦂ a
-------------
→ x ∈dom Γ
data _∉dom_ : ℕ → ctx → Set where
notInEmpty : ∀ {x}
----------
→ x ∉dom ∅
notInNonempty : ∀ {x x' Γ T}
→ x ≢ x'
→ x ∉dom Γ
--------------------
→ x ∉dom (Γ , x' ⦂ T)
irrelevantExtensionsOK : ∀ {Γ : ctx}
→ ∀ {x y t t'}
→ Γ ∋ x ⦂ t
→ x ≢ y
→ Γ , y ⦂ t' ∋ x ⦂ t
irrelevantExtensionsOK {Γ} {x} {y} {t} cont@(Z {Γ₀} {x} {t}) neq = S neq cont
irrelevantExtensionsOK (S neq' rest) neq = S neq (irrelevantExtensionsOK rest neq')
irrelevantReductionsOK : ∀ {Γ : ctx}
→ ∀ {x y t t'}
→ Γ , x ⦂ t ∋ y ⦂ t'
→ y ≢ x
→ Γ ∋ y ⦂ t'
-- ⊥-elim (!neq (Relation.Binary.PropositionalEquality.sym x x))
irrelevantReductionsOK {Γ} {x} {y} {t} {t'} z@(Z {Γ} {x} {t}) neq =
let
s : x ≡ x
s = refl
bot = neq s
in
Data.Empty.⊥-elim bot
irrelevantReductionsOK {Γ} {x} {y} {t} {t'} (S x₁ qq) neq = qq
irrelevantReductionsInValuesOK : ∀ {Γ : ctx}
→ ∀ {x y t t'}
→ Γ , x ⦂ t ∋ y ⦂ t'
→ t ≢ t'
→ Γ ∋ y ⦂ t'
irrelevantReductionsInValuesOK {Γ} {x} {.x} {t} {.t} Z tNeqt' = ⊥-elim (tNeqt' refl)
irrelevantReductionsInValuesOK {Γ} {x} {y} {t} {t'} (S yNeqx yt'InΓ') tNeqt' = yt'InΓ'
∈domExcludedMiddle : ∀ {Γ x}
→ x ∉dom Γ
→ Relation.Nullary.¬ (x ∈dom Γ)
∈domExcludedMiddle {.∅} {x} notInEmpty (inDom ())
∈domExcludedMiddle {.(_ , _ ⦂ _)} {x} (notInNonempty xNeqx' xNotInΓ) (inDom n) =
let
rest = ∈domExcludedMiddle xNotInΓ
xInΓ = irrelevantReductionsOK n xNeqx'
in
rest (inDom xInΓ)
∉domPreservation : ∀ {x x' Γ T T'}
→ x ∉dom (Γ , x' ⦂ T)
---------------------
→ x ∉dom (Γ , x' ⦂ T')
∉domPreservation {x} {x'} {Γ} {T} {T'} (notInNonempty xNeqX' xNotInDom) = notInNonempty xNeqX' xNotInDom
∉domGreaterThan : ∀ {Γ x}
→ (∀ x' → x' ∈dom Γ → x' < x)
→ x ∉dom Γ
∉domGreaterThan {∅} {x} xBigger = notInEmpty
∉domGreaterThan {Γ , x' ⦂ t} {x} xBigger =
notInNonempty x≢x' (∉domGreaterThan rest) -- (∉domGreaterThan (λ x'' → λ x''InΓ → xBigger x'' (inDom {!!})))
where
x'<x = xBigger x' (inDom Z)
x≢x' : x ≢ x'
x≢x' = ≢-sym (Data.Nat.Properties.<⇒≢ x'<x)
rest : (x'' : ℕ)
→ x'' ∈dom Γ
→ x'' < x
rest x'' (inDom x''InΓ) with x' ≟ x''
... | yes x'≡x'' rewrite x'≡x'' = xBigger x'' (inDom Z)
... | no x'≢x'' = xBigger x'' (inDom (S (≢-sym x'≢x'') x''InΓ))
fresh : (Γ : ctx)
→ ∃[ x ] (x ∉dom Γ × (∀ x' → x' ∈dom Γ → x' < x))
fresh ∅ =
⟨ zero , ⟨ notInEmpty , xBigger ⟩ ⟩
where
xBigger : (∀ x' → x' ∈dom ∅ → x' < zero)
xBigger x' (inDom ())
fresh (Γ , x ⦂ t) =
⟨ x' , ⟨ x'IsFresh , x'Bigger ⟩ ⟩
where
freshInRest = fresh Γ
biggerThanRest = suc (proj₁ freshInRest)
x' = biggerThanRest ⊔ (suc x) -- bigger than both everything in Γ and x.
freshInRestBigger = proj₂ (proj₂ freshInRest)
x'Bigger : (x'' : ℕ) → (x'' ∈dom (Γ , x ⦂ t)) → x'' < x'
x'Bigger x'' (inDom x''InΓ') with x ≟ x''
... | yes x≡x'' rewrite x≡x'' =
s≤s (Data.Nat.Properties.n≤m⊔n (proj₁ (fresh Γ)) x'') -- s≤s (Data.Nat.Properties.<⇒≤ x''<oldFresh)
... | no x≢x'' =
let
x''<oldFresh = freshInRestBigger x'' (inDom (irrelevantReductionsOK x''InΓ' (≢-sym x≢x'')) )
x''≤oldFresh = (Data.Nat.Properties.<⇒≤ x''<oldFresh)
in
s≤s ( Data.Nat.Properties.m≤n⇒m≤n⊔o x x''≤oldFresh) -- s≤s (Data.Nat.Properties.<⇒≤ x''<oldFresh)
x'IsFresh : x' ∉dom (Γ , x ⦂ t)
x'IsFresh = ∉domGreaterThan x'Bigger
-- Removing elements from a context
_#_ : ctx → ℕ → ctx
∅ # x = ∅
(Γ , x' ⦂ T) # x with compare x x'
... | equal _ = Γ
... | _ = (Γ # x) , x' ⦂ T
contextLookupUnique : ∀ {Γ : ctx}
→ ∀ {x t t'}
→ Γ ∋ x ⦂ t
→ Γ ∋ x ⦂ t'
→ t ≡ t'
contextLookupUnique z1@Z z2@Z = refl
contextLookupUnique z1@Z s2@(S {Γ} {x} {y} {a} {b} neq xHasTypeT') = Data.Empty.⊥-elim (neq refl)
contextLookupUnique (S neq xHasTypeT) Z = Data.Empty.⊥-elim (neq refl)
contextLookupUnique (S x₁ xHasTypeT) (S x₂ xHasTypeT') = contextLookupUnique xHasTypeT xHasTypeT'
contextLookupNeq : ∀ {Γ : ctx}
→ ∀ {x x' t t'}
→ Γ , x ⦂ t ∋ x' ⦂ t'
→ t ≢ t'
→ x ≢ x'
contextLookupNeq Z tNeq = Data.Empty.⊥-elim (tNeq refl)
contextLookupNeq (S xNeq x'InΓ) tNeq = λ xEq → xNeq (sym xEq)
lookupWeakening : ∀ {Γ : ctx}
→ ∀ {x x' t t'}
→ Γ ∋ x ⦂ t
→ ∃[ T ] ((Γ , x' ⦂ t') ∋ x ⦂ T)
lookupWeakening {Γ} {x} {x'} {t} {t'} Γcontainment with x ≟ x'
... | yes refl = ⟨ t' , Z {Γ = Γ} {x = x'} {a = t'} ⟩
... | no neq = ⟨ t , S neq Γcontainment ⟩
∉dom-≢ : {Γ : ctx}
→ ∀ {x x' t}
→ x ∉dom (Γ , x' ⦂ t)
→ x ≢ x'
∉dom-≢ {Γ} {x} {x'} {t} (notInNonempty xNeqx' xNotInΓ') xEqx' = xNeqx' xEqx'
|
programs/oeis/047/A047383.asm | neoneye/loda | 22 | 104701 | <reponame>neoneye/loda
; A047383: Numbers that are congruent to {1, 5} mod 7.
; 1,5,8,12,15,19,22,26,29,33,36,40,43,47,50,54,57,61,64,68,71,75,78,82,85,89,92,96,99,103,106,110,113,117,120,124,127,131,134,138,141,145,148,152,155,159,162,166,169,173,176,180,183,187,190,194,197,201,204,208,211,215,218,222,225,229,232,236,239,243,246,250,253,257,260,264,267,271,274,278,281,285,288,292,295,299,302,306,309,313,316,320,323,327,330,334,337,341,344,348
mul $0,7
add $0,3
div $0,2
|
exercise_6/unlink_exit_polymorphic.asm | vikrant-navalgund/SLAE32 | 3 | 101149 | <filename>exercise_6/unlink_exit_polymorphic.asm<gh_stars>1-10
BITS 32
section .text
global _start
_start:
xor ecx, ecx
imul ecx
push 0xe4c9cb
push 0xc9f9ce8f
push 0xf1c4cb87
mov ebx, esp
mov cl, 0xb
_flip:
add al, 0x2
xor byte [esp], 10101010b
add [esp], al
inc esp
loop _flip
sub al, 0xc
int 0x80
inc al
int 0x80
|
test/Fail/Issue1944-checkParams2.agda | pthariensflame/agda | 3 | 9355 | <filename>test/Fail/Issue1944-checkParams2.agda
-- Andreas, AIM XXIII, 2016-04-26 flight EDI-GOT home
-- {-# OPTIONS -v impossible:10 #-}
-- Parameter arguments of overloaded projection applications
-- should not be skipped!
record R A : Set where
field f : A
open R
record S A : Set where
field f : A
open S
module _ (A B : Set) (a : A) where
r : R A
f r = a
test1 = f {A = A} r
test2 = f {A} r
test = f {A = B} r
|
src/assets/game_assets-misc_objects.ads | thomas070605/shoot-n-loot | 0 | 718 | <reponame>thomas070605/shoot-n-loot
with GESTE;
with GESTE.Grid;
pragma Style_Checks (Off);
package Game_Assets.Misc_Objects is
-- Misc_Objects
Width : constant := 20;
Height : constant := 16;
Tile_Width : constant := 8;
Tile_Height : constant := 8;
-- Tile Layer 1
package Tile_Layer_1 is
Width : constant := 20;
Height : constant := 20;
Data : aliased GESTE.Grid.Grid_Data :=
(( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) ;
end Tile_Layer_1;
package Item is
Objects : Object_Array :=
(
0 => (
Kind => POINT_OBJ,
Id => 1,
Name => new String'("Chest_Closed"),
X => 0.00000E+00,
Y => 8.00000E+00,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 136,
Str => null
),
1 => (
Kind => POINT_OBJ,
Id => 2,
Name => new String'("Chest_Open"),
X => 0.00000E+00,
Y => 2.40000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 69,
Str => null
),
2 => (
Kind => POINT_OBJ,
Id => 4,
Name => new String'("Menu_Cursor"),
X => 2.40000E+01,
Y => 4.00000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 165,
Str => null
),
3 => (
Kind => POINT_OBJ,
Id => 5,
Name => new String'("Empty_Tile"),
X => 2.40000E+01,
Y => 8.00000E+00,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 166,
Str => null
),
4 => (
Kind => POINT_OBJ,
Id => 7,
Name => new String'("D0"),
X => 4.80000E+01,
Y => 8.00000E+00,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 167,
Str => null
),
5 => (
Kind => POINT_OBJ,
Id => 8,
Name => new String'("D1"),
X => 5.60000E+01,
Y => 8.00000E+00,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 168,
Str => null
),
6 => (
Kind => POINT_OBJ,
Id => 9,
Name => new String'("D2"),
X => 6.40000E+01,
Y => 8.00000E+00,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 169,
Str => null
),
7 => (
Kind => POINT_OBJ,
Id => 10,
Name => new String'("D3"),
X => 7.20000E+01,
Y => 8.00000E+00,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 170,
Str => null
),
8 => (
Kind => POINT_OBJ,
Id => 11,
Name => new String'("D4"),
X => 8.00000E+01,
Y => 8.00000E+00,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 171,
Str => null
),
9 => (
Kind => POINT_OBJ,
Id => 12,
Name => new String'("D5"),
X => 8.80000E+01,
Y => 8.00000E+00,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 172,
Str => null
),
10 => (
Kind => POINT_OBJ,
Id => 13,
Name => new String'("D6"),
X => 9.60000E+01,
Y => 8.00000E+00,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 173,
Str => null
),
11 => (
Kind => POINT_OBJ,
Id => 14,
Name => new String'("D7"),
X => 1.04000E+02,
Y => 8.00000E+00,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 174,
Str => null
),
12 => (
Kind => POINT_OBJ,
Id => 15,
Name => new String'("D8"),
X => 1.12000E+02,
Y => 8.00000E+00,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 175,
Str => null
),
13 => (
Kind => POINT_OBJ,
Id => 16,
Name => new String'("D9"),
X => 1.20000E+02,
Y => 8.00000E+00,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 176,
Str => null
),
14 => (
Kind => POINT_OBJ,
Id => 17,
Name => new String'("Dot"),
X => 1.28000E+02,
Y => 8.00000E+00,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 177,
Str => null
),
15 => (
Kind => POINT_OBJ,
Id => 20,
Name => new String'("Coin"),
X => 0.00000E+00,
Y => 4.00000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 178,
Str => null
),
16 => (
Kind => POINT_OBJ,
Id => 22,
Name => new String'("M1"),
X => 0.00000E+00,
Y => 5.60000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 57,
Str => null
),
17 => (
Kind => POINT_OBJ,
Id => 23,
Name => new String'("M2"),
X => 8.00000E+00,
Y => 5.60000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 118,
Str => null
),
18 => (
Kind => POINT_OBJ,
Id => 24,
Name => new String'("M3"),
X => 1.60000E+01,
Y => 5.60000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 179,
Str => null
),
19 => (
Kind => POINT_OBJ,
Id => 25,
Name => new String'("M4"),
X => 2.40000E+01,
Y => 5.60000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 180,
Str => null
),
20 => (
Kind => POINT_OBJ,
Id => 26,
Name => new String'("M5"),
X => 3.20000E+01,
Y => 5.60000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 120,
Str => null
),
21 => (
Kind => POINT_OBJ,
Id => 27,
Name => new String'("M6"),
X => 4.00000E+01,
Y => 5.60000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 181,
Str => null
),
22 => (
Kind => POINT_OBJ,
Id => 28,
Name => new String'("M7"),
X => 4.80000E+01,
Y => 5.60000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 182,
Str => null
),
23 => (
Kind => POINT_OBJ,
Id => 29,
Name => new String'("P1"),
X => 0.00000E+00,
Y => 7.20000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 4,
Str => null
),
24 => (
Kind => POINT_OBJ,
Id => 30,
Name => new String'("P2"),
X => 8.00000E+00,
Y => 7.20000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 183,
Str => null
),
25 => (
Kind => POINT_OBJ,
Id => 31,
Name => new String'("P3"),
X => 1.60000E+01,
Y => 7.20000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 184,
Str => null
),
26 => (
Kind => POINT_OBJ,
Id => 32,
Name => new String'("P4"),
X => 2.40000E+01,
Y => 7.20000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 185,
Str => null
),
27 => (
Kind => POINT_OBJ,
Id => 33,
Name => new String'("P5"),
X => 0.00000E+00,
Y => 8.80000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 186,
Str => null
),
28 => (
Kind => POINT_OBJ,
Id => 34,
Name => new String'("P6"),
X => 8.00000E+00,
Y => 8.80000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 187,
Str => null
),
29 => (
Kind => POINT_OBJ,
Id => 35,
Name => new String'("P7"),
X => 1.60000E+01,
Y => 8.80000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 188,
Str => null
),
30 => (
Kind => POINT_OBJ,
Id => 36,
Name => new String'("P8"),
X => 2.40000E+01,
Y => 8.80000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 189,
Str => null
),
31 => (
Kind => POINT_OBJ,
Id => 39,
Name => new String'("P9"),
X => 3.20000E+01,
Y => 8.80000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 190,
Str => null
),
32 => (
Kind => POINT_OBJ,
Id => 40,
Name => new String'("P10"),
X => 4.00000E+01,
Y => 8.80000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 191,
Str => null
),
33 => (
Kind => POINT_OBJ,
Id => 41,
Name => new String'("P11"),
X => 4.80000E+01,
Y => 8.80000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 115,
Str => null
),
34 => (
Kind => POINT_OBJ,
Id => 42,
Name => new String'("P12"),
X => 5.60000E+01,
Y => 8.80000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 192,
Str => null
),
35 => (
Kind => POINT_OBJ,
Id => 43,
Name => new String'("P13"),
X => 6.40000E+01,
Y => 8.80000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 193,
Str => null
),
36 => (
Kind => POINT_OBJ,
Id => 44,
Name => new String'("Bullet"),
X => 4.00000E+01,
Y => 2.40000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 113,
Str => null
),
37 => (
Kind => POINT_OBJ,
Id => 45,
Name => new String'("Exit_Portal"),
X => 2.40000E+01,
Y => 2.40000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 194,
Str => null
)
);
Chest_Closed : aliased constant Object := (
Kind => POINT_OBJ,
Id => 1,
Name => new String'("Chest_Closed"),
X => 0.00000E+00,
Y => 8.00000E+00,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 136,
Str => null
);
Chest_Open : aliased constant Object := (
Kind => POINT_OBJ,
Id => 2,
Name => new String'("Chest_Open"),
X => 0.00000E+00,
Y => 2.40000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 69,
Str => null
);
Menu_Cursor : aliased constant Object := (
Kind => POINT_OBJ,
Id => 4,
Name => new String'("Menu_Cursor"),
X => 2.40000E+01,
Y => 4.00000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 165,
Str => null
);
Empty_Tile : aliased constant Object := (
Kind => POINT_OBJ,
Id => 5,
Name => new String'("Empty_Tile"),
X => 2.40000E+01,
Y => 8.00000E+00,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 166,
Str => null
);
D0 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 7,
Name => new String'("D0"),
X => 4.80000E+01,
Y => 8.00000E+00,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 167,
Str => null
);
D1 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 8,
Name => new String'("D1"),
X => 5.60000E+01,
Y => 8.00000E+00,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 168,
Str => null
);
D2 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 9,
Name => new String'("D2"),
X => 6.40000E+01,
Y => 8.00000E+00,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 169,
Str => null
);
D3 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 10,
Name => new String'("D3"),
X => 7.20000E+01,
Y => 8.00000E+00,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 170,
Str => null
);
D4 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 11,
Name => new String'("D4"),
X => 8.00000E+01,
Y => 8.00000E+00,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 171,
Str => null
);
D5 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 12,
Name => new String'("D5"),
X => 8.80000E+01,
Y => 8.00000E+00,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 172,
Str => null
);
D6 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 13,
Name => new String'("D6"),
X => 9.60000E+01,
Y => 8.00000E+00,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 173,
Str => null
);
D7 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 14,
Name => new String'("D7"),
X => 1.04000E+02,
Y => 8.00000E+00,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 174,
Str => null
);
D8 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 15,
Name => new String'("D8"),
X => 1.12000E+02,
Y => 8.00000E+00,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 175,
Str => null
);
D9 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 16,
Name => new String'("D9"),
X => 1.20000E+02,
Y => 8.00000E+00,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 176,
Str => null
);
Dot : aliased constant Object := (
Kind => POINT_OBJ,
Id => 17,
Name => new String'("Dot"),
X => 1.28000E+02,
Y => 8.00000E+00,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 177,
Str => null
);
Coin : aliased constant Object := (
Kind => POINT_OBJ,
Id => 20,
Name => new String'("Coin"),
X => 0.00000E+00,
Y => 4.00000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 178,
Str => null
);
M1 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 22,
Name => new String'("M1"),
X => 0.00000E+00,
Y => 5.60000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 57,
Str => null
);
M2 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 23,
Name => new String'("M2"),
X => 8.00000E+00,
Y => 5.60000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 118,
Str => null
);
M3 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 24,
Name => new String'("M3"),
X => 1.60000E+01,
Y => 5.60000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 179,
Str => null
);
M4 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 25,
Name => new String'("M4"),
X => 2.40000E+01,
Y => 5.60000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 180,
Str => null
);
M5 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 26,
Name => new String'("M5"),
X => 3.20000E+01,
Y => 5.60000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 120,
Str => null
);
M6 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 27,
Name => new String'("M6"),
X => 4.00000E+01,
Y => 5.60000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 181,
Str => null
);
M7 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 28,
Name => new String'("M7"),
X => 4.80000E+01,
Y => 5.60000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 182,
Str => null
);
P1 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 29,
Name => new String'("P1"),
X => 0.00000E+00,
Y => 7.20000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 4,
Str => null
);
P2 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 30,
Name => new String'("P2"),
X => 8.00000E+00,
Y => 7.20000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 183,
Str => null
);
P3 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 31,
Name => new String'("P3"),
X => 1.60000E+01,
Y => 7.20000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 184,
Str => null
);
P4 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 32,
Name => new String'("P4"),
X => 2.40000E+01,
Y => 7.20000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 185,
Str => null
);
P5 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 33,
Name => new String'("P5"),
X => 0.00000E+00,
Y => 8.80000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 186,
Str => null
);
P6 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 34,
Name => new String'("P6"),
X => 8.00000E+00,
Y => 8.80000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 187,
Str => null
);
P7 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 35,
Name => new String'("P7"),
X => 1.60000E+01,
Y => 8.80000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 188,
Str => null
);
P8 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 36,
Name => new String'("P8"),
X => 2.40000E+01,
Y => 8.80000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 189,
Str => null
);
P9 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 39,
Name => new String'("P9"),
X => 3.20000E+01,
Y => 8.80000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 190,
Str => null
);
P10 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 40,
Name => new String'("P10"),
X => 4.00000E+01,
Y => 8.80000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 191,
Str => null
);
P11 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 41,
Name => new String'("P11"),
X => 4.80000E+01,
Y => 8.80000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 115,
Str => null
);
P12 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 42,
Name => new String'("P12"),
X => 5.60000E+01,
Y => 8.80000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 192,
Str => null
);
P13 : aliased constant Object := (
Kind => POINT_OBJ,
Id => 43,
Name => new String'("P13"),
X => 6.40000E+01,
Y => 8.80000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 193,
Str => null
);
Bullet : aliased constant Object := (
Kind => POINT_OBJ,
Id => 44,
Name => new String'("Bullet"),
X => 4.00000E+01,
Y => 2.40000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 113,
Str => null
);
Exit_Portal : aliased constant Object := (
Kind => POINT_OBJ,
Id => 45,
Name => new String'("Exit_Portal"),
X => 2.40000E+01,
Y => 2.40000E+01,
Width => 8.00000E+00,
Height => 8.00000E+00,
Flip_Vertical => FALSE,
Flip_Horizontal => FALSE,
Tile_Id => 194,
Str => null
);
end Item;
end Game_Assets.Misc_Objects;
|
test/asset/agda-stdlib-1.0/Data/Rational/Properties.agda | omega12345/agda-mode | 0 | 16476 | <reponame>omega12345/agda-mode
------------------------------------------------------------------------
-- The Agda standard library
--
-- Properties of Rational numbers
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.Rational.Properties where
open import Function using (_∘_ ; _$_)
open import Data.Integer as ℤ using (ℤ; ∣_∣; +_; -[1+_])
open import Data.Integer.Coprimality using (coprime-divisor)
import Data.Integer.Properties as ℤ
open import Data.Rational.Base
open import Data.Nat as ℕ using (ℕ; zero; suc)
import Data.Nat.Properties as ℕ
open import Data.Nat.Coprimality as C using (Coprime; coprime?)
open import Data.Nat.Divisibility hiding (/-cong)
open import Data.Product using (_,_)
open import Data.Sum
open import Relation.Binary
open import Relation.Binary.PropositionalEquality
open import Relation.Nullary using (Dec; yes; no; recompute)
open import Relation.Nullary.Decidable as Dec′ using (True; fromWitness)
open import Algebra.FunctionProperties {A = ℚ} _≡_
open import Algebra.FunctionProperties.Consequences.Propositional
------------------------------------------------------------------------
-- Helper lemmas
private
recomputeCP : ∀ {n d} → .(Coprime n (suc d)) → Coprime n (suc d)
recomputeCP {n} {d-1} c = recompute (coprime? n (suc d-1)) c
------------------------------------------------------------------------
-- Equality
≡⇒≃ : _≡_ ⇒ _≃_
≡⇒≃ refl = refl
≃⇒≡ : _≃_ ⇒ _≡_
≃⇒≡ {i = mkℚ n₁ d₁ c₁} {j = mkℚ n₂ d₂ c₂} eq = helper
where
open ≡-Reasoning
1+d₁∣1+d₂ : suc d₁ ∣ suc d₂
1+d₁∣1+d₂ = coprime-divisor (+ suc d₁) n₁ (+ suc d₂)
(C.sym (recomputeCP c₁)) $
divides ∣ n₂ ∣ $ begin
∣ n₁ ℤ.* + suc d₂ ∣ ≡⟨ cong ∣_∣ eq ⟩
∣ n₂ ℤ.* + suc d₁ ∣ ≡⟨ ℤ.abs-*-commute n₂ (+ suc d₁) ⟩
∣ n₂ ∣ ℕ.* suc d₁ ∎
1+d₂∣1+d₁ : suc d₂ ∣ suc d₁
1+d₂∣1+d₁ = coprime-divisor (+ suc d₂) n₂ (+ suc d₁)
(C.sym (recomputeCP c₂)) $
divides ∣ n₁ ∣ (begin
∣ n₂ ℤ.* + suc d₁ ∣ ≡⟨ cong ∣_∣ (sym eq) ⟩
∣ n₁ ℤ.* + suc d₂ ∣ ≡⟨ ℤ.abs-*-commute n₁ (+ suc d₂) ⟩
∣ n₁ ∣ ℕ.* suc d₂ ∎)
helper : mkℚ n₁ d₁ c₁ ≡ mkℚ n₂ d₂ c₂
helper with ∣-antisym 1+d₁∣1+d₂ 1+d₂∣1+d₁
... | refl with ℤ.*-cancelʳ-≡ n₁ n₂ (+ suc d₁) (λ ()) eq
... | refl = refl
infix 4 _≟_
_≟_ : Decidable {A = ℚ} _≡_
p ≟ q with (↥ p ℤ.* ↧ q) ℤ.≟ (↥ q ℤ.* ↧ p)
... | yes pq≃qp = yes (≃⇒≡ pq≃qp)
... | no ¬pq≃qp = no (¬pq≃qp ∘ ≡⇒≃)
------------------------------------------------------------------------
-- _≤_
infix 4 _≤?_
drop-*≤* : ∀ {p q} → p ≤ q → (↥ p ℤ.* ↧ q) ℤ.≤ (↥ q ℤ.* ↧ p)
drop-*≤* (*≤* pq≤qp) = pq≤qp
≤-reflexive : _≡_ ⇒ _≤_
≤-reflexive refl = *≤* ℤ.≤-refl
≤-refl : Reflexive _≤_
≤-refl = ≤-reflexive refl
≤-trans : Transitive _≤_
≤-trans {i = p@(mkℚ n₁ d₁ c₁)} {j = q@(mkℚ n₂ d₂ c₂)} {k = r@(mkℚ n₃ d₃ c₃)} (*≤* eq₁) (*≤* eq₂)
= *≤* $ ℤ.*-cancelʳ-≤-pos (n₁ ℤ.* ℤ.+ suc d₃) (n₃ ℤ.* ℤ.+ suc d₁) d₂ $ begin
let sd₁ = ↧ p; sd₂ = ↧ q; sd₃ = ↧ r in
(n₁ ℤ.* sd₃) ℤ.* sd₂ ≡⟨ ℤ.*-assoc n₁ sd₃ sd₂ ⟩
n₁ ℤ.* (sd₃ ℤ.* sd₂) ≡⟨ cong (n₁ ℤ.*_) (ℤ.*-comm sd₃ sd₂) ⟩
n₁ ℤ.* (sd₂ ℤ.* sd₃) ≡⟨ sym (ℤ.*-assoc n₁ sd₂ sd₃) ⟩
(n₁ ℤ.* sd₂) ℤ.* sd₃ ≤⟨ ℤ.*-monoʳ-≤-pos d₃ eq₁ ⟩
(n₂ ℤ.* sd₁) ℤ.* sd₃ ≡⟨ cong (ℤ._* sd₃) (ℤ.*-comm n₂ sd₁) ⟩
(sd₁ ℤ.* n₂) ℤ.* sd₃ ≡⟨ ℤ.*-assoc sd₁ n₂ sd₃ ⟩
sd₁ ℤ.* (n₂ ℤ.* sd₃) ≤⟨ ℤ.*-monoˡ-≤-pos d₁ eq₂ ⟩
sd₁ ℤ.* (n₃ ℤ.* sd₂) ≡⟨ sym (ℤ.*-assoc sd₁ n₃ sd₂) ⟩
(sd₁ ℤ.* n₃) ℤ.* sd₂ ≡⟨ cong (ℤ._* sd₂) (ℤ.*-comm sd₁ n₃) ⟩
(n₃ ℤ.* sd₁) ℤ.* sd₂ ∎
where open ℤ.≤-Reasoning
≤-antisym : Antisymmetric _≡_ _≤_
≤-antisym (*≤* le₁) (*≤* le₂) = ≃⇒≡ (ℤ.≤-antisym le₁ le₂)
≤-total : Total _≤_
≤-total p q = [ inj₁ ∘ *≤* , inj₂ ∘ *≤* ]′ (ℤ.≤-total
(↥ p ℤ.* ↧ q)
(↥ q ℤ.* ↧ p))
_≤?_ : Decidable _≤_
p ≤? q = Dec′.map′ *≤* drop-*≤* ((↥ p ℤ.* ↧ q) ℤ.≤? (↥ q ℤ.* ↧ p))
≤-isPreorder : IsPreorder _≡_ _≤_
≤-isPreorder = record
{ isEquivalence = isEquivalence
; reflexive = ≤-reflexive
; trans = ≤-trans
}
≤-isPartialOrder : IsPartialOrder _≡_ _≤_
≤-isPartialOrder = record
{ isPreorder = ≤-isPreorder
; antisym = ≤-antisym
}
≤-isTotalOrder : IsTotalOrder _≡_ _≤_
≤-isTotalOrder = record
{ isPartialOrder = ≤-isPartialOrder
; total = ≤-total
}
≤-isDecTotalOrder : IsDecTotalOrder _≡_ _≤_
≤-isDecTotalOrder = record
{ isTotalOrder = ≤-isTotalOrder
; _≟_ = _≟_
; _≤?_ = _≤?_
}
≤-decTotalOrder : DecTotalOrder _ _ _
≤-decTotalOrder = record
{ Carrier = ℚ
; _≈_ = _≡_
; _≤_ = _≤_
; isDecTotalOrder = ≤-isDecTotalOrder
}
≤-irrelevant : Irrelevant _≤_
≤-irrelevant (*≤* x₁) (*≤* x₂) = cong *≤* (ℤ.≤-irrelevant x₁ x₂)
------------------------------------------------------------------------
-- DEPRECATED NAMES
------------------------------------------------------------------------
-- Please use the new names as continuing support for the old names is
-- not guaranteed.
-- Version 1.0
≤-irrelevance = ≤-irrelevant
{-# WARNING_ON_USAGE ≤-irrelevance
"Warning: ≤-irrelevance was deprecated in v1.0.
Please use ≤-irrelevant instead."
#-}
|
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xa0.log_2_1504.asm | ljhsiun2/medusa | 9 | 81611 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %r15
push %r9
push %rbx
push %rdi
// Store
lea addresses_WC+0x13acc, %r12
nop
nop
nop
sub %rbx, %rbx
movw $0x5152, (%r12)
nop
nop
nop
and %rdi, %rdi
// Store
lea addresses_WC+0x1c64c, %r9
nop
nop
sub %r13, %r13
movb $0x51, (%r9)
nop
nop
nop
xor %r13, %r13
// Store
lea addresses_WT+0x8952, %rdi
nop
nop
nop
and %r11, %r11
mov $0x5152535455565758, %rbx
movq %rbx, (%rdi)
cmp %r11, %r11
// Load
lea addresses_A+0x17d0c, %r9
nop
nop
nop
nop
nop
cmp $36764, %r13
vmovntdqa (%r9), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $0, %xmm3, %rbx
nop
nop
dec %rbx
// Faulty Load
lea addresses_WC+0xb4cc, %r11
clflush (%r11)
xor $53213, %rbx
mov (%r11), %r13
lea oracles, %r9
and $0xff, %r13
shlq $12, %r13
mov (%r9,%r13,1), %r13
pop %rdi
pop %rbx
pop %r9
pop %r15
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': True, 'same': False, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_WC', 'AVXalign': False, 'size': 2}}
{'OP': 'STOR', 'dst': {'NT': True, 'same': False, 'congruent': 7, 'type': 'addresses_WC', 'AVXalign': False, 'size': 1}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WT', 'AVXalign': False, 'size': 8}}
{'src': {'NT': True, 'same': False, 'congruent': 5, 'type': 'addresses_A', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_WC', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'00': 2}
00 00
*/
|
dcf/src/dcf-unzip-streams.ads | onox/dcf-ada | 5 | 23492 | -- SPDX-License-Identifier: MIT
--
-- Copyright (c) 1999 - 2018 <NAME>
-- SWITZERLAND
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-- THE SOFTWARE.
-- UnZip.Streams
-- -------------
--
-- Extracts, as a stream, a file which is has been compressed into a Zip archive.
-- The Zip archive itself (the input) can be a file or a more general stream.
-- This package is resembling Ada.Streams.Stream_IO, to facilitate transition.
with Ada.Streams;
with DCF.Zip;
with DCF.Streams;
package DCF.Unzip.Streams is
pragma Preelaborate;
type Stream_Writer
(Target : access DCF.Streams.Root_Zipstream_Type'Class)
is new Ada.Streams.Root_Stream_Type with private;
-- A simple helper object to extract files to a Root_Zipstream_Type
--
-- To extract to a file on disk, create a Stream_Writer object as follows:
--
-- File_Stream : aliased DCF.Streams.File_Zipstream := DCF.Streams.Create (Path);
-- Stream_Writer : DCF.Unzip.Streams.Stream_Writer (File_Stream'Access);
--
-- And then call procedure Extract below.
use type DCF.Streams.Zipstream_Class_Access;
procedure Extract
(Destination : in out Ada.Streams.Root_Stream_Type'Class;
Archive_Info : in Zip.Zip_Info; -- Archive's Zip_info
File : in Zip.Archived_File; -- Zipped entry
Verify_Integrity : in Boolean)
with Pre => Archive_Info.Is_Loaded and Archive_Info.Stream /= null;
-- Extract a Zip archive entry to the given output stream
--
-- The memory footprint is limited to the decompression structures and
-- buffering, so the outward stream can be an interesting alternative
-- to the inward, albeit less comfortable.
private
type Stream_Writer
(Target : access DCF.Streams.Root_Zipstream_Type'Class)
is new Ada.Streams.Root_Stream_Type with record
Index : DCF.Streams.Zs_Index_Type := DCF.Streams.Zs_Index_Type'First;
end record;
overriding procedure Read
(Stream : in out Stream_Writer;
Item : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset) is null;
overriding procedure Write
(Stream : in out Stream_Writer;
Item : in Ada.Streams.Stream_Element_Array);
end DCF.Unzip.Streams;
|
programs/oeis/250/A250879.asm | neoneye/loda | 22 | 869 | ; A250879: Number of (2+1) X (n+1) 0..3 arrays with nondecreasing x(i,j)-x(i,j-1) in the i direction and nondecreasing x(i,j)+x(i-1,j) in the j direction.
; 440,1456,3442,6728,11644,18520,27686,39472,54208,72224,93850,119416,149252,183688,223054,267680,317896,374032,436418,505384,581260,664376,755062,853648,960464,1075840,1200106,1333592,1476628,1629544,1792670,1966336,2150872,2346608,2553874,2773000,3004316,3248152,3504838,3774704,4058080,4355296,4666682,4992568,5333284,5689160,6060526,6447712,6851048,7270864,7707490,8161256,8632492,9121528,9628694,10154320,10698736,11262272,11845258,12448024,13070900,13714216,14378302,15063488,15770104,16498480,17248946,18021832,18817468,19636184,20478310,21344176,22234112,23148448,24087514,25051640,26041156,27056392,28097678,29165344,30259720,31381136,32529922,33706408,34910924,36143800,37405366,38695952,40015888,41365504,42745130,44155096,45595732,47067368,48570334,50104960,51671576,53270512,54902098,56566664
mov $5,$0
add $0,2
mov $1,$0
mul $0,5
mul $1,2
mul $1,$0
mov $3,$1
mov $4,$1
mul $4,$0
add $3,$4
mov $0,$3
mov $2,1
mov $6,$5
lpb $2
add $0,$6
sub $2,1
lpe
mov $8,$5
lpb $8
add $7,$6
sub $8,1
lpe
mov $2,10
mov $6,$7
lpb $2
add $0,$6
sub $2,1
lpe
mov $7,0
mov $8,$5
lpb $8
add $7,$6
sub $8,1
lpe
mov $2,5
mov $6,$7
lpb $2
add $0,$6
sub $2,1
lpe
|
test/asset/agda-stdlib-1.0/Algebra/Properties/Lattice.agda | omega12345/agda-mode | 0 | 6333 | <reponame>omega12345/agda-mode
------------------------------------------------------------------------
-- The Agda standard library
--
-- Some derivable properties
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
open import Algebra
module Algebra.Properties.Lattice {l₁ l₂} (L : Lattice l₁ l₂) where
open Lattice L
open import Algebra.Structures
open import Algebra.FunctionProperties _≈_
import Algebra.Properties.Semilattice as SL
open import Relation.Binary
import Relation.Binary.Lattice as R
open import Relation.Binary.Reasoning.Setoid setoid
open import Function
open import Function.Equality using (_⟨$⟩_)
open import Function.Equivalence using (_⇔_; module Equivalence)
open import Data.Product using (_,_; swap)
------------------------------------------------------------------------
-- Every lattice contains two semilattices.
∧-idempotent : Idempotent _∧_
∧-idempotent x = begin
x ∧ x ≈⟨ refl ⟨ ∧-cong ⟩ sym (∨-absorbs-∧ _ _) ⟩
x ∧ (x ∨ x ∧ x) ≈⟨ ∧-absorbs-∨ _ _ ⟩
x ∎
∨-idempotent : Idempotent _∨_
∨-idempotent x = begin
x ∨ x ≈⟨ refl ⟨ ∨-cong ⟩ sym (∧-idempotent _) ⟩
x ∨ x ∧ x ≈⟨ ∨-absorbs-∧ _ _ ⟩
x ∎
∧-isSemilattice : IsSemilattice _≈_ _∧_
∧-isSemilattice = record
{ isBand = record
{ isSemigroup = record
{ isMagma = record
{ isEquivalence = isEquivalence
; ∙-cong = ∧-cong
}
; assoc = ∧-assoc
}
; idem = ∧-idempotent
}
; comm = ∧-comm
}
∧-semilattice : Semilattice l₁ l₂
∧-semilattice = record { isSemilattice = ∧-isSemilattice }
∨-isSemilattice : IsSemilattice _≈_ _∨_
∨-isSemilattice = record
{ isBand = record
{ isSemigroup = record
{ isMagma = record
{ isEquivalence = isEquivalence
; ∙-cong = ∨-cong
}
; assoc = ∨-assoc
}
; idem = ∨-idempotent
}
; comm = ∨-comm
}
∨-semilattice : Semilattice l₁ l₂
∨-semilattice = record { isSemilattice = ∨-isSemilattice }
open SL ∧-semilattice public using (poset)
open Poset poset using (_≤_; isPartialOrder)
------------------------------------------------------------------------
-- The dual construction is also a lattice.
∧-∨-isLattice : IsLattice _≈_ _∧_ _∨_
∧-∨-isLattice = record
{ isEquivalence = isEquivalence
; ∨-comm = ∧-comm
; ∨-assoc = ∧-assoc
; ∨-cong = ∧-cong
; ∧-comm = ∨-comm
; ∧-assoc = ∨-assoc
; ∧-cong = ∨-cong
; absorptive = swap absorptive
}
∧-∨-lattice : Lattice _ _
∧-∨-lattice = record { isLattice = ∧-∨-isLattice }
------------------------------------------------------------------------
-- Every algebraic lattice can be turned into an order-theoretic one.
isOrderTheoreticLattice : R.IsLattice _≈_ _≤_ _∨_ _∧_
isOrderTheoreticLattice = record
{ isPartialOrder = isPartialOrder
; supremum = supremum
; infimum = infimum
}
where
∧-meetSemilattice = SL.orderTheoreticMeetSemilattice ∧-semilattice
∨-joinSemilattice = SL.orderTheoreticJoinSemilattice ∨-semilattice
open R.MeetSemilattice ∧-meetSemilattice using (infimum)
open R.JoinSemilattice ∨-joinSemilattice using ()
renaming (supremum to supremum′; _≤_ to _≤′_)
-- An alternative but equivalent interpretation of the order _≤_.
sound : ∀ {x y} → x ≤′ y → x ≤ y
sound {x} {y} y≈y∨x = sym $ begin
x ∧ y ≈⟨ ∧-congˡ y≈y∨x ⟩
x ∧ (y ∨ x) ≈⟨ ∧-congˡ (∨-comm y x) ⟩
x ∧ (x ∨ y) ≈⟨ ∧-absorbs-∨ x y ⟩
x ∎
complete : ∀ {x y} → x ≤ y → x ≤′ y
complete {x} {y} x≈x∧y = sym $ begin
y ∨ x ≈⟨ ∨-congˡ x≈x∧y ⟩
y ∨ (x ∧ y) ≈⟨ ∨-congˡ (∧-comm x y) ⟩
y ∨ (y ∧ x) ≈⟨ ∨-absorbs-∧ y x ⟩
y ∎
supremum : R.Supremum _≤_ _∨_
supremum x y =
let x∨y≥x , x∨y≥y , greatest = supremum′ x y
in sound x∨y≥x , sound x∨y≥y ,
λ z x≤z y≤z → sound (greatest z (complete x≤z) (complete y≤z))
orderTheoreticLattice : R.Lattice _ _ _
orderTheoreticLattice = record { isLattice = isOrderTheoreticLattice }
------------------------------------------------------------------------
-- One can replace the underlying equality with an equivalent one.
replace-equality : {_≈′_ : Rel Carrier l₂} →
(∀ {x y} → x ≈ y ⇔ (x ≈′ y)) → Lattice _ _
replace-equality {_≈′_} ≈⇔≈′ = record
{ _≈_ = _≈′_
; _∧_ = _∧_
; _∨_ = _∨_
; isLattice = record
{ isEquivalence = record
{ refl = to ⟨$⟩ refl
; sym = λ x≈y → to ⟨$⟩ sym (from ⟨$⟩ x≈y)
; trans = λ x≈y y≈z → to ⟨$⟩ trans (from ⟨$⟩ x≈y) (from ⟨$⟩ y≈z)
}
; ∨-comm = λ x y → to ⟨$⟩ ∨-comm x y
; ∨-assoc = λ x y z → to ⟨$⟩ ∨-assoc x y z
; ∨-cong = λ x≈y u≈v → to ⟨$⟩ ∨-cong (from ⟨$⟩ x≈y) (from ⟨$⟩ u≈v)
; ∧-comm = λ x y → to ⟨$⟩ ∧-comm x y
; ∧-assoc = λ x y z → to ⟨$⟩ ∧-assoc x y z
; ∧-cong = λ x≈y u≈v → to ⟨$⟩ ∧-cong (from ⟨$⟩ x≈y) (from ⟨$⟩ u≈v)
; absorptive = (λ x y → to ⟨$⟩ ∨-absorbs-∧ x y)
, (λ x y → to ⟨$⟩ ∧-absorbs-∨ x y)
}
} where open module E {x y} = Equivalence (≈⇔≈′ {x} {y})
|
src/gdb/gdb-7.11/gdb/testsuite/gdb.ada/rdv_wait/foo.adb | aps337/unum-sdk | 31 | 26317 | -- Copyright 2012-2016 Free Software Foundation, Inc.
--
-- This program 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 3 of the License, or
-- (at your option) any later version.
--
-- This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
with Pck; use Pck;
procedure Foo is
task type T is
entry Finish;
end T;
type TA is access T;
task body T is
begin
-- Wait for up to 100 seconds for the Finish Rendez-Vous to occur.
select
accept Finish do
null;
end Finish;
or
delay 100.0;
end select;
end T;
MIT : TA;
begin
-- Create a task, and give it some time to activate and then start
-- its execution.
MIT := new T;
delay 0.01;
-- Now, call our anchor. The task we just created should now be
-- blocked on a timed entry wait.
Break_Me;
-- Tell the task to finish before the 100 seconds are up. The test
-- is now finished, no need to wait :).
MIT.Finish;
end Foo;
|
test/Succeed/Issue2579.agda | shlevy/agda | 1,989 | 12701 | -- Andreas, 2017-05-13, issue reported by nad
module Issue2579 where
open import Common.Bool
open import Issue2579.Import
import Issue2579.Instance Bool true as I
-- without the "as I" the instance is not in scope
-- (and you get a parse error)
theWrapped : {{w : Wrap Bool}} → Bool
theWrapped {{w}} = Wrap.wrapped w
test : Bool
test = theWrapped
|
scripts/track/convert.scpt | katsuma/itunes-client | 12 | 1710 | on run argv
tell application "iTunes"
set persistent_id to (item 1 of argv) as string
set specified_track to (some track whose persistent ID is persistent_id)
set loc to (get location of specified_track)
set converted_tracks to (convert specified_track)
set converted_track to item 1 of converted_tracks
return persistent ID of converted_track
end tell
end run
|
oeis/145/A145557.asm | neoneye/loda-programs | 11 | 174002 | <gh_stars>10-100
; A145557: Numerators of partial sums of a certain alternating series of inverse central binomial coefficients.
; Submitted by <NAME>
; 1,5,13,361,31,1193,31021,34467,5273479,1821745,220211,230450795,2880634987,1502939987,5896829249,12430516053889,1381168450513,3271188435379,2299645470079393,459929094015491,819873602375609,810854992749436603,311867304903633289,31758487216019894591,24098581085326767,1905509232961194733,1413887850857206554377,487547534778347082427,14138878508572065428057,2690947845179844708739,598656750027657217064101,20354329500940345379373031,2482235304992725046289211,111781973488770749215411253
mov $1,1
lpb $0
mov $2,$0
mul $2,2
add $3,$1
mul $3,$0
sub $0,1
mul $1,2
add $2,1
mul $1,$2
dif $3,-1
lpe
add $1,$3
gcd $3,$1
div $1,$3
mov $0,$1
|
programs/oeis/077/A077043.asm | neoneye/loda | 22 | 5574 | ; A077043: "Three-quarter squares": a(n) = n^2 - A002620(n).
; 0,1,3,7,12,19,27,37,48,61,75,91,108,127,147,169,192,217,243,271,300,331,363,397,432,469,507,547,588,631,675,721,768,817,867,919,972,1027,1083,1141,1200,1261,1323,1387,1452,1519,1587,1657,1728,1801,1875,1951,2028,2107,2187,2269,2352,2437,2523,2611,2700,2791,2883,2977,3072,3169,3267,3367,3468,3571,3675,3781,3888,3997,4107,4219,4332,4447,4563,4681,4800,4921,5043,5167,5292,5419,5547,5677,5808,5941,6075,6211,6348,6487,6627,6769,6912,7057,7203,7351
pow $0,2
mov $1,$0
div $1,4
sub $0,$1
|
src/gen/gstreamer-gst_low_level-gstreamer_0_10_gst_gstbufferlist_h.ads | persan/A-gst | 1 | 3458 | <reponame>persan/A-gst<filename>src/gen/gstreamer-gst_low_level-gstreamer_0_10_gst_gstbufferlist_h.ads
pragma Ada_2005;
pragma Style_Checks (Off);
pragma Warnings (Off);
with Interfaces.C; use Interfaces.C;
limited with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h;
with glib;
with glib.Values;
with System;
with System;
with glib;
-- limited with GStreamer.GST_Low_Level.glib_2_0_glib_glist_h;
package GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbufferlist_h is
-- unsupported macro: GST_TYPE_BUFFER_LIST (gst_buffer_list_get_type ())
-- arg-macro: function GST_IS_BUFFER_LIST (obj)
-- return G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_BUFFER_LIST);
-- arg-macro: function GST_IS_BUFFER_LIST_CLASS (klass)
-- return G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_BUFFER_LIST);
-- arg-macro: function GST_BUFFER_LIST_GET_CLASS (obj)
-- return G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_BUFFER_LIST, GstBufferListClass);
-- arg-macro: function GST_BUFFER_LIST (obj)
-- return G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_BUFFER_LIST, GstBufferList);
-- arg-macro: function GST_BUFFER_LIST_CLASS (klass)
-- return G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_BUFFER_LIST, GstBufferListClass);
-- arg-macro: function GST_BUFFER_LIST_CAST (obj)
-- return (GstBufferList *)obj;
-- unsupported macro: GST_TYPE_BUFFER_LIST_ITERATOR (gst_buffer_list_iterator_get_type ())
-- arg-macro: procedure gst_buffer_list_is_writable (list)
-- gst_mini_object_is_writable (GST_MINI_OBJECT_CAST (list))
-- arg-macro: procedure gst_buffer_list_make_writable (list)
-- GST_BUFFER_LIST_CAST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST (list)))
-- GStreamer
-- * Copyright (C) 2009 Axis Communications <dev-gstreamer at axis dot com>
-- * @author <NAME> <jonas dot holmberg at axis dot com>
-- *
-- * gstbufferlist.h: Header for GstBufferList object
-- *
-- * This library is free software; you can redistribute it and/or
-- * modify it under the terms of the GNU Library General Public
-- * License as published by the Free Software Foundation; either
-- * version 2 of the License, or (at your option) any later version.
-- *
-- * This library is distributed in the hope that it will be useful,
-- * but WITHOUT ANY WARRANTY; without even the implied warranty of
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- * Library General Public License for more details.
-- *
-- * You should have received a copy of the GNU Library General Public
-- * License along with this library; if not, write to the
-- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-- * Boston, MA 02111-1307, USA.
--
-- skipped empty struct u_GstBufferList
-- skipped empty struct GstBufferList
-- skipped empty struct u_GstBufferListClass
-- skipped empty struct GstBufferListClass
-- skipped empty struct u_GstBufferListIterator
-- skipped empty struct GstBufferListIterator
--*
-- * GstBufferListDoFunction:
-- * @buffer: (transfer full): the #GstBuffer
-- * @user_data: user data
-- *
-- * A function for accessing the last buffer returned by
-- * gst_buffer_list_iterator_next(). The function can leave @buffer in the list,
-- * replace @buffer in the list or remove @buffer from the list, depending on
-- * the return value. If the function returns NULL, @buffer will be removed from
-- * the list, otherwise @buffer will be replaced with the returned buffer.
-- *
-- * The last buffer returned by gst_buffer_list_iterator_next() will be replaced
-- * with the buffer returned from the function. The function takes ownership of
-- * @buffer and if a different value than @buffer is returned, @buffer must be
-- * unreffed. If NULL is returned, the buffer will be removed from the list. The
-- * list must be writable.
-- *
-- * Returns: (transfer full): the buffer to replace @buffer in the list, or NULL
-- * to remove @buffer from the list
-- *
-- * Since: 0.10.24
--
type GstBufferListDoFunction is access function (arg1 : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; arg2 : System.Address) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer;
pragma Convention (C, GstBufferListDoFunction); -- gst/gstbufferlist.h:66
--*
-- * GstBufferListItem:
-- * @GST_BUFFER_LIST_CONTINUE: Retrieve next buffer
-- * @GST_BUFFER_LIST_SKIP_GROUP: Skip to next group
-- * @GST_BUFFER_LIST_END: End iteration
-- *
-- * The result of the #GstBufferListFunc.
-- *
-- * Since: 0.10.24
--
type GstBufferListItem is
(GST_BUFFER_LIST_CONTINUE,
GST_BUFFER_LIST_SKIP_GROUP,
GST_BUFFER_LIST_END);
pragma Convention (C, GstBufferListItem); -- gst/gstbufferlist.h:82
--*
-- * GstBufferListFunc:
-- * @buffer: pointer the buffer
-- * @group: the group index of @buffer
-- * @idx: the index in @group of @buffer
-- * @user_data: user data passed to gst_buffer_list_foreach()
-- *
-- * A function that will be called from gst_buffer_list_foreach(). The @buffer
-- * field will point to a the reference of the buffer at @idx in @group.
-- *
-- * When this function returns #GST_BUFFER_LIST_CONTINUE, the next buffer will be
-- * returned. When #GST_BUFFER_LIST_SKIP_GROUP is returned, all remaining buffers
-- * in the current group will be skipped and the first buffer of the next group
-- * is returned (if any). When GST_BUFFER_LIST_END is returned,
-- * gst_buffer_list_foreach() will return.
-- *
-- * When @buffer is set to NULL, the item will be removed from the bufferlist.
-- * When @buffer has been made writable, the new buffer reference can be assigned
-- * to @buffer. This function is responsible for unreffing the old buffer when
-- * removing or modifying.
-- *
-- * Returns: a #GstBufferListItem
-- *
-- * Since: 0.10.24
--
type GstBufferListFunc is access function
(arg1 : System.Address;
arg2 : GLIB.guint;
arg3 : GLIB.guint;
arg4 : System.Address) return GstBufferListItem;
pragma Convention (C, GstBufferListFunc); -- gst/gstbufferlist.h:109
function gst_buffer_list_get_type return GLIB.GType; -- gst/gstbufferlist.h:113
pragma Import (C, gst_buffer_list_get_type, "gst_buffer_list_get_type");
-- allocation
function gst_buffer_list_new return System.Address; -- gst/gstbufferlist.h:116
pragma Import (C, gst_buffer_list_new, "gst_buffer_list_new");
-- refcounting
--*
-- * gst_buffer_list_ref:
-- * @list: a #GstBufferList
-- *
-- * Increases the refcount of the given buffer list by one.
-- *
-- * Note that the refcount affects the writeability of @list and its data, see
-- * gst_buffer_list_make_writable(). It is important to note that keeping
-- * additional references to GstBufferList instances can potentially increase
-- * the number of memcpy operations in a pipeline.
-- *
-- * Returns: (transfer full): @list
-- *
-- * Since: 0.10.24
--
function gst_buffer_list_ref (list : System.Address) return System.Address; -- gst/gstbufferlist.h:139
pragma Import (C, gst_buffer_list_ref, "gst_buffer_list_ref");
--*
-- * gst_buffer_list_unref:
-- * @list: (transfer full): a #GstBufferList
-- *
-- * Decreases the refcount of the buffer list. If the refcount reaches 0, the
-- * buffer list will be freed.
-- *
-- * Since: 0.10.24
--
procedure gst_buffer_list_unref (list : System.Address); -- gst/gstbufferlist.h:159
pragma Import (C, gst_buffer_list_unref, "gst_buffer_list_unref");
-- copy
--*
-- * gst_buffer_list_copy:
-- * @list: a #GstBufferList
-- *
-- * Create a shallow copy of the given buffer list. This will make a newly
-- * allocated copy of the source list with copies of buffer pointers. The
-- * refcount of buffers pointed to will be increased by one.
-- *
-- * Returns: (transfer full): a new copy of @list.
-- *
-- * Since: 0.10.24
--
function gst_buffer_list_copy (list : System.Address) return System.Address; -- gst/gstbufferlist.h:182
pragma Import (C, gst_buffer_list_copy, "gst_buffer_list_copy");
--*
-- * gst_buffer_list_is_writable:
-- * @list: a #GstBufferList
-- *
-- * Tests if you can safely add buffers and groups into a buffer list.
-- *
-- * Since: 0.10.24
--
--*
-- * gst_buffer_list_make_writable:
-- * @list: (transfer full): a #GstBufferList
-- *
-- * Makes a writable buffer list from the given buffer list. If the source buffer
-- * list is already writable, this will simply return the same buffer list. A
-- * copy will otherwise be made using gst_buffer_list_copy().
-- *
-- * Returns: (transfer full): a writable list, which may or may not be the
-- * same as @list
-- *
-- * Since: 0.10.24
--
function gst_buffer_list_n_groups (list : System.Address) return GLIB.guint; -- gst/gstbufferlist.h:212
pragma Import (C, gst_buffer_list_n_groups, "gst_buffer_list_n_groups");
procedure gst_buffer_list_foreach
(list : System.Address;
func : GstBufferListFunc;
user_data : System.Address); -- gst/gstbufferlist.h:214
pragma Import (C, gst_buffer_list_foreach, "gst_buffer_list_foreach");
function gst_buffer_list_get
(list : System.Address;
group : GLIB.guint;
idx : GLIB.guint) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; -- gst/gstbufferlist.h:217
pragma Import (C, gst_buffer_list_get, "gst_buffer_list_get");
-- iterator
function gst_buffer_list_iterator_get_type return GLIB.GType; -- gst/gstbufferlist.h:220
pragma Import (C, gst_buffer_list_iterator_get_type, "gst_buffer_list_iterator_get_type");
function gst_buffer_list_iterate (list : System.Address) return System.Address; -- gst/gstbufferlist.h:221
pragma Import (C, gst_buffer_list_iterate, "gst_buffer_list_iterate");
procedure gst_buffer_list_iterator_free (it : System.Address); -- gst/gstbufferlist.h:222
pragma Import (C, gst_buffer_list_iterator_free, "gst_buffer_list_iterator_free");
function gst_buffer_list_iterator_n_buffers (it : System.Address) return GLIB.guint; -- gst/gstbufferlist.h:224
pragma Import (C, gst_buffer_list_iterator_n_buffers, "gst_buffer_list_iterator_n_buffers");
function gst_buffer_list_iterator_next (it : System.Address) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; -- gst/gstbufferlist.h:225
pragma Import (C, gst_buffer_list_iterator_next, "gst_buffer_list_iterator_next");
function gst_buffer_list_iterator_next_group (it : System.Address) return GLIB.gboolean; -- gst/gstbufferlist.h:226
pragma Import (C, gst_buffer_list_iterator_next_group, "gst_buffer_list_iterator_next_group");
procedure gst_buffer_list_iterator_add (it : System.Address; buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer); -- gst/gstbufferlist.h:228
pragma Import (C, gst_buffer_list_iterator_add, "gst_buffer_list_iterator_add");
procedure gst_buffer_list_iterator_add_list (it : System.Address; list : access GStreamer.GST_Low_Level.glib_2_0_glib_glist_h.GList); -- gst/gstbufferlist.h:229
pragma Import (C, gst_buffer_list_iterator_add_list, "gst_buffer_list_iterator_add_list");
procedure gst_buffer_list_iterator_add_group (it : System.Address); -- gst/gstbufferlist.h:230
pragma Import (C, gst_buffer_list_iterator_add_group, "gst_buffer_list_iterator_add_group");
procedure gst_buffer_list_iterator_remove (it : System.Address); -- gst/gstbufferlist.h:231
pragma Import (C, gst_buffer_list_iterator_remove, "gst_buffer_list_iterator_remove");
function gst_buffer_list_iterator_steal (it : System.Address) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; -- gst/gstbufferlist.h:232
pragma Import (C, gst_buffer_list_iterator_steal, "gst_buffer_list_iterator_steal");
procedure gst_buffer_list_iterator_take (it : System.Address; buffer : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer); -- gst/gstbufferlist.h:233
pragma Import (C, gst_buffer_list_iterator_take, "gst_buffer_list_iterator_take");
function gst_buffer_list_iterator_do
(it : System.Address;
do_func : GstBufferListDoFunction;
user_data : System.Address) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; -- gst/gstbufferlist.h:235
pragma Import (C, gst_buffer_list_iterator_do, "gst_buffer_list_iterator_do");
-- conversion
function gst_buffer_list_iterator_merge_group (it : System.Address) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; -- gst/gstbufferlist.h:239
pragma Import (C, gst_buffer_list_iterator_merge_group, "gst_buffer_list_iterator_merge_group");
end GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbufferlist_h;
|
oeis/290/A290974.asm | neoneye/loda-programs | 11 | 15945 | <reponame>neoneye/loda-programs
; A290974: Alternating sum of row 2n of A022166.
; Submitted by <NAME>
; 1,-1,7,-217,27559,-14082649,28827182503,-236123451882073,7737057147819885991,-1014103817421900276726361,531681448124675830384033629607,-1115016280616112042365706510363949657,9353433376690281791373262192784600640357799
add $0,1
mov $3,11
mov $4,-2
lpb $0
sub $0,1
add $2,1
mul $3,$2
mov $2,$4
mul $4,4
lpe
mov $0,$3
div $0,11
|
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/in_out_parameter4.adb | best08618/asylo | 7 | 22502 | <reponame>best08618/asylo
-- { dg-do run }
-- { dg-options "-gnat12 -gnatVa" }
procedure In_Out_Parameter4 is
type Enum is (E_Undetermined, E_Down, E_Up);
subtype Status_T is Enum range E_Down .. E_Up;
function Recurse (Val : in out Integer) return Status_T is
Result : Status_T;
procedure Dummy (I : in out Integer) is begin null; end;
begin
if Val > 500 then
Val := Val - 1;
Result := Recurse (Val);
return Result;
else
return E_UP;
end if;
end;
Val : Integer := 501;
S : Status_T;
begin
S := Recurse (Val);
end;
|
archive/agda-2/Oscar/Data/Proposextensequality.agda | m0davis/oscar | 0 | 7726 |
module Oscar.Data.Proposextensequality where
open import Oscar.Data.Proposequality using (_≡_)
open import Oscar.Level
infix 4 _≡̇_
_≡̇_ : ∀ {a} {A : Set a} {b} {B : A → Set b} → ((x : A) → B x) → ((x : A) → B x) → Set (a ⊔ b)
f ≡̇ g = ∀ x → f x ≡ g x
|
programs/oeis/158/A158383.asm | neoneye/loda | 22 | 167737 | <reponame>neoneye/loda
; A158383: 625n + 1.
; 626,1251,1876,2501,3126,3751,4376,5001,5626,6251,6876,7501,8126,8751,9376,10001,10626,11251,11876,12501,13126,13751,14376,15001,15626,16251,16876,17501,18126,18751,19376,20001,20626,21251,21876,22501,23126,23751,24376,25001,25626,26251,26876,27501,28126,28751,29376,30001,30626,31251,31876,32501,33126,33751,34376,35001,35626,36251,36876,37501,38126,38751,39376,40001,40626,41251,41876,42501,43126,43751,44376,45001,45626,46251,46876,47501,48126,48751,49376,50001,50626,51251,51876,52501,53126,53751,54376,55001,55626,56251,56876,57501,58126,58751,59376,60001,60626,61251,61876,62501
mul $0,625
add $0,626
|
programs/oeis/194/A194512.asm | karttu/loda | 0 | 167953 | ; A194512: First coordinate of (2,7)-Lagrange pair for n.
; 4,1,5,2,-1,3,0,4,1,5,2,6,3,0,4,1,5,2,6,3,7,4,1,5,2,6,3,7,4,8,5,2,6,3,7,4,8,5,9,6,3,7,4,8,5,9,6,10,7,4,8,5,9,6,10,7,11,8,5,9,6,10,7,11,8,12,9,6,10,7,11,8,12,9,13,10,7,11,8,12,9,13,10,14,11,8,12,9,13,10,14,11
sub $1,$0
mul $0,5
add $0,12
sub $1,1
lpb $0,1
sub $0,9
add $1,2
lpe
add $1,$0
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c3/c34004a.ada | best08618/asylo | 7 | 17582 | <filename>gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c3/c34004a.ada
-- C34004A.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 THE REQUIRED PREDEFINED OPERATIONS ARE DECLARED
-- (IMPLICITLY) FOR DERIVED FIXED POINT TYPES.
-- HISTORY:
-- JRK 09/08/86 CREATED ORIGINAL TEST.
-- JET 08/06/87 FIXED BUGS IN DELTAS AND RANGE ERROR.
-- JET 09/22/88 CHANGED USAGE OF X'SIZE.
-- RDH 04/16/90 ADDED TEST FOR REAL VARIABLE VALUES.
-- THS 09/25/90 REMOVED ALL REFERENCES TO B, MODIFIED CHECK OF
-- '=', INITIALIZED Z NON-STATICALLY, MOVED BINARY
-- CHECKS.
-- DTN 11/30/95 REMOVED NON ADA95 ATTRIBUTES.
-- KAS 03/04/96 REMOVED COMPARISON OF T'SMALL TO T'BASE'SMALL
WITH SYSTEM; USE SYSTEM;
WITH REPORT; USE REPORT;
PROCEDURE C34004A IS
TYPE PARENT IS DELTA 2.0 ** (-7) RANGE -100.0 .. 100.0;
SUBTYPE SUBPARENT IS PARENT RANGE
IDENT_INT (1) * (-50.0) ..
IDENT_INT (1) * ( 50.0);
TYPE T IS NEW SUBPARENT DELTA 2.0 ** (-4) RANGE
IDENT_INT (1) * (-30.0) ..
IDENT_INT (1) * ( 30.0);
TYPE FIXED IS DELTA 2.0 ** (-4) RANGE -1000.0 .. 1000.0;
X : T := -30.0;
I : INTEGER := X'SIZE; --CHECK FOR THE AVAILABILITY OF 'SIZE.
W : PARENT := -100.0;
R : CONSTANT := 1.0;
M : CONSTANT := 100.0;
F : FLOAT := 0.0;
G : FIXED := 0.0;
PROCEDURE A (X : ADDRESS) IS
BEGIN
NULL;
END A;
FUNCTION IDENT (X : T) RETURN T IS
BEGIN
IF EQUAL (3, 3) THEN
RETURN X; -- ALWAYS EXECUTED.
END IF;
RETURN T'FIRST;
END IDENT;
BEGIN
DECLARE
Z : CONSTANT T := IDENT(0.0);
BEGIN
TEST ("C34004A", "CHECK THAT THE REQUIRED PREDEFINED " &
"OPERATIONS ARE DECLARED (IMPLICITLY) " &
"FOR DERIVED FIXED POINT TYPES");
X := IDENT (30.0);
IF X /= 30.0 THEN
FAILED ("INCORRECT :=");
END IF;
IF X + IDENT (-1.0) /= 29.0 OR X + 70.0 /= 100.0 THEN
FAILED ("INCORRECT BINARY +");
END IF;
IF X - IDENT (30.0) /= 0.0 OR X - 100.0 /= -70.0 THEN
FAILED ("INCORRECT BINARY -");
END IF;
IF T'(X) /= 30.0 THEN
FAILED ("INCORRECT QUALIFICATION");
END IF;
IF T (X) /= 30.0 THEN
FAILED ("INCORRECT SELF CONVERSION");
END IF;
IF EQUAL (3, 3) THEN
W := -30.0;
END IF;
IF T (W) /= -30.0 THEN
FAILED ("INCORRECT CONVERSION FROM PARENT");
END IF;
IF PARENT (X) /= 30.0 OR PARENT (Z - 100.0) /= -100.0 THEN
FAILED ("INCORRECT CONVERSION TO PARENT");
END IF;
IF T (IDENT_INT (-30)) /= -30.0 THEN
FAILED ("INCORRECT CONVERSION FROM INTEGER");
END IF;
IF INTEGER (X) /= 30 OR INTEGER (Z - 100.0) /= -100 THEN
FAILED ("INCORRECT CONVERSION TO INTEGER");
END IF;
IF EQUAL (3, 3) THEN
F := -30.0;
END IF;
IF T (F) /= -30.0 THEN
FAILED ("INCORRECT CONVERSION FROM FLOAT");
END IF;
IF FLOAT (X) /= 30.0 OR FLOAT (Z - 100.0) /= -100.0 THEN
FAILED ("INCORRECT CONVERSION TO FLOAT");
END IF;
IF EQUAL (3, 3) THEN
G := -30.0;
END IF;
IF T (G) /= -30.0 THEN
FAILED ("INCORRECT CONVERSION FROM FIXED");
END IF;
IF FIXED (X) /= 30.0 OR FIXED (Z - 100.0) /= -100.0 THEN
FAILED ("INCORRECT CONVERSION TO FIXED");
END IF;
IF IDENT (R) /= 1.0 OR X = M THEN
FAILED ("INCORRECT IMPLICIT CONVERSION");
END IF;
IF IDENT (30.0) /= 30.0 OR X = 100.0 THEN
FAILED ("INCORRECT REAL LITERAL");
END IF;
IF NOT (X = IDENT (30.0)) THEN
FAILED ("INCORRECT =");
END IF;
IF X /= IDENT (30.0) OR NOT (X /= 100.0) THEN
FAILED ("INCORRECT /=");
END IF;
IF X < IDENT (30.0) OR 100.0 < X THEN
FAILED ("INCORRECT <");
END IF;
IF X > IDENT (30.0) OR X > 100.0 THEN
FAILED ("INCORRECT >");
END IF;
IF X <= IDENT (0.0) OR 100.0 <= X THEN
FAILED ("INCORRECT <=");
END IF;
IF IDENT (0.0) >= X OR X >= 100.0 THEN
FAILED ("INCORRECT >=");
END IF;
IF NOT (X IN T) OR 100.0 IN T THEN
FAILED ("INCORRECT ""IN""");
END IF;
IF X NOT IN T OR NOT (100.0 NOT IN T) THEN
FAILED ("INCORRECT ""NOT IN""");
END IF;
IF +X /= 30.0 OR +(Z - 100.0) /= -100.0 THEN
FAILED ("INCORRECT UNARY +");
END IF;
IF -X /= 0.0 - 30.0 OR -(Z - 100.0) /= 100.0 THEN
FAILED ("INCORRECT UNARY -");
END IF;
IF ABS X /= 30.0 OR ABS (Z - 100.0) /= 100.0 THEN
FAILED ("INCORRECT ABS");
END IF;
IF T (X * IDENT (-1.0)) /= -30.0 OR
T (IDENT (2.0) * (Z + 15.0)) /= 30.0 THEN
FAILED ("INCORRECT * (FIXED, FIXED)");
END IF;
IF X * IDENT_INT (-1) /= -30.0 OR
(Z + 50.0) * 2 /= 100.0 THEN
FAILED ("INCORRECT * (FIXED, INTEGER)");
END IF;
IF IDENT_INT (-1) * X /= -30.0 OR
2 * (Z + 50.0) /= 100.0 THEN
FAILED ("INCORRECT * (INTEGER, FIXED)");
END IF;
IF T (X / IDENT (3.0)) /= 10.0 OR
T ((Z + 90.0) / X) /= 3.0 THEN
FAILED ("INCORRECT / (FIXED, FIXED)");
END IF;
IF X / IDENT_INT (3) /= 10.0 OR (Z + 90.0) / 30 /= 3.0 THEN
FAILED ("INCORRECT / (FIXED, INTEGER)");
END IF;
A (X'ADDRESS);
IF T'AFT /= 2 OR T'BASE'AFT < 3 THEN
FAILED ("INCORRECT 'AFT");
END IF;
IF T'BASE'SIZE < 15 THEN
FAILED ("INCORRECT 'BASE'SIZE");
END IF;
IF T'DELTA /= 2.0 ** (-4) OR T'BASE'DELTA > 2.0 ** (-7) THEN
FAILED ("INCORRECT 'DELTA");
END IF;
IF T'FORE /= 3 OR T'BASE'FORE < 4 THEN
FAILED ("INCORRECT 'FORE");
END IF;
IF T'MACHINE_OVERFLOWS /= T'BASE'MACHINE_OVERFLOWS THEN
FAILED ("INCORRECT 'MACHINE_OVERFLOWS");
END IF;
IF T'MACHINE_ROUNDS /= T'BASE'MACHINE_ROUNDS THEN
FAILED ("INCORRECT 'MACHINE_ROUNDS");
END IF;
IF T'SIZE < 10 THEN
FAILED ("INCORRECT TYPE'SIZE");
END IF;
IF T'SMALL > 2.0 ** (-4) OR T'BASE'SMALL > 2.0 ** (-7) THEN
FAILED ("INCORRECT 'SMALL");
END IF;
END;
RESULT;
END C34004A;
|
source/oasis/program-elements-generic_package_renaming_declarations.ads | optikos/oasis | 0 | 22417 | <reponame>optikos/oasis
-- Copyright (c) 2019 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Program.Elements.Declarations;
with Program.Lexical_Elements;
with Program.Elements.Defining_Names;
with Program.Elements.Expressions;
with Program.Elements.Aspect_Specifications;
package Program.Elements.Generic_Package_Renaming_Declarations is
pragma Pure (Program.Elements.Generic_Package_Renaming_Declarations);
type Generic_Package_Renaming_Declaration is
limited interface and Program.Elements.Declarations.Declaration;
type Generic_Package_Renaming_Declaration_Access is
access all Generic_Package_Renaming_Declaration'Class
with Storage_Size => 0;
not overriding function Name
(Self : Generic_Package_Renaming_Declaration)
return not null Program.Elements.Defining_Names.Defining_Name_Access
is abstract;
not overriding function Renamed_Package
(Self : Generic_Package_Renaming_Declaration)
return not null Program.Elements.Expressions.Expression_Access
is abstract;
not overriding function Aspects
(Self : Generic_Package_Renaming_Declaration)
return Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access is abstract;
type Generic_Package_Renaming_Declaration_Text is limited interface;
type Generic_Package_Renaming_Declaration_Text_Access is
access all Generic_Package_Renaming_Declaration_Text'Class
with Storage_Size => 0;
not overriding function To_Generic_Package_Renaming_Declaration_Text
(Self : aliased in out Generic_Package_Renaming_Declaration)
return Generic_Package_Renaming_Declaration_Text_Access is abstract;
not overriding function Generic_Token
(Self : Generic_Package_Renaming_Declaration_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Package_Token
(Self : Generic_Package_Renaming_Declaration_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Renames_Token
(Self : Generic_Package_Renaming_Declaration_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function With_Token
(Self : Generic_Package_Renaming_Declaration_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Semicolon_Token
(Self : Generic_Package_Renaming_Declaration_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
end Program.Elements.Generic_Package_Renaming_Declarations;
|
src/Basics.agda | jstolarek/dep-typed-wbl-heaps | 1 | 14422 | ----------------------------------------------------------------------
-- Copyright: 2013, <NAME>, Lodz University of Technology --
-- --
-- License: See LICENSE file in root of the repo --
-- Repo address: https://github.com/jstolarek/dep-typed-wbl-heaps --
-- --
-- This module re-exports all Basics/* modules for convenience. --
-- Note that both Basics.Nat and Basics.Ordering define ≥ operator. --
-- Here we re-export the one from Basics.Ordering as it will be --
-- used most of the time. --
-- This module also defines two type synonyms that will be helpful --
-- when working on heaps: Rank and Priority. --
----------------------------------------------------------------------
module Basics where
open import Basics.Bool public
open import Basics.Nat public hiding (_≥_)
open import Basics.Ordering public
open import Basics.Reasoning public
-- Rank of a weight biased leftist heap is defined as number of nodes
-- in a heap. In other words it is size of a tree used to represent a
-- heap.
Rank : Set
Rank = Nat
-- Priority assigned to elements stored in a Heap.
--
-- CONVENTION: Lower number means higher Priority. Therefore the
-- highest Priority is zero. It will sometimes be more convenient not
-- to use this inversed terminology. We will then use terms "smaller"
-- and "greater" (in contrast to "lower" and "higher"). Example:
-- Priority 3 is higher than 5, but 3 is smaller than 5.
Priority : Set
Priority = Nat
-- Note that both Rank and Priority are Nat, which allows us to
-- operate on them with functions that work for Nat.
|
src/interface/yaml-presenter.ads | robdaemon/AdaYaml | 32 | 17796 | <filename>src/interface/yaml-presenter.ads
-- part of AdaYaml, (c) 2017 <NAME>
-- released under the terms of the MIT license, see the file "copying.txt"
with Ada.Finalization;
with Yaml.Destination;
with Yaml.Stream_Concept;
with Yaml.Stacks;
package Yaml.Presenter is
type Instance is tagged limited private;
type Buffer_Type is access all String;
subtype Line_Length_Type is Integer range 20 .. Integer'Last;
Default_Line_Length : constant Line_Length_Type := 80;
type Flow_Style_Type is (Compact, Canonical);
procedure Configure (P : in out Instance; Max_Line_Length : Line_Length_Type;
Flow_Style : Flow_Style_Type);
procedure Set_Output (P : in out Instance;
D : not null Destination.Pointer);
procedure Set_Output (P : in out Instance;
Buffer : not null Buffer_Type);
procedure Put (P : in out Instance; E : Event);
generic
with package Stream is new Stream_Concept (<>);
procedure Consume (P : in out Instance;
S : in out Stream.Instance);
procedure Flush (P : in out Instance);
private
type Position_Type is
(Before_Stream_Start, After_Stream_End, Before_Doc_Start,
After_Directives_End, After_Implicit_Doc_Start, Before_Doc_End,
After_Implicit_Doc_End, After_Implicit_Map_Start, After_Map_Header,
After_Flow_Map_Start, After_Implicit_Block_Map_Key,
After_Explicit_Block_Map_Key, After_Block_Map_Value, After_Seq_Header,
After_Implicit_Seq_Start, After_Flow_Seq_Start, After_Block_Seq_Item,
After_Flow_Map_Key, After_Flow_Map_Value, After_Flow_Seq_Item,
After_Annotation_Name, After_Annotation_Param);
type Level is record
Position : Position_Type;
Indentation : Integer;
end record;
package Level_Stacks is new Yaml.Stacks (Level);
type Instance is new Ada.Finalization.Limited_Controlled with record
Max_Line_Length : Line_Length_Type := Default_Line_Length;
Flow_Style : Flow_Style_Type := Compact;
Cur_Column : Positive;
Cur_Max_Column : Positive;
Buffer_Pos : Positive;
Buffer : Buffer_Type;
Dest : Destination.Pointer;
Levels : Level_Stacks.Stack;
end record;
overriding procedure Finalize (Object : in out Instance);
end Yaml.Presenter;
|
src/commands/DoPrintBin.asm | jhm-ciberman/calculator-asm | 2 | 168466 | <reponame>jhm-ciberman/calculator-asm
proc DoPrintBin
fastcall ArrayListSize, [_lg_stack]
cmp eax, 0
je .empty_stack
fastcall ArrayListPop, [_lg_stack]
fastcall PrintBinary, rax
fastcall ConsolePrintChar, 98 ; 'b' character
fastcall ConsolePrintChar, 32 ; space character
ret
.empty_stack:
fastcall ConsolePrint, _gr_message_empty_stack
ret
endp
|
Quiz/Quiz 1/Q1-1812981642/QUIZ1_1812918642.asm | MohammadSakiL/CSE331L-Section-1-Fall20-NSU | 0 | 170888 |
; You may customize this and other start-up templates;
; The location of this template is c:\emu8086\inc\0_com_template.txt
org 100h
; AL 27H and AL 35H
MOV AL,27H
MOV BL,35H
ADD AL,BL
DAA
ret
|
Cubical/Homotopy/Group/Pi4S3/S3PushoutIso.agda | FernandoLarrain/cubical | 1 | 4975 | <filename>Cubical/Homotopy/Group/Pi4S3/S3PushoutIso.agda
{-# OPTIONS --safe #-}
{-
This file has been split in two due to slow type checking
combined with insufficient reductions when the
experimental-lossy-unification flag is included.
Part 2: Cubical.Homotopy.Group.Pi4S3.S3PushoutIso2
The goal of these two files is to show that
π₄(S³) ≅ π₃((S² × S²) ⊔ᴬ S²) where A = S² ∨ S².
This is proved in Brunerie (2016) using the James construction and
via (S² × S²) ⊔ᴬ S² ≃ J₂(S²).
In this file, we prove it directly using the encode-decode method. For
the statement of the isomorphism, see part 2.
-}
module Cubical.Homotopy.Group.Pi4S3.S3PushoutIso where
open import Cubical.Homotopy.Loopspace
open import Cubical.Homotopy.Group.Base
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Pointed
open import Cubical.Foundations.Pointed.Homogeneous
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.GroupoidLaws renaming (assoc to ∙assoc)
open import Cubical.Foundations.Path
open import Cubical.Foundations.Isomorphism
open Iso
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Univalence
open import Cubical.Functions.Morphism
open import Cubical.HITs.SetTruncation
renaming (rec to sRec ; rec2 to sRec2
; elim to sElim ; elim2 to sElim2 ; elim3 to sElim3
; map to sMap)
open import Cubical.HITs.Sn
open import Cubical.HITs.Susp renaming (toSusp to σ)
open import Cubical.HITs.S1 hiding (decode ; encode)
open import Cubical.Data.Sigma
open import Cubical.Data.Nat
open import Cubical.Data.Bool
open import Cubical.Algebra.Group
open import Cubical.Algebra.Semigroup
open import Cubical.Algebra.Monoid
open import Cubical.HITs.Join
open import Cubical.HITs.Pushout
open import Cubical.HITs.Wedge
open import Cubical.Homotopy.Freudenthal hiding (Code ; encode)
open import Cubical.Homotopy.Connected
open import Cubical.HITs.Truncation renaming
(rec to trRec ; elim to trElim ; elim2 to trElim2 ; map to trMap)
open import Cubical.Foundations.Function
open import Cubical.HITs.S2
Pushout⋁↪fold⋁ : ∀ {ℓ} (A : Pointed ℓ) → Type ℓ
Pushout⋁↪fold⋁ A = Pushout {A = A ⋁ A} ⋁↪ fold⋁
Pushout⋁↪fold⋁∙ : ∀ {ℓ} (A : Pointed ℓ) → Pointed ℓ
fst (Pushout⋁↪fold⋁∙ A) = Pushout⋁↪fold⋁ A
snd (Pushout⋁↪fold⋁∙ A) = inl (pt A , pt A)
-- The type of interest -- ''almost`` equivalent to ΩS³
Pushout⋁↪fold⋁S₊2 = Pushout {A = S₊∙ 2 ⋁ S₊∙ 2} ⋁↪ fold⋁
-- Same type, using base/surf definition of S² (easier to work with)
Pushout⋁↪fold⋁S² = Pushout⋁↪fold⋁ S²∙
-- Truncated version, to be proved equivalent to ∥ ΩS³ ∥₅
∥Pushout⋁↪fold⋁S²∥₅ = hLevelTrunc 5 Pushout⋁↪fold⋁S²
Ω∥S³∥₆ = Path (hLevelTrunc 6 (Susp S²)) ∣ north ∣ ∣ north ∣
-- Elimination into sets for Pushout⋁↪fold⋁S²
module _ {ℓ : Level} {P : Pushout⋁↪fold⋁S² → Type ℓ}
(hlev : ((x : Pushout⋁↪fold⋁S²) → isSet (P x)))
(b : P (inl (base , base))) where
private
×fun : (x y : S²) → P (inl (x , y))
×fun = S²ToSetElim (λ _ → isSetΠ (λ _ → hlev _))
(S²ToSetElim (λ _ → hlev _) b)
inrfun : (x : S²) → P (inr x)
inrfun = S²ToSetElim (λ _ → hlev _) (subst P (push (inl base)) b)
inl-pp : (x : S²) → PathP (λ i → P (push (inl x) i)) (×fun x base) (inrfun x)
inl-pp = S²ToSetElim (λ _ → isOfHLevelPathP 2 (hlev _) _ _)
λ j → transp (λ i → P (push (inl base) (i ∧ j))) (~ j) b
inr-pp : (x : S²) → PathP (λ i → P (push (inr x) i)) (×fun base x) (inrfun x)
inr-pp = S²ToSetElim (λ _ → isOfHLevelPathP 2 (hlev _) _ _)
(transport (λ j → PathP (λ i → P (push (push tt j) i)) (×fun base base)
(inrfun base))
(inl-pp base))
Pushout⋁↪fold⋁S²→Set : (x : Pushout⋁↪fold⋁S²) → P x
Pushout⋁↪fold⋁S²→Set (inl x) = ×fun (fst x) (snd x)
Pushout⋁↪fold⋁S²→Set (inr x) = inrfun x
Pushout⋁↪fold⋁S²→Set (push (inl x) i) = inl-pp x i
Pushout⋁↪fold⋁S²→Set (push (inr x) i) = inr-pp x i
Pushout⋁↪fold⋁S²→Set (push (push a j) i) = help j i
where
help : SquareP (λ j i → P (push (push tt j) i))
(λ i → inl-pp base i)
(λ i → inr-pp base i)
(λ _ → ×fun base base)
(λ _ → inrfun base)
help = toPathP (isProp→PathP (λ _ → isOfHLevelPathP' 1 (hlev _) _ _) _ _)
{- A wedge connectivity lemma for Pushout⋁↪fold⋁S². It can be
stated for general dependent types, but it's easier to work with
in the special case of path types -}
module Pushout⋁↪fold⋁S²WedgeCon {ℓ : Level } {A : Type ℓ}
(f g : Pushout⋁↪fold⋁S² → A)
(h : isOfHLevel 5 A)
(lp : (x : S²) → f (inl (x , base)) ≡ g (inl (x , base)))
(rp : (x : S²) → f (inl (base , x)) ≡ g (inl (base , x)))
(r≡l : (x : S²)
→ (sym (cong f (push (inl x))) ∙∙ lp x ∙∙ cong g (push (inl x)))
≡ (sym (cong f (push (inr x))) ∙∙ rp x ∙∙ cong g (push (inr x))))
where
btm-filler : I → I → I → A
btm-filler k i j =
hfill (λ k → λ {(i = i0)
→ doubleCompPath-filler (sym (cong f (push (inl base))))
(lp base)
(cong g (push (inl base))) (~ k) j
; (i = i1)
→ doubleCompPath-filler (sym (cong f (push (inr base))))
(rp base)
(cong g (push (inr base))) (~ k) j
; (j = i0) → f (push (push tt i) (~ k))
; (j = i1) → g (push (push tt i) (~ k))})
(inS (r≡l base i j))
k
lp-base≡rp-base : lp base ≡ rp base
lp-base≡rp-base = (λ i j → btm-filler i1 i j)
f∘inl≡g∘inl : (x y : S²) → f (inl (x , y)) ≡ g (inl (x , y))
f∘inl≡g∘inl = wedgeconFunS² (λ _ _ → h _ _) lp rp lp-base≡rp-base
f∘inl≡g∘inl-base : (x : S²) → f∘inl≡g∘inl x base ≡ lp x
f∘inl≡g∘inl-base = wedgeconFunS²Id (λ _ _ → h _ _) lp rp lp-base≡rp-base
f∘inr≡g∘inr : (x : S²) → f (inr x) ≡ g (inr x)
f∘inr≡g∘inr x = cong f (sym (push (inl x))) ∙∙ lp x ∙∙ cong g (push (inl x))
inlfill : (x : S²) → I → I → I → A
inlfill x k i j =
hfill (λ k → λ { (i = i0) → f∘inl≡g∘inl-base x (~ k) j
; (i = i1) → doubleCompPath-filler
(cong f (sym (push (inl x))))
(lp x)
(cong g (push (inl x))) k j
; (j = i0) → f (push (inl x) (i ∧ k))
; (j = i1) → g (push (inl x) (i ∧ k))})
(inS (lp x j))
k
inrfill : (x : S²) → I → I → I → A
inrfill x k i j =
hfill (λ k → λ { (i = i0) → doubleCompPath-filler
(cong f (sym (push (inr x))))
(rp x)
(cong g (push (inr x))) (~ k) j
; (i = i1) → f∘inr≡g∘inr x j
; (j = i0) → f (push (inr x) (i ∨ ~ k))
; (j = i1) → g (push (inr x) (i ∨ ~ k))})
(inS (r≡l x (~ i) j))
k
main : (x : Pushout⋁↪fold⋁S²) → f x ≡ g x
main (inl x) = f∘inl≡g∘inl (fst x) (snd x)
main (inr x) = f∘inr≡g∘inr x
main (push (inl x) i) j = inlfill x i1 i j
main (push (inr x) i) j = inrfill x i1 i j
main (push (push a i) j) k =
hcomp (λ r → λ {(i = i0) → inlfill base i1 j k
; (i = i1) → inrfill-side r j k
; (j = i0) → rp base k
; (j = i1) → r≡l base (~ r ∧ i) k
; (k = i0) → f (push (push a i) j)
; (k = i1) → g (push (push a i) j)})
(hcomp (λ r → λ {(i = i0) → inlfill base r j k
; (i = i1) → doubleCompPath-filler
(cong f (sym (push (inr base))))
(rp base)
(cong g (push (inr base))) (j ∧ r) k
; (j = i0) → lp-base≡rp-base (r ∨ i) k
; (j = i1) → inlfill-side r i k
; (k = i0) → f (push (push a i) (j ∧ r))
; (k = i1) → g (push (push a i) (j ∧ r))})
(lp-base≡rp-base i k))
where
inlfill-side : I → I → I → A
inlfill-side r i k =
hcomp (λ j → λ { (r = i0) → btm-filler j i k
; (r = i1) → r≡l base i k
; (i = i0) → doubleCompPath-filler
(cong f (sym (push (inl base))))
(lp base)
(cong g (push (inl base))) (r ∨ ~ j) k
; (i = i1) → doubleCompPath-filler
(cong f (sym (push (inr base))))
(rp base)
(cong g (push (inr base))) (r ∨ ~ j) k
; (k = i0) → f (push (push a i) (r ∨ ~ j))
; (k = i1) → g (push (push a i) (r ∨ ~ j))})
(r≡l base i k)
inrfill-side : I → I → I → A
inrfill-side r j k =
hcomp (λ i → λ { (r = i0)
→ (doubleCompPath-filler
(cong f (sym (push (inr base))))
(rp base)
(cong g (push (inr base)))) (j ∨ ~ i) k
; (r = i1) → inrfill base i j k
; (j = i0) → inrfill base i i0 k
; (j = i1) → r≡l base (~ r) k
; (k = i0) → f (push (inr base) (j ∨ ~ i))
; (k = i1) → g (push (inr base) (j ∨ ~ i))})
(r≡l base (~ r ∨ ~ j) k)
{-
Goal: Prove Ω ∥ SuspS² ∥₆ ≃ ∥ Pushout⋁↪fold⋁S² ∥₅
This will by done via the encode-decode method. For this, we nede a family
of equivalences ∥ Pushout⋁↪fold⋁S² ∥₅ ≃ ∥ Pushout⋁↪fold⋁S² ∥₅, indexed by S².
In order to define this, we need the following cubes/coherences in
∥ Pushout⋁↪fold⋁S² ∥₅:
-}
→Ω²∥Pushout⋁↪fold⋁S²∥₅ : (x y : S²)
→ Square {A = ∥Pushout⋁↪fold⋁S²∥₅} (λ _ → ∣ inl (x , y) ∣ₕ)
(λ _ → ∣ inl (x , y) ∣ₕ)
(λ _ → ∣ inl (x , y) ∣ₕ)
(λ _ → ∣ inl (x , y) ∣ₕ)
→Ω²∥Pushout⋁↪fold⋁S²∥₅ =
wedgeconFunS²
(λ _ _ → isOfHLevelPath 4 (isOfHLevelTrunc 5 _ _) _ _)
(λ x → λ i j → ∣ inl (x , surf i j) ∣ₕ)
(λ x → λ i j → ∣ inl (surf i j , x) ∣ₕ)
λ r i j → ∣ hcomp (λ k → λ { (i = i0) → push (push tt (~ r)) (~ k)
; (i = i1) → push (push tt (~ r)) (~ k)
; (j = i1) → push (push tt (~ r)) (~ k)
; (j = i0) → push (push tt (~ r)) (~ k)
; (r = i0) → push (inr (surf i j)) (~ k)
; (r = i1) → push (inl (surf i j)) (~ k)})
(inr (surf i j)) ∣ₕ
→Ω²∥Pushout⋁↪fold⋁S²∥₅Id : (x : S²)
→ →Ω²∥Pushout⋁↪fold⋁S²∥₅ x base ≡ λ i j → ∣ inl (x , surf i j) ∣ₕ
→Ω²∥Pushout⋁↪fold⋁S²∥₅Id =
wedgeconFunS²Id
(λ _ _ → isOfHLevelPath 4 (isOfHLevelTrunc 5 _ _) _ _)
(λ x → λ i j → ∣ inl (x , surf i j) ∣ₕ)
(λ x → λ i j → ∣ inl (surf i j , x) ∣ₕ)
λ r i j → ∣ hcomp (λ k → λ { (i = i0) → push (push tt (~ r)) (~ k)
; (i = i1) → push (push tt (~ r)) (~ k)
; (j = i1) → push (push tt (~ r)) (~ k)
; (j = i0) → push (push tt (~ r)) (~ k)
; (r = i0) → push (inr (surf i j)) (~ k)
; (r = i1) → push (inl (surf i j)) (~ k)})
(inr (surf i j)) ∣ₕ
push-inl∙push-inr⁻ : (y : S²) → Path Pushout⋁↪fold⋁S² (inl (y , base)) (inl (base , y))
push-inl∙push-inr⁻ y i = (push (inl y) ∙ sym (push (inr y))) i
push-inl∙push-inr⁻∙ : push-inl∙push-inr⁻ base ≡ refl
push-inl∙push-inr⁻∙ =
(λ k i → (push (inl base) ∙ sym (push (push tt (~ k)))) i)
∙ rCancel (push (inl base))
push-inl∙push-inr⁻-filler : I → I → I → I → Pushout⋁↪fold⋁S²
push-inl∙push-inr⁻-filler r i j k =
hfill (λ r → λ { (i = i0) → push-inl∙push-inr⁻∙ (~ r) k
; (i = i1) → push-inl∙push-inr⁻∙ (~ r) k
; (j = i0) → push-inl∙push-inr⁻∙ (~ r) k
; (j = i1) → push-inl∙push-inr⁻∙ (~ r) k
; (k = i0) → inl (surf i j , base)
; (k = i1) → inl (surf i j , base)})
(inS (inl (surf i j , base)))
r
push-inl∙push-inr⁻-hLevFiller : (y : S²)
→ Cube {A = ∥Pushout⋁↪fold⋁S²∥₅}
(λ j k → ∣ push-inl∙push-inr⁻ y k ∣)
(λ j k → ∣ push-inl∙push-inr⁻ y k ∣)
(λ j k → ∣ push-inl∙push-inr⁻ y k ∣)
(λ j k → ∣ push-inl∙push-inr⁻ y k ∣)
(→Ω²∥Pushout⋁↪fold⋁S²∥₅ y (pt (S² , base)))
λ i j → ∣ inl (surf i j , y) ∣
push-inl∙push-inr⁻-hLevFiller =
S²ToSetElim (λ _ → isOfHLevelPathP' 2
(isOfHLevelPathP' 3
(isOfHLevelPathP' 4 (isOfHLevelTrunc 5) _ _) _ _) _ _)
λ i j k → ∣ push-inl∙push-inr⁻-filler i1 i j k ∣ₕ
{-
We combine the above definitions. The equivalence
∥Pushout⋁↪fold⋁S²∥₅ ≃ ∥Pushout⋁↪fold⋁S²∥₅ (w.r.t. S²) is induced
by the following function
-}
S²→Pushout⋁↪fold⋁S²↺' : (x : S²) → Pushout⋁↪fold⋁S² → ∥Pushout⋁↪fold⋁S²∥₅
S²→Pushout⋁↪fold⋁S²↺' base (inl (x , y)) = ∣ inl (x , y) ∣
S²→Pushout⋁↪fold⋁S²↺' (surf i j) (inl (x , y)) = →Ω²∥Pushout⋁↪fold⋁S²∥₅ x y i j
S²→Pushout⋁↪fold⋁S²↺' base (inr z) = ∣ inl (base , z) ∣ₕ
S²→Pushout⋁↪fold⋁S²↺' (surf i i₁) (inr z) = ∣ inl (surf i i₁ , z) ∣ₕ
S²→Pushout⋁↪fold⋁S²↺' base (push (inl y) k) =
∣ (push (inl y) ∙ sym (push (inr y))) k ∣
S²→Pushout⋁↪fold⋁S²↺' (surf i j) (push (inl y) k) =
push-inl∙push-inr⁻-hLevFiller y i j k
S²→Pushout⋁↪fold⋁S²↺' base (push (inr y) i) = ∣ inl (base , y) ∣
S²→Pushout⋁↪fold⋁S²↺' (surf i j) (push (inr y) k) = ∣ inl (surf i j , y) ∣
S²→Pushout⋁↪fold⋁S²↺' base (push (push a i₁) i) = ∣ push-inl∙push-inr⁻∙ i₁ i ∣
S²→Pushout⋁↪fold⋁S²↺' (surf i j) (push (push a k) l) =
∣ hcomp (λ r → λ { (i = i0) → push-inl∙push-inr⁻∙ (k ∨ ~ r) l
; (i = i1) → push-inl∙push-inr⁻∙ (k ∨ ~ r) l
; (j = i0) → push-inl∙push-inr⁻∙ (k ∨ ~ r) l
; (j = i1) → push-inl∙push-inr⁻∙ (k ∨ ~ r) l
; (k = i0) → push-inl∙push-inr⁻-filler r i j l
; (k = i1) → inl (surf i j , base)
; (l = i0) → inl (surf i j , base)
; (l = i1) → inl (surf i j , base)})
(inl (surf i j , base)) ∣ₕ
{- For easier treatment later, we state its inverse explicitly -}
S²→Pushout⋁↪fold⋁S²↺'⁻ : (x : S²) → Pushout⋁↪fold⋁S² → ∥Pushout⋁↪fold⋁S²∥₅
S²→Pushout⋁↪fold⋁S²↺'⁻ base y = S²→Pushout⋁↪fold⋁S²↺' base y
S²→Pushout⋁↪fold⋁S²↺'⁻ (surf i j) y = S²→Pushout⋁↪fold⋁S²↺' (surf (~ i) j) y
S²→Pushout⋁↪fold⋁S²↺'≡idfun : (x : _) → S²→Pushout⋁↪fold⋁S²↺' base x ≡ ∣ x ∣
S²→Pushout⋁↪fold⋁S²↺'≡idfun (inl x) = refl
S²→Pushout⋁↪fold⋁S²↺'≡idfun (inr x) = cong ∣_∣ₕ (push (inr x))
S²→Pushout⋁↪fold⋁S²↺'≡idfun (push (inl x) i) j =
∣ compPath-filler (push (inl x)) (λ i₁ → push (inr x) (~ i₁)) (~ j) i ∣ₕ
S²→Pushout⋁↪fold⋁S²↺'≡idfun (push (inr x) i) j = ∣ push (inr x) (j ∧ i) ∣
S²→Pushout⋁↪fold⋁S²↺'≡idfun (push (push a i) j) k =
∣ coh-lem {A = Pushout⋁↪fold⋁S²}
(push (inl base)) (push (inr base)) (λ k → push (push tt k)) i j k ∣ₕ
where
coh-lem : ∀ {ℓ} {A : Type ℓ} {x y : A} (p q : x ≡ y) (r : p ≡ q)
→ Cube {A = A}
(λ j k → compPath-filler p (sym q) (~ k) j) (λ k j → q (k ∧ j))
(λ i k → x) (λ i k → q k)
(((λ k → p ∙ sym (r (~ k))) ∙ rCancel p))
r
coh-lem {A = A} {x = x} {y = y} =
J (λ y p → (q : x ≡ y) (r : p ≡ q)
→ Cube {A = A}
(λ j k → compPath-filler p (sym q) (~ k) j) (λ k j → q (k ∧ j))
(λ i k → x) (λ i k → q k)
(((λ k → p ∙ sym (r (~ k))) ∙ rCancel p))
r)
λ q → J (λ q r → Cube (λ j k → compPath-filler refl (λ i → q (~ i)) (~ k) j)
(λ k j → q (k ∧ j)) (λ i k → x) (λ i k → q k)
((λ k → refl ∙ (λ i → r (~ k) (~ i))) ∙ rCancel refl) r)
((λ z j k → lUnit (sym (rUnit (λ _ → x))) z k j)
◁ (λ i j k → (refl ∙ (λ i₁ → rUnit (λ _ → x) (~ i₁))) (k ∨ i) j))
S²→Pushout⋁↪fold⋁S²↺ : (x : S²) → ∥Pushout⋁↪fold⋁S²∥₅ → ∥Pushout⋁↪fold⋁S²∥₅
S²→Pushout⋁↪fold⋁S²↺ x = trRec (isOfHLevelTrunc 5) (S²→Pushout⋁↪fold⋁S²↺' x)
isEq-S²→Pushout⋁↪fold⋁S²↺' : (x : _) → isEquiv (S²→Pushout⋁↪fold⋁S²↺ x)
isEq-S²→Pushout⋁↪fold⋁S²↺' =
S²ToSetElim (λ _ → isProp→isSet (isPropIsEquiv _))
(subst isEquiv (funExt id≡) (idIsEquiv _))
where
id≡ : (x : _) → x ≡ S²→Pushout⋁↪fold⋁S²↺ base x
id≡ = trElim (λ _ → isOfHLevelPath 5 (isOfHLevelTrunc 5) _ _)
(sym ∘ S²→Pushout⋁↪fold⋁S²↺'≡idfun)
S²→Pushout⋁↪fold⋁S²↺⁻¹ : (x : S²) → ∥Pushout⋁↪fold⋁S²∥₅ → ∥Pushout⋁↪fold⋁S²∥₅
S²→Pushout⋁↪fold⋁S²↺⁻¹ x = trRec (isOfHLevelTrunc 5) (S²→Pushout⋁↪fold⋁S²↺'⁻ x)
{- S²→Pushout⋁↪fold⋁S²↺⁻¹ is a section of S²→Pushout⋁↪fold⋁S²↺ -}
secS²→Pushout⋁↪fold⋁S²↺ : (x : S²) (y : ∥Pushout⋁↪fold⋁S²∥₅)
→ S²→Pushout⋁↪fold⋁S²↺ x (S²→Pushout⋁↪fold⋁S²↺⁻¹ x y) ≡ y
secS²→Pushout⋁↪fold⋁S²↺ x =
trElim (λ _ → isOfHLevelPath 5 (isOfHLevelTrunc 5) _ _)
(h x)
where
h : (x : S²) (a : Pushout⋁↪fold⋁S²)
→ S²→Pushout⋁↪fold⋁S²↺ x
(S²→Pushout⋁↪fold⋁S²↺⁻¹ x ∣ a ∣) ≡ ∣ a ∣
h base a = cong (S²→Pushout⋁↪fold⋁S²↺ base)
(S²→Pushout⋁↪fold⋁S²↺'≡idfun a)
∙ S²→Pushout⋁↪fold⋁S²↺'≡idfun a
h (surf i j) a k = main a k i j
where
side : (a : Pushout⋁↪fold⋁S²) → _
side a = cong (S²→Pushout⋁↪fold⋁S²↺ base) (S²→Pushout⋁↪fold⋁S²↺'≡idfun a)
∙ S²→Pushout⋁↪fold⋁S²↺'≡idfun a
refl-b : Path ∥Pushout⋁↪fold⋁S²∥₅ _ _
refl-b = (refl {x = ∣ inl (base , base) ∣ₕ})
main : (a : Pushout⋁↪fold⋁S²)
→ Cube (λ i j → S²→Pushout⋁↪fold⋁S²↺ (surf i j)
(S²→Pushout⋁↪fold⋁S²↺⁻¹ (surf i j) ∣ a ∣))
(λ _ _ → ∣ a ∣)
(λ i _ → side a i) (λ i _ → side a i)
(λ i _ → side a i) (λ i _ → side a i)
main =
Pushout⋁↪fold⋁S²→Set (λ _ → isOfHLevelPathP' 2
(isOfHLevelPathP' 3 (isOfHLevelTrunc 5 _ _) _ _) _ _)
λ k i j →
hcomp (λ r → λ { (i = i0) → rUnit refl-b r k
; (i = i1) → rUnit refl-b r k
; (j = i0) → rUnit refl-b r k
; (j = i1) → rUnit refl-b r k
; (k = i0) → →Ω²∥Pushout⋁↪fold⋁S²∥₅Id
(surf (~ i) j) (~ r) i j
; (k = i1) → μ base base})
(μ-coh k i j)
where
μ : (x y : S²) → ∥Pushout⋁↪fold⋁S²∥₅
μ x y = ∣ inl (x , y) ∣ₕ
μUnit : (x : S²) → μ x base ≡ μ base x
μUnit base = refl
μUnit (surf i j) k = ∣
hcomp (λ r → λ {(i = i0) → push (push tt k) (~ r)
; (i = i1) → push (push tt k) (~ r)
; (j = i0) → push (push tt k) (~ r)
; (j = i1) → push (push tt k) (~ r)
; (k = i0) → push (inl (surf i j)) (~ r)
; (k = i1) → push (inr (surf i j)) (~ r)})
(inr (surf i j)) ∣ₕ
μ-coh : Path (Square {A = ∥Pushout⋁↪fold⋁S²∥₅}
(λ _ → ∣ inl (base , base) ∣) (λ _ → ∣ inl (base , base) ∣)
(λ _ → ∣ inl (base , base) ∣) (λ _ → ∣ inl (base , base) ∣))
(λ i j → ∣ inl (surf (~ i) j , surf i j) ∣ₕ)
refl
μ-coh =
(cong₂Funct (λ (x y : (Path S² base base)) → cong₂ μ x y) (sym surf) surf
∙ cong (_∙ cong (cong (μ base)) surf) (λ i → cong (cong (λ x → μUnit x i)) (sym surf))
∙ lCancel (cong (cong (μ base)) surf))
retrS²→Pushout⋁↪fold⋁S²↺ : (x : S²) (y : ∥Pushout⋁↪fold⋁S²∥₅)
→ S²→Pushout⋁↪fold⋁S²↺⁻¹ x (S²→Pushout⋁↪fold⋁S²↺ x y) ≡ y
retrS²→Pushout⋁↪fold⋁S²↺ x =
trElim (λ _ → isOfHLevelPath 5 (isOfHLevelTrunc 5) _ _)
(main x)
where
main : (x : S²) (a : Pushout⋁↪fold⋁S²)
→ S²→Pushout⋁↪fold⋁S²↺⁻¹ x (S²→Pushout⋁↪fold⋁S²↺ x ∣ a ∣) ≡ ∣ a ∣
main base a = secS²→Pushout⋁↪fold⋁S²↺ base ∣ a ∣
main (surf i j) a l = secS²→Pushout⋁↪fold⋁S²↺ (surf (~ i) j) ∣ a ∣ l
∥Pushout⋁↪fold⋁S²∥₅≃∥Pushout⋁↪fold⋁S²∥₅ : (x : S²)
→ Iso ∥Pushout⋁↪fold⋁S²∥₅ ∥Pushout⋁↪fold⋁S²∥₅
fun (∥Pushout⋁↪fold⋁S²∥₅≃∥Pushout⋁↪fold⋁S²∥₅ x) = S²→Pushout⋁↪fold⋁S²↺ x
inv (∥Pushout⋁↪fold⋁S²∥₅≃∥Pushout⋁↪fold⋁S²∥₅ x) = S²→Pushout⋁↪fold⋁S²↺⁻¹ x
rightInv (∥Pushout⋁↪fold⋁S²∥₅≃∥Pushout⋁↪fold⋁S²∥₅ x) = secS²→Pushout⋁↪fold⋁S²↺ x
leftInv (∥Pushout⋁↪fold⋁S²∥₅≃∥Pushout⋁↪fold⋁S²∥₅ x) = retrS²→Pushout⋁↪fold⋁S²↺ x
PreCode : (x : Susp S²) → Type
PreCode north = ∥Pushout⋁↪fold⋁S²∥₅
PreCode south = ∥Pushout⋁↪fold⋁S²∥₅
PreCode (merid a i) = isoToPath (∥Pushout⋁↪fold⋁S²∥₅≃∥Pushout⋁↪fold⋁S²∥₅ a) i
hLevPreCode : (x : Susp S²) → isOfHLevel 5 (PreCode x)
hLevPreCode =
suspToPropElim base (λ _ → isPropIsOfHLevel 5) (isOfHLevelTrunc 5)
Code : (hLevelTrunc 6 (Susp S²)) → Type ℓ-zero
Code =
fst ∘ trRec {B = TypeOfHLevel ℓ-zero 5} (isOfHLevelTypeOfHLevel 5)
λ x → (PreCode x) , (hLevPreCode x)
private
cong-coherence : ∀ {ℓ} {A : Type ℓ} {x : A} (p : x ≡ x) (r : refl ≡ p)
→ cong (p ∙_) (sym r) ∙ sym (rUnit p)
≡ cong (_∙ p) (sym r) ∙ sym (lUnit p)
cong-coherence p = J (λ p r → cong (p ∙_) (sym r) ∙ sym (rUnit p)
≡ cong (_∙ p) (sym r) ∙ sym (lUnit p)) refl
{- The function Pushout⋁↪fold⋁S² → Ω∥S³∥₆ will be the obvious one -}
Pushout⋁↪fold⋁S²→Ω∥S³∥₆ : Pushout⋁↪fold⋁S² → Ω∥S³∥₆
Pushout⋁↪fold⋁S²→Ω∥S³∥₆ (inl x) = cong ∣_∣ₕ (σ S²∙ (fst x) ∙ σ S²∙ (snd x))
Pushout⋁↪fold⋁S²→Ω∥S³∥₆ (inr x) = cong ∣_∣ₕ (σ S²∙ x)
Pushout⋁↪fold⋁S²→Ω∥S³∥₆ (push (inl x) i) j =
∣ (cong (σ S²∙ x ∙_) (rCancel (merid base)) ∙ sym (rUnit (σ S²∙ x))) i j ∣ₕ
Pushout⋁↪fold⋁S²→Ω∥S³∥₆ (push (inr x) i) j =
∣ (cong (_∙ σ S²∙ x) (rCancel (merid base)) ∙ sym (lUnit (σ S²∙ x))) i j ∣ₕ
Pushout⋁↪fold⋁S²→Ω∥S³∥₆ (push (push a k) i) j =
∣ cong-coherence (σ S²∙ base) (sym (rCancel (merid base))) k i j ∣ₕ
{- Truncated version (the equivalence) -}
∥Pushout⋁↪fold⋁S²∥₅→Ω∥S³∥₆ : ∥Pushout⋁↪fold⋁S²∥₅ → Ω∥S³∥₆
∥Pushout⋁↪fold⋁S²∥₅→Ω∥S³∥₆ =
trRec (isOfHLevelTrunc 6 _ _) Pushout⋁↪fold⋁S²→Ω∥S³∥₆
decode' : (x : Susp S²) → Code ∣ x ∣
→ Path (hLevelTrunc 6 (Susp S²)) ∣ north ∣ ∣ x ∣
decode' north p = ∥Pushout⋁↪fold⋁S²∥₅→Ω∥S³∥₆ p
decode' south p = ∥Pushout⋁↪fold⋁S²∥₅→Ω∥S³∥₆ p ∙ cong ∣_∣ₕ (merid base)
decode' (merid a i) = main a i
where
baseId : (x : Pushout⋁↪fold⋁S²)
→ ∥Pushout⋁↪fold⋁S²∥₅→Ω∥S³∥₆ (S²→Pushout⋁↪fold⋁S²↺' base x)
≡ ∥Pushout⋁↪fold⋁S²∥₅→Ω∥S³∥₆ ∣ x ∣
baseId x =
cong ∥Pushout⋁↪fold⋁S²∥₅→Ω∥S³∥₆ (S²→Pushout⋁↪fold⋁S²↺'≡idfun x)
mainLemma : (a : S²) (x : Pushout⋁↪fold⋁S²)
→ ∥Pushout⋁↪fold⋁S²∥₅→Ω∥S³∥₆ (S²→Pushout⋁↪fold⋁S²↺'⁻ a x)
∙ (λ i → ∣ merid a i ∣)
≡ ∥Pushout⋁↪fold⋁S²∥₅→Ω∥S³∥₆ ∣ x ∣ ∙ cong ∣_∣ₕ (merid base)
mainLemma base x = cong (_∙ cong ∣_∣ₕ (merid base)) (baseId x)
mainLemma (surf i j) x k = surf-filler x k i j
where
∙ΩbaseId :
(q : typ (Ω (Susp∙ (typ S²∙)))) → q ≡ q ∙ σ S²∙ base
∙ΩbaseId q = rUnit q ∙ cong (q ∙_) (sym (rCancel (merid base)))
cubeCoherence :
∀ {ℓ} {A : Type ℓ} {x : A} {p : x ≡ x}
→ (refl ≡ p)
→ (q : Square {A = x ≡ x} (λ _ → p) (λ _ → p) (λ _ → p) (λ _ → p))
→ Cube {A = Path A x x}
(λ i j → q i j ∙ q (~ i) j) (λ _ _ → p ∙ p)
(λ k j → p ∙ p) (λ _ _ → p ∙ p)
(λ _ _ → p ∙ p) λ _ _ → p ∙ p
cubeCoherence {A = A} {x = x} {p = p} =
J (λ p _ → (q : Square {A = x ≡ x}
(λ _ → p) (λ _ → p) (λ _ → p) (λ _ → p))
→ Cube {A = Path A x x}
(λ i j → q i j ∙ q (~ i) j) (λ _ _ → p ∙ p)
(λ k j → p ∙ p) (λ _ _ → p ∙ p)
(λ _ _ → p ∙ p) λ _ _ → p ∙ p)
(λ q →
(cong₂Funct (λ (x y : Path (x ≡ x) refl refl) → cong₂ _∙_ x y) q (sym q)
∙ transport
(λ i → cong (λ (p : (refl {x = x}) ≡ refl) k → rUnit (p k) i) q
∙ cong (λ (p : (refl {x = x}) ≡ refl) k → lUnit (p k) i) (sym q)
≡ refl {x = refl {x = lUnit (refl {x = x}) i}})
(rCancel q)))
surf-side : (i j r l : I) → hLevelTrunc 6 (Susp S²)
surf-side i j r l =
((cong ∣_∣ₕ (∙ΩbaseId (σ S²∙ (surf (~ i) j)) r))
∙ cong ∣_∣ₕ (compPath-filler (merid (surf i j))
(sym (merid base)) (~ r))) l
side : (r l : I) → hLevelTrunc 6 (Susp S²)
side r l =
((cong ∣_∣ₕ (∙ΩbaseId (σ S²∙ base) r))
∙ cong ∣_∣ₕ (compPath-filler (merid base)
(sym (merid base)) (~ r))) l
surf-filler : (x : Pushout⋁↪fold⋁S²)
→ Cube {A = Path (hLevelTrunc 6 (Susp S²)) ∣ north ∣ ∣ south ∣}
(λ i j → ∥Pushout⋁↪fold⋁S²∥₅→Ω∥S³∥₆
(S²→Pushout⋁↪fold⋁S²↺' (surf (~ i) j) x)
∙ (λ k → ∣ merid (surf i j) k ∣))
(λ _ _ → ∥Pushout⋁↪fold⋁S²∥₅→Ω∥S³∥₆ ∣ x ∣
∙ cong ∣_∣ₕ (merid base))
(λ k j → baseId x k ∙ (λ i₂ → ∣ merid base i₂ ∣))
(λ k j → baseId x k ∙ (λ i₂ → ∣ merid base i₂ ∣))
(λ k i → baseId x k ∙ (λ i₂ → ∣ merid base i₂ ∣))
(λ k i → baseId x k ∙ (λ i₂ → ∣ merid base i₂ ∣))
surf-filler =
Pushout⋁↪fold⋁S²→Set
(λ _ → isOfHLevelPathP' 2
(isOfHLevelPathP' 3 (isOfHLevelTrunc 6 _ _ _ _) _ _) _ _)
(λ k i j l → hcomp (λ r
→ λ {(i = i0) → surf-side i0 i0 r l
; (i = i1) → surf-side i0 i0 r l
; (j = i0) → surf-side i0 i0 r l
; (j = i1) → surf-side i0 i0 r l
; (k = i0) → surf-side i j r l
; (k = i1) → surf-side i0 i0 r l
; (l = i0) → ∣ north ∣ₕ
; (l = i1) → ∣ merid base r ∣ₕ})
(cubeCoherence {p = cong ∣_∣ₕ (σ (S²∙) base)}
(cong (cong ∣_∣ₕ) (sym (rCancel (merid base))))
(λ i j k → ∣ σ S²∙ (surf (~ i) j) k ∣ₕ) k i j l))
main : (a : S²)
→ PathP (λ i → Code ∣ merid a i ∣
→ Path (hLevelTrunc 6 (Susp S²)) ∣ north ∣ ∣ merid a i ∣)
∥Pushout⋁↪fold⋁S²∥₅→Ω∥S³∥₆
λ x → ∥Pushout⋁↪fold⋁S²∥₅→Ω∥S³∥₆ x
∙ cong ∣_∣ₕ (merid base)
main a =
toPathP (funExt
(trElim (λ _ → isOfHLevelSuc 4 (isOfHLevelTrunc 6 _ _ _ _))
(λ x
→ (λ j → transp (λ i → Path
(hLevelTrunc 6 (Susp S²)) ∣ north ∣ ∣ merid a (i ∨ j) ∣) j
(compPath-filler
(∥Pushout⋁↪fold⋁S²∥₅→Ω∥S³∥₆
(S²→Pushout⋁↪fold⋁S²↺'⁻ a (transportRefl x j)))
(cong ∣_∣ₕ (merid a)) j))
∙ mainLemma a x)))
decode : (x : hLevelTrunc 6 (Susp S²))
→ Code x → Path (hLevelTrunc 6 (Susp S²)) ∣ north ∣ x
decode =
trElim (λ _ → isOfHLevelΠ 6 λ _ → isOfHLevelPath 6 (isOfHLevelTrunc 6) _ _)
decode'
decode∙ : decode ∣ north ∣ ∣ inl (base , base) ∣ ≡ refl
decode∙ =
cong (cong ∣_∣ₕ) (cong (λ x → x ∙ x) (rCancel (merid base)) ∙ sym (rUnit refl))
encode : (x : hLevelTrunc 6 (Susp S²))
→ Path (hLevelTrunc 6 (Susp S²)) ∣ north ∣ x → Code x
encode x p = subst Code p ∣ inl (base , base) ∣
encode-decode : (x : hLevelTrunc 6 (Susp S²))
→ (p : ∣ north ∣ ≡ x) → decode x (encode x p) ≡ p
encode-decode x = J (λ x p → decode x (encode x p) ≡ p)
(cong (decode ∣ north ∣) (transportRefl ∣ inl (base , base) ∣ₕ)
∙ decode∙)
decode-encode : (p : Code ∣ north ∣) → encode ∣ north ∣ (decode ∣ north ∣ p) ≡ p
decode-encode =
trElim (λ _ → isOfHLevelPath 5 (isOfHLevelTrunc 5) _ _)
(Pushout⋁↪fold⋁S²WedgeCon.main ((λ a → encode ∣ north ∣ (decode ∣ north ∣ ∣ a ∣))) ∣_∣ₕ
(isOfHLevelTrunc 5)
(λ x → cong (encode ∣ north ∣) (cong (cong ∣_∣ₕ) (cong (σ S²∙ x ∙_)
(rCancel (merid base)) ∙ sym (rUnit (σ S²∙ x))))
∙ surf-filler x)
(λ x → (cong (encode ∣ north ∣) (cong (cong ∣_∣ₕ) (cong (_∙ σ S²∙ x)
(rCancel (merid base)) ∙ sym (lUnit (σ S²∙ x))))
∙ surf-filler x
∙ cong ∣_∣ₕ (push (inl x)) ∙ cong ∣_∣ₕ (sym (push (inr x)))))
λ x → lem (encode ∣ north ∣)
(cong (decode ∣ north ∣) (cong ∣_∣ₕ (push (inl x))))
((cong (decode ∣ north ∣) (cong ∣_∣ₕ (push (inr x)))))
(surf-filler x) (cong ∣_∣ₕ (push (inl x))) (cong ∣_∣ₕ (sym (push (inr x)))))
where
subber = transport (λ j → Code ∣ merid base (~ j) ∣ₕ)
lem : ∀ {ℓ} {A B : Type ℓ} {x x' y : A} {l w u : B}
(f : A → B) (p : x ≡ y) (p' : x' ≡ y) (q : f y ≡ l)
(r : l ≡ w) (r' : w ≡ u)
→ cong f (sym p) ∙∙ cong f p ∙ q ∙∙ r
≡ (cong f (sym p') ∙∙ (cong f p' ∙ q ∙ (r ∙ r')) ∙∙ sym r')
lem {x = x} {x' = x'} {y = y'} {l = l} {w = w} {u = u} f p p' q r r' =
(λ i → (λ j → f (p (~ j ∨ i))) ∙∙ (λ j → f (p (j ∨ i))) ∙ q ∙∙ r)
∙∙ (λ i → (λ j → f (p' (~ j ∨ ~ i))) ∙∙ (λ j → f (p' (j ∨ ~ i)))
∙ compPath-filler q r i ∙∙ λ j → r (i ∨ j))
∙∙ λ i → cong f (sym p') ∙∙ cong f p' ∙ q
∙ compPath-filler r r' i ∙∙ λ j → r' (~ j ∧ i)
mainId : (x : S²)
→ (S²→Pushout⋁↪fold⋁S²↺' x (inl (base , base))) ≡ ∣ inl (x , base) ∣ₕ
mainId base = refl
mainId (surf i i₁) = refl
surf-filler : (x : S²)
→ encode ∣ north ∣ (λ i → ∣ σ S²∙ x i ∣) ≡ ∣ inl (x , base) ∣
surf-filler x =
(λ i → transp (λ j → Code (∣ merid base (i ∧ ~ j) ∣ₕ)) (~ i)
(encode ∣ merid base i ∣
λ j → ∣ compPath-filler
(merid x) (sym (merid base)) (~ i) j ∣ₕ))
∙ cong subber
(transportRefl (S²→Pushout⋁↪fold⋁S²↺' x (inl (base , base)))
∙ mainId x)
IsoΩ∥SuspS²∥₅∥Pushout⋁↪fold⋁S²∥₅ :
Iso (hLevelTrunc 5 (typ (Ω (Susp∙ S²))))
(hLevelTrunc 5 Pushout⋁↪fold⋁S²)
IsoΩ∥SuspS²∥₅∥Pushout⋁↪fold⋁S²∥₅ =
compIso (invIso (PathIdTruncIso _)) is
where
is : Iso _ _
fun is = encode ∣ north ∣
inv is = decode ∣ north ∣
rightInv is = decode-encode
leftInv is = encode-decode ∣ north ∣
|
programs/oeis/002/A002299.asm | neoneye/loda | 22 | 15155 | ; A002299: Binomial coefficients C(2*n+5,5).
; 1,21,126,462,1287,3003,6188,11628,20349,33649,53130,80730,118755,169911,237336,324632,435897,575757,749398,962598,1221759,1533939,1906884,2349060,2869685,3478761,4187106,5006386,5949147,7028847,8259888,9657648,11238513,13019909,15020334,17259390,19757815,22537515,25621596,29034396,32801517,36949857,41507642,46504458,51971283,57940519,64446024,71523144,79208745,87541245,96560646,106308566,116828271,128164707,140364532,153476148,167549733,182637273,198792594,216071394,234531275,254231775,275234400,297602656,321402081,346700277,373566942,402073902,432295143,464306843,498187404,534017484,571880029,611860305,654045930,698526906,745395651,794747031,846678392,901289592,958683033,1018963693,1082239158,1148619654,1218218079,1291150035,1367533860,1447490660,1531144341,1618621641,1710052162,1805568402,1905305787,2009402703,2118000528,2231243664,2349279569,2472258789,2600334990,2733664990
mul $0,2
mov $1,-6
bin $1,$0
mov $0,$1
|
runtime/ravenscar-sfp-stm32f427/gnarl-common/s-taspri.ads | TUM-EI-RCS/StratoX | 12 | 25355 | <filename>runtime/ravenscar-sfp-stm32f427/gnarl-common/s-taspri.ads
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T A S K _ P R I M I T I V E S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2001-2014, 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. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- --
------------------------------------------------------------------------------
-- This is the version of this package for Ravenscar bare board targets
pragma Polling (Off);
-- Turn off polling, we do not want ATC polling to take place during tasking
-- operations. It causes infinite loops and other problems.
with System.OS_Interface;
package System.Task_Primitives
with SPARK_Mode => Off is -- because of access types
pragma Preelaborate;
type Task_Body_Access is access procedure;
-- Pointer to the task body's entry point (or possibly a wrapper
-- declared local to the GNARL).
type Private_Data is limited private;
-- Any information that the GNULLI needs maintained on a per-task
-- basis. A component of this type is guaranteed to be included
-- in the Ada_Task_Control_Block.
subtype Task_Address is System.Address;
Task_Address_Size : constant := Standard'Address_Size;
-- Type used for task addresses and its size
Alternate_Stack_Size : constant := 0;
-- No alternate signal stack is used on this platform
private
pragma SPARK_Mode (Off);
type Private_Data is limited record
Thread_Desc : aliased System.OS_Interface.Thread_Descriptor;
-- Thread descriptor associated to the ATCB to which it belongs
Thread : aliased System.OS_Interface.Thread_Id :=
System.OS_Interface.Null_Thread_Id;
-- Thread Id associated to the ATCB to which it belongs.
-- ??? It is mostly used by GDB, so we may want to remove it at some
-- point.
pragma Atomic (Thread);
-- Thread field may be updated by two different threads of control.
-- (See, Enter_Task and Create_Task in s-taprop.adb).
-- They put the same value (thr_self value). We do not want to
-- use lock on those operations and the only thing we have to
-- make sure is that they are updated in atomic fashion.
Lwp : aliased System.Address := System.Null_Address;
-- This element duplicates the Thread element. It is read by gdb when
-- the remote protocol is used.
end record;
end System.Task_Primitives;
|
data/maps/headers/RocketHideoutElevator.asm | opiter09/ASM-Machina | 1 | 81452 |
map_header RocketHideoutElevator, ROCKET_HIDEOUT_ELEVATOR, LOBBY, 0
end_map_header
|
programs/oeis/021/A021788.asm | neoneye/loda | 22 | 171419 | <gh_stars>10-100
; A021788: Decimal expansion of 1/784.
; 0,0,1,2,7,5,5,1,0,2,0,4,0,8,1,6,3,2,6,5,3,0,6,1,2,2,4,4,8,9,7,9,5,9,1,8,3,6,7,3,4,6,9,3,8,7,7,5,5,1,0,2,0,4,0,8,1,6,3,2,6,5,3,0,6,1,2,2,4,4,8,9,7,9,5,9,1,8,3,6,7,3,4,6,9,3,8,7,7,5,5,1,0,2,0,4,0,8,1
add $0,1
mov $1,10
pow $1,$0
mul $1,3
div $1,2352
mod $1,10
mov $0,$1
|
Lvl/Functions.agda | Lolirofle/stuff-in-agda | 6 | 13689 | <filename>Lvl/Functions.agda
module Lvl.Functions where
open import Lvl
open import Numeral.Natural
add : ℕ → Lvl.Level → Lvl.Level
add ℕ.𝟎 ℓ = ℓ
add (ℕ.𝐒 n) ℓ = Lvl.𝐒(add n ℓ)
|
ada/original_2008/ada-gui/agar-gui-widget-slider.adb | auzkok/libagar | 286 | 20725 | package body agar.gui.widget.slider is
use type c.int;
package cbinds is
procedure set_int_increment
(slider : slider_access_t;
increment : c.int);
pragma import (c, set_int_increment, "AG_SliderSetIntIncrement");
procedure set_real_increment
(slider : slider_access_t;
increment : c.double);
pragma import (c, set_real_increment, "AG_SliderSetRealIncrement");
end cbinds;
procedure set_increment
(slider : slider_access_t;
increment : positive) is
begin
cbinds.set_int_increment
(slider => slider,
increment => c.int (increment));
end set_increment;
procedure set_increment
(slider : slider_access_t;
increment : long_float) is
begin
cbinds.set_real_increment
(slider => slider,
increment => c.double (increment));
end set_increment;
function widget (slider : slider_access_t) return widget_access_t is
begin
return slider.widget'access;
end widget;
end agar.gui.widget.slider;
|
Optics/All.agda | cwjnkins/bft-consensus-agda | 4 | 7517 | <reponame>cwjnkins/bft-consensus-agda
{- Byzantine Fault Tolerant Consensus Verification in Agda, version 0.9.
Copyright (c) 2020 Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.oracle.com/licenses/upl
-}
module Optics.All where
open import Optics.Functorial public
open import Optics.Reflection public
|
emt3.asm | smirzaei/systems-programming-class | 0 | 82230 | <reponame>smirzaei/systems-programming-class
STK SEGMENT
DW 64 DUP(?)
STK ENDS
DTS SEGMENT
msg db ' : ','$'
CDS SEGMENT
ASSUME CS:CDS,SS:STK,DS:DTS
MAIN PROC FAR
MOV AX,SEG DTS
MOV DS,AX
MOV di,offset saat
MOV ah,2ch
INT 21h
MOV al,ch
call CHANGE
add di,03
MOV al,cl
call CHANGE
MOV dx,offset saat
MOV ah,09h
INT 21h
MOV ah,4ch
INT 21h
exit: ; Terminate the program
MOV AH,4CH
INT 21H
MAIN ENDP
CHANGE proc far
mov bl,10
xor ah,ah
div bl
or ax,3030h
mov[di],ax
ret
CHANGE endp
CDS ENDS
END MAIN
|
asgn2/prob2.asm | debargham14/Microprocessors-8085- | 0 | 162063 | <gh_stars>0
LXI H,2050
MOV B,M
LXI H,2051
MOV D,M
MVI A,00
MVI C,00
LOOP: ADD D
JNC SKIP
INR C
SKIP: INX H
DCR B
JNZ LOOP
STA 2052
XRA A
MOV A,C
STA 2053
HLT
|
Public/Src/Tools/Execution.Analyzer/Analyzers.Core/XlgDebugger/JPath/JPath.g4 | miniksa/BuildXL | 448 | 4042 | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// To generate lexer/parser/... run:
//
// java -cp $CLASSPATH:antlr-4.7.2-complete.jar -Xmx500M \
// org.antlr.v4.Tool \
// -listener -visitor -Dlanguage=CSharp -package BuildXL.Execution.Analyzer.JPath JPath.g4
grammar JPath;
WS : [ \t\r\n]+ -> skip ; // skip spaces, tabs, newlines
// logic operators
NOT : 'not';
AND : 'and';
OR : 'or' ;
XOR : 'xor';
IFF : 'iff';
// bool operators
GTE : '>=' ;
LTE : '<=' ;
GT : '>' ;
LT : '<' ;
EQ : '=' ;
NEQ : '!=' ;
MATCH : '~' ;
NMATCH : '!~' ;
// arithmetic operators
MINUS : '-' ;
PLUS : '+' ;
TIMES : '*' ;
DIV : '/' ;
MOD : '%' ;
// set operators
CONCAT : '++' ;
UNION : '@+' ; // same as PLUS when operands are not numbers
DIFFERENCE : '@-' ; // same as MINUS when operands are not numbers
INTERSECT : '&' ;
IntLit
: '-'?[0-9]+ ;
StrLit
: '\'' ~[']* '\''
| '"' ~["]* '"'
;
RegExLit
: '/' ~[/]+ '/'
| '!' ~[!]+ '!'
;
fragment IdFragment
: [a-zA-Z_][a-zA-Z0-9_]* ;
Id
: IdFragment ;
VarId
: '$' IdFragment ;
EscID
: '`' ~[`]+ '`' ;
Opt
: '-' [a-zA-Z0-9'-']+ ;
intBinaryOp
: Token=(PLUS | MINUS | TIMES | DIV | MOD) ;
intUnaryOp
: Token=MINUS ;
boolBinaryOp
: Token=(GTE | GT | LTE | LT | EQ | NEQ | MATCH | NMATCH) ;
logicBinaryOp
: Token=(AND | OR | XOR | IFF) ;
logicUnaryOp
: Token=NOT ;
setBinaryOp
: Token=(PLUS | MINUS | CONCAT | UNION | DIFFERENCE | INTERSECT) ;
anyBinaryOp
: intBinaryOp
| boolBinaryOp
| logicBinaryOp
| setBinaryOp
;
prop
: PropertyName=Id #PropertyId
| PropertyName=EscID #EscId
;
selector
: Name=prop #IdSelector
;
literal
: Value=StrLit #StrLitExpr
| Value=RegExLit #RegExLitExpr
| Value=IntLit #IntLitExpr
;
propVal
: (Name=prop ':')? Value=expr #PropertyValue
;
objLit
: '{' Props+=propVal (',' Props+=propVal)* '}' #ObjLitProps
;
expr
: '$' #RootExpr
| '_' #ThisExpr
| Var=VarId #VarExpr
| Sub=selector #SelectorExpr
| Obj=objLit #ObjLitExpr
| Lit=literal #LiteralExpr
| Lhs=expr '.' Sub=expr #MapExpr
| Lhs=expr '[' Filter=expr ']' #FilterExpr
| Lhs=expr '[' Begin=expr '..' End=expr ']' #RangeExpr
| '#' Sub=expr #CardinalityExpr // cardinality, i.e., the number of elements in the result
| Func=expr '(' Args+=expr (',' Args+=expr)* ')' #FuncAppExprParen
| Func=expr OptName=Opt (OptValue=literal)? #FuncOptExpr
| Input=expr '|' Func=expr #PipeExpr
| Input=expr '|>' File=StrLit #SaveToFileExpr
| Input=expr '|>>' File=StrLit #AppendToFileExpr
| Lhs=expr Op=anyBinaryOp Rhs=expr #BinExpr
| '(' Sub=expr ')' #SubExpr
| 'let' Var=VarId ':=' Val=expr 'in' Sub=expr? #LetExpr
| Var=VarId ':=' Val=expr ';'? #AssignExpr
;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.