Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
157 commits
Select commit Hold shift + click to select a range
12dc61b
individual classes wtih each a handle back to the parent
Feb 11, 2020
becdd9f
... to be simplified
Feb 11, 2020
012db79
going with a simplified setup
Feb 11, 2020
b7cc7fd
this should be the most straightforward setup and hopefully work...
Feb 11, 2020
966377a
inheriting from the already defined classes
Feb 11, 2020
b4bb9db
some renaming
Feb 11, 2020
554bbfb
wip
Feb 11, 2020
fba4cc7
yuk - so much for making it nice and clean...
Feb 11, 2020
892a86d
now that actually works
Feb 11, 2020
b8423bc
some renaming
Feb 11, 2020
8300921
almost done with #2
Feb 11, 2020
3e9b963
... concluding that it makes sense to allow for a parameter less cons…
Feb 11, 2020
843ebeb
minor constructor changes
Feb 11, 2020
597c9f7
adding constructors that allow to construct subtransformations on the…
Feb 11, 2020
65aa8d6
second transformation done
Feb 11, 2020
866c195
wip
Feb 11, 2020
d435a7a
more wip
Feb 12, 2020
d027df0
...wip
Feb 12, 2020
6ce2d66
all search and replace transformations are migrated - need to double …
Feb 12, 2020
10eef67
found the issue - looks ok so far
Feb 12, 2020
30e4efd
updated two of the BasicTransformations
Feb 12, 2020
235e631
functor generation, first half
Feb 12, 2020
53991b5
wip
Feb 13, 2020
b343a9b
that should be ok in terms of the SelectByFoldingOverExpressions tran…
Feb 13, 2020
ceb48ac
allowing to parameterize the StatementTransformation within SelectByF…
Feb 13, 2020
6adedde
... and now this is a stackoverflow
Feb 13, 2020
e2d3427
... fixing the stackoverflow - still need to check correctness
Feb 13, 2020
2a26252
some clean-up
Feb 13, 2020
5f84795
Merge branch 'features/transformationSetup' into beheim/transformatio…
Feb 13, 2020
253ada4
whitespace
Feb 13, 2020
b70ab90
migrated the conjugations
Feb 13, 2020
f90ff17
wip
Feb 13, 2020
70ce747
migrated the type transformation
Feb 13, 2020
84a2945
expressions
Feb 13, 2020
3013af4
that should take care of the statement transformation
Feb 13, 2020
4e6dcd1
starting on the namespace transformation
Feb 13, 2020
0cfa8d0
wip
Feb 13, 2020
907c825
almost there
Feb 14, 2020
96e8b7c
now I just need to take case of the tests
Feb 14, 2020
cc6f2ee
... and the tests work again
Feb 14, 2020
2215708
making sure we get the right diff
Feb 14, 2020
3201b1e
doc comment
Feb 14, 2020
0594281
Merge branch 'beheim/codeOutput' into beheim/transformations
Feb 14, 2020
d93913b
renaming the type transformation
Feb 14, 2020
d53d474
migrated the StripRangeInfo transformation
Feb 14, 2020
df9203a
... let's see if that can be cleaner
Feb 14, 2020
a3dc6f3
wip
Feb 14, 2020
d6ba14b
more wip
Feb 14, 2020
103d7d1
... unfortunatly doesn't seem to be happy
Feb 15, 2020
d935b7e
removing the let static
Feb 15, 2020
a7234c5
the migration of StripPositionInfo is the problem ...
Feb 15, 2020
371a030
well, that works ...
Feb 15, 2020
97728ae
removing the virtual members
Feb 15, 2020
5d1b649
reverting 2215708814d003f112c8e65843c043a43800717a
Feb 15, 2020
65af81d
... and updating new code
Feb 15, 2020
ef3fe35
cleaned up expression transformation
Feb 15, 2020
92d90a4
adapting the statement and namespace transformation to follow the sam…
Feb 15, 2020
5e7bc79
migrated DistinctQubits
Feb 15, 2020
6a6fa1b
migrated MutationChecker
Feb 15, 2020
5bd316f
reference counter
Feb 15, 2020
ccc94d7
migrated ReplaceTypeParams
Feb 15, 2020
5d63479
migrated the side effect checker
Feb 15, 2020
b52bfc7
migrated the OptimizingTransformation
Feb 15, 2020
7c1c2aa
migrated VariableRenaming
Feb 16, 2020
28ea13b
no need to define a transformation state in F# (we can just keep it i…
Feb 16, 2020
3c01758
migrated the evaluation
Feb 16, 2020
e58ebe0
migrated VariableRemoving
Feb 16, 2020
b58fd21
migrated StatementRemoval
Feb 16, 2020
bad936a
... need to go over the code to make sure new transformations are con…
Feb 16, 2020
28b11b1
Comment
Feb 16, 2020
d09378c
minor thing
Feb 16, 2020
d8e0df7
minor things
Feb 16, 2020
5234dea
forgot something
Feb 16, 2020
783a771
using a dictionary instead of a map for constant propagation
Feb 16, 2020
21d84f8
removing the fixme
Feb 16, 2020
61ca58b
migrated LoopUnrolling
Feb 16, 2020
01708e6
migrated the callable inlining
Feb 16, 2020
221fe27
migrated statement grouping
Feb 16, 2020
5577133
last one down
Feb 16, 2020
f2fef67
updated the transformations in the Transformation project
Feb 16, 2020
38a37dc
temporarily disable execution tests
Feb 16, 2020
6b12369
disable C# warning for unused variables in example project
Feb 16, 2020
344e48f
that was surprisingly painless - all tests pass again
Feb 16, 2020
63cc58f
getting updates from feature branch
Feb 16, 2020
6d7c5c4
resolving issues due to merg
Feb 16, 2020
8f72525
forgot to make one merge adaption
Feb 16, 2020
7a72d6f
Revert "temporarily disable execution tests"
Feb 16, 2020
0ba5dfc
right package to reenable execution tests
Feb 16, 2020
59b9596
getting a proper diff
Feb 17, 2020
4e70bd9
renamed a file
Feb 17, 2020
92cc4e4
adapting comments
Feb 17, 2020
4fd1692
doc comment edit
Feb 18, 2020
ae36ce5
Merge branch 'features/transformationSetup' into beheim/transformations
Feb 18, 2020
b77bc78
Revert "getting a proper diff"
Feb 19, 2020
33a9bba
Merge branch 'beheim/transformationNodes' into beheim/transformations
Feb 19, 2020
0275aeb
doesn't look like we can have a generic let ...
Feb 19, 2020
12f53f4
we would need the if on each node
Feb 19, 2020
bc7bc6b
that should safe the if query on each node
Feb 19, 2020
c0de289
putting options into a separate file
Feb 19, 2020
8a7a5d5
that should do for the type transformations
Feb 19, 2020
4d7701a
that should do for the expression kind transformation
Feb 19, 2020
9b201c4
that should do for the expression transformation
Feb 19, 2020
7767343
same for statements, added an EmptyStatement
Feb 19, 2020
3476541
getting closer
Feb 19, 2020
0b820f4
that should do it as a first draft
Feb 19, 2020
ef6cc70
removing the walkers
Feb 19, 2020
d2f18b4
minor thing
Feb 20, 2020
3e9bb8c
adding a class version without type parameter and going over the opti…
Feb 20, 2020
4a87401
Merge branch 'beheim/transformations' into beheim/transformationNodes
Feb 20, 2020
f0aeb0a
adapted the transformation test to use the new setup
Feb 20, 2020
ef2d4b3
Merge branch 'features/transformationSetup' into beheim/transformatio…
Feb 20, 2020
683b7ba
forgot a comment
Feb 20, 2020
9e35b0d
removing changes that shouldn't have been committed
Feb 20, 2020
a7a1317
replacing "unsafe"
Feb 22, 2020
52c6a4c
getting updates from feature branch
Feb 22, 2020
668672f
deleting the transformation definitions
Feb 22, 2020
cebe220
rename QsSyntaxTreeTransformation to SyntaxTreeTransformation
Feb 22, 2020
5181b22
to be reverted
Feb 22, 2020
888f488
renaming InternalState to SharedState and adding a direct handle to s…
Feb 22, 2020
b0f8f67
removing the options to override handles to other subtransformations
Feb 22, 2020
9b9b07d
sorting specializations by their kind upon transformation
Feb 22, 2020
738b220
disabling subtransformations if no parent is specified
Feb 23, 2020
7eed928
adapting a test to respect the order in which specializations are walked
Feb 23, 2020
7093e7e
Revert "to be reverted"
Feb 23, 2020
91778a0
updated runtime packages
Feb 23, 2020
5f6d5b9
adding a couple of doc comments
Feb 23, 2020
62a97d5
renaming Transform -> onNamespace
Feb 23, 2020
f06b07a
renaming Transform -> onScope
Feb 23, 2020
b6d1406
rename Transform -> onStatementKind
Feb 23, 2020
8db26d2
renaming Transform -> onTypedExpression
Feb 23, 2020
4ebd1ed
renaming Transform -> onExpressionKind
Feb 23, 2020
b075c73
renaming Transform -> onType
Feb 23, 2020
40c5115
capitalization in NamespaceTransformation
Feb 23, 2020
5449ccc
capitalization in statement transformations
Feb 23, 2020
b22c211
capitalization for expression transformations
Feb 23, 2020
440f3fd
capitalization in type transformations
Feb 23, 2020
804e4b8
disabling unnecessary transformations in the Optimization project (Op…
Feb 23, 2020
f7c5a3b
that should do as far as the optimization project goes
Feb 23, 2020
eff826e
going over BasicTransformations
Feb 24, 2020
61066a3
going over the ClassicallyControlledTransformation
Feb 24, 2020
bacdad9
removing unnecessary Core.* prefixes
Feb 24, 2020
d46c9bf
going over CodeOutput
Feb 24, 2020
1396c67
going over conjugations
Feb 24, 2020
a2ca436
going over FunctorGeneration
Feb 24, 2020
92b214b
going over Monomorphization
Feb 24, 2020
0bcc106
going over SearchAndReplace
Feb 24, 2020
dff4615
some renaming and moving stuff, and making sure the tools for classic…
Feb 24, 2020
8245104
more renaming
Feb 24, 2020
18c7763
Merge branch 'features/transformationSetup' into beheim/transformatio…
Feb 24, 2020
631f706
temporarily disabling execution tests
Feb 24, 2020
cb42a7c
fixing an issue with the functor generation
Feb 24, 2020
91f53f0
Revert "temporarily disabling execution tests"
Feb 24, 2020
bc05daf
correct runtime packages to reenable execution tests
Feb 24, 2020
fa172f0
Final clean-up of node naming and order (#332)
bettinaheim Feb 24, 2020
c21ceb3
Update src/QsCompiler/Transformations/ClassicallyControlledUtils.cs
bettinaheim Feb 26, 2020
79aeee4
Update src/QsCompiler/Transformations/IntrinsicResolutionTransformati…
bettinaheim Feb 26, 2020
2c5afb6
some file renaming
Feb 26, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/QsCompiler/CommandLineTool/Commands/Diagnose.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,13 @@ private static void PrintGeneratedQs(IEnumerable<QsNamespace> evaluatedTree, Com
if (Options.IsCodeSnippet(file))
{
var subtree = evaluatedTree.Select(ns => FilterBySourceFile.Apply(ns, file)).Where(ns => ns.Elements.Any());
var code = new string[] { "" }.Concat(StripSnippetWrapping(subtree).Select(SyntaxTreeToQs.Default.ToCode));
var code = new string[] { "" }.Concat(StripSnippetWrapping(subtree).Select(SyntaxTreeToQsharp.Default.ToCode));
logger.Log(InformationCode.FormattedQsCode, Enumerable.Empty<string>(), messageParam: code.ToArray());
}
else
{
var imports = evaluatedTree.ToImmutableDictionary(ns => ns.Name, ns => compilation.OpenDirectives(file, ns.Name).ToImmutableArray());
SyntaxTreeToQs.Apply(out List<ImmutableDictionary<NonNullable<string>, string>> generated, evaluatedTree, (file, imports));
SyntaxTreeToQsharp.Apply(out List<ImmutableDictionary<NonNullable<string>, string>> generated, evaluatedTree, (file, imports));
var code = new string[] { "" }.Concat(generated.Single().Values.Select(nsCode => $"{nsCode}{Environment.NewLine}"));
logger.Log(InformationCode.FormattedQsCode, Enumerable.Empty<string>(), file.Value, messageParam: code.ToArray());
};
Expand Down
4 changes: 2 additions & 2 deletions src/QsCompiler/CommandLineTool/Commands/Format.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ private static IEnumerable<string> GenerateQsCode(Compilation compilation, NonNu
if (Options.IsCodeSnippet(file))
{
var subtree = compilation.SyntaxTree.Values.Select(ns => FilterBySourceFile.Apply(ns, file)).Where(ns => ns.Elements.Any());
return DiagnoseCompilation.StripSnippetWrapping(subtree).Select(SyntaxTreeToQs.Default.ToCode);
return DiagnoseCompilation.StripSnippetWrapping(subtree).Select(SyntaxTreeToQsharp.Default.ToCode);
}
else
{
var imports = compilation.SyntaxTree.Values
.ToImmutableDictionary(ns => ns.Name, ns => compilation.OpenDirectives(file, ns.Name).ToImmutableArray());
var success = SyntaxTreeToQs.Apply(out List<ImmutableDictionary<NonNullable<string>, string>> generated, compilation.SyntaxTree.Values, (file, imports));
var success = SyntaxTreeToQsharp.Apply(out List<ImmutableDictionary<NonNullable<string>, string>> generated, compilation.SyntaxTree.Values, (file, imports));
if (!success) logger?.Log(WarningCode.UnresolvedItemsInGeneratedQs, Enumerable.Empty<string>(), file.Value);

return generated.Single().Select(entry =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ private static IEnumerable<TextEdit> OpenDirectiveSuggestions(this FileContentMa

string CharacteristicsAnnotation(Characteristics c)
{
var charEx = SyntaxTreeToQs.CharacteristicsExpression(SymbolResolution.ResolveCharacteristics(c));
var charEx = SyntaxTreeToQsharp.CharacteristicsExpression(SymbolResolution.ResolveCharacteristics(c));
return charEx == null ? "" : $"{Keywords.qsCharacteristics.id} {charEx}";
}

Expand Down
4 changes: 2 additions & 2 deletions src/QsCompiler/Compiler/RewriteSteps/ClassicallyControlled.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Linq;
using Microsoft.Quantum.QsCompiler.DataTypes;
using Microsoft.Quantum.QsCompiler.SyntaxTree;
using Microsoft.Quantum.QsCompiler.Transformations.ClassicallyControlledTransformation;
using Microsoft.Quantum.QsCompiler.Transformations.ClassicallyControlled;


namespace Microsoft.Quantum.QsCompiler.BuiltInRewriteSteps
Expand All @@ -28,7 +28,7 @@ public ClassicallyControlled()

public bool Transformation(QsCompilation compilation, out QsCompilation transformed)
{
transformed = ClassicallyControlledTransformation.Apply(compilation);
transformed = ReplaceClassicalControl.Apply(compilation);
return true;
}

Expand Down
4 changes: 2 additions & 2 deletions src/QsCompiler/Compiler/RewriteSteps/IntrinsicResolution.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System.Collections.Generic;
using Microsoft.Quantum.QsCompiler.SyntaxTree;
using Microsoft.Quantum.QsCompiler.Transformations.IntrinsicResolutionTransformation;
using Microsoft.Quantum.QsCompiler.Transformations.IntrinsicResolution;


namespace Microsoft.Quantum.QsCompiler.BuiltInRewriteSteps
Expand Down Expand Up @@ -35,7 +35,7 @@ public IntrinsicResolution(QsCompilation environment)

public bool Transformation(QsCompilation compilation, out QsCompilation transformed)
{
transformed = IntrinsicResolutionTransformation.Apply(this.Environment, compilation);
transformed = ReplaceWithTargetIntrinsics.Apply(this.Environment, compilation);
return true;
}

Expand Down
8 changes: 4 additions & 4 deletions src/QsCompiler/Compiler/RewriteSteps/Monomorphization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
using System.Collections.Generic;
using System.Linq;
using Microsoft.Quantum.QsCompiler.SyntaxTree;
using Microsoft.Quantum.QsCompiler.Transformations.MonomorphizationTransformation;
using Microsoft.Quantum.QsCompiler.Transformations.MonomorphizationValidationTransformation;
using Microsoft.Quantum.QsCompiler.Transformations.Monomorphization;
using Microsoft.Quantum.QsCompiler.Transformations.Monomorphization.Validation;


namespace Microsoft.Quantum.QsCompiler.BuiltInRewriteSteps
Expand Down Expand Up @@ -33,7 +33,7 @@ public Monomorphization()

public bool Transformation(QsCompilation compilation, out QsCompilation transformed)
{
transformed = MonomorphizationTransformation.Apply(compilation);
transformed = Monomorphize.Apply(compilation);
return true;
}

Expand All @@ -42,7 +42,7 @@ public bool PreconditionVerification(QsCompilation compilation) =>

public bool PostconditionVerification(QsCompilation compilation)
{
try { MonomorphizationValidationTransformation.Apply(compilation); }
try { ValidateMonomorphization.Apply(compilation); }
catch { return false; }
return true;
}
Expand Down
Loading